From 30c44b03e93d3ab91d602e6a571e7d89da8d6664 Mon Sep 17 00:00:00 2001 From: Alpha Chen Date: Fri, 14 Nov 2014 11:14:41 -0800 Subject: [PATCH] [vim] incsearch.vim --- vim/.vimrc | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/vim/.vimrc b/vim/.vimrc index 6e02ebc..bbedd71 100644 --- a/vim/.vimrc +++ b/vim/.vimrc @@ -74,6 +74,29 @@ set hlsearch set ignorecase set smartcase +" incsearch.vim +augroup incsearch-keymap + autocmd! + autocmd VimEnter * call s:incsearch_keymap() +augroup END +function! s:incsearch_keymap() + IncSearchNoreMap + IncSearchNoreMap +endfunction +let g:incsearch#auto_nohlsearch = 1 +let g:incsearch#consistent_n_direction = 1 +let g:incsearch#magic = '\v' +let g:incsearch#emacs_like_keymap = 1 +map / (incsearch-forward) +map ? (incsearch-backward) +map g/ (incsearch-stay) +map n (incsearch-nohl-n) +map N (incsearch-nohl-N) +map * (incsearch-nohl-*) +map # (incsearch-nohl-#) +map g* (incsearch-nohl-g*) +map g# (incsearch-nohl-g#) + " encoding set encoding=utf8 set fileencoding=utf8