Skip to content

Commit 4c2b05e

Browse files
committed
Merge branch 'add-hlsearch-plugin'
2 parents 40e5354 + b6608a2 commit 4c2b05e

File tree

2 files changed

+41
-1
lines changed

2 files changed

+41
-1
lines changed

README.md

+13-1
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,6 @@ so when ever you see `<leader>` it meas `,` key.
9494
| `<shift>b` | Normal | Opens an edit command |
9595
| `<shift>t` | Normal | Opens a tabedit command |
9696
| `<leader>h` | Normal | Highlight search word under cursor without jump to next |
97-
| `<leader>/` | Normal | Disable highlight search word |
9897
| `<leader>.` | Normal | Set working directory |
9998
| `<leader>be` | Normal | Opens an edit command with the path of the currently edited file filled in |
10099
| `<leader>te` | Normal | Opens a tab edit command with the path of the currently edited file filled |
@@ -120,6 +119,18 @@ Normal mode:
120119

121120
For more keys, see `:h vimwiki-mappings` or [vimwiki-readme](http://github.com/vimwiki/vimwiki#key-bindings)
122121

122+
### Incsearch
123+
124+
Key Mapping:
125+
126+
- `/`: highlights **ALL** pattern and forward match.
127+
- `?`: highlights **ALL** pattern and backward match.
128+
- `g/`: highlights **ALL** pattern matches.
129+
130+
Normal:
131+
132+
- `<esc><esc>`: Disable highlight search word.
133+
123134
## Commands
124135

125136
### Plugins Commands
@@ -143,6 +154,7 @@ For more information, see `:help fugitive`.
143154
<!-- PLUGIN_LIST_BEGIN -->
144155
| Plugin | Description |
145156
| ------ | ----------- |
157+
| [incsearch.vim](https://github.com/haya14busa/incsearch.vim) [:gear:](./plug_plugins/incsearch.vim) | 🔦 Improved incremental searching for Vim |
146158
| [lightline.vim](https://github.com/itchyny/lightline.vim) [:gear:](./plug_plugins/lightline.vim) | A light and configurable statusline/tabline plugin for Vim |
147159
| [molokai](https://github.com/tomasr/molokai) [:gear:](./plug_plugins/molokai.vim) | Molokai color scheme for Vim |
148160
| [vim-fugitive](https://github.com/tpope/vim-fugitive) [:gear:](./plug_plugins/vim-fugitive.vim) | fugitive.vim: A Git wrapper so awesome, it should be illegal |

plug_plugins/incsearch.vim

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
" Copyright (c) 2019-present Kaiming Guo. All rights reserved.
2+
" Use of this source code is governed by a BSD-style license that can be
3+
" found in the LICENSE file.
4+
5+
if exists('g:plug_installing_plugins')
6+
Plug 'haya14busa/incsearch.vim'
7+
finish
8+
endif
9+
10+
if has('autocmd')
11+
augroup auto_incsearch_settings
12+
autocmd!
13+
14+
autocmd CmdLineEnter [/\?] set nohlsearch
15+
autocmd CmdLineLeave [/\?] set hlsearch
16+
augroup END
17+
endif
18+
19+
map / <Plug>(incsearch-forward)
20+
map ? <Plug>(incsearch-backward)
21+
map g/ <Plug>(incsearch-stay)
22+
23+
map n <Plug>(incsearch-nohl-n)
24+
map N <Plug>(incsearch-nohl-N)
25+
26+
nnoremap <silent> <esc><esc> :<C-u>nohlsearch<cr>
27+
28+
" vim: set sw=2 ts=2 et tw=78 :

0 commit comments

Comments
 (0)