推荐介绍配置
分类:编程应用

首若是针对vim IDE的局地安排,招待补充!

"设置字符集set fileencodings=utf-8,ucs-bom,gb18030,gbk,gb2312,cp936set termencoding=utf-8set encoding=utf-8"把当前行的对起格式应用到下一行set autoindent"将换行自动缩进设置成4个空格;set shiftwidth=4"表示一个tab键相当于4个空格键set tabstop=4"自动填充4个空格为tabset expandtab"显示行号set nu"启用标记折叠。所有文本将按照特定标记(默认为{{{和}}})自动折叠。set foldmethod=marker"粘贴不缩进的方法:set pasteset paste"从不备份set nobackup"禁止生成临时文件set noswapfile"确认VIset confirm"关闭鼠标set mouse -=a"显 示 TAB 键"set list"设置文件格式set fileformat=unix"代码自动完成(ctrl-x ctrl-o)autocmd FileType python set omnifunc=pythoncomplete#Completeautocmd FileType javascrīpt set omnifunc=javascrīptcomplete#CompleteJSautocmd FileType html set omnifunc=htmlcomplete#CompleteTagsautocmd FileType css set omnifunc=csscomplete#CompleteCSSautocmd FileType xml set omnifunc=xmlcomplete#CompleteTagsautocmd FileType php set omnifunc=phpcomplete#CompletePHPautocmd FileType c set omnifunc=ccomplete#Completefiletype plugin on"文件头注释生成,"映射F2快捷键,生成后跳转至第10行,然后使用o进入vim的插入模式autocmd BufNewFile *.c,*.cpp,*.sh,*.py,*.java,*.php exec ":call Setfilehead()"func Setfilehead() "如果文件类型为.c或者.cpp文件 if (&filetype == 'c' || &filetype == 'cpp') call setline(1, "/*************************************************************************") call setline(2, " @Author: Your Name") call setline(3, " @Created Time : ".strftime call setline(4, " @File Name: ".expand call setline(5, " @Description:") call setline(6, " ************************************************************************/") call setline endif "如果文件类型为.sh文件 if &filetype == 'shell' call setline(1, "#!/bin/sh") call setline(2, "# Author: Your Name") call setline(3, "# Created Time : ".strftime call setline(4, "# File Name: ".expand call setline(5, "# Description:") call setline endif "如果文件类型为.py文件 if &filetype == 'python' call setline(1, "#!/usr/bin/env python") call setline(2, "# -*- coding=utf8 -*-") call setline(3, """"") call setline(4, "# Author: Your Name") call setline(5, "# Created Time : ".strftime call setline(6, "# File Name: ".expand call setline(7, "# Description:") call setline(8, """"") call setline endif "如果文件类型为.php文件 if &filetype == 'php' call append(0, '<?php ') call append call append(2, '* @File: '.expand call append(3, '* @Author: Your Name') call append(4, '* @Description: ---') call append(5, '* @Date: '.strftime("%Y-%m-%d %H:%M:%S")) call append(6, '* @Last Modified: '.strftime("%Y-%m-%d %H:%M:%S")."n" ) call append call append call append call append call append call append call append call append(14, '/* vim: set expandtab ts=4 sw=4 sts=4 tw=100: */') call append(15, '?>') endif endfuncmap <F2> :call Setfilehead()<CR>:10<CR>o"内部注释快捷键生成,映射F11快捷键,生成后跳转至下行,该注释段可以自行修改func SetComment() call append , '//**************** comment start ********************') call append+1, '//**************** comment end ********************')endfuncmap <F11> :call SetComment()<CR>j<CR>O

本文由正版必中一肖图发布于编程应用,转载请注明出处:推荐介绍配置

上一篇:敏捷开首 下一篇:没有了
猜你喜欢
热门排行
精彩图文