diff --git a/vim/.config/vim/vimrc b/vim/.config/vim/vimrc index 3acded7..a1dd701 100644 --- a/vim/.config/vim/vimrc +++ b/vim/.config/vim/vimrc @@ -7,18 +7,25 @@ set autoindent " line length is 89 set textwidth=89 -" Enable soft wrapping -set wrap +" Default: No wrap for code and config +set nowrap " Wrap at word boundaries -set linebreak - +" set linebreak " Maintain indentation on wrapped lines -set breakindent - +" set breakindent " Optional: visual indicator for wrapped lines set showbreak=↪\ +" a group for wrapping by filetype +augroup filetype_wrapping + autocmd! + " Enable soft wrap for prose + autocmd FileType markdown,text,gitcommit setlocal wrap linebreak breakindent + " Maintain no wrap for code and structured data + autocmd FileType go,python,sh,yaml,json setlocal nowrap +augroup END + " Navigate visual lines instead of logical lines nnoremap j gj nnoremap k gk @@ -56,7 +63,7 @@ filetype indent on set ofu=syntaxcomplete#Complete# " au FileType python setlocal tabstop=4 expandtab shiftwidth=4 softtabstop=4 -au FileType markdown setlocal tabstop=4 expandtab shiftwidth=4 softtabstop=4 +au FileType markdown setlocal tabstop=4 expandtab shiftwidth=4 softtabstop=4 wrap " typing idate inserts the current date iab idate =strftime("%Y-%m-%d")