aboutsummaryrefslogtreecommitdiff
path: root/vim/plugin
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2017-11-02 14:25:54 +1300
committerTom Ryder <tom@sanctum.geek.nz>2017-11-02 14:25:54 +1300
commit607a1b5a2ece6053b7849402041b06178d7d699c (patch)
treedb14746f50ffe9a0c482ab23e5003f2bbd3ba7d8 /vim/plugin
parentRefactor plugin function for dependency injection (diff)
downloaddotfiles-607a1b5a2ece6053b7849402041b06178d7d699c.tar.gz
dotfiles-607a1b5a2ece6053b7849402041b06178d7d699c.zip
Make bigfile 'synmaxcol' setting configurable
Defaults to 256 columns and only sets it if the option's value isn't already lower than that.
Diffstat (limited to 'vim/plugin')
-rw-r--r--vim/plugin/bigfile.vim9
1 files changed, 7 insertions, 2 deletions
diff --git a/vim/plugin/bigfile.vim b/vim/plugin/bigfile.vim
index 82d1a7dd..c5dee62a 100644
--- a/vim/plugin/bigfile.vim
+++ b/vim/plugin/bigfile.vim
@@ -13,6 +13,11 @@ if has('eval') && has('autocmd')
let g:bigfile_size = 10 * 1024 * 1024
endif
+ " Cut 'synmaxcol' down to this or smaller for big files
+ if !exists('g:bigfile_size_synmaxcol')
+ let g:bigfile_size_synmaxcol = 256
+ endif
+
" Declare function for turning off slow options
function! s:BigFileOptions(name, size)
@@ -30,8 +35,8 @@ if has('eval') && has('autocmd')
endif
" Limit the number of columns of syntax highlighting
- if exists('&synmaxcol')
- setlocal synmaxcol=256
+ if exists('&synmaxcol') && &synmaxcol > g:bigfile_size_synmaxcol
+ execute 'setlocal synmaxcol=' . g:bigfile_size_synmaxcol
endif
endfunction