vim-filetype
来源:互联网 发布:centos u盘挂载 编辑:程序博客网 时间:2024/05/25 12:21
filetype---- 文件类型检测
vim中执行:filetype
查看Vim的文件类型检测功能是否已打开;:set filetype
查看当前文件是什么类型;:set filetype=HTML设置文件类型为HTML;
filetype的默认属性:detection:ON plugin:OFF indent:OFF
detection:默认情况vim会对文件自动检测文件类型,也就是你看到的'detection:ON',如需关闭:filetype off。
还有一种方式就是在文件内容中指定,Vim会从文件的头几行自动扫描文件是否有声明文件类型的代码,如在文件的首行加入 //vim: filetype=HTML
,当作注释写入,以致于不影响文件的编译,这样Vim不通过文件名也能检测出文件是什么类型
plugin:当plugin状态为"ON"时,那么就会在Vim的运行时环境目录下加载该类型相关的插件。比如为了让Vim更好的支持Html编程,就需要下载一些Html相关的插件。vim中执行 :filetype plugin on
indent:不同类型文件有不同的方式,比如Python要求使用4个空格作为缩进,而Html使用2个空格作为缩进,那么indent就可以为不同文件类型选择合适的缩进方式。你可以在Vim的安装目录的indent目录下看到定义了很多缩进相关的脚本。vim中执行 :filetype indent on
。
以上三个参数,可以写成一行filetype plugin indent on
在_vimrc文件中写入。
0 0
- vim FILETYPE
- vim-filetype
- vim filetype
- vim filetype.vim
- matchit.vim 和 filetype
- vim:一些命令和选项 filetype, autocmd, map,tabstop等
- 关于VIM自动缩进失效(filetype indent on无效)的详细分析
- Upload filetype not allow
- Filetype修改上传
- dede Upload filetype not allow
- opencms批量修改filetype和filename
- Change filetype sl to renderman shader language instead of slang
- How do I register a custom filetype in iOS【链接】
- DEDE出现“Upload filetype not allow”的原因及解决
- DedeCMS上传图片提示Upload filetype not allow解决办法汇总
- DedeCMS上传图片提示Upload filetype not allow解决办法汇总
- 织梦上传图片Upload filetype not allow !出错
- vim
- The connection to adb is down, and a severe error has occured.
- 【Matlab】Matlab编程学习笔记【待续】
- C语言全局变量定义方法
- WebService_HelloWorld_笔记
- Cocos2d-x各项目的功能
- vim-filetype
- selenium第一个小程序遇到的问题
- LeetCode 题解(48): Minimum Path Sum
- MySql入门命令总结
- 【Information Retrieval】文本信息检索
- python Tkinter (1)
- ARM和NEON指令
- Leetcode-Rotate List
- hdu 5007 Post Robot