-
Notifications
You must be signed in to change notification settings - Fork 293
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Automatically indent on "else" #31
Comments
Yes, it should and it does. The 'e' in indentkeys does just that. If it’s not working for you I would bet a lot that it’s either your syntax that’s broken or your configuration. Something as basic as that would have been caught a long time ago (I hope). I’m closing this, awaiting an actual example that breaks the indentation function. The value of indentkeys is correct and why should be obvious from the documentation. If it isn’t, I suggest that you post to vim-dev and ask them (Bram) to clarify the documentation. To answer your question, however, the 0* are there to indent the character listed when it appears as the first non-indent character in the line. |
Indeed. The culprit is the neocomplcache plugin in my configuration files. Here is what I use:
The interesting part is that it works if '=else' is added to indentkeys :) Regarding the 0* in indentkeys, could you please provide me some simple use case of how can I test them so that I could understand them better? Best regards! |
Well, simply type one of the characters at the start of a line. The { is there to align the start of hash literals, the } is there to align the end of hash literals and blocks, the ) is there to align the end of method argument lists and other kinds of parenthesis-delimited blocks, and the ] is there to indent the ending of an array literal. I can’t remember why [ isn’t in that list, but I’m sure there was a reason.
|
Ok, now I could understand. My tests were failing because of neocomplcache. I've disabled all my user plugins and did see most of the indentkeys options working. The only thing that didn't make any difference is the '0{'. Could you test if there is any situation it helps for you? Try just deleting the '0{' from indentkeys and see the results. Maybe that is the reason why '0[' is not necessary... |
Shouldn't the indent file include 'else' in indentkeys?
Setting identkeys to include 'e' doesn't seem to work (at least for me in Vim 7.3). On the other hand, it seems to work if I change (just included '=else') the indentkeys line to:
Also, why does indentkeys include the default "0{,0},0),0], ^F,o,O,e"? I agree that ^F, 'o' and 'O' are useful, but I couldn't understand the other ones nor I could test if they are working. Maybe I didn't understand the documentation correctly.
The text was updated successfully, but these errors were encountered: