我有
vim 7.3,默认情况下使用Ubuntu 11.04提供的设置.我的.vimrc如下所示:
set nocompatible set autoindent set tabstop=4 set softtabstop=4 set shiftwidth=4 set expandtab filetype plugin indent on let g:omni_sql_no_default_maps = 1 " Stops Omni from grabbing left/right keys " syntax,colorscheme and status line directives omitted.
如何针对不同的文件类型(例如php,phtml,rb)有选择地禁用此缩进?
到目前为止,我已经尝试了autocmd FileType php filetype插件缩进和一些变体,但我还没有太多运气.
(删除filetype插件…行会产生所需的行为,但显然会影响所有文件类型,而不仅仅是少数.)
Prince对autocmd的建议对我不起作用.这样做:
filetype plugin on autocmd BufRead,BufNewFile * filetype indent off autocmd BufRead,BufNewFile *.py filetype indent on
有选择地为python文件启用文件类型缩进.设置ai非常酷,因为它适用于缩进作为后备的文件.
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。