spf13/spf13-vim — pull request #513 by lukedomanski (2013-12-11 19:21:46+00:00)
Title: Changed g* wrap relative mappings to revert to standard behaviour under nowrap

As discussed in issue #464 the new g* wrap relative line movement mappings still only move to the first or last column on the SCREEN when nowrap is set, when you would expect them to move relative to the LINE.

added/changed the following

```vim
function! WrapRelativeMotion(key)
if &wrap
execute "normal! g" . a:key
else
execute "normal!" a:key
endif
endfunction

noremap $ :call WrapRelativeMotion("$")
noremap :call WrapRelativeMotion("$")
noremap 0 :call WrapRelativeMotion("0")
noremap :call WrapRelativeMotion("0")
noremap ^ :call WrapRelativeMotion("^")
```

Please improve if you are unhappy with it, but as far as I can see, it does not break anything or slow down the movement noticeably.