How can I manually enter tabs (possibly .vimrc file)?

余生颓废 提交于 2019-12-24 08:57:08

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!