How to set TAB to 2 spaces in vim Posted on 10 December 2012 by kosmas emailFacebookTwitterLinkedinProblem You would like to set up your vim editor to use 2 spaces for the tab character. Solution Add the following to your ~/.vimrc file: set ts=2 1 set ts=2