diff options
Diffstat (limited to 'general')
-rw-r--r-- | general/functions.vim | 30 | ||||
-rw-r--r-- | general/settings.vim | 7 |
2 files changed, 12 insertions, 25 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> diff --git a/general/settings.vim b/general/settings.vim index be7e9acf..06b13ede 100644 --- a/general/settings.vim +++ b/general/settings.vim @@ -1,7 +1,5 @@ -" set leader key -"map <Space> <Leader> -"nmap <space> <leader> set iskeyword+=- " treat dash separated words as a word text object" +set formatoptions-=cro " Stop newline continution of comments if !exists('g:vscode') syntax enable " Enables syntax highlighing @@ -35,7 +33,6 @@ if !exists('g:vscode') set signcolumn=yes " Always show the signcolumn, otherwise it would shift the text each time set updatetime=300 " Faster completion set timeoutlen=100 " By default timeoutlen is 1000 ms - set formatoptions-=cro " Stop newline continution of comments set clipboard=unnamedplus " Copy paste between vim and everything else set incsearch set guifont=Hack\ Nerd\ Font @@ -44,7 +41,7 @@ if !exists('g:vscode') " set autochdir " Your working directory will always be the same as your working directory " set foldcolumn=2 " Folding abilities - au! BufWritePost $MYVIMRC source % " auto source when writing to init.vm alternatively you can run :source $MYVIMRC + " au! BufWritePost $MYVIMRC source % " auto source when writing to init.vm alternatively you can run :source $MYVIMRC autocmd FileType * setlocal formatoptions-=c formatoptions-=r formatoptions-=o |