vim - 强制>>使用空格,而不是标签

时间:2014-10-28 13:36:03

标签: vim

我的这些设置是我的.vimrc:

set softtabstop=4
set shiftwidth=4
set tabstop=4
set expandtab

我也在使用tpope的sensible.vim插件。

当我使用>>缩进,它使用的是制表符而不是空格。

我怎样才能拥有>>插入空格?

以下是输出:set

:set
--- Options ---
  ambiwidth=double    binary              history=1000        nrformats=hex       scrolloff=1         smarttab            tabpagemax=50       ttyfast
  autoindent          display=lastline    incsearch           number              shiftwidth=4        softtabstop=4       tabstop=4           ttymouse=xterm2
  autoread          noendofline           laststatus=2        ruler               showcmd             suffixesadd=.js     ttimeout            wildmenu
  background=dark     helplang=en       nomodeline            scroll=20           sidescrolloff=5   noswapfile            ttimeoutlen=100     t_Co=16
  backspace=indent,eol,start
  complete=.,w,b,u,t
  fileencodings=ucs-bom,utf-8,default,latin1
  fileformats=unix,dos,mac
  guioptions=aegimrLt
  listchars=tab:> ,trail:-,extends:>,precedes:<,nbsp:+
  printoptions=paper:letter
  runtimepath=~/.vim,~/.vim/bundle/syntastic,/var/lib/vim/addons,/usr/share/vim/vimfiles,/usr/share/vim/vim74,/usr/share/vim/vimfiles/after,/var/lib/vim/addons/after,~/.vim/after
  sessionoptions=blank,buffers,curdir,folds,help,tabpages,winsize
  suffixes=.bak,~,.swp,.o,.info,.aux,.log,.dvi,.bbl,.blg,.brf,.cb,.ind,.idx,.ilg,.inx,.out,.toc
  tags=./tags;,./TAGS,tags,TAGS
  viminfo=!,'100,<50,s10,h

1 个答案:

答案 0 :(得分:2)

有些东西:set[local] noexpandtab。这可以通过插件或文件类型插件。您可以通过:verbose setlocal expandtab?找到(针对特定缓冲区)。

对于插件,您可以在获取选项后重新设置选项:

autocmd VimEnter * set expandtab

对于文件类型插件,您可以在~/.vim/after/ftplugin/<filetype>.vim中覆盖单个文件类型的设置,或者通过从:filetype plugin on注释掉~/.vimrc来完全关闭它们。