Vim Tips Wiki

Changes: Script:3336


Back to page

(reference to smartmove.vim)
(adjust Template:ScriptComments to remove id as no longer needed; minor tweaks)
Line 1: Line 1:
{{ScriptComments|3336|Smart Home Key}}
{{ScriptComments|Smart Home Key}}

Latest revision as of 07:56, November 15, 2011

Use this page to discuss script 3336 Smart Home Key

  • Add constructive comments, bug reports, or discuss improvements (see the guideline).
  • Do not document the script here (the author should do that on
  • This page may be out of date: check the script's page above, and its release notes.



v:lnum doesn't return the current line number in my gvim, I modified the script a bit, this way :


if l:ccol != l:fcol
  call cursor(line('.'), l:fcol)
  call cursor(line('.'), l:hcol)


There is a similar function in smartmove.vim ( that also takes into account the line wrapping and will do g0/g^ on wrapped lines. The End key is mapped in a similar way.

You can install Home/End keys with :call smartmove#MapHomeEnd() or adapt the code in smartmove#MapHomeEnd() for other keys.


Around Wikia's network

Random Wiki