以下是Linux下vim常用的配置文件,可以直接拷貝使用桶蛔,支持插件管理
"""""""""""""""""""""""""""""""""""""""""""插件管理"""""""""""""""""""""""""""""""""""""""""""""
call plug#begin()
Plug 'itchyny/lightline.vim'
Plug 'preservim/NERDTree'
Plug 'lfv89/vim-interestingwords'
Plug 'morhetz/gruvbox'
Plug 'ayu-theme/ayu-vim'
Plug 'drewtempelmeyer/palenight.vim'
Plug 'joshdick/onedark.vim'
Plug 'vim-airline/vim-airline'
Plug 'vim-airline/vim-airline-themes'
Plug 'Yggdroot/indentLine'
Plug 'godlygeek/tabular'
Plug 'hrp/EnhancedCommentify'
Plug 'luochen1990/rainbow'
call plug#end()
"""""""""""""""""""""""""""""""""""""""""""插件設置"""""""""""""""""""""""""""""""""""""""""""""
let g:EnhCommentifyRespectIndent = 'Yes'
let g:EnhCommentifyPretty = 'Yes'
let g:rainbow_active = 1
"""""""""""""""""""""""""""""""""""""""""""基本設置"""""""""""""""""""""""""""""""""""""""""""""
filetype on "開啟文件類型偵測
filetype indent on "適應不同語言的縮進
syntax enable "開啟語法高亮功能
syntax on "允許使用用戶配色
"""""""""""""""""""""""""""""""""""""""""""顯示設置"""""""""""""""""""""""""""""""""""""""""""""
set laststatus=2 "總是顯示狀態(tài)欄
set ruler "顯示光標位置
set number "顯示行號
set cursorline "高亮顯示當前行
"set cursorcolumn "高亮顯示當前列
set hlsearch " 高亮搜索結果
exec "nohlsearch"
set incsearch "邊輸邊高亮
set ignorecase "搜索時忽略大小寫
set smartcase
"set relativenumber "其他行顯示相對行號
"set scrolloff=5 "垂直滾動時光標距底部位置
"""""""""""""""""""""""""""""""""""""""""""編碼設置"""""""""""""""""""""""""""""""""""""""""""""
set fileencodings=utf-8,gb2312,gbk,gb18030,cp936 " 檢測文件編碼,將fileencoding設置為最終編碼
set fileencoding=utf-8 " 保存時的文件編碼
set termencoding=utf-8 " 終端的輸出字符編碼
set encoding=utf-8 " VIM打開文件使用的內部編碼
"""""""""""""""""""""""""""""""""""""""""""編輯設置"""""""""""""""""""""""""""""""""""""""""""""
"set expandtab "擴展制表符為空格
"set tabstop=4 "制表符占空格數(shù)
"set softtabstop=4 "將連續(xù)數(shù)量的空格視為一個制表符
"set shiftwidth=4 "自動縮進所使用的空格數(shù)
"set textwidth=79 "編輯器每行字符數(shù)
"set wrap "設置自動折行
"set linebreak "防止單詞內部折行
"set wrapmargin=5 "指定折行處與右邊緣空格數(shù)
"set autoindent "打開自動縮進
set wildmenu "vim命令自動補全