dag / vim-fish

Vim support for editing fish scripts
MIT License
431 stars 59 forks source link

Disable folding (feature request) #8

Closed haarts closed 11 years ago

haarts commented 11 years ago

You can now modify the folding behaviour. But it'd be nice if there was an option to disable it completely.

dag commented 11 years ago

All you need is:

autocmd FileType fish setlocal nofoldenable

Or just put setlocal nofoldenable in your own ~/.vim/ftplugin/fish.vim.

Closing as wontfix unless you have any objections.

haarts commented 11 years ago

Not at all, if there was a mailing list I would have asked there. Thanks for clearing this up.

dag commented 11 years ago

Oh I don't mind. May I ask why you want to disable folding completely? Just concerned about the cost of calculating the folds? It's probably negligible.

haarts commented 11 years ago

The computation cost don't bother me at all. I don't regularly use folds as I don't find them entirely useful (opinion, I know).

dag commented 11 years ago

I just realized the defaults in Vim mean the folds will all start out closed. I thought the defaults were to leave all folds open, so you wouldn't notice they're there if you didn't use them. I can see how this would be annoying if you don't want to use folds.

I'll see about making things more clear in the README or something.

dag commented 11 years ago

Personally I think the fact that folds fold text is nice because it can let you focus on other parts or give you an overview of the file, but this is all secondary. The killer feature of folds for me is that they delimit structures so you can navigate them (zj and zk) and operate on them as text objects (vim-textobj-fold).

But I really didn't mean for the default experience with vim-fish to be that every fold is closed. Not sure if I should just document how to disable folds (or how to configure them to start out opened) or instead make folding in vim-fish opt-in. I don't really like either option and would have preferred Vim's defaults to be different, but alas.

dag commented 11 years ago

Gah, it's worse: the folding options are only window-local so there's no straightforward way to set them per buffer or filetype.

dag commented 11 years ago

Scratch that; I had misunderstood the behavior of window-local options.