Posts Tagged ‘tab’

Different tabs for different files

September 14, 2018 Leave a comment


Needed to have different tabs for different files when editing with vim. Eg in python tab == 4 spaces, in a MakeFile tab == tab.


Added this to ~/.vimrc

" Use different indentation for yaml files
 autocmd FileType yaml,yml setlocal tabstop=2 expandtab shiftwidth=2 softtabstop=2

 " In makefiles, don't expand tabs to spaces, since actual tab characters are
 " needed, and have indentation at 8 chars to be sure that all indents are tabs
 autocmd FileType make set noexpandtab shiftwidth=8 softtabstop=0


Categories: vim Tags:

Tab navigation

December 20, 2016 Leave a comment

In normal mode, you can type:

gt go to next tab
gT go to previous tab
{i}gt go to tab in position i

Note that the gt command counts from one. That means 3gt will jump to the third tab. Also note is 0gt and 1gt mean the same thing: jumping to the first tab.

Categories: vim Tags: ,