读书人

vim 编辑makefile文件时如何才能让t

发布时间: 2012-03-15 11:50:39 作者: rapoo

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

读书人网 >UNIXLINUX

热点推荐