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

    PS:F7编译  F9运行  F8调用GDB  F12形成初始文件头(C++)(都在NORMAL模式下)

    Ctrl+A 全选加复制(NORMAL模式下)

    Ctrl+Z 自动缩进(NORMAL模式下)

    编译选项加了 -std=c++11 -O2

    set nocompatible
    source $VIMRUNTIME/vimrc_example.vim
    source $VIMRUNTIME/mswin.vim
    behave mswin
    
    set diffexpr=MyDiff()
    function MyDiff()
      let opt = '-a --binary '
      if &diffopt =~ 'icase' | let opt = opt . '-i ' | endif
      if &diffopt =~ 'iwhite' | let opt = opt . '-b ' | endif
      let arg1 = v:fname_in
      if arg1 =~ ' ' | let arg1 = '"' . arg1 . '"' | endif
      let arg2 = v:fname_new
      if arg2 =~ ' ' | let arg2 = '"' . arg2 . '"' | endif
      let arg3 = v:fname_out
      if arg3 =~ ' ' | let arg3 = '"' . arg3 . '"' | endif
      let eq = ''
      if $VIMRUNTIME =~ ' '
        if &sh =~ '<cmd'
          let cmd = '""' . $VIMRUNTIME . 'diff"'
          let eq = '"'
        else
          let cmd = substitute($VIMRUNTIME, ' ', '" ', '') . 'diff"'
        endif
      else
        let cmd = $VIMRUNTIME . 'diff'
      endif
      silent execute '!' . cmd . ' ' . opt . arg1 . ' ' . arg2 . ' > ' . arg3 . eq
    endfunction
    
    syntax on
    set nu
    
    set nobackup
    set noswapfile
    set cindent
    set mouse=a
    set tabstop=8
    set shiftwidth=8
    set background=dark
    colorscheme evening
    
    set guifont=courier_new:h10
    
    map <C-A> ggVG"+y
    map <C-Z> gg=G
    
    map <F7> :call Cmp()<CR>
    func! Cmp()
    exec "w"
    exec "!g++ -O2 -std=c++11 % -o %<"
    endfunc
    
    map <F8> :call Rungdb()<CR>
    func! Rungdb()
        exec "w"
        exec "!g++ -Wall -O2 -std=c++11 % -g -o %<"
        exec "!gdb ./%<"
    endfunc
    
    map <F9> :call Run()<CR>
    func! Run()
    exec "!%<"
    endfunc
    
    map <F12> :call SetTitle()<CR>
    func SetTitle()
    let l = 0
    let l = l + 1 | call setline(l,'#include <bits/stdc++.h>')
    let l = l + 1 | call setline(l,'')
    let l = l + 1 | call setline(l,'using namespace std;')
    let l = l + 1 | call setline(l,'')
    let l = l + 1 | call setline(l,'#define rep(i, a, b)	for (int i(a); i <= (b); ++i)')
    let l = l + 1 | call setline(l,'')
    let l = l + 1 | call setline(l,'int main(){')
    let l = l + 1 | call setline(l,'')
    let l = l + 1 | call setline(l,'')
    let l = l + 1 | call setline(l,'')
    let l = l + 1 | call setline(l,'	return 0;')
    let l = l + 1 | call setline(l,'}')
    let l = l + 1 | call setline(l,'')
    let l = l + 1 | call setline(l,'')
    endfunc
  • 相关阅读:
    Bootstrap(项目2)
    Bootstrap(项目1)
    Bootstrap(Carousel幻灯片)轮播图
    Bootstrap(滚动监听)
    Bootstrap基础10(标签页)
    Bootstrap基础9(工具提示框、警告框、弹出框)
    Bootstrap基础8(模态框(弹窗))
    Bootstrap基础7(标签、徽章、大屏展播、页面标题、缩略图、进度条、面板、折叠效果)
    Bootstrap基础6(路径导航)
    2018~2019学年下学期《计算机图像处理》
  • 原文地址:https://www.cnblogs.com/cxhscst2/p/6675412.html
Copyright © 2011-2022 走看看