问题
Whenever I try to enter tabs in vim, it just enters 4 spaces. I am currently writing a makefile so I need to be able to enter literal tabs. Any ideas?
回答1:
Remove set expandtab from (or use set noexpandtab in) your .vimrc.
To insert a literal tab when expandtab is on, you can use Ctrl+vTab (or Ctrl+qTab on windows with the default settings)
回答2:
in your .vimrc you want
set noexpandtab
回答3:
To the best of my knowledge, expandtab is automatically reset for Makefile
:verbose set et?
shows
noexpandtab
Last set from C:\Program Files\Vim\vim73\ftplugin\make.vim
even though I have se et in my $MYVIMRC
Try adding
filetype plugin on
to your $MYVIMRC
来源:https://stackoverflow.com/questions/14825861/how-can-i-manually-enter-tabs-possibly-vimrc-file