dag / vim-fish

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

Drop or improve the funced behavior #12

Closed dag closed 10 years ago

dag commented 11 years ago

After using it for a while I can only conclude that it's an annoyance, especially being put in Insert mode, and I've also since discovered better ways to work with funced in Vim. It might still be useful to do something like, move the cursor to the first line following a function start declaration, but stay in Normal mode and don't indent. The user then just has to hit S (or cc) to start Insert and indent.

netmute commented 10 years ago

I second this. When opening vim I expect to be in command mode, everything else is confusing.

dag commented 10 years ago

@netmute Let me know if the new behavior is also annoying.

What bugs me is that fish's funced for a new function adds an empty line, so if you just hit o to start inserting the function body the empty line is kept. There's also no way for vim-fish to reliably detect if you're funcediting a new function or an existing one, so if we do anything it needs to work in both cases.

An alternative to the new behavior in vim-fish could be to scan the whole file to detect if it looks like a new function (ie. has no function body) and then delete that empty line. This would be more work though, and arguably more magical (even if perhaps less surprising). Thoughts?

netmute commented 10 years ago

Less magic is better in my opinion. I can always just do an S on the empty line, doesn't really bother me.

dag commented 10 years ago

And the new behavior of placing the cursor on that line, useful or annoying? It's not a big win over jS, admittedly, but I think the latter requires more mental effort if nothing else.

netmute commented 10 years ago

It stays out of my way, so it's fine :)