From 90f381edc5c3300e7c79a4d7005d1d172ddcc155 Mon Sep 17 00:00:00 2001 From: Hugues Hiegel Date: Thu, 7 Sep 2017 16:03:41 +0200 Subject: Easyyyyyyyy ’Mooooootionnnnnss... MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitmodules | 9 +++++++++ bundle/incsearch-easymotion.vim | 1 + bundle/incsearch.vim | 1 + bundle/vim-easymotion | 1 + colors/blue.vim | 4 ++++ colors/red.vim | 3 +++ vimrc | 40 ++++++++++++++++++++++++++++++++++++++++ 7 files changed, 59 insertions(+) create mode 160000 bundle/incsearch-easymotion.vim create mode 160000 bundle/incsearch.vim create mode 160000 bundle/vim-easymotion diff --git a/.gitmodules b/.gitmodules index 76d35fa..817ae3d 100644 --- a/.gitmodules +++ b/.gitmodules @@ -13,3 +13,12 @@ [submodule "bundle/vim-obsession"] path = bundle/vim-obsession url = git://github.com/tpope/vim-obsession +[submodule "bundle/vim-easymotion"] + path = bundle/vim-easymotion + url = https://github.com/easymotion/vim-easymotion +[submodule "bundle/incsearch.vim"] + path = bundle/incsearch.vim + url = https://github.com/haya14busa/incsearch.vim +[submodule "bundle/incsearch-easymotion.vim"] + path = bundle/incsearch-easymotion.vim + url = https://github.com/haya14busa/incsearch-easymotion.vim diff --git a/bundle/incsearch-easymotion.vim b/bundle/incsearch-easymotion.vim new file mode 160000 index 0000000..fcdd3ae --- /dev/null +++ b/bundle/incsearch-easymotion.vim @@ -0,0 +1 @@ +Subproject commit fcdd3aee6f4c0eef1a515727199ece8d6c6041b5 diff --git a/bundle/incsearch.vim b/bundle/incsearch.vim new file mode 160000 index 0000000..ceff510 --- /dev/null +++ b/bundle/incsearch.vim @@ -0,0 +1 @@ +Subproject commit ceff51093e5dac1cf566b6748de7108bc5235b33 diff --git a/bundle/vim-easymotion b/bundle/vim-easymotion new file mode 160000 index 0000000..e4d71c7 --- /dev/null +++ b/bundle/vim-easymotion @@ -0,0 +1 @@ +Subproject commit e4d71c7ba45baf860fdaaf8c06cd9faebdccbd50 diff --git a/colors/blue.vim b/colors/blue.vim index d9f5b7c..9376448 100644 --- a/colors/blue.vim +++ b/colors/blue.vim @@ -706,6 +706,10 @@ if has("gui_running") || &t_Co >= 255 hi! todoDiggle ctermfg=236 ctermbg=none cterm=bold hi! todoMark ctermfg=236 ctermbg=08 cterm=bold + hi! EasyMotionTargetDefault ctermfg=46 cterm=bold ctermbg=34 + hi! EasyMotionTarget ctermfg=46 cterm=bold ctermbg=none + hi! EasyMotionShadeDefault ctermfg=240 + elseif &t_Co >= 88 hi! Comment ctermfg=81 cterm=bold hi! Constant ctermfg=65 cterm=none diff --git a/colors/red.vim b/colors/red.vim index 5f28e90..f59e74c 100644 --- a/colors/red.vim +++ b/colors/red.vim @@ -699,6 +699,9 @@ if has("gui_running") || &t_Co >= 255 hi! todoDiggle ctermfg=236 ctermbg=none cterm=bold hi! todoMark ctermfg=236 ctermbg=08 cterm=bold + hi! EasyMotionTargetDefault ctermfg=48 cterm=bold ctermbg=none + hi! EasyMotionTarget ctermfg=48 cterm=none ctermbg=none + elseif &t_Co >= 88 hi! Comment ctermfg=81 cterm=bold hi! Constant ctermfg=65 cterm=none diff --git a/vimrc b/vimrc index 6a81a82..9f3b67e 100644 --- a/vimrc +++ b/vimrc @@ -292,6 +292,46 @@ xnoremap /* `>a */` noremap \* m"e?/\* *:s:/\* *::/ *\*\/:s: *\*/::\|:nohljg`"3h noremap \\ m"0:s:// *::\|:nohlg`"3h + + noremap / :NERDTreeToggle + +" You can use other keymappings like instead of if you want to +" use these mappings as default search and somtimes want to move cursor with +" EasyMotion. +function! s:incsearch_config(...) abort + return incsearch#util#deepextend(deepcopy({ + \ 'modules': [incsearch#config#easymotion#module({'overwin': 1})], + \ 'keymap': { + \ "\": '(easymotion)' + \ }, + \ 'is_expr': 0 + \ }), get(a:, 1, {})) +endfunction + +noremap / incsearch#go(incsearch_config()) +noremap ? incsearch#go(incsearch_config({'command': '?'})) +noremap g/ incsearch#go(incsearch_config({'is_stay': 1})) + +let g:EasyMotion_do_mapping = 0 " Disable default mappings + +let mapleader=" " +" Jump to anywhere you want with minimal keystrokes, with just one key binding. +" `s{char}{label}` +nmap (easymotion-overwin-f) +" or +" `s{char}{char}{label}` +" Need one more keystroke, but on average, it may be more comfortable. +nmap (easymotion-overwin-f2) + +" Turn off case insensitive feature +let g:EasyMotion_smartcase = 0 + +" JK motions: Line motions +map j (easymotion-j) +map k (easymotion-k) + + + " Reformatting is done using 'gq' noremap Q :s/^/> / noremap q :s/^[ ]*>[ ]*// -- cgit v1.2.3