From: OnionKnight <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED]
Subject: Troubles configuring vim (multi-questions)
Date: Thu, 12 Apr 2007 17:22:06 -0700 (PDT)
[deleted]
* I wanted the Home-button to act so that it first jumps to the first
non-whitespace character of the current line (i.e. skip the indentation)
and
if Home is pressed when you're already at the first non-whitespace
character
or before then it should jump to the real beginning of the line, column #1.
I made this function:
function! HomeKey ()
let c = col(".")
if c == 1
w
else
g0w
if col(".") >= c
g0
endif
endif
endfunction
This doesn't want to work properly. It extends the command window and dumps
some code from the bottom of the .vimrc and then asks for pressing enter
and
lastly jumps to line #180 in the same file. If c == 1 nothing happens, it
doesn't go all wild but that 'w' keypress isn't executed. Also I have
noticed that g0 doesn't really take you back to beginning of the line but
the beginning of the horizontal scroll. A problem, but it doesn't explain
why the code is acting crazy.
[deleted]
Try homeLikeVC++.vim from Luc Hermitte
Look at:
http://hermitte.free.fr/vim/ressources/vimfiles/plugin/homeLikeVC++_vim.html
Rgds,
Eric
_________________________________________________________________
MSN is giving away a trip to Vegas to see Elton John. Enter to win today.
http://msnconcertcontest.com?icid-nceltontagline