Questions tagged [indent]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0
votes
1answer
26 views

How to make a filetype behave exactly like C++?

I want the filetype .my_cpp and .my_cc to behave exactly like C++ files in Vim. I have the following set: autocmd BufNewFile,BufRead *.my_cc set syntax=cpp autocmd BufNewFile,BufRead *.my_cpp set ...
0
votes
1answer
112 views

Vim mapping to auto-indent when entering inside braces, brackets etc

Which vim mapping/ plugin will help me in auto-indenting when entering inside braces, brackets or any similar characters. For example: Input {press enter} Output { cursor here } I want ...
0
votes
1answer
27 views

Quick question about indentation

Just had a quick (and probably stupid) question about indentation. When I try editing a script, one of my settings seems to "freeze" the indentation several tabs in, and I can't figure out ...
2
votes
1answer
23 views

Creating a new indented line with a closing bracket below when hitting enter

I'm coming to Vim from VSCode. So far, it's been great although I've noticed I have some muscle memory movements that I've had trouble moving to Vim. When I write something like this (cursor is ...
0
votes
2answers
36 views

How to make the indentation more smart

I'm using vim to code and I set autoindent in my ~/.vimrc. Now, if I code as below: if (a == 1) {| // the cursor is here and I type ENTER } After typing the ENTER, the code becomes as below: ...
0
votes
1answer
46 views

Vim ignores `filetype indent off`

I don't have a personal vimrc. I use /etc/vimrc. The last 2 lines are: let testvar=999 filetype indent off I confirmed execution at the vim prompt using :echo testver, which displays 999. I tried ...
2
votes
2answers
55 views

Fix indentation in a file while keeping cursor on the same line

I'd like to use vim's builtin indent fix feature on an entire file. I have looked up answers, but all I found were suggestions to type gg=G, the only problem being that it brings your cursor to the ...
1
vote
1answer
99 views

How to disable intelligent indent for text/markdown files?

Since ever in my configuration of vim text and markdown-files are indented on following lines to align with open parenthesis. Text Text Text (e.g. Hello World) More Text This happens ...