Vim: autoindent with == doesn't work as expected
- Click thumbs-up 👍 on this issue if you want it!
- Click confused 😕 on this issue if not having it makes VSCodeVim unusable.
The VSCodeVim team prioritizes issues based on reaction count.
What did you do?
When I have this code in Python:
def someFunction(arg1):
print('this should indent')
And when in normal mode with my cursor on the line print('this should indent')
and press ==
What did you expect to happen?
Indent of four spaces
What happened instead?
Nothing
Technical details:
- VSCode Version: 1.11.2
- VsCodeVim Version: 0.6.18
- OS: windows
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Reactions: 85
- Comments: 37 (13 by maintainers)
It’s nearly 2022 now, is there any way to reindent the current line correctly ??
But is == really supposed to format? The default behavior in vim seems to be to reindent current line from what I can find, might be wrong though.
I agree with @albheim. If the behavior is to mimic vim,
=
should really mean reindent, not reformat.@madchap you can try
editor.action.reindentselectedlines
, but there’s no good solution to this on our end. Formatting is done by each language’s extension, and we just invoke the commands. https://github.com/VSCodeVim/Vim/issues/1017#issuecomment-569801348 is relevant.The problem is there are two types of formatters in VS Code:
When extensions only have document formatter, and you try to format a selection (such as Vue and Go), the message
no formatter for x file found
shows up. I have opened up an issue on VS Code side to provide a more meaningful message.So what is the actual solution here? As of today, I have the issue as well.
I also have the issue that @xvjiarui describe
Sorry, but there is no formatter for 'go'-files installed.
NOTE
gofmt
command line workseditor.action.formatDocument
works a expectedthe issue is when I use
=
to format the code. I have tried to set the value ofgo.formatTool
togfmt
,goreturns
but still I get the notice “Sorry, but there is no formatter for ‘go’-files installed.”I have disabled all other extension and re-installed vscodevim, without any results.
thanks
have the same issue with vue, it prompts that
Sorry, but there is no formatter for 'vue'-files installed.