mirror of
https://github.com/notwa/rc
synced 2025-02-05 07:43:22 -08:00
lift some handy vim functions
This commit is contained in:
parent
26c2863dde
commit
efd4ab0f0c
1 changed files with 18 additions and 1 deletions
19
home/vimrc
19
home/vimrc
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue