tpope / vim-sleuth

sleuth.vim: Heuristically set buffer options
https://www.vim.org/scripts/script.php?script_id=4375
1.92k stars 86 forks source link

Do not guess settings if nomodifiable #23

Closed vheon closed 9 years ago

vheon commented 9 years ago

I noticed that when I open a vim help file I get a little lag. I profiled it and it was vm-sleuth guessing options. Since I think it is not useful to guess options for a file opened with view or any file in read-only mode, it seemed more general to disable based on the modifiable flag instead of special case the help filetype or make a blacklist.

tpope commented 9 years ago

I think that's reasonable.

blueyed commented 8 years ago

@vheon Would be interesting to see what was slow in that case..

I would like nomodifiable files to look good, too - of course.. ;)

See https://github.com/tpope/vim-sleuth/issues/35 regarding a way to trigger it automatically.

jucor commented 7 years ago

Actually, I often view read-only source code [eg system libraries], and it would be very helpful to have them properly detected so that they are auto-folded. @vheon , would you be open to reconsidering, and making a blacklist or a help-specific behaviour?

tpope commented 7 years ago

I didn't think about folding. Let's try checking &buftype ==# 'help' instead.

jucor commented 7 years ago

Makes perfect sense. Do you think that would also be a good place to check on a blacklist of filetypes while we're at it, as per #29 ?

tpope commented 7 years ago

That could potentially be added on, but start with the buf type check if you want a quick merge.