aboutsummaryrefslogtreecommitdiff
path: root/autoload
diff options
context:
space:
mode:
Diffstat (limited to 'autoload')
-rw-r--r--autoload/big_file_options.vim16
1 files changed, 4 insertions, 12 deletions
diff --git a/autoload/big_file_options.vim b/autoload/big_file_options.vim
index 5c57343..f8b0671 100644
--- a/autoload/big_file_options.vim
+++ b/autoload/big_file_options.vim
@@ -1,8 +1,6 @@
" Wrapper function to get the configured size limit, default to 10 MiB
function! s:Limit()
- let limit = exists('g:big_file_options_limit')
- \ ? g:big_file_options_limit
- \ : 10 * 1024 * 1024
+ let limit = get(g:, 'big_file_options_limit', 10 * 1024 * 1024)
return limit
endfunction
@@ -67,9 +65,7 @@ function! s:SetPre()
endif
" Decide whether to set readonly options
- let readonly = exists('g:big_file_options_readonly')
- \ ? g:big_file_options_readonly
- \ : 1
+ let readonly = get(g:, 'big_file_options_readonly', 1)
if readonly
setlocal buftype=nowrite
setlocal nomodifiable
@@ -87,18 +83,14 @@ function! s:SetPost()
if has('syntax')
" Disable syntax highlighting if configured
- let syntax = exists('g:big_file_options_syntax')
- \ ? g:big_file_options_syntax
- \ : 0
+ let syntax = get(g:, 'big_file_options_syntax', 0)
if !syntax
setlocal syntax=OFF
endif
" Force maximum syntax columns down if configured
if exists('+synmaxcol')
- let synmaxcol = exists('g:big_file_options_synmaxcol')
- \ ? g:big_file_options_synmaxcol
- \ : 256
+ let synmaxcol = get(g:, 'big_file_options_synmaxcol', 256)
if exists('+synmaxcol') && &synmaxcol > synmaxcol
let &l:synmaxcol = synmaxcol
endif