VIM配置
2016-07-04 17:30
281 查看
autocmd BufNewFile *.c,*.cc,*.cpp,*.py,*.sh,*.java exec ":call SetTitle()" func SetInfo() call setline(2, " File Name : ".expand("%")) call setline(3, " Created on : ".strftime("%m-%d-%Y")) call setline(4, " Author : spxcds") endfunc func SetTitle() if &filetype == 'cpp' || &filetype == 'c' || &filetype == 'java' call setline(1, "/******************************") call SetInfo() call setline(5, "*******************************/") call setline(6, "") endif if &filetype == 'python' call setline(1, "\"\"\"") call SetInfo() call setline(5, "\"\"\"") call setline(6, "\#coding=utf8") call setline(7,"") endif endfunc filetype plugin indent on colo evening set nu set hlsearch set expandtab set syntax=on set tabstop=4 set shiftwidth=4 set smarttab set smartindent set showmatch set matchtime=0 set report=0 :inoremap ( ()<ESC>i :inoremap ) <c-r>=ClosePair(')')<CR> :inoremap { {}<ESC>i :inoremap {<CR> {<CR>}<ESC>O :inoremap } <c-r>=ClosePair('}')<CR> :inoremap [ []<ESC>i :inoremap ] <c-r>=ClosePair(']')<CR> function ClosePair(char) if getline('.')[col('.') - 1] == a:char return "\<Right>" else return a:char endif endfunction
相关文章推荐
- 排序算法(4)——冒泡排序
- centos下采用rpm方式安装mysql
- 剑指offer----重建二叉树---java实现
- Web 前端本地化(一)
- jquery 中prop()函数
- java反射
- IOS自动化测试之UIAutomation学习
- myist_1009 So Easy[Ⅰ]
- 消除游戏的理解(3)
- Mac下zookeeper启动失败/zookeeper_server.pid:Permission denied
- [置顶] 微信抢红包的算法实现(C++)
- java线程同步锁
- Andorid——Activity总结
- 通信组件之Intent的基本使用
- jedis针对三种redis工作模式、哨兵模式的源码阅读分析
- 大神的游戏(codevs 1353)
- 可以使用QT给龙芯开发软件
- 部分字符串替换为*
- 源码分析 -- ActivityThread
- 用C++实现简易的文本编辑器