aboutsummaryrefslogtreecommitdiff
path: root/vim/vimrc
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2017-10-28 21:53:46 +1300
committerTom Ryder <tom@sanctum.geek.nz>2017-10-28 21:53:46 +1300
commit0dbc9b35f9ae0c21390f2133406da3279af190c7 (patch)
tree1b0b94d784772dd35566da3ad6827f09e6163733 /vim/vimrc
parentMove format .vimrc config into subfile (diff)
downloaddotfiles-0dbc9b35f9ae0c21390f2133406da3279af190c7.tar.gz
dotfiles-0dbc9b35f9ae0c21390f2133406da3279af190c7.zip
Move BigFileMeasures() .vimrc func into subfile
Also add a note to IDEAS.md for later to consider packaging this as a proepr plugin, even if it doesn't actually leave the dotfiles repository just yet.
Diffstat (limited to 'vim/vimrc')
-rw-r--r--vim/vimrc29
1 files changed, 0 insertions, 29 deletions
diff --git a/vim/vimrc b/vim/vimrc
index d00376f0..9dcbb38f 100644
--- a/vim/vimrc
+++ b/vim/vimrc
@@ -249,32 +249,3 @@ if has('autocmd')
autocmd!
augroup END
endif
-
-" When opening a large file, take some measures to keep things loading quickly
-if has('eval') && has('autocmd')
-
- " Threshold is 10 MiB
- let g:bigfilesize = 10 * 1024 * 1024
-
- " Declare function for turning off slow options
- function! BigFileMeasures()
- let l:file = expand('<afile>')
- if getfsize(l:file) > g:bigfilesize
- setlocal nobackup
- setlocal nowritebackup
- setlocal noswapfile
- if has('persistent_undo')
- setlocal noundofile
- endif
- if exists('&synmaxcol')
- setlocal synmaxcol=256
- endif
- endif
- endfunction
-
- " Define autocmd for calling to check filesize
- augroup bigfilesize
- autocmd!
- autocmd BufReadPre * call BigFileMeasures()
- augroup end
-endif