VIM: colour column on textwidth or if not set col 80
This had to be done in a FileType * autocmd so that it is done once file
type has been determined and textwidth is set, as suggested by tae on
discord
7630218973
这个提交存在于:
父节点
9479b9574e
当前提交
9ba7608e66
共有 2 个文件被更改,包括 13 次插入 和 0 次删除
|
@ -10,3 +10,11 @@ function! mine#functions#text() abort
|
||||||
inoremap <buffer> ; ;<C-g>u
|
inoremap <buffer> ; ;<C-g>u
|
||||||
inoremap <buffer> ? ?<C-g>u
|
inoremap <buffer> ? ?<C-g>u
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
function! mine#functions#colorcols() abort
|
||||||
|
if &textwidth > 0
|
||||||
|
setlocal colorcolumn=+0
|
||||||
|
else
|
||||||
|
setlocal colorcolumn=80,100
|
||||||
|
endif
|
||||||
|
endfunction
|
||||||
|
|
|
@ -43,3 +43,8 @@ let g:netrw_browsex_viewer = "opout"
|
||||||
set formatoptions+=r
|
set formatoptions+=r
|
||||||
" Automatically insert comment leader after hitting o or O
|
" Automatically insert comment leader after hitting o or O
|
||||||
set formatoptions+=o
|
set formatoptions+=o
|
||||||
|
|
||||||
|
augroup colorcols
|
||||||
|
autocmd!
|
||||||
|
autocmd FileType,VimEnter,BufEnter * call mine#functions#colorcols()
|
||||||
|
augroup end
|
||||||
|
|
正在加载…
添加表格
添加链接
在新工单中引用