Friday, October 28, 2011

Re: how to make 'h,j,k,l' faster ?

On Friday, October 28, 2011 12:23:44 Tim Chase wrote:

> On 10/28/11 10:21, Ben Fritz wrote:
> > I find it very nice to set relative line numbers and use a
> > count with j/k for down/up movement.

> I know about them head-wise, and you're right about it being
> easier than keying in the absolute line#, but it's a more
> recent feature of vim which hasn't yet made it to my
> muscle-memory (or more importantly, my vimrc :)

i can't imagine why not -- it's the coolest new feature since
'cursorline'

i'll wager you already have a toggle for 'number' -- a little
tweak'll turn it into a three way:

nmap <silent> <F9> :call NumberToggle()<CR>
imap <silent> <F9> <C-O>:call NumberToggle()<CR>


function! NumberToggle()
if exists("&rnu")
if &number
setlocal relativenumber
else
if &relativenumber
setlocal norelativenumber
else
setlocal number
endif
endif
else
if &number
setlocal nonumber
else
setlocal number
endif
endif
endfunction

this one even tests for the existence of the feature so it'll
work when you use the same .vimrc for older vims

sc

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

No comments: