Add end of line mappings to J and K

This commit is contained in:
Tom Cammann 2014-01-14 01:00:06 +00:00
parent 4122b8eda5
commit c72e01e970
2 changed files with 15 additions and 0 deletions

View File

@ -110,6 +110,10 @@ function! EasyMotion#JK(visualmode, direction) " {{{
call s:EasyMotion('^.\{,' . prev_column . '}\zs\(.\|$\)', a:direction, a:visualmode ? visualmode() : '', '')
endif
endfunction " }}}
" -- End of Line Motion ---------------------------
function! EasyMotion#Eol(visualmode, direction) " {{{
call s:EasyMotion('\(.\)$', a:direction, a:visualmode ? visualmode() : '', '')
endfunction " }}}
" -- Search Motion -----------------------
function! EasyMotion#Search(visualmode, direction) " {{{
call s:EasyMotion(@/, a:direction, a:visualmode ? visualmode() : '', '')

View File

@ -202,6 +202,15 @@ xnoremap <silent><Plug>(easymotion-k) <Esc>:<C-u>call EasyMotion#JK(1,1)<CR>
noremap <silent><Plug>(easymotion-bd-jk) :<C-u>call EasyMotion#JK(0,2)<CR>
xnoremap <silent><Plug>(easymotion-bd-jk) <Esc>:<C-u>call EasyMotion#JK(1,2)<CR>
"}}}
" -- End of Line Motion {{{
noremap <silent><Plug>(easymotion-J) :<C-u>call EasyMotion#Eol(0,0)<CR>
xnoremap <silent><Plug>(easymotion-J) <Esc>:<C-u>call EasyMotion#Eol(1,0)<CR>
noremap <silent><Plug>(easymotion-K) :<C-u>call EasyMotion#Eol(0,1)<CR>
xnoremap <silent><Plug>(easymotion-K) <Esc>:<C-u>call EasyMotion#Eol(1,1)<CR>
noremap <silent><Plug>(easymotion-bd-JK) :<C-u>call EasyMotion#JK(0,2)<CR>
xnoremap <silent><Plug>(easymotion-bd-JK) <Esc>:<C-u>call EasyMotion#JK(1,2)<CR>
"}}}
" -- Search Motion {{{
noremap <silent><Plug>(easymotion-n) :<C-u>call EasyMotion#Search(0,0)<CR>
@ -307,6 +316,8 @@ if g:EasyMotion_do_mapping == 1 || g:EasyMotion_do_special_mapping == 1
\ , 'E' : { 'name': 'EW' , 'dir': 0 }
\ , 'ge': { 'name': 'E' , 'dir': 1 }
\ , 'gE': { 'name': 'EW' , 'dir': 1 }
\ , 'J' : { 'name': 'Eol' , 'dir': 0 }
\ , 'K' : { 'name': 'Eol' , 'dir': 1 }
\ , 'j' : { 'name': 'JK' , 'dir': 0 }
\ , 'k' : { 'name': 'JK' , 'dir': 1 }
\ , 'n' : { 'name': 'Search' , 'dir': 0 }