smarter jk maps

Mon, 12 Jun 2017 17:20:38 -0400

author
Meredith Howard <mhoward@roomag.org>
date
Mon, 12 Jun 2017 17:20:38 -0400
changeset 601
c1615fda063a
parent 600
0e927f9c141a
child 602
2f9ceb002f74

smarter jk maps

.vimrc file | annotate | diff | comparison | revisions
--- a/.vimrc
+++ b/.vimrc
@@ -87,8 +87,8 @@ nmap <C-l> <C-w>l
 nmap <C-\> <C-w>p
 
 " navigate by on-screen lines
-map j gj
-map k gk
+nnoremap <expr> j v:count ? 'j' : 'gj'
+nnoremap <expr> k v:count ? 'k' : 'gk'
 
 " alt buffer
 nmap gb <C-^>

mercurial