summaryrefslogtreecommitdiff
path: root/vimrc
diff options
context:
space:
mode:
authorHugues Hiegel <hugues.hiegel@advisorsla.com>2017-09-07 16:03:41 +0200
committerHugues Hiegel <hugues.hiegel@advisorsla.com>2017-09-07 16:03:41 +0200
commit90f381edc5c3300e7c79a4d7005d1d172ddcc155 (patch)
treeaba92838f2d61a16a28328e9d06b878a34be4b40 /vimrc
parenteff6a6c236746df59bec39d75e02f0b9a71110ed (diff)
Easyyyyyyyy ’Mooooootionnnnnss...
Diffstat (limited to 'vimrc')
-rw-r--r--vimrc40
1 files changed, 40 insertions, 0 deletions
diff --git a/vimrc b/vimrc
index 6a81a82..9f3b67e 100644
--- a/vimrc
+++ b/vimrc
@@ -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>