diff options
author | Hugues Hiegel <hugues.hiegel@advisorsla.com> | 2017-09-07 16:03:41 +0200 |
---|---|---|
committer | Hugues Hiegel <hugues.hiegel@advisorsla.com> | 2017-09-07 16:03:41 +0200 |
commit | 90f381edc5c3300e7c79a4d7005d1d172ddcc155 (patch) | |
tree | aba92838f2d61a16a28328e9d06b878a34be4b40 | |
parent | eff6a6c236746df59bec39d75e02f0b9a71110ed (diff) |
Easyyyyyyyy ’Mooooootionnnnnss...
-rw-r--r-- | .gitmodules | 9 | ||||
m--------- | bundle/incsearch-easymotion.vim | 0 | ||||
m--------- | bundle/incsearch.vim | 0 | ||||
m--------- | bundle/vim-easymotion | 0 | ||||
-rw-r--r-- | colors/blue.vim | 4 | ||||
-rw-r--r-- | colors/red.vim | 3 | ||||
-rw-r--r-- | vimrc | 40 |
7 files changed, 56 insertions, 0 deletions
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 +Subproject fcdd3aee6f4c0eef1a515727199ece8d6c6041b diff --git a/bundle/incsearch.vim b/bundle/incsearch.vim new file mode 160000 +Subproject ceff51093e5dac1cf566b6748de7108bc5235b3 diff --git a/bundle/vim-easymotion b/bundle/vim-easymotion new file mode 160000 +Subproject e4d71c7ba45baf860fdaaf8c06cd9faebdccbd5 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 @@ -292,6 +292,46 @@ xnoremap <silent> /* <ESC>`>a */<ESC>`<i/* <ESC> noremap <silent> \* m"e?/\* *<CR>:s:/\* *::<CR>/ *\*\/<CR>:s: *\*/::\|:nohl<CR>jg`"3h noremap <silent> \\ m"0:s:// *::\|:nohl<CR>g`"3h + + noremap <silent> /<CR> :NERDTreeToggle<CR> + +" You can use other keymappings like <C-l> instead of <CR> 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': { + \ "\<C-l>": '<Over>(easymotion)' + \ }, + \ 'is_expr': 0 + \ }), get(a:, 1, {})) +endfunction + +noremap <silent><expr> / incsearch#go(<SID>incsearch_config()) +noremap <silent><expr> ? incsearch#go(<SID>incsearch_config({'command': '?'})) +noremap <silent><expr> g/ incsearch#go(<SID>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 <Leader><Leader> <Plug>(easymotion-overwin-f) +" or +" `s{char}{char}{label}` +" Need one more keystroke, but on average, it may be more comfortable. +nmap <Leader><Leader> <Plug>(easymotion-overwin-f2) + +" Turn off case insensitive feature +let g:EasyMotion_smartcase = 0 + +" JK motions: Line motions +map <Leader>j <Plug>(easymotion-j) +map <Leader>k <Plug>(easymotion-k) + + + " Reformatting is done using 'gq<motion>' noremap <ESC>Q :s/^/> /<CR> noremap <ESC>q :s/^[ ]*>[ ]*//<CR> |