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 /vimrc | |
parent | eff6a6c236746df59bec39d75e02f0b9a71110ed (diff) |
Easyyyyyyyy ’Mooooootionnnnnss...
Diffstat (limited to 'vimrc')
-rw-r--r-- | vimrc | 40 |
1 files changed, 40 insertions, 0 deletions
@@ -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> |