無(wú)插件版
不使用code渲染
" no Plug
"--------- 鍵映射 ------------------------------
let mapleader=";"
nmap <leader>w :w<CR>
nmap <leader>q :q<CR>
"--------- 縮進(jìn)指示線 indentLine 配置 ----------
let g:indentLine_char='┆'
let g:indentLine_enabled = 1
"set runtimepath+=~/.vim
set nocompatible
"顯示行號(hào)"
set number
"" 隱藏滾動(dòng)條"
set guioptions-=r
set guioptions-=L
set guioptions-=b
"隱藏頂部標(biāo)簽欄"
"set showtabline=0
""設(shè)置字體"
set guifont=Monaco:h13
syntax on "開(kāi)啟語(yǔ)法高亮"
let g:solarized_termcolors=256 "solarized主題設(shè)置在終端下的設(shè)置"
set background=dark "設(shè)置背景色"
"colorscheme solarized
"set nowrap "設(shè)置不折行(折行:長(zhǎng)的一行用多行顯示)"
set fileformat=unix "設(shè)置以u(píng)nix的格式保存文件"
set cindent "設(shè)置C樣式的縮進(jìn)格式"
set tabstop=4 "設(shè)置table長(zhǎng)度"
set softtabstop=4 "按backspace回退的縮進(jìn)長(zhǎng)度"
set shiftwidth=4 "同上"
set showmatch "顯示匹配的括號(hào)"
set scrolloff=5 "距離頂部和底部5行"
set laststatus=2 "命令行為兩行"
set fenc=utf-8 "文件編碼"
set backspace=2
"set mouse=a "啟用鼠標(biāo)"
set selection=exclusive
set selectmode=mouse,key
set matchtime=5
set ignorecase "忽略大小寫(xiě)"
set incsearch
set hlsearch "高亮搜索項(xiàng)"
set expandtab "不允許擴(kuò)展table"
set whichwrap+=,h,l
set autoread
set cursorline "突出顯示當(dāng)前行"
set cursorcolumn "突出顯示當(dāng)前列"
帶插件版
- 安裝git
- 在家目錄中建立
.vim目錄,在該目錄中建立bundle目錄 - 進(jìn)入
bundle目錄,下載vundle.vim:git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim - 建立vimrc,vim打開(kāi)任意文件輸入:
PluginInstall
" update 2016-12-15
filetype off
set nocompatible
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
"YCM需要單獨(dú)安裝后在添加
"Plugin 'Valloric/YouCompleteMe'
Plugin 'VundleVim/Vundle.vim'
Plugin 'Lokaltog/vim-powerline'
Plugin 'scrooloose/nerdtree'
Plugin 'Yggdroot/indentLine'
Plugin 'scrooloose/nerdcommenter'
Plugin 'tomasr/molokai'
call vundle#end()
filetype plugin indent on
"--------- 鍵映射 ------------------------------
let mapleader=";"
nmap <leader>w :w<CR>
nmap <leader>q :q<CR>
"switch windows
"F2開(kāi)啟和關(guān)閉樹(shù)"
map <F2> :NERDTreeToggle<CR>
map <F4> <leader>ci <CR>
"--------- 樹(shù)型目錄NERDTree配置 ----------------
let NERDTreeChDirMode=1
let NERDTreeShowBookmarks=1 "顯示書(shū)簽
let NERDTreeIgnore=['~$', '.pyc$', '.swp$'] "設(shè)置忽略文件類(lèi)型
let NERDTreeWinSize=25 "窗口大小
"--------- 縮進(jìn)指示線 indentLine 配置 ----------
let g:indentLine_char='┆'
let g:indentLine_enabled = 1
"--------------基本設(shè)置--------------
set previewheight=1 "設(shè)置預(yù)覽窗口(Scratch)顯示行數(shù)
"set pumheight=15 "設(shè)置彈出菜單高度
set number "顯示行號(hào)"
"" 隱藏滾動(dòng)條"
set guioptions-=r
set guioptions-=L
set guioptions-=b
set showtabline=0 "隱藏頂部標(biāo)簽欄"
set guifont=Monaco:h13 "設(shè)置字體"
syntax on "開(kāi)啟語(yǔ)法高亮"
let g:solarized_termcolors=256 "solarized主題設(shè)置在終端下的設(shè)置"
set background=dark "設(shè)置背景色"
"colorscheme solarized
" set nowrap "設(shè)置不折行"
set fileformat=unix "設(shè)置以u(píng)nix的格式保存文件"
"set cindent "設(shè)置C樣式的縮進(jìn)格式"
set tabstop=4 "設(shè)置table長(zhǎng)度"
set shiftwidth=4 "同上"
set softtabstop=4 "按backspace回退的縮進(jìn)長(zhǎng)度"
set showmatch "顯示匹配的括號(hào)"
set scrolloff=5 "距離頂部和底部5行"
set laststatus=2 "命令行為兩行"
set fenc=utf-8 "文件編碼"
set backspace=2
"set mouse=a "啟用鼠標(biāo)"
set selection=exclusive
set selectmode=key
set matchtime=5
set ignorecase "忽略大小寫(xiě)"
set incsearch
set hlsearch "高亮搜索項(xiàng)"
set expandtab "允許擴(kuò)展table"
set whichwrap+=,h,l
set autoread
set cursorcolumn "突出顯示當(dāng)前列"