Skip to content
Create a gist now

Instantly share code, notes, and snippets.

My first VimL function. It removes all matched lines in a file. Woohoo!
" :RL <regexp> will now remove all matched lines in a file
function! RemoveLine(regexp)
exe '%s,^.*' . a:regexp . '.*$\n,,g'
command! -nargs=1 RL call RemoveLine(<f-args>)


will delete all lines containing foo.

But glad you are learning VimL -- cause I don't want to have to write those wonderful plugins.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.