入坑 vim 后更改了不少配置
前置配置
右键——设置:
-
壁纸
-
中文输入法
-
中文快捷键
bash:
- 添加到收藏夹
mkdir .trash.vimrc
set nu
set si
set sw=4
set sts=4
set ts=4
set so=10
set mouse=a
map <F5> :!clear<CR><CR>
map <F6> :w<CR>:!g++ -std=c++17 -DDEBUG -fsanitize=undefined,address -fno-sanitize-recover=undefined,address -Wall -Wextra % -o %:r && cat data && echo '----------start----------' && ./%:r < data<CR>.bashrc
cvim(){
str="$1"
if [ ${str:0-4} = ".cpp" ] && [ ! -f "$1" ];then
cp ~/.main.cpp ./$1
fi
vim $1
}
rm(){
mv $@ ~/.trash
}
alias vim='cvim'
alias cl='clear'
cd code.main.cpp
#include<bits/stdc++.h>
#define rep(i,j,k,...) for(int i=j,##__VA_ARGS__;i<=int(k);i++)
#define rev(i,j,k,...) for(int i=j,##__VA_ARGS__;i>=int(k);i--)
#define x first
#define y second
#define exec(...) [&](){__VA_ARGS__}()
#define endl '\n'
#define os ostream
#define pb push_back
#define view(x) begin(x),end(x)
#define lambda [&]
using namespace std;
using ll=long long;
template<typename T>void ckmin(T& x,T y){x=min(x,y);}
template<typename T>void ckmax(T& x,T y){x=max(x,y);}
#ifdef DEBUG
template<typename T1,typename T2>os& operator<<(os&,pair<T1,T2>);
template<typename T,typename=decltype(T().begin()),typename=enable_if_t<!is_same_v<decay_t<T>,string>>>os& operator<<(os& out,T x){auto n=0u;out<<"{";for(auto i:x) out<<i<<(++n==x.size()?"":",");return out<<"}";}
template<typename ...T>os& operator<<(os& out,tuple<T...> x){return apply(lambda(T... x){auto n=0u;out<<"{";((out<<x<<(++n==sizeof...(T)?"":",")),...);},x),out<<"}";}
template<typename T1,typename T2>os& operator<<(os& out,pair<T1,T2> x){return out<<tuple(x);}
#define debug(...) cerr<<"#"<<__LINE__<<": "<<#__VA_ARGS__<<" = "<<std::make_tuple(__VA_ARGS__)<<endl
#else
#define debug(...) (void)0
#endif
signed main(){
cin.tie(0)->sync_with_stdio(0);
}顺便测试 debug 宏
要求在 15min 内完成