Skip to content

Instantly share code, notes, and snippets.

@DanielFGray
Created February 2, 2015 05:02
Show Gist options
  • Save DanielFGray/7b78646f90c45242af5a to your computer and use it in GitHub Desktop.
Save DanielFGray/7b78646f90c45242af5a to your computer and use it in GitHub Desktop.
function! Togglegjgk()
if !exists("g:togglegjgk") || g:togglegjgk==0
let g:togglegjgk=1
nnoremap j gj
nnoremap k gk
nnoremap gk k
nnoremap gj j
else
let g:togglegjgk=0
unmap j
unmap k
unmap gk
unmap gj
endif
endfunction
nnoremap <silent> <leader>tgj <Esc>:<C-u>call Togglegjgk()<CR>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment