vimrc备份


" vimrc by digiter@126.com

" General
set encoding=utf-8 " text encoding
set nocompatible " not compatible vith vi
set autoread " auto load file modified outside
filetype plugin indent on " indent configure depend on filetype
syntax on " highlight syntax
color desert

" search and match
set incsearch " increasing search

" text formatting
set nowrap " no wrap lines
set number " show line numbers
set shiftwidth=4 " tab width
autocmd FileType c,cpp set noexpandtab " when filetype = c or cpp

" Compile and Run
map <C-F9> :call Compile()<CR>
function Compile()
execute "silent! w"
execute "!g++ % -o \%<"
endfunc
map <C-F10> :call Run()<CR>
function Run()
execute "!./%<"
endfunc

" Default code
map <F3> :call Header()<CR>
function Header()
let head = [
\ '/*',
\ ' * Author: rush',
\ ' * Creation Time: '.strftime('%Y-%m-%d %T'),
\ ' * File Name: '.expand('%'),
\ ' */',
\ '#include <cstdio>',
\ '#include <cstring>',
\ '#include <cmath>',
\ '#include <cstdlib>',
\ '#include <iostream>',
\ '#include <algorithm>',
\ '#include <vector>',
\ '#include <map>',
\ '#include <set>',
\ '#include <string>',
\ '#define OUT(x) cout << #x << ": " << (x) << endl',
\ '#define SZ(x) ((int)x.size())',
\ '#define FOR(i, n) for (int i = 0; i < (n); ++i)',
\ 'using namespace std;',
\ 'typedef long long LL;',
\ '',
\ 'int main() {',
\ ' return 0;',
\ '}']
call append(0, head)
endfunc


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值