zoukankan      html  css  js  c++  java
  • 环境配置

    gedit配置

    wget https://files.cnblogs.com/files/youxam/config.sh && bash config.sh
    

    vim配置

    colorscheme ron
    set t_Co=256
    set mouse=a
    set ts=4
    set sw=4
    set nu
    set ru
    set ai
    set ci
    set cin
    set ls=2
    func C()
        exec "w"
        exec "!g++ % -o /tmp/%< && /tmp/%<"
    endfunc
    func P()
    	exec "w"
    	exec "!cat %"
    endfunc
    map! <F5> <ESC>:call C()<CR>
    map <F5> :call C()<CR>
    map <F6> :call P()<CR>
    map! <F6> <ESC>:call P()<CR>
    

    调试宏

    #ifdef debug
        #define DEBUG(fmt,...)         printf("33[33;1m[DEBUG]33[34m%s:%d33[0m : "#fmt"
    ",__FILE__, __LINE__,##__VA_ARGS__)
        #define WARNIF(exp,fmt,...)    if(exp)printf("33[31;1m[WARNING `"#exp"`]33[34m%s:%d33[0m : "#fmt"
    ",__FILE__, __LINE__,##__VA_ARGS__);
    #else
        #define DEBUG(fmt,...)
        #define WARNIF(exp,fmt,...)
    #endif
    

    调试宏gedit无颜色版本

    #ifdef debug
        #define DEBUG(fmt,...)         printf("[DEBUG]%s:%d : "#fmt"
    ",__FILE__, __LINE__,##__VA_ARGS__)
        #define WARNIF(exp,fmt,...)    if(exp)printf("[WARNING `"#exp"`]%s:%d : "#fmt"
    ",__FILE__, __LINE__,##__VA_ARGS__);
    #else
        #define DEBUG(fmt,...)
        #define WARNIF(exp,fmt,...)
    #endif
    

    gedit编译

    #!/bin/sh
    #gedit编译
    fullname=$GEDIT_CURRENT_DOCUMENT_NAME
    dir=$GEDIT_CURRENT_DOCUMENT_DIR
    name=`echo $fullname | cut -d. -f1`
    cat | awk 'BEGIN{a=0} /*//{a=1} a==0{print $0}' | grep -v "/*" | cat > IN
    g++ $fullname -Ddebug -o $name && time $dir/$name < IN
    
  • 相关阅读:
    hdu 1325 判断有向图是否为树
    poj 1182
    Ubuntu 系统 文件操作命令
    vim 快捷键大全
    Git 上传本地命令
    git错误:fatal: Not a git repository (or any of the parent directories): .git
    Git 如何回到过去,然后 再 回到将来
    Git 提供篇
    Linux 的cp命令
    Linux :: vi E212: Can't open file for writing
  • 原文地址:https://www.cnblogs.com/youxam/p/debug.html
Copyright © 2011-2022 走看看