想在VIMRC中加入一个自动判断语句
如果是C文件类型,就在文件前加注释信息
如果是PYTHON和BASH就在文件前加文件头和注释
用什么函数来判断呢?
试了一下,用did_filetype(),启动VIM报错
怎么在vimrc中自动检测文件名类型?
-
- 帖子: 147
- 注册时间: 2006-11-29 21:27
-
- 帖子: 403
- 注册时间: 2007-10-27 1:04
Re: 怎么在vimrc中自动检测文件名类型?
autocmd FileType c
\ do_something_here()
autocmd FileType python
\ do_something_here()
autocmd FileType bash
\ do_something_here()
\ do_something_here()
autocmd FileType python
\ do_something_here()
autocmd FileType bash
\ do_something_here()
-
- 帖子: 147
- 注册时间: 2006-11-29 21:27
Re: 怎么在vimrc中自动检测文件名类型?
autocmd怎么用法,VIM帮助说的看不懂
/do_something_here()是自定义函数吗?
/do_something_here()是自定义函数吗?