From c72e01e97091f145796c1cda7b6d73fcd5f5b097 Mon Sep 17 00:00:00 2001 From: Tom Cammann Date: Tue, 14 Jan 2014 01:00:06 +0000 Subject: [PATCH] Add end of line mappings to J and K --- autoload/EasyMotion.vim | 4 ++++ plugin/EasyMotion.vim | 11 +++++++++++ 2 files changed, 15 insertions(+) diff --git a/autoload/EasyMotion.vim b/autoload/EasyMotion.vim index 3df3443..41bb7b2 100644 --- a/autoload/EasyMotion.vim +++ b/autoload/EasyMotion.vim @@ -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() : '', '') diff --git a/plugin/EasyMotion.vim b/plugin/EasyMotion.vim index f3ac6e0..d9391cb 100644 --- a/plugin/EasyMotion.vim +++ b/plugin/EasyMotion.vim @@ -202,6 +202,15 @@ xnoremap (easymotion-k) :call EasyMotion#JK(1,1) noremap (easymotion-bd-jk) :call EasyMotion#JK(0,2) xnoremap (easymotion-bd-jk) :call EasyMotion#JK(1,2) "}}} +" -- End of Line Motion {{{ +noremap (easymotion-J) :call EasyMotion#Eol(0,0) +xnoremap (easymotion-J) :call EasyMotion#Eol(1,0) +noremap (easymotion-K) :call EasyMotion#Eol(0,1) +xnoremap (easymotion-K) :call EasyMotion#Eol(1,1) +noremap (easymotion-bd-JK) :call EasyMotion#JK(0,2) +xnoremap (easymotion-bd-JK) :call EasyMotion#JK(1,2) +"}}} + " -- Search Motion {{{ noremap (easymotion-n) :call EasyMotion#Search(0,0) @@ -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 }