public
Created

My first VimL function. It removes all matched lines in a file. Woohoo!

  • Download Gist
.vimrc
VimL
1 2 3 4 5
" :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>)

:%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.

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.