Skip to content

Instantly share code, notes, and snippets.

@sedm0784
Last active August 29, 2015 13:56
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 sedm0784/9133952 to your computer and use it in GitHub Desktop.
Save sedm0784/9133952 to your computer and use it in GitHub Desktop.
Mappings for leaping between sections
# An edited version of the code for searching for PlaceHolders (^K) from here:
# http://vim.wikia.com/wiki/User:Tlgrok/Form_Feeds_and_Vertical_Tabs
function! <SID>FindSection (forward)
let l:place_holder = nr2char(12) "form feed
let l:flags="W"
if (!a:forward)
let l:flags.="b"
endif
let l:match=search(l:place_holder, l:flags)
if (!l:match)
echo "No more sections in requested direction."
return
endif
endfunction
nnoremap <silent> [l :call <SID>FindSection(0)<CR>
nnoremap <silent> ]l :call <SID>FindSection(1)<CR>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment