Commit daf28d12 authored by Dom Sekotill's avatar Dom Sekotill
Browse files

Disable unneeded options for non-modifiable buffers

When a Vim buffer is marked as non-modifiable (`&modifiable == 0`)
disable spell checking and the colour-column.
parent e34d8b1f
Loading
Loading
Loading
Loading
+13 −0
Original line number Diff line number Diff line
@@ -113,6 +113,19 @@ let g:ycm_autoclose_preview_window_after_completion=1
let g:AutoPairsCenterLine = 0


" === NON-MODIFIABLE BUFFERS ===

au OptionSet modifiable if ! v:option_new | noa call <SID>no_mod() | endif
au BufWinEnter * if ! &modifiable | noa call <SID>no_mod() | endif

function s:no_mod()
	" Settings to clean up non-modifiable buffer views
	" Things like spell checking & color-column are not needed
	setl nospell
	setl colorcolumn=0
endfunction


" === INVLIST ===

" Show tabs with •◦◦◦