vim的配置文件

記錄一下。

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
  if $VIMRUNTIME =~ ' '
    if &sh =~ '\<cmd'
      if empty(&shellxquote)
        let l:shxq_sav = ''
        set shellxquote&
      endif
      let cmd = '"' . $VIMRUNTIME . '\diff"'
    else
      let cmd = substitute($VIMRUNTIME, ' ', '" ', '') . '\diff"'
    endif
  else
    let cmd = $VIMRUNTIME . '\diff'
  endif
  silent execute '!' . cmd . ' ' . opt . arg1 . ' ' . arg2 . ' > ' . arg3
  if exists('l:shxq_sav')
    let &shellxquote=l:shxq_sav
  endif
endfunction

"----------------------------- 配置,雙引號(hào)后面為注釋掉的內(nèi)容 ---------------------------------
"顯示中文不亂碼
let &termencoding=&encoding
set fileencodings=utf-8,gbk,ucs-bom,cp936,chinese,ucs-bom

"永久顯示行號(hào)
set nu!

"colorscheme evening    "配色方案

set tabstop=4       "設(shè)置tab的跳數(shù)
set autoread        "設(shè)置當(dāng)文件在外部被修改,自動(dòng)更新該文件
set mouse=a         "設(shè)置在任何模式下鼠標(biāo)都可用
set nobackup        "設(shè)置不生成備份文件

"設(shè)置不生成 .un 文件
set noundofile
set nobackup
set noswapfile

"===========================
"查找/替換相關(guān)的設(shè)置
"===========================
set hlsearch "高亮顯示查找結(jié)果
set incsearch "增量查找
 
"===========================
"狀態(tài)欄的設(shè)置
"===========================
set statusline=[%F]%y%r%m%*%=[Line:%l/%L,Column:%c][%p%%] "顯示文件名:總行數(shù),總的字符數(shù)
set ruler "在編輯過程中,在右下角顯示光標(biāo)位置的狀態(tài)行
"
"===========================
"代碼設(shè)置
"===========================
syntax enable "打開語(yǔ)法高亮
syntax on "打開語(yǔ)法高亮
set showmatch "設(shè)置匹配模式,相當(dāng)于括號(hào)匹配
set smartindent "智能對(duì)齊
"set shiftwidth=4 "換行時(shí),交錯(cuò)使用4個(gè)空格
set autoindent "設(shè)置自動(dòng)對(duì)齊
set ai! "設(shè)置自動(dòng)縮進(jìn)
"set cursorcolumn "啟用光標(biāo)列
set cursorline  "啟用光標(biāo)行
set guicursor+=a:blinkon0 "設(shè)置光標(biāo)不閃爍
set fdm=indent  "代碼縮進(jìn)折疊 

"===========================
"多文件編輯
"===========================
"let g:miniBufExplMapCTabSwitchBufs=1
"let g:miniBufExplMapWindowsNavVim=1
"let g:miniBufExplMapWindowNavArrows=1
最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請(qǐng)結(jié)合常識(shí)與多方信息審慎甄別。
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡(jiǎn)書系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容