]> git.rmz.io Git - dotfiles.git/commitdiff
vim: only move visual lines when no count is given
authorSamir Benmendil <samir.benmendil@gmail.com>
Thu, 6 Nov 2014 20:57:12 +0000 (20:57 +0000)
committerSamir Benmendil <samir.benmendil@gmail.com>
Thu, 6 Nov 2014 20:57:12 +0000 (20:57 +0000)
vim/vimrc

index 31bc4b008c0bc5a08c378838983e051b446d9a75..e8a5192f1e72d736f7886573baafb8ad6ea9dd29 100644 (file)
--- a/vim/vimrc
+++ b/vim/vimrc
@@ -312,8 +312,8 @@ cnoremap <c-a> <home>
 cnoremap <c-e> <end>
 
 " proper movement when lines are wrapped
-noremap j gj
-noremap k gk
+noremap <expr> j (v:count == 0 ? 'gj' : 'j')
+noremap <expr> k (v:count == 0 ? 'gk' : 'k')
 
 " disable arrows
 noremap  <Up>    <NOP>