Recently I have been mostly working in JavaScript and per my project standards, all my tabs are replaced by 2 spaces. The problem with this is that for other projects in other programming languages the standard tab width is 4 spaces, so it becomes annoying to have to hit tab twice to indent a line correctly. To fix this you can declare settings specific for a language if you place them on ~/.vim/ftplugin/LANGUAGE.vim.

Since currently I am working on an Android app and I want a tab width of 4, I created the file ~/.vim/ftplugin/java.vim and added this content:

" Make tabs 4 spaces wide "
set tabstop=4
set shiftwidth=4
[ linux  productivity  vim  ]
Vim command line mode
The Vim statusline
Load bash preferences when SSH to a host
Spell and Grammar checking on vim
Getting familiar with Terraform