码迷,mamicode.com
首页 > 系统相关 > 详细

VIM 添加注释的部分配置

时间:2015-08-31 15:06:47      阅读:172      评论:0      收藏:0      [点我收藏+]

标签:

 1 "以下为我的vim的部分配置
 2 au FileType php call AddPHPFuncList()
 3 function AddPHPFuncList()
 4     set dictionary-=~/.vim/php_funclist.txt dictionary+=~/.vim/php_funclist.txt
 5     set complete-=k complete+=k
 6 endfunction
 7 "从这开始是我所说的
 8 "在当前行的上面添加函数的注释
 9 map <F5> ms:call AddNotes()<cr>s
10 function AddNotes()
11     call append(line(".")-1,"/**")
12     call append(line(".")-1," * @description\t")
13     "多个人使用的话给以给成这样,我就自己用
14     "let name=$USER
15     "call append(line(".")-1," * @author\t".name."\t".strftime("%Y-%m-%d %H:%M"))
16     call append(line(".")-1," * @author\t\zhaoyingnan\t".strftime("%Y-%m-%d %H:%M"))
17     call append(line(".")-1," * @param\tint\t\t\t$iVar")
18     call append(line(".")-1," * @param\tstring\t\t$sVar")
19     call append(line(".")-1," * @param\tarray\t\t$aVar")
20     call append(line(".")-1," * @return\t")
21     call append(line(".")-1," **/")
22     normal gg=G
23 endfunction
24 
25 "添加头文件注释
26 map <F4> ms:call AddTitle()<cr>s
27 function AddTitle()
28     call append(1,"/**")
29     call append(2," * Description: ")
30     call append(3," * Create date: ".strftime("%Y-%m-%d %H:%M"))
31     "call append(4," * Modified date: ".strftime("%Y-%m-%d %H:%M"))
32     call append(4," * Author: zhaoyingnan")
33     call append(5," **/")
34 endfunction  

 

VIM 添加注释的部分配置

标签:

原文地址:http://www.cnblogs.com/yingnan/p/4772861.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!