|
284 | 284 | endfunction
|
285 | 285 |
|
286 | 286 | " 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! |
292 | 294 | onoremap $ v:call WrapRelativeMotion("$")<CR>
|
293 | 295 | 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 |
297 | 298 | vnoremap $ :<C-U>call WrapRelativeMotion("$", 1)<CR>
|
298 | 299 | vnoremap <End> :<C-U>call WrapRelativeMotion("$", 1)<CR>
|
299 | 300 | vnoremap 0 :<C-U>call WrapRelativeMotion("0", 1)<CR>
|
|
0 commit comments