From 91c69fef0337255f8194801a54e621b1f13315d3 Mon Sep 17 00:00:00 2001 From: Sal Ferrarello Date: Mon, 27 Apr 2020 07:01:57 -0400 Subject: [PATCH] Consolidate search settings in init.vim See #200 --- init.vim | 40 ++++++++++++++++++++++++---------------- 1 file changed, 24 insertions(+), 16 deletions(-) diff --git a/init.vim b/init.vim index d3aeb1f..be83c5f 100644 --- a/init.vim +++ b/init.vim @@ -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 / +nnoremap / :nohlsearch + +" }}} Search + " Enable filetype detection filetype on " Load filetype plugins @@ -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 / -nnoremap / :nohlsearch - " add `-` as part of the word in all situations set iskeyword+=-