Created

Embed URL

HTTPS clone URL

SSH clone URL

You can clone with HTTPS or SSH.

Download Gist

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

View .vimrc
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.

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.