OnionKnight schrieb:
I think I understand the difference now and my function is pretty neat now.
function! HomeKey ()
        let c = col(".")
        if c == 1
                normal ^
        else
                normal ^
                if col(".") >= c
                        normal 0
                endif
        endif
endfunction

quote= comes handy:

   :noremap <silent> <home> @=col(".")==1?"^":"0"<cr>
   :imap <home> <c-o><home>

Noremap because it also works for Visual mode.

--
Regards,
Andy

EOM

Reply via email to