Skip to content

Commit

Permalink
Consolidate search settings in init.vim
Browse files Browse the repository at this point in the history
See #200
  • Loading branch information
salcode committed Apr 27, 2020
1 parent e9a345b commit 91c69fe
Showing 1 changed file with 24 additions and 16 deletions.
40 changes: 24 additions & 16 deletions init.vim
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,30 @@ augroup END

" }}} Line Numbers

" {{{ Search

" Ignore case when searching.
set ignorecase

" Override ignorecase if the search pattern contains upper case characters.
set smartcase

" Highlight all search matches.
set hlsearch

" Highlight search matches as the search is being typed.
set incsearch

" Preview effects of command incrementally (e.g. :substitute). Neovim only.
if has('nvim')
set inccommand=nosplit
endif

" Clear the search results with <leader>/
nnoremap <silent> <leader>/ :nohlsearch<CR>
" }}} Search

" Enable filetype detection
filetype on
" Load filetype plugins
Expand Down Expand Up @@ -199,22 +223,6 @@ set noexpandtab
" would insert a combination of the tab character and spaces
set softtabstop=4

" highlight all search matches after search is complete
set hlsearch

" ignore case when searching
set ignorecase

" override ignorecase if the search pattern contains upper case characters
set smartcase
set incsearch
" Preview effects of command incrementally (e.g. :substitute). Neovim only.
if has('nvim')
set inccommand=nosplit
endif
" Clear the search results with <leader>/
nnoremap <silent> <leader>/ :nohlsearch<CR>
" add `-` as part of the word in all situations
set iskeyword+=-

Expand Down

0 comments on commit 91c69fe

Please sign in to comment.