Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- nnoremap j :call CheckJ()<cr>
- nnoremap k :call CheckK()<cr>
- nnoremap h :call CheckH()<cr>
- nnoremap l :call CheckL()<cr>
- fun! CheckJ()
- if line('.') == line('$')
- norm! gg
- else
- norm! j
- endif
- endfun
- fun! CheckK()
- if line('.') == 1
- norm! G
- else
- norm! k
- endif
- endfun
- fun! CheckH()
- if col('.') == 1
- norm! $
- else
- norm! h
- endif
- endfun
- fun! CheckL()
- if col('.') == (col('$') - 1)
- norm! 0
- else
- norm! l
- endif
- endfun
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement