improve line wrapping
This commit is contained in:
@@ -7,18 +7,25 @@ set autoindent
|
|||||||
" line length is 89
|
" line length is 89
|
||||||
set textwidth=89
|
set textwidth=89
|
||||||
|
|
||||||
" Enable soft wrapping
|
" Default: No wrap for code and config
|
||||||
set wrap
|
set nowrap
|
||||||
|
|
||||||
" Wrap at word boundaries
|
" Wrap at word boundaries
|
||||||
set linebreak
|
" set linebreak
|
||||||
|
|
||||||
" Maintain indentation on wrapped lines
|
" Maintain indentation on wrapped lines
|
||||||
set breakindent
|
" set breakindent
|
||||||
|
|
||||||
" Optional: visual indicator for wrapped lines
|
" Optional: visual indicator for wrapped lines
|
||||||
set showbreak=↪\
|
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
|
" Navigate visual lines instead of logical lines
|
||||||
nnoremap j gj
|
nnoremap j gj
|
||||||
nnoremap k gk
|
nnoremap k gk
|
||||||
@@ -56,7 +63,7 @@ filetype indent on
|
|||||||
set ofu=syntaxcomplete#Complete#
|
set ofu=syntaxcomplete#Complete#
|
||||||
|
|
||||||
" au FileType python setlocal tabstop=4 expandtab shiftwidth=4 softtabstop=4
|
" 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
|
" typing idate inserts the current date
|
||||||
iab idate <c-r>=strftime("%Y-%m-%d")<cr>
|
iab idate <c-r>=strftime("%Y-%m-%d")<cr>
|
||||||
|
|||||||
Reference in New Issue
Block a user