Skip to content

Instantly share code, notes, and snippets.

@waffle2k
Created February 27, 2012 15:18
Show Gist options
  • Save waffle2k/1924514 to your computer and use it in GitHub Desktop.
Save waffle2k/1924514 to your computer and use it in GitHub Desktop.
vimrc snipped
" Strip down to just the IP address in the highlighted region
function! ExtractIP()
'<,'>perldo $_ = $1 if /((?:\d+\.){3}\d+)/;
endfun
vmap <silent> <C-i> <Esc>:call ExtractIP()<CR>
function! SortUniq()
'<,'>sort
'<,'>g/^\(.*\)$\n\1$/d
endfun
vmap <silent> <C-u> <Esc>:call SortUniq()<CR>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment