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

ubuntu下vim配置(刷题和比赛两套)

时间:2014-10-31 22:13:51      阅读:274      评论:0      收藏:0      [点我收藏+]

标签:style   blog   io   os   ar   使用   sp   on   2014   

1. 平时刷题练习使用

"mswin.vim 插件提供windows下的编辑快捷键功能
source $VIMRUNTIME/mswin.vim
behave mswin

set nu
set history=1000000
set tabstop=4 
set shiftwidth=4
set smarttab
set cindent
set nobackup
set noswapfile
set mouse=a
colo torte

"设置字体
set guifont=DejaVuSans\Mono\ 12

"F6编译运行
map <F6> :call CR()<CR>
func! CR()
	exec "w"
	exec "! g++ % -o %<"
	exec "! ./%<"
endfunc

imap <c-]> {<cr>}<c-o>O<left><right>
"F2插入必要代码
map <F2> :call SetTitle()<CR>
func SetTitle()
let l = 0
let l = l + 1 | call setline(l, '/*')
let l = l + 1 | call setline(l, ' * Author: yew1eb')
let l = l + 1 | call setline(l, ' * Created Time:  '.strftime('%c'))
let l = l + 1 | call setline(l, ' * File Name: '.expand('%'))
let l = l + 1 | call setline(l, ' */')
let l = l + 1 | call setline(l, '#include <ctime>')
let l = l + 1 | call setline(l, '#include <cmath>')
let l = l + 1 | call setline(l, '#include <cstdio>')
let l = l + 1 | call setline(l, '#include <cstdlib>')
let l = l + 1 | call setline(l, '#include <cstring>')
let l = l + 1 | call setline(l, '#include <algorithm>')
let l = l + 1 | call setline(l, '#include <iostream>')
let l = l + 1 | call setline(l, '#include <string>')
let l = l + 1 | call setline(l, '#include <vector>')
let l = l + 1 | call setline(l, '#include <stack>')
let l = l + 1 | call setline(l, '#include <queue>')
let l = l + 1 | call setline(l, '#include <set>')
let l = l + 1 | call setline(l, '#include <map>')
let l = l + 1 | call setline(l, 'using namespace std;')
let l = l + 1 | call setline(l, 'typedef long long ll;')
let l = l + 1 | call setline(l, 'const int inf = 0x7fffffff;')
let l = l + 1 | call setline(l, 'const ll  INF = 1e18;')
let l = l + 1 | call setline(l, 'const double eps = 1e-8;')
let l = l + 1 | call setline(l, 'const double pi = acos(-1.0);')
let l = l + 1 | call setline(l, '')
let l = l + 1 | call setline(l, 'int main() {')
let l = l + 1 | call setline(l, '    return 0;')
let l = l + 1 | call setline(l, '}')
let l = l + 1 | call setline(l, '')
endfunc


2. 比赛现场使用

syntax on
set nu ts=4 sw=4 mouse=a cin
colo evening




ubuntu下vim配置(刷题和比赛两套)

标签:style   blog   io   os   ar   使用   sp   on   2014   

原文地址:http://blog.csdn.net/yew1eb/article/details/40661027

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