Skip to content

Commit 4122da2

Browse files
committed
rolled back some changes to ensure d0 and d^ match default behaviours, spf13#464
1 parent 7b21d20 commit 4122da2

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

.vimrc

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -284,16 +284,17 @@
284284
endfunction
285285

286286
" Map g* keys in Normal, Operator-pending, and Visual+select
287-
nnoremap $ :call WrapRelativeMotion("$")<CR>
288-
nnoremap <End> :call WrapRelativeMotion("$")<CR>
289-
nnoremap 0 :call WrapRelativeMotion("0")<CR>
290-
nnoremap <Home> :call WrapRelativeMotion("0")<CR>
291-
nnoremap ^ :call WrapRelativeMotion("^")<CR>
287+
noremap $ :call WrapRelativeMotion("$")<CR>
288+
noremap <End> :call WrapRelativeMotion("$")<CR>
289+
noremap 0 :call WrapRelativeMotion("0")<CR>
290+
noremap <Home> :call WrapRelativeMotion("0")<CR>
291+
noremap ^ :call WrapRelativeMotion("^")<CR>
292+
" Overwrite the operator pending $/<End> mappings from above
293+
" to force inclusive motion with :execute normal!
292294
onoremap $ v:call WrapRelativeMotion("$")<CR>
293295
onoremap <End> v:call WrapRelativeMotion("$")<CR>
294-
onoremap 0 v:call WrapRelativeMotion("0")<CR>
295-
onoremap <Home> v:call WrapRelativeMotion("0")<CR>
296-
onoremap ^ v:call WrapRelativeMotion("^")<CR>
296+
" Overwrite the Visual+select mode mappings from above
297+
" to ensure the correct vis_sel flag is passed to function
297298
vnoremap $ :<C-U>call WrapRelativeMotion("$", 1)<CR>
298299
vnoremap <End> :<C-U>call WrapRelativeMotion("$", 1)<CR>
299300
vnoremap 0 :<C-U>call WrapRelativeMotion("0", 1)<CR>

0 commit comments

Comments
 (0)