Skip to content

Instantly share code, notes, and snippets.

@pera
Created May 6, 2012 22:02
Show Gist options
  • Star 7 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save pera/2624765 to your computer and use it in GitHub Desktop.
Save pera/2624765 to your computer and use it in GitHub Desktop.
Improve move speed on Vim
" Improve move speed
let g:boostmove=0
set updatetime=500
au CursorMoved * call BoostMoveON()
au CursorMovedI * call BoostMoveON()
au CursorHold * call BoostMoveOFF()
au CursorHoldI * call BoostMoveOFF()
function BoostMoveON()
if (winline() != line('$')) && (line('.') != 1)
if (winline() == winheight('.')) || (winline() == 1)
let g:boostmove=1
setlocal nocursorline
setlocal syntax=OFF
endif
endif
endfunction
function BoostMoveOFF()
if g:boostmove==1
let g:boostmove=0
setlocal cursorline
setlocal syntax=ON
endif
endfunction
@EDmitry
Copy link

EDmitry commented May 16, 2013

Does this one still work for you? Didn't manage to get this one working :(

@robinmoussu
Copy link

For me that hack work :

set updatetime=4000
let g:boostmove=0
au CursorMoved * call BoostMoveON()
au CursorMovedI * call BoostMoveON()
au CursorHold * call BoostMoveOFF()
au CursorHoldI * call BoostMoveOFF()
function BoostMoveON()
    if (g:boostmove == 0)
        set updatetime=10
        let g:boostmove=1
        setlocal syntax=off
    endif
endfunction
function BoostMoveOFF()
    if g:boostmove==1
        set updatetime=4000
        let g:boostmove=0
        setlocal syntax=on
    endif
endfunction

It's not really clean, since syntax highlight is off while making a movement, but it is allow fast movement.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment