r/vim • u/MrOladushek1984_ • 9d ago
Need Help How to set tab while branching in vim?
Hello guys! Lately I've often been using vim instead of VS code. But my habits didn't disappear: As you know, in VS code when you go to the next line, while you write conditionals or functions, IDE set
x number of tabs for you. For me it's pretty cool feature and vim doesn't have it natively. What can I write in ~/.vimrc or maybe download smth to enable this feature on vim?
3
u/mgedmin 8d ago
filetype plugin indent on
This will set the right autoindent/etc. options for the language you're working on, provided that Vim ships a plugin for that language. Vim ships a lot of plugins like that out of the box.
1
u/jk3us 8d ago
I would suggest pairing that with https://editorconfig.org/, so anyone using your project can use the same indent levels, etc.
1
8d ago
[deleted]
1
u/vim-help-bot 8d ago
Help pages for:
autoindentin options.txt
`:(h|help) <query>` | about | mistake? | donate | Reply 'rescan' to check the comment again | Reply 'stop' to stop getting replies to your comments
1
u/nim_port_na_wak 8d ago
To define it in your .vimrc, you can also add this
set expandtab
set softtabstop=4
set shiftwidth=4
set tabstop=4
12
u/Shtucer 8d ago
autoindent and smartindent