你的位置:首页 > 操作系统

[操作系统]VIM 添加注释的部分配置


 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>'s10 function AddNotes()11   call append(line(".")-1,"/**")12   call append(line(".")-1," * @description\t")13   "多个人使用的话给以给成这样,我就自己用14   "let name=$USER15   "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=G23 endfunction24 25 "添加头文件注释26 map <F4> ms:call AddTitle()<cr>'s27 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