config/nvim: reduce formatoptions for txt

This commit is contained in:
xerus2000 2020-11-26 20:39:12 +01:00
parent c75fed6a26
commit 3828bf88f7
1 changed files with 4 additions and 2 deletions

View File

@ -29,6 +29,7 @@ highlight ColorColumn ctermbg=grey guibg=#888888
" search
set incsearch hlsearch " Handier search, even though nvim seems to enable it by default
set ignorecase smartcase " Only search case-sensitive when searching with uppercase
set inccommand=split
" matching
set showmatch " Highlight matching parenthesis
set matchpairs+=<:> " More pairings for '%'
@ -44,7 +45,7 @@ set foldopen+=jump " Automatically open folds on jump
syntax on
filetype plugin on
" comments
autocmd Filetype * setlocal formatoptions-=o | setlocal formatoptions+=qn1jr " Change comment behavior
autocmd Filetype * setlocal formatoptions-=o | setlocal formatoptions+=qn12jr " Change comment behavior
autocmd Filetype json syntax match Comment +\/\/.\+$+ " Comment highlighting in JSON
autocmd Filetype markdown let &comments = "b:*,b:-,b:+," . &comments
" custom hardcoded types
@ -57,7 +58,8 @@ autocmd BufNewFile *.sh,$HOME/.local/bin/* execute 'silent! 1s/.*/#!\/bin\/sh\r\
"autocmd BufNewFile * if !empty(&filetype) | execute 'silent! 1s/.*/#!\/usr\/bin\/' . &filetype . '\r\r'| :startinsert | endif
set spelllang=en_us,de_de
autocmd FileType markdown setlocal wrap spell colorcolumn= " Spell checking & no guiding columns in markdown
autocmd BufEnter *.txt setlocal ts=4 sw=4 formatoptions+=t
autocmd FileType markdown setlocal wrap spell colorcolumn= " Spell checking & no guiding columns in markdown
" Center on insert mode
autocmd InsertEnter * norm zz