From 50ff2310bc80f34d447a11d9924931cbb9db2ba9 Mon Sep 17 00:00:00 2001 From: Tim Pope Date: Sat, 6 Mar 2010 14:19:12 -0500 Subject: [PATCH] Accept a count with [e and ]e --- doc/unimpaired.txt | 6 ++---- plugin/unimpaired.vim | 6 +++--- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/doc/unimpaired.txt b/doc/unimpaired.txt index 5212d7c..f8ce827 100644 --- a/doc/unimpaired.txt +++ b/doc/unimpaired.txt @@ -49,10 +49,10 @@ LINE OPERATIONS *unimpaired-lines* ] Add [count] blank lines below the cursor. *[e* *v_[e* -[e Exchange the current line with the one above it. +[e Exchange the current line with [count] lines above it. *]e* *v_]e* -]e Exchange the current line with the one below it. +]e Exchange the current line with [count] lines below it. ENCODING AND DECODING *unimpaired-encoding* @@ -94,8 +94,6 @@ Mnenomic: encoding always comes before decoding; "[" always comes before "]". TODO *unimpaired-todo* -Accept a count with |[e| and |]e| - Descend into and ascend from directories with |[o| and |]o|. Avoid munging null characters when encoding and decoding. diff --git a/plugin/unimpaired.vim b/plugin/unimpaired.vim index e12adaa..eb9d09d 100644 --- a/plugin/unimpaired.vim +++ b/plugin/unimpaired.vim @@ -70,10 +70,10 @@ nnoremap unimpairedBlankDown :put =repeat(nr2char(10),v:coun nmap [ unimpairedBlankUp nmap ] unimpairedBlankDown -nnoremap unimpairedMoveUp m`:move--`` +nnoremap unimpairedMoveUp :exe 'norm m`'exe 'move--'.v:count1`` nnoremap unimpairedMoveDown :exe 'norm m`'exe 'move+'.v:count1`` -xnoremap unimpairedMoveUp m`:move--`` -xnoremap unimpairedMoveDown m`:move'>+`` +xnoremap unimpairedMoveUp :exe 'norm m`'exe '''<,''>move--'.v:count1`` +xnoremap unimpairedMoveDown :exe 'norm m`'exe '''<,''>move''>+'.v:count1`` nmap [e unimpairedMoveUp nmap ]e unimpairedMoveDown