When opening a C file, then even with the vanilla setup on my Linux Mint system, if I type identifier at the beginning of an indented line and then ':'
immediately after it, the indentation for that line gets deleted.
How can I disable this behavior?
HOME=$PWD vi testfile.cin an empty directory so I'm pretty sure it's not a problem of debugging my (empty).vimrc. But thiscindentoption is pointing me in the right direction, so thanks! ;-) – Petr Skocik Feb 06 '21 at 10:50cindentmust not be set by default. SettingHOME=$PWDis wrong, as it still allows processing/usr/share/vimand such. That is, your problem is broken installation / altered runtime files. – Matt Feb 06 '21 at 11:17vim -u NONE -U NONE -Nrecommended in the link you posted works to suppress the behavior, though. Useful info. Thank you. – Petr Skocik Feb 06 '21 at 11:34cindentshould not be enabled for non-C filetypes, only C filetypes and a few very similar languages (where this is expected, astext:is treated as a label). Are you sure there's no vimrc file in ~/.vimrc or ~/.vim/vimrc? Or maybe there's a plugin or something in the~/.vim/packdirectory? On which system are you using Vim? Maybe they ship with a weird non-standard configuration? You can also check where it was set with:20verbose set cindent, and see which files are loaded with:scriptnames. – Martin Tournoij Feb 06 '21 at 14:24:20verbose set consent?, with the?asking to query what the option is set to and the:verboseasking where it was set. – filbranden Feb 06 '21 at 15:36:20verbose set cindent?showed/usr/share/vim/vim80/indent/c.vimas the culprit (I guess that's what my system, Linux Mint 19.3, provides). Textfiles were only affected with my real.vimrc, which also hadset cindentin it. – Petr Skocik Feb 06 '21 at 15:48cinkeyseither. This setting is very old and goes back to before Vim had a generic indentation system. – Martin Tournoij Feb 06 '21 at 23:36