diff options
author | Chris <[email protected]> | 2020-05-10 16:20:02 -0400 |
---|---|---|
committer | Chris <[email protected]> | 2020-05-10 16:20:02 -0400 |
commit | 5977c59876bd41de06461b81b6758dafe097faed (patch) | |
tree | 1a5746674d9a6d38bbb65ac29d4357cf43978088 /general/functions.vim | |
parent | dd8fa942f44cf9d7f37c2444dc02994b6abdf9af (diff) |
lots of good stuff
Diffstat (limited to 'general/functions.vim')
-rw-r--r-- | general/functions.vim | 30 |
1 files changed, 10 insertions, 20 deletions
diff --git a/general/functions.vim b/general/functions.vim index bec4580b..31297c36 100644 --- a/general/functions.vim +++ b/general/functions.vim @@ -1,21 +1,11 @@ -" distinct highlight current, first and last match when searching -function! HLCurrent() abort - if exists("currmatch") - call matchdelete(currmatch) - endif - " only on cursor - let patt = '\c\%#'.@/ - " check prev and next match - let prevmatch = search(@/, 'bWn') - let nextmatch = search(@/, 'Wn') - " if on first or last match - if prevmatch == 0 || nextmatch == 0 - let currmatch = matchadd('EdgeSearch', patt, 101) - else - let currmatch = matchadd('IncSearch', patt, 101) - endif - redraw -endfunction +" Turn spellcheck on for markdown files +augroup auto_spellcheck + autocmd BufNewFile,BufRead *.md setlocal spell +augroup END + +" Remove trailing whitespaces automatically before save +augroup strip_ws + autocmd BufWritePre * call utils#stripTrailingWhitespaces() +augroup END + -nnoremap <silent> n n:call HLCurrent()<cr> -nnoremap <silent> N N:call HLCurrent()<cr> |