加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > 安全 > 正文

缺省源和Vim配置

发布时间:2020-12-15 18:22:27 所属栏目:安全 来源:网络整理
导读:缺省源 #includebits/stdc++.h#includebits/extc++.h#define file(s) freopen(s".in","r",stdin),freopen(s".out","w",stdout)#define go(x,i) for(register int i = head[x]; i; i = nxt[i])#define For(i,a,b) for(register int i = (a),i##_end_ = (b); i

缺省源

#include<bits/stdc++.h>
#include<bits/extc++.h>

#define file(s) freopen(s".in","r",stdin),freopen(s".out","w",stdout)
#define go(x,i) for(register int i = head[x]; i; i = nxt[i])
#define For(i,a,b) for(register int i = (a),i##_end_ = (b); i <= i##_end_; ++ i)
#define FOR(i,i##_end_ = (b); i >= i##_end_; -- i)
#define debug(x) cout << #x << " = " << x << endl
#define mem(a,b) memset(a,b,sizeof(a))
#define cpy(a,b) memcpy(a,sizeof(a))
#define min(a,b) (a < b ? a : b)
#define max(a,b) (b < a ? a : b)
#define inf (0x3f3f3f3f)
#define INF (1e18)
#define pb push_back
#define mp make_pair
#define x first
#define y second

typedef unsigned long long ull;
typedef unsigned int uint;
typedef long long ll;
typedef std::pair<ll,int> PLI;
typedef std::pair<int,int> PII;
typedef long double ldb;
typedef double db;

namespace IO {
#define getc() ((S_ == T_) && (T_ = (S_ = Ch_) + fread(Ch_,1,Buffsize,S_ == T_) ? 0 : *S_ ++)
#define putc(x) *nowps ++ = (x)
    const uint Buffsize = 1 << 15,Output = 1 << 23;
    static char Ch_[Buffsize],*S_ = Ch_,*T_ = Ch_;
    static char Out[Output],*nowps = Out;
    inline void flush(){fwrite(Out,nowps - Out,stdout); nowps = Out;}
    template<class T>inline void read(T &_) {
        _ = 0; static char __; T ___ = 1;
        for(__ = getc(); !isdigit(__); __ = getc()) if(__ == '-') ___ = -1;
        for(; isdigit(__); __ = getc()) _ = (_ << 3) + (_ << 1) + (__ ^ 48);
        _ *= ___;
    }
    template<class T>inline void write(T _,char __ = 'n') {
        if(!_) putc('0');
        if(_ < 0) putc('-'),_ = -_;
        static uint sta[111],tp;
        for(tp = 0; _; _ /= 10) sta[++ tp] = _ % 10;
        for(; tp; putc(sta[tp --] ^ 48)); putc(__);
    }
    template<class T>inline bool chkmax(T &_,T __) {return _ < __ ? _ = __,1 : 0;}
    template<class T>inline bool chkmin(T &_,T __) {return _ > __ ? _ = __,1 : 0;}
}

using namespace std;
using namespace IO;

int main() {
#ifdef ylsakioi
    file("");
#endif
    return flush(),0;
}

Vimrc

set nocompatible
source $VIMRUNTIME/vimrc_example.vim
source $VIMRUNTIME/mswin.vim
behave mswin

set diffexpr=MyDiff()
function MyDiff()
  let opt = '-a --binary '
  if &diffopt =~ 'icase' | let opt = opt . '-i ' | endif
  if &diffopt =~ 'iwhite' | let opt = opt . '-b ' | endif
  let arg1 = v:fname_in
  if arg1 =~ ' ' | let arg1 = '"' . arg1 . '"' | endif
  let arg2 = v:fname_new
  if arg2 =~ ' ' | let arg2 = '"' . arg2 . '"' | endif
  let arg3 = v:fname_out
  if arg3 =~ ' ' | let arg3 = '"' . arg3 . '"' | endif
  let eq = ''
  if $VIMRUNTIME =~ ' '
    if &sh =~ '&;cmd'
      let cmd = '""' . $VIMRUNTIME . 'diff"'
      let eq = '"'
    else
      let cmd = substitute($VIMRUNTIME,' ','" ','') . 'diff"'
    endif
  else
    let cmd = $VIMRUNTIME . 'diff'
  endif
  silent execute '!' . cmd . ' ' . opt . arg1 . ' ' . arg2 . ' > ' . arg3 . eq
endfunction
syntax on
    "高亮
    set cindent
    set smartindent
    set autoindent
    "set cin
    "set si
    "set ai
    set tabstop=4
    set shiftwidth=4
    set softtabstop=4
    "set ts=4
    "set sw=4
    "set sts=4
    "缩进
    set mouse=a
    "Linux鼠标使用
    color molokai
    "colo desert
    "主题
    set number
    "set nu
    "行号
    set guifont=Consolas h15
    "Linux: set guifont=Consolas h16
    set backspace=2
    "set bs=2
    set clipboard=unnamed
    "共享剪切板
    set go=
    set nobackup
    set cursorline
    "set cursorcolumn

function! Open()
    exec "vsp %<.out"
    exec "sp %<.in"
endfunction

au GUIEnter * call libcallnr("vimtweak.dll","SetAlpha",210)   "自动透明

syntax enable  
   
   
map<F4> <Esc>:call Open() <CR>
imap<F4> <Esc>:call Open() <CR>

"map <F9> <ESC>:w<CR>:!g++ % -o %< -Wall -Wshadow -Wextra -lm <CR>
"imap <F9> <ESC>:w<CR>:!g++ % -o %< -Wall -Wshadow -Wextra -lm <CR>

"map <F10> <ESC>:!./%<<CR>
"imap <F10> <ESC>:!./%<<CR>

"map<F8> <F9> <F10>
"imap<F8> <F9> <F10>
"
map <F9> <ESC>:w<CR>:!g++ ./% -o ./%< -Dylsakioi -Wall -Wshadow -Wextra -lm -fsanitize=address -fsanitize=undefined<CR>
imap <F9> <ESC>:w<CR>:!g++ ./% -o ./%< -Dylsakioi -Wall -Wshadow -Wextra -lm -fsanitize=address -fsanitize=undefined<CR>
map <F10> <ESC>:!./%<<CR>
imap <F10> <ESC>:!./%<<CR>
map<F8> <Esc>:!g++ ./% -o ./%< -Dylsakioi -pg<CR><Esc>:!time ./%<<CR><Esc>:!gprof ./%< > res_%<.txt<CR>
imap<F8> <Esc>:!g++ ./% -o ./%< -Dylsakioi -pg<CR><Esc>:!time ./%<<CR><Esc>:!gprof ./%< > res_%<.txt<CR>

map<C-a> <ESC>ggVG
imap<C-a> <ESC>ggVG

map<F5> i#include<bits/stdc++.h><CR>#include<bits/extc++.h><CR><CR>#define file(s) freopen(s".in",stdout)<CR>#define go(x,i) for(register int i = head[x]; i; i = nxt[i])<CR>#define For(i,i##_end_ = (b); i <= i##_end_; ++ i)<CR>#define FOR(i,i##_end_ = (b); i >= i##_end_; -- i)<CR>#define debug(x) cout << #x << " = " << x << endl<CR>#define mem(a,sizeof(a))<CR>#define cpy(a,sizeof(a))<CR>#define min(a,b) (a < b ? a : b)<CR>#define max(a,b) (b < a ? a : b)<CR>#define inf (0x3f3f3f3f)<CR>#define INF (1e18)<CR>#define pb push_back<CR>#define mp make_pair<CR>#define x first<CR>#define y second<CR><CR>typedef unsigned long long ull;<CR>typedef unsigned int uint;<CR>typedef long long ll;<CR>typedef std::pair<ll,int> PLI;<CR>typedef std::pair<int,int> PII;<CR>typedef long double ldb;<CR>typedef double db;<CR><CR>namespace IO {<CR>#define getc() ((S_ == T_) && (T_ = (S_ = Ch_) + fread(Ch_,S_ == T_) ? 0 : *S_ ++)<CR>#define putc(x) *nowps ++ = (x)<CR>const uint Buffsize = 1 << 15,Output = 1 << 23;<CR>static char Ch_[Buffsize],*T_ = Ch_;<CR>static char Out[Output],*nowps = Out;<CR>inline void flush(){fwrite(Out,stdout); nowps = Out;}<CR>template<class T>inline void read(T &_) {<CR>_ = 0; static char __; T ___ = 1;<CR>for(__ = getc(); !isdigit(__); __ = getc()) if(__ == '-') ___ = -1;<CR>for(; isdigit(__); __ = getc()) _ = (_ << 3) + (_ << 1) + (__ ^ 48);<CR>_ *= ___;<CR>}<CR>template<class T>inline void write(T _,char __ = 'n') {<CR>if(!_) putc('0');<CR>if(_ < 0) putc('-'),_ = -_;<CR>static uint sta[111],tp;<CR>for(tp = 0; _; _ /= 10) sta[++ tp] = _ % 10;<CR>for(; tp; putc(sta[tp --] ^ 48)); putc(__);<CR>}<CR>template<class T>inline bool chkmax(T &_,1 : 0;}<CR>template<class T>inline bool chkmin(T &_,1 : 0;}<CR>}<CR><CR>using namespace std;<CR>using namespace IO;<CR><CR>int main() {<CR>#ifdef ylsakioi<CR>file("");<CR>#endif<CR>return flush(),0;<CR>}<Esc>

imap<F5> <Esc> <F5>

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读