aboutsummaryrefslogtreecommitdiff
path: root/vim
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2017-10-28 21:33:46 +1300
committerTom Ryder <tom@sanctum.geek.nz>2017-10-28 21:33:46 +1300
commitd83db65420a1963fb83c13cbde50f0d0d1cdee92 (patch)
treee76f798f8380e2e90d1fa0fa215dc035cf3d3a2d /vim
parentMove swapfile .vimrc config into subfile (diff)
downloaddotfiles-d83db65420a1963fb83c13cbde50f0d0d1cdee92.tar.gz
dotfiles-d83db65420a1963fb83c13cbde50f0d0d1cdee92.zip
Move search .vimrc config into subfile
Diffstat (limited to 'vim')
-rw-r--r--vim/config/search.vim26
-rw-r--r--vim/vimrc27
2 files changed, 26 insertions, 27 deletions
diff --git a/vim/config/search.vim b/vim/config/search.vim
new file mode 100644
index 00000000..ed71bff8
--- /dev/null
+++ b/vim/config/search.vim
@@ -0,0 +1,26 @@
+" Some special settings for searching, if available
+if has('extra_search')
+
+ " Searching as I enter my pattern, \i toggles this
+ set incsearch
+ nnoremap <leader>i :set incsearch!<CR>
+
+ " Highlight search results, \h toggles this
+ set hlsearch
+ nnoremap <leader>h :set hlsearch!<CR>
+
+ " Pressing ^L will clear highlighting until the next search-related
+ " operation; quite good because the highlighting gets distracting after
+ " you've found what you wanted
+ nnoremap <silent> <C-l> :nohlsearch<CR><C-l>
+
+ " Clear search highlighting as soon as I enter insert mode, and restore it
+ " once I leave it
+ if has('autocmd')
+ augroup highlight
+ autocmd!
+ silent! autocmd InsertEnter * set nohlsearch
+ silent! autocmd InsertLeave * set hlsearch
+ augroup END
+ endif
+endif
diff --git a/vim/vimrc b/vim/vimrc
index 8e83e144..3a579836 100644
--- a/vim/vimrc
+++ b/vim/vimrc
@@ -209,33 +209,6 @@ set autowrite
set scrolloff=0
set sidescrolloff=16
-" Some special settings for searching, if available
-if has('extra_search')
-
- " Searching as I enter my pattern, \i toggles this
- set incsearch
- nnoremap <leader>i :set incsearch!<CR>
-
- " Highlight search results, \h toggles this
- set hlsearch
- nnoremap <leader>h :set hlsearch!<CR>
-
- " Pressing ^L will clear highlighting until the next search-related
- " operation; quite good because the highlighting gets distracting after
- " you've found what you wanted
- nnoremap <silent> <C-l> :nohlsearch<CR><C-l>
-
- " Clear search highlighting as soon as I enter insert mode, and restore it
- " once I leave it
- if has('autocmd')
- augroup highlight
- autocmd!
- silent! autocmd InsertEnter * set nohlsearch
- silent! autocmd InsertLeave * set hlsearch
- augroup END
- endif
-endif
-
" Configure spell checking features, if available
if has('spell')