Skip to content

Instantly share code, notes, and snippets.

@danr
Created January 28, 2017 17:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save danr/8be81b1680cfd545c225d21a886ce4f1 to your computer and use it in GitHub Desktop.
Save danr/8be81b1680cfd545c225d21a886ce4f1 to your computer and use it in GitHub Desktop.
Move around dodging empty lines
def nonempty -params 1 %{
exec -no-hooks %arg{1}
try %{
exec -no-hooks -draft \;Gg<a-k>(\n.*){3}<ret>
exec -no-hooks -draft \;Ge<a-k>(\n.*){3}<ret>
exec -no-hooks -draft \;<a-x><a-k>\A[\n]\Z<ret>
nonempty %arg{1}
}
}
map global normal j ':nonempty j<ret>'
map global normal k ':nonempty k<ret>'
map global normal J ':nonempty J<ret>'
map global normal K ':nonempty K<ret>'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment