Ubantu 20.04 配置

Powered by:NEFU AB_IN

Vim

set guifont=VeraMono:h10:cANSI
set nu
set tabstop=4
set softtabstop=4
set shiftwidth=4

set autoindent
set smartindent

inoremap ' ''<ESC>i
inoremap " ""i
inoremap ( ()i
inoremap [ []i
inoremap { {}O

" 当新建 .cpp文件时自动调用SetComment 函数
autocmd BufNewFile *.cpp exec ":call SetComment()"
" 加入注释
func SetComment()
    call setline(1,"/*================================================================")
    call append(line("."),   "*   Copyright (C) ".strftime("%Y")." Sangfor Ltd. All rights reserved.")
    call append(line(".")+1, "*   ")
    call append(line(".")+2, "*   文件名称:".expand("%:t"))
    call append(line(".")+3, "*   创 建 者:NEFU AB_IN")
    call append(line(".")+4, "*   创建日期:".strftime("%Y年%m月%d日"))
    call append(line(".")+5, "*   描    述:https://blog.csdn.net/qq_45859188")
    call append(line(".")+6, "*")
    call append(line(".")+7, "================================================================*/")
    call append(line(".")+8, "")
    call append(line(".")+9,  "include <bits/stdc++.h>")
    call append(line(".")+10, "using namespace std;")
    call append(line(".")+11, "#define LL                    long long")
    call append(line(".")+12, "#define ULL                   unsigned long long")
    call append(line(".")+13, "#define SZ(X)                 ((int)(X).size())")
    call append(line(".")+14, "#define IOS                   ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);")
    call append(line(".")+15, "typedef pair<int , int>       PII;")
    call append(line(".")+16, "")
    call append(line(".")+17, "int main(){
     ")
    call append(line(".")+18, "  IOS;")
    call append(line(".")+19, "   ")
    call append(line(".")+20, "  return 0;")
    call append(line(".")+21, "}")
endfunc
" 加入shell,Makefile注释
func SetComment_sh()
    call setline(3, "#================================================================")
    call setline(4, "#   Copyright (C) ".strftime("%Y")." Sangfor Ltd. All rights reserved.")
    call setline(5, "#   ")
    call setline(6, "#   文件名称:".expand("%:t"))
    call setline(7, "#   创 建 者:NEFU AB_IN")
    call setline(8, "#   创建日期:".strftime("%Y年%m月%d日"))
    call setline(9, "#   描    述:https://blog.csdn.net/qq_45859188")
    call setline(10, "#")
    call setline(11, "#================================================================")
    call setline(12, "")
    call setline(13, "")
    call setline(14, "")
    call setline(15, "#include ")
    call setline(16, "using namespace std;")
    call setline(17, "#define LL                    long long")
    call setline(18, "#define ULL                   unsigned long long")
    call setline(19, "#define SZ(X)                 ((int)(X).size())")
    call setline(20, "#define IOS                   ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);")
    call setline(21, "typedef pair       PII;")
    call setline(22, "")
    call setline(23, "int main()")
    call setline(24, "{")
    call setline(25, "  IOS;")
    call setline(25, "  ")
    call setline(25, "  return 0;")
    call setline(25, "}")
endfunc

Cpp自动运行脚本

#!/bin/bash
cppname=$1              
outname=${cppname%.*}                                                                             
outname=$outname".out"                                                             
g++ $cppname -o $outname  
./$outname

之后

vim ~/.bashrc

在里面实现一个alias即可

Ubantu 20.04阿里云源

deb http://mirrors.aliyun.com/ubuntu/ focal main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ focal main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ focal-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ focal-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ focal-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ focal-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ focal-proposed main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ focal-proposed main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ focal-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ focal-backports main restricted universe multiverse

你可能感兴趣的:(linux)