我的VIM的配置檔案

2021-05-05 20:37:05 字數 1966 閱讀 1762

[root@leo-desktop:~/]# cat .vimrc

"說明:將此檔案重新命名為.vimrc並拷貝到~/下

"         將plugin下的檔案安裝/拷貝到/usr/share/vim/vim71/plugin/下

set nu                       "設定行號

set autoindent          "設定自動縮排

set cindent                "設定c語言型別的自動縮排

set shiftwidth=4       "設定c語言自動縮排為4個空格

set expandtab          "將tab鍵轉換為空格鍵

set tabstop=4           "是指tab的長度為4個空格

set softtabstop=4     "使得按退格鍵可以一次刪除掉4個空格,不足4個刪除剩下的空格

set incsearch            "輸入搜尋內容就顯示搜尋的內容

set hlsearch             "搜尋時高亮顯示被找到的文字

set nocompatible        "設定與vi不相容的模式,即執行在增強模式下

set mouse=a             "設定滑鼠在任何時候都能使用

set showcmd                "設定狀態列始終顯示當前執行的命令

set wrap                "長行顯示自動折行

set ruler                "開啟狀態列標尺

set scrolloff=3            "設定游標離上下邊界3行時視窗自動滾動

set history=50            "設定冒號命令和搜尋命令的命令列表歷史長度為50

"set cursorline          "高亮當前行

syntax on                "設定高亮顯示

colorscheme evening     "設定背景為夜間模式

"自動不全ctrl+p時的一些選項:多於一行時顯示選單,最長選擇,顯示當前選擇的額外資訊

set completeopt=menu,longest,preview

"autocmd bufenter * call dowordcomplete() "自動完成功能,按tab鍵確認,開這個功能速度太慢

"設定ctags和taglist

let tlist_show_one_file=1

let tlist_exit_onlywindow=1

"設定檔案管理器和視窗管理器

let g:winmanagerwindowlayout='fileexplorer|taglist'

nmap wm :wmtoggle

"開啟檔案型別檢查

filetype plugin indent on

"**摺疊:za開啟/關閉當前摺疊;zm關閉所有摺疊;zr開啟所有摺疊

set foldmethod=syntax

"完成配對

inoremap ( ()i

inoremap i

inoremap [ i

inoremap < <>i

inoremap ' ''i

inoremap " ""i

inoremap )

inoremap }

inoremap ]

inoremap >

"inoremap '

"inoremap "

"按f8執行儲存並且開始編譯當前的c程式,然後在執行它

map :call compileandruncprogram()

func! compileandruncprogram()

exec "w"

exec "!gcc -wall % -o %<"

exec "!./%<"

endfunc

vim 配置檔案

set encoding utf 8 set fileencoding utf 8 syntax highlight syntax enable syntax on colorscheme colorscheme desert here to set line number set nu here ...

vim配置檔案

vundle 配置 set nocompatible filetype off set rtp vim bundle vundle.vim call vundle begin plugin vundlevim vundle.vim vim 外掛程式管理 plugin spf13 vim colors...

vim配置檔案

乙個簡單的vim配置檔案,留下備用,修改配置檔案永久生效,vim vimrc set nocompatible 關閉 vi 相容模式 syntax on 自動語法高亮 set number 顯示行號 set cursorline 突出顯示當前行 set ruler 開啟狀態列標尺 set shift...