关于 ubuntu-linux for noi 与 vscode 配置

· · 个人记录

https://www.luogu.com.cn/blog/ILoveHaskell/Linux-Shell

ubuntu-linux for noi

不要更新

  1. 下载未知软件之前先要看是否会导致更新

内存

  1. 清空缓存:sync 然后 sudo echo 3 > sudo /proc/sys/vm/drop_caches

  2. 清空swap:sudo swapoff -a sudo swapon-a

  3. 看:free -m

文件

  1. 比较:diff -B -Z -w -c A B

  2. 新建:touch A

vscode

cpp.json:

{
    "#include": {
        "prefix": "#include",
        "body": [
            "#include<cstdio>",
            "#include<algorithm>",
            "#include<cstring>",
            "#include<cassert>",
            "const int Q=100005;",
            "const int INF=(1<<30);",
            "typedef long long ll;",
            "#define rg register int",
            "#define cint const int",
            "const int SZ=1<<21;",
            "char ibuf[SZ|5],*IP1=ibuf,*IP2=ibuf;",
            "#define gc() (__builtin_expect(IP1==IP2,0)&&(IP2=(IP1=ibuf)+fread(ibuf,1,SZ,stdin),__builtin_expect(IP1==IP2,0))?EOF:*IP1++)",
            "char obuf[SZ|5],*OP1=obuf;const char*OP2=obuf+SZ;",
            "inline void pc(const char c){*OP1++=c;__builtin_expect(OP1==OP2,0)&&(fwrite(obuf,1,SZ,stdout),OP1=obuf);}",
            "inline bool ig(const char c){return c>=48&&c<=57;}",
            "inline void read(rg&oi){char c;rg f=1,res=0;while(c=gc(),(!ig(c))&&c^'-');c^'-'?res=(c^48):f=-1;while(c=gc(),ig(c))res=res*10+(c^48);oi=f*res;}",
            "inline void print(rg oi){char io[23];rg l=0;if(oi<0)pc('-'),oi=~oi+1;do io[++l]=(oi%10+48);while(oi/=10);for(;l;--l)pc(io[l]);}",
            "inline void write(cint oi,const char c){print(oi);pc(c);}",
            "namespace Solve{inline void main();}signed main(){Solve::main();fwrite(obuf,1,OP1-obuf,stdout);return 0;}",
            "namespace Solve{char _ST_;",
            "$0",
            "char _ED_;inline void main(){",
            "   fprintf(stderr,\"static memory:%.6lf MB\\n\",(&_ST_-&_ED_)/1024./1024.);",
            "}}",
        ],
    },
}

keybindings.json

// 将键绑定放在此文件中以覆盖默认值auto[]
[
    {
        "key": "ctrl+q",
        "command": "editor.action.peekDefinition",
        "when": "editorHasDefinitionProvider && editorTextFocus && !inReferenceSearchEditor && !isInEmbeddedEditor"
    },
    {
        "key": "ctrl+shift+f10",
        "command": "-editor.action.peekDefinition",
        "when": "editorHasDefinitionProvider && editorTextFocus && !inReferenceSearchEditor && !isInEmbeddedEditor"
    },
    {
        "key": "ctrl+shift+up",
        "command": "editor.action.moveLinesUpAction",
        "when": "editorTextFocus && !editorReadonly"
    },
    {
        "key": "alt+up",
        "command": "-editor.action.moveLinesUpAction",
        "when": "editorTextFocus && !editorReadonly"
    },
    {
        "key": "ctrl+shift+down",
        "command": "editor.action.moveLinesDownAction",
        "when": "editorTextFocus && !editorReadonly"
    },
    {
        "key": "alt+down",
        "command": "-editor.action.moveLinesDownAction",
        "when": "editorTextFocus && !editorReadonly"
    },
    {
        "key": "ctrl+d",
        "command": "editor.action.deleteLines",
        "when": "textInputFocus && !editorReadonly"
    },
    {
        "key": "ctrl+shift+k",
        "command": "-editor.action.deleteLines",
        "when": "textInputFocus && !editorReadonly"
    }
]

插件:

basic:

ms-vscode.cpptools

MS-CEINTL.vscode-language-pack-zh-han

James-Yu.latex-workshop

yzhang.markdown-all-in-one

zhuangtongfa.material-theme

extra:

danielpinto8zz6.c-cpp-compile-run

ms-vscode.cpptools-extension-pack

yzane.markdown-pdf

shd101wyy.markdown-preview-enhanced

tomoki1207.pdf,

settings.json

{
    "workbench.colorTheme": "One Dark Pro Mix",
    "editor.accessibilitySupport": "off"
}