日期:2014-05-16  浏览次数:21710 次

vim 编辑makefile文件时,怎么才能让tab不要被转换为空格呢?
在vimrc里了加了这一行
autocmd FileType makefile set noexpandtab 

为什么编辑makefile时输入tab还会被转成空格。

Here is my .vimrc:


set nocompatible
source $VIMRUNTIME/vimrc_example.vim
source $VIMRUNTIME/mswin.vim
"behave mswin
syntax on
set expandtab "使用空格代替tab. 
set tabstop=4
set shiftwidth=4
autocmd FileType makefile set noexpandtab
set autoindent
set cindent
set nu
set diffexpr=MyDiff()
set nobackup
let &termencoding=&encoding

------解决方案--------------------
autocmd FileType make set noexpandtab