I want to work on someone else\'s project, and he uses 4 spaces for indentation. I use 2, and my screen is not big enough to edit using 4 spaces comfortably.
Can I confi
If he uses true spaces instead of tabs (which it sounds like), no, you cannot have vim display 2 spaces where there are 4. However, you can tell vim the following commands to replace all 4-space groups with the tab character, and then display them as 2 spaces.
:set tabstop=4 ! display a tab as 4 columns
:set shiftwidth=4
:set noexpandtab
:gg=G ! convert the whole file to tabs
:set tabstop=2 !display a tab as 2 columns
:set shiftwidth=2
When you are ready to submit your work,
:set tabstop=4
:set shiftwidth=4
:set expandtab
:%retab
Should convert it back.