Open RobertAudi opened 10 years ago
Hmm, I thought I fixed this. I'll have a look at it again.
@dag Why don't you use the indentation stuff from this other fish vim plugin?
https://github.com/Soares/fish.vim/blob/master/indent/fish.vim
Have you tried that with endwise? Thinking about it more now I think the problem is that if you make =
work then you break endwise, and what's in vim-fish
currently is a compromise optimized for input - at the expense of editing. If you manually write it line by line, everything is good and you get end
inserted for you, but as you discovered trying to format blocks of existing code gets messed up.
If I can't figure out how to make everything work together maybe I should add an option for disabling endwise for fish all together, and make =
work instead. Thoughts?
I should note, you can also use gq
to format using the native fish_indent
. Downside is that only produces tabulators. Maybe I could hack that to run a substitute on the result to post-process.
@dag I managed to make endwise work with =
using the indentation stuff I linked in my previous comment. I created a plugin that combines your stuff with the stuff of the other plugin. My version can be found here:
IMHO, vim-fish should not break =
.
I don't have endwise installed, but my vim is still unable to indent code properly when using vim-fish.
Endwise is nice but a luxury, indenting code properly is a must.
How can I tell vim-fish to be compatible with =
?
Yeah, I'm also seeing broken behaviour when indenting using =
. Have anyone come to any conclusions regarding this?
Any updates?
https://github.com/RobertAudi/fish.vim (same as https://github.com/AzizLight/fish.vim) works much better
@nhooyr None of them works well on indentation.
When I add an
if
statement, and press<Enter>
, theend
keyword is added. So far so good. However, if theif
statement is indented already (or nested), i.e.: Thei
of theif
and thee
ofend
is not in column 0, and if I indent the selection with=
(in normal mode using==
, or in visual mode), then the indentation completely breaks.The breakage gets worse every time a block of code is indented, as shown in the screenshots.