zoukankan      html  css  js  c++  java
  • VIM配置

    用这个配置需要下载 molokai主题vimtweak.dll(半透明设置)

    这个配置实现的功能:

    1. 高亮

    2. 括号匹配

    3. F9编译运行

    4. 半透明

    5. 显示行号

    抄自队友..click here

    
    "--- Encoding ---"
    set encoding=utf-8
    set termencoding=utf-8
    set fileencoding=utf-8
    source $VIMRUNTIME/delmenu.vim
    source $VIMRUNTIME/menu.vim
    language messages zh_CN.utf-8
    
    "--- Tab ---"
    set noexpandtab " 不将 tab 转换成空格
    autocmd FileType python set expendtab " python 则 tab 转空格
    set tabstop=4 " tab 宽度为 4 个空格
    set softtabstop=4
    set shiftwidth=4
    set smartindent " 智能缩进
    set cindent " C/C++ 风格缩进
    
    "--- Theme ---"
    syntax enable
    syntax on
    set number " 显示行号
    set ruler " 显示位置
    set guifont=Consolas:h13:cANSI " 英文字体
    set guifontwide=YouYuan:h13 " 中文字体
    filetype plugin indent on " 自动探测文件类型
    if has ("gui_running")
        colorscheme molokai " gVim 用 molokai 主题
        set cursorline " 高亮当前行
    else
        colorscheme desert " vim 用 desert 主题
    endif
    
    "--- Setting ---"
    set autoread " 文件在别的地方被改,则自动重新加载
    set nobackup " 不产生备份文件
    set hlsearch " 高亮匹配的字符串
    
    "--- Mapping ---"
    noremap <F9> :call Compile_Kazusa()<CR>
    inoremap <F9> <ESC>:call Compile_Kazusa()<CR>
    vnoremap <C-c> "+y 
    vnoremap <C-x> "+x
    
    "--- Compiling Function ---"
    func! Compile_Kazusa()
        exec "w"
        if &filetype == 'c'
            exec "! gcc % -o %<"
            exec "! %<"
        elseif &filetype == 'cpp'
            exec "! g++ % -o %<"
            exec "! %<"
        elseif &filetype == 'java'
            exec "! javac %"
            exec "! java %<"
        elseif &filetype == 'python'
            exec "! python %"
        endif
    endfunc
    
    inoremap ( ()<ESC>i
    inoremap [ []<ESC>i
    inoremap { {}<ESC>i
    
    
    autocmd Syntax html,vim inoremap < <lt>><Esc>i| inoremap > <c-r>=ClosePair('>')<CR>
    inoremap ) <c-r>=ClosePair(')')<CR>
    inoremap ] <c-r>=ClosePair(']')<CR>
    inoremap } <c-r>=CloseBracket()<CR>
    inoremap " <c-r>=QuoteDelim('"')<CR>
    inoremap ' <c-r>=QuoteDelim("'")<CR>
    
    function ClosePair(char)
     if getline('.')[col('.') - 1] == a:char
     return "<Right>"
     else
     return a:char
     endif
    endf
    
    
    
    function CloseBracket()
     if match(getline(line('.') + 1), 's*}') < 0
     return "<CR>}"
     else
     return "<Esc>j0f}a"
     endif
    endf
    
    
    
    function QuoteDelim(char)
     let line = getline('.')
     let col = col('.')
     if line[col - 2] == "\"
     return a:char
     elseif line[col - 1] == a:char
     return "<Right>"
     else
     return a:char.a:char."<Esc>i"
     endif
    endf
    
    
    "自动透明 "
    au GUIEnter * call libcallnr("vimtweak.dll", "SetAlpha", 234) 
    
    
  • 相关阅读:
    jmeter(46) redis
    jmeter(45) tcp/ip协议
    Codeforces Round #538 (Div. 2)D(区间DP,思维)
    Codeforces Global Round 1D(DP,思维)
    Educational Codeforces Round 57D(DP,思维)
    UPC11073(DP,思维)
    Yahoo Progamming Contest 2019D(DP,思维)
    Atcoder Beginner Contest 118D(DP,完全背包,贪心)
    Xuzhou Winter Camp 1C(模拟)
    Educational Codeforces Round 57 (Rated for Div. 2)D(动态规划)
  • 原文地址:https://www.cnblogs.com/fightfordream/p/7078985.html
Copyright © 2011-2022 走看看