1
0
mirror of https://github.com/chylex/dotfiles.git synced 2024-11-24 20:42:49 +01:00

Compare commits

...

3 Commits

2 changed files with 38 additions and 5 deletions

View File

@ -136,10 +136,6 @@ nnoremap gp `[v`]
xnoremap p P
xnoremap P p
" Extend/shrink selection
xmap + <Action>(EditorSelectWord)
xmap - <Action>(EditorUnSelectWord)
" Show parameter info
nmap <A-p> <Action>(ParameterInfo)
imap <A-p> <Action>(ParameterInfo)

39
.vimrc
View File

@ -125,6 +125,44 @@ nnoremap gp `[v`]
xnoremap p P
xnoremap P p
" Clear search highlights
nnoremap <Esc> :nohlsearch<Return><Esc>
" Update search register when using f/t
function FindChar(action, reverse)
let t:reversesearch = a:reverse
let c = nr2char(getchar())
call setreg('/', c)
nohlsearch
execute 'normal! '.a:action.c
endfunction
function FindCharVisual(action, reverse)
normal gv
call FindChar(a:action, a:reverse)
endfunction
function! ResetReverseSearchFlag()
if getcmdtype() =~ "[/?]"
let t:reversesearch = 0
endif
endfunction
nmap f :call FindChar('f', 0)<CR>
nmap F :call FindChar('F', 1)<CR>
nmap t :call FindChar('t', 0)<CR>
nmap T :call FindChar('T', 1)<CR>
xmap f :call FindCharVisual('f', 0)<CR>
xmap F :call FindCharVisual('F', 1)<CR>
xmap t :call FindCharVisual('t', 0)<CR>
xmap T :call FindCharVisual('T', 1)<CR>
noremap <expr> n 'nN'[t:reversesearch]
noremap <expr> N 'Nn'[t:reversesearch]
cnoremap <CR> <cmd>call ResetReverseSearchFlag()<CR><CR>
" Plugin: https://github.com/easymotion/vim-easymotion.git
nmap <Space> <Plug>(easymotion-overwin-f)
xmap <Space> <Plug>(easymotion-s)
@ -135,4 +173,3 @@ let g:highlightedyank_highlight_duration = 500
" Plugin: https://github.com/luochen1990/rainbow
let g:rainbow_active = 1