缩进 – 在Vim 7.3中针对特定文件类型选择性地禁用“filetype插
发布时间:2020-12-16 01:26:31 所属栏目:安全 来源:网络整理
导读:我有 vim 7.3,默认情况下使用Ubuntu 11.04提供的设置.我的.vimrc如下所示: set nocompatibleset autoindentset tabstop=4set softtabstop=4set shiftwidth=4set expandtabfiletype plugin indent onlet g:omni_sql_no_default_maps = 1 " Stops Omni from g
我有
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非常酷,因为它适用于缩进作为后备的文件. (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |