gvim配置

  "======================================================================================
  "General settings
  "======================================================================================
  syntax on
  set expandtab
  set guifont=Courier\ New\ 12
  set guifontwide=STXihei:h14
  "set guifont=Bitstream\ Vera\ Sans\ Mono:h14
  "set nomacatsui
  "set termencoding=macroman
  set backspace=indent,eol,start
  set whichwrap=b,s,<,>,[,]
  colorscheme desert
  set cmdheight=1
  set laststatus=2
  set shiftwidth=4
  set tabstop=4
  set number
  set nolinebreak
  set nocompatible
  set nobackup
  set nowb
  set noswapfile
  set mouse=a
  set incsearch
  set hlsearch
  set history=400
  set hidden
  set expandtab
  set confirm
  set et
  set wrap
  set cindent
  set ambiwidth=double
  set foldlevel=999
  set helplang=cn
  set cmdheight=2
  set mouse=a
  set encoding=utf-8
  "set go=e
  set backspace=indent,eol,start
  <code>
  set ambiwidth=double
  </code><code>
  set dictionary-=/opt/local/share/vim/vim72/plugin/funclist.txt dictionary+=/opt/local/share/vim/vim72/plugin/funclist.txt
  set complete-=k complete+=k
  </code><code>
  function! InsertTabWrapper()
      let col=col('.')-1
      if !col || getline('.')[col-1] !~ '\k'
          return "\<tab>"
      else
          return "\<c-n>"
      endif
  endfunction
  </c-n></tab></code><code>
  "Remap the tab key to select action with InsertTabWrapper
  inoremap <tab> <c-r>=InsertTabWrapper()<cr>
  </cr></c-r></tab></code><code>
  map <f7> :NERDTreeToggle<cr>
  "imap <f3> <esc>:NERDTreeToggle<cr>
  </cr></esc></f3></cr></f7></code><code>
   
  if has("gui_macvim")
      let macvim_skip_cmd_opt_movement = 1
      let macvim_hig_shift_movement = 1
  </code><code>
   
  set transparency = 2
  set fileencodings=utf-8,ucs-bom,gb18030,gbk,gb2312,cp936
  "GUI界面里的字体,默认有抗锯齿
  set guifont=Monaco:h12:cANSI
  "行间距,如果默认值太小,代码会非常纠结
  set linespace=4                                                                      
  "用<>调整缩进时的长度
  set shiftwidth=4
  "制表符的长度,统一为4个空格的宽度
  set tabstop=4
  "初始窗口的宽度
  set columns=195
  "初始窗口的高度
  set lines=45
  "初始窗口的位置
  winpos 52 42
   </code><code>
  "显示行号
  set number
  "行号栏的宽度
  set numberwidth=4
  "禁止自动换行
  set nowrap
  "在输入命令时列出匹配项目,也就是截图底部的效果
  set wildmenu
  "显示光标位置
  set ruler
  "分割窗口时保持相等的宽/高
  set equalalways
  </code><code> 
  "匹配括号的规则,增加针对html的<>
  set matchpairs=(:),{:},[:],<:>
  "让退格,空格,上下箭头遇到行首行尾时自动移到下一行(包括insert模式)
  set whichwrap=b,s,<,>,[,]
  "取消自动备份
  set nobackup
  "保存关闭文件之前保留一个备份
  set writebackup
   </code><code>
  "js语法高亮脚本的设置
  let g:javascript_enable_domhtmlcss=1
  </code><code>
  "设置自定义的<leader>快捷键
  let mapleader=","
  let g:mapleader=","
  </leader></code><code>
  """"""""""""""""""""""""""""""
  " bufExplorer插件的设置
  """"""""""""""""""""""""""""""
  let g:bufExplorerSortBy='mru'
  let g:bufExplorerSplitRight=0    
  let g:bufExplorerSplitVertical=1    .
  let g:bufExplorerSplitVertSize = 30
  let g:bufExplorerUseCurrentWindow=1
  autocmd BufWinEnter \[Buf\ List\] setl nonumber
  </code><code> 
   """"""""""""""""""""""""""""""
   " winManager插件的设置
   """"""""""""""""""""""""""""""
   let g:winManagerWindowLayout = "BufExplorer,FileExplorer|TagList"
   let g:winManagerWidth = 30
   let g:defaultExplorer = 0
   nmap <silent> <leader>wm :WMToggle<cr>
  </cr></leader></silent></code><code> 
   """"""""""""""""""""""""""""""
   " netrw插件的快捷键
   """"""""""""""""""""""""""""""
   let g:netrw_winsize = 30
   nmap <silent> <leader>fe :Sexplore!<cr>
     
   
   
   
     macm File.Save          key=<d-s>
     macm File.Undo          key=<d-z>
     macm File.Copy          key=<d-c>
     macm File.Paste         key=<d-v>
     macm File.Cut           key=<d-x>
     macm File.Select\ All   key=<d-a>
   
  endif
   
  "Tab configuration
  map tn :tabnew<cr>
  map te :tabedit
  map tc :tabclose<cr>
  map tm :tabmove
  map tt :tabnext<cr>
  map tp :tabprevious<cr>
  map tl :tablast<cr>
  map tf :tabfirst<cr>
  try
     set switchbuf=usetab
     set stal=2
  catch
  endtry
 

</cr></cr></cr></cr></cr></cr></d-a></d-x>

</d-v></d-c></d-z></d-s></cr></leader>

</silent></code>

linux下,配置文件放到home根部录下,即:~/.vimrc文件。

猜你喜欢

转载自shuaigelingfei.iteye.com/blog/1857070