Whenever I append a :
character in Vim in Python mode, it either:
What is it even trying to do, and how do I get rid of this behavior?
Globally Disable Auto-Indentation by Disabling the Filevim files (eg. sh. vim ) who set indentexpr option (eg to GetShIndent() ).
Fix indentation in the whole fileStart in the top of a file (to get there, press gg anywhere in the file.). Then press =G , and Vim will fix the indentation in the whole file. If you don't start in the beginning of the file, it will fix indentation from current line to the bottom of file.
Paste toggleStart insert mode. Press F2 (toggles the 'paste' option on). Use your terminal to paste text from the clipboard. Press F2 (toggles the 'paste' option off).
Certain keys, when pressed, will trigger Vim's indent feature, which will attempt to set the correct amount of indentation on the current line. (You can manually trigger this by typing ==
in normal mode.)
You can change which keys trigger this behavior, but first you need to know what indenting mode is being used.
First, execute :set indentexpr?
. If it is nonempty (I would expect this for Python), then indentexpr
mode is being used. In this case, executing :set indentkeys?
gives you the list of trigger keys. To remove the colon, execute :setlocal indentkeys-=:
.
If indentexpr
is empty, then you are probably using cindent
mode, and :set cindent?
will tell you that cindent
is set. In this case, do the same as before, but using cinkeys
instead of indentkeys
. (Note that indentexpr
mode takes precedence over cindent
mode.)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With