I believe there is a method to write a comment in a file that vim will use to override default tabbing and indent values.
Can someone point me to information about this feature and how to use it?
vimrc provides for a very convenient way to move between tabs. When in insert mode, press [Esc] to get to command mode, then use [Ctrl]+T plus a directional arrow to go to the tab you want: up to go to the first tab, down to the last, and left or right to go to the previous or next tab.
To indent the current line, or a visual block: ctrl-t, ctrl-d - indent current line forward, backwards (insert mode) visual > or < - indent block by sw (repeat with . ) then try hitting the F5 key while in insert mode (or just :set paste ).
As for tabs, there are two settings. Within Vim, type a colon and then "set tabstop=4" which will set the tabs to display as four spaces. Hit colon again and type "set expandtab" which will insert spaces for tabs.
Per-file settings can be done using "modeline magic".
The basic idea is that you can add a comment to an individual file like this:
/* vim: set tabstop=8:softtabstop=8:shiftwidth=8:noexpandtab */
Within vim, you should review:
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