path: root/vim/plugin/big_file_options.vim
AgeCommit message (Collapse)AuthorFilesLines
2017-11-10Use exists+ test rather than exists&Tom Ryder1-1/+1
From :help hidden-options: >Not all options are supported in all versions. This depends on the >supported features and sometimes on the system. A remark about this is >in curly braces below. When an option is not supported it may still be >set without getting an error, this is called a hidden option. You can't >get the value of a hidden option though, it is not stored. > >To test if option "foo" can be used with ":set" use something like this: > if exists('&foo') >This also returns true for a hidden option. To test if option "foo" is >really supported use something like this: > if exists('+foo')
2017-11-05Use BufReadPost hook for big_file_options.vimTom Ryder1-4/+4
Using BufReadPre meant that it was too early to set the 'syntax' option locally for the buffer. This fixes that, and also works correctly for cases where the buffer does not necessarily correspond to a file on disk.
2017-11-04Add short-circuit boilerplate to pluginsTom Ryder1-47/+50
Set a g:loaded_* flag to prevent repeated reloads, and refuse to load at all if &compatible is set or if required features are missing. Some more accommodating plugins avoid the problems 'compatible' causes by saving its value at startup into a script variable, setting the option to the Vim default, and then restoring it when the plugin is done, to prevent any of its flags from interfering in the plugin code: let s:save_cpo = &cpo set cpo&vim ... let &cpo = s:save_cpo unlet s:save_cpo I don't want this boilerplate, so I'm going to do what Tim Pope's modules seem to, and just have the plugin refuse to do a single thing if 'compatible' is set.
2017-11-04Adjust plugin code layout a lotTom Ryder1-0/+62
Including renaming big_file.vim and accompanying functions yet again, to big_file_options.vim. Trying to keep complex autocmd and mapping definitions on long lines broken up semantically; definition and options on one line, patterns or mapping key on the next, and the command to run on the last. Also trying to make sure that <silent>, <buffer>, and <unique> are applied in the correct places, and that all mapping commands are using the :<C-U> idiom for the command prefix.