Created
September 30, 2013 16:23
-
-
Save trevmex/6766312 to your computer and use it in GitHub Desktop.
My first VimL function. It removes all matched lines in a file. Woohoo!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" :RL <regexp> will now remove all matched lines in a file | |
function! RemoveLine(regexp) | |
exe '%s,^.*' . a:regexp . '.*$\n,,g' | |
endfunction | |
command! -nargs=1 RL call RemoveLine(<f-args>) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
:%g/foo/d
will delete all lines containing foo.
But glad you are learning VimL -- cause I don't want to have to write those wonderful plugins.