sponsor Vim development Vim logo Vim Book Ad

smartmove.vim : Some useful keymappings for movement

 script karma  Rating 4/1, Downloaded by 1063  Comments, bugs, improvements  Vim wiki

created by
Marko Mahnič
 
script type
utility
 
description
1. Jump to next tag on screen in a help file.

When the cursor is at or after the last tag on the screen continue the search
at the top of the screen.

mapped to: <tab>, <s-tab> in normal mode
disable with: let g:loaded_smartmove_nexthelptag=-1

The mapping is created on BufEnter when buftype=help or the buffer is readonly
and filetype=help.

2. Use H and L instead of ctrl-f and ctrl-b

When the cursor is at the top of the screen and H is pressed the screen is
scrolled up. When count is given or the cursor is not at the top of the screen,
the default function of H is executed (Home). Similar for L.

mapped to: H, L in normal and visual mode
disable with: let g:loaded_smartmove_smartscreen=-1

3. Make Home/End keys smarter

Home key toggles between ^/0 on normal lines. On wrapped lines it will move the
cursor to the beginning of the current screen line and if it is already there
it will move one line up. Similar functionality is provided for the End key.

To enable :call smartmove#MapHomeEnd()

Similar: vimscript#3336
 
install details
Unpack into vim runtime directory (eg. ~/.vim)
 

rate this script Life Changing Helpful Unfulfilling 
script versions (upload new version)

Click on the package to download.

package script version date Vim version user release notes
smartmove.zip 0.5.1 2010-04-09 7.0 Marko Mahnič minor fix
smartmove.zip 0.5 2010-04-09 7.0 Marko Mahnič Initial upload
ip used for rating: 142.132.191.50

If you have questions or remarks about this site, visit the vimonline development pages. Please use this site responsibly.
Questions about Vim should go to the maillist. Help Bram help Uganda.
   
Vim at Github