On Tue, Dec 22, 2015 at 4:51 PM, John <[email protected]> wrote:
>
> Hello, this may be a very basic question but I have not found a
> solution as of yet. All I want is that when I press the End key it
> will go to the actual end of the line, not having the cursor before
> a semicolon or curly brace. I know I can press Alt+End to do this
> but it would be more convenient if I could have the End button do
> it. Thank you.

This has bothered me since Vim adjusted line end positioning several
years ago. But I think I just figured out a simple solution, could you
test it for me?

In cream-lib.vim, replace the Cream_map_end() definition with the
following:

_____________________________________________________________________

function! Cream_map_end()

" get current pos
let oldcol = virtcol('.')
" go to last screen column
normal g$

" Hack: fix that <C-b> doesn't allow ending up after last char
" with wrap off (2004-04-23)
if &wrap == 0
" if line is shorter than screen
if virtcol('$') < Cream_linewidth()
" fix position
normal $
" if we were already at screen line end
elseif oldcol >= virtcol('.')
" move farther
normal $
else
" nothing, first g$ did what we wanted
endif
else
" if already at screen end, go to line end
if oldcol < virtcol('.')
if col(".") == col("$") - 1
normal $
endif
elseif oldcol == virtcol('.')
normal $
else
endif
endif

endfunction
_____________________________________________________________________

This works for me, please report back how this works for you.

-- 
Steve Hall  [ digitect dancingpaper com ]
Cream for Vim  http://cream.SourceForge.net
http://SteveHallArchitecture.com
------------------------------------------------------------------------------
_______________________________________________
cream-general mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/cream-general

Reply via email to