1
0
Fork 0
mirror of https://github.com/notwa/rc synced 2024-05-18 09:53:22 -07:00

lift some handy vim functions

This commit is contained in:
Connor Olding 2021-10-07 12:28:40 -07:00
parent 26c2863dde
commit efd4ab0f0c

View File

@ -119,7 +119,24 @@ endif
let $PATH .= ':'.$HOME.'/sh' " allow direct invocation of shell funcs
" autocmd {{{1
" fun {{{1
" lifted from BurntSushi:
fu! GlobalReplace()
normal! gv"ry
let replacement = input("Replace " . @r . " with: ")
if replacement != ""
exe "%s/" . @r . "/" . replacement . "/g"
endif
endf
" lifted from BurntSushi:
fu! StripTrailingWhitespace()
let l = line(".")
let c = col(".")
%s/\s\+$//e
call cursor(l, c)
endf
fu! TabEight()
setlocal tabstop=8 shiftwidth=8 noexpandtab softtabstop=0