New answers tagged

0

Normally I configure my vi/vim with set expandtab set tabstop=4 set shiftwidth=4` to "expand tabs" (to spaces), using "tab stops" of four spaces and the "shift width" also to four spaces. To apply these changes to an existing file which already contains tabs I'd just use a common ex substitute command: :% s/^V^I/ /g (Where ^V^...


0

Could you have typed >>? This would indent the current line further, and under certain settings (mostly related to softtabstop, shiftwidth, shiftround, etc.) could change a space into a tab. Obviously u undoes the change, but << is the counterpart. For correcting spaces vs. tabs after changing the appropriate settings, use :retab[!].


Top 50 recent answers are included