Wikia

Vim Tips Wiki

Script:3336

Talk0
1,610pages on
this wiki
Revision as of 07:56, November 15, 2011 by JohnBot (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

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 vim.org).
  • This page may be out of date: check the script's vim.org page above, and its release notes.

CommentsEdit

Hi,

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)
else
  call cursor(line('.'), l:hcol)
endif

[...]

There is a similar function in smartmove.vim (http://www.vim.org/scripts/script.php?script_id=3050) 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.

MM

Around Wikia's network

Random Wiki