Ubuntu Setup Package/common 下载vim-configuration.tar.gz 。然后解压此包:
tar -xzf vim-configuration.tar.gz -C ~ 即可实现效果图所示的VIM。
terminal和vim的配色方案修改参考: linux下Vim和Terminal配色
vim配置文件详解参考: 所需即所获:像 IDE 一样使用 vim

下面是自定义vim配置文件,仅供参考!

"""""""""""""""""""""""""""""Keyboard Shortcut""""""""""""""""""""""""""""
" 定义快捷键的前缀,即<Leader>
let mapleader=";"
" 定义快捷键到行首和行尾
nmap LB 0
nmap LE $
" 设置快捷键将选中文本块复制至系统剪贴板
vnoremap <Leader>y "+y
" 设置快捷键将系统剪贴板内容粘贴至 vim
nmap <Leader>p "+p
" 定义快捷键关闭当前分割窗口

nmap <leader>wq :wq<CR>
nmap <Leader>q :q<CR>
" 定义快捷键保存当前窗口内容
nmap <Leader>w :w<CR>
" 定义快捷键保存所有窗口内容并退出 vim
nmap <Leader>WQ :wa<CR>:q<CR>
" 不做任何保存,直接退出 vim
nmap <Leader>Q :qa!<CR>


" 依次遍历子窗口
nnoremap nw <C-W><C-W>

" 跳转至右方的窗口
nnoremap <Leader>lw <C-W>l

" 跳转至左方的窗口
nnoremap <Leader>hw <C-W>h

" 跳转至上方的子窗口
nnoremap <Leader>kw <C-W>k

" 跳转至下方的子窗口
nnoremap <Leader>jw <C-W>j

" 定义快捷键在结对符之间跳转
nmap <Leader>M %

" 显示/隐藏 MiniBufExplorer 窗口
map <Leader>mt :MBEToggle<cr>
" buffer 切换快捷键
map <leader>bn :MBEbn<cr>
map <leader>bp :MBEbp<cr>
""""""""""""""""""""""""""Keyboard END""""""""""""""""""""""""""""""""""""


""""""""""""""""""""""""""User Settings"""""""""""""""""""""""""""""""""""
set nocompatible    "关闭vim兼容模式
set wildmenu        "vim自身命令行模式智能补全
set incsearch
set ignorecase
set laststatus=2    " 总是显示状态栏
set ruler           " 显示光标当前位置
set number          " 开启行号显示
set cursorline      " 高亮显示当前行/set cursorcolumn
set hlsearch        " 高亮显示搜索结果
set nowrap          " 禁止折行
set expandtab
set tabstop=4       " 设置编辑时制表符占用空格数
set shiftwidth=4    " 设置格式化时制表符占用空格数
set softtabstop=4   " 让 vim 把连续数量的空格视为一个制表符
"""""""""""""""""""""""""User END"""""""""""""""""""""""""""""""""""""""""


""""""""""""""""""""""""""Vundle Setting""""""""""""""""""""""""""""""""""
filetype off
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
Plugin 'VundleVim/Vundle.vim'
Plugin 'altercation/vim-colors-solarized'
Plugin 'Lokaltog/vim-powerline'
"Plugin 'octol/vim-cpp-enhanced-highlight'
"Plugin 'tomasr/molokai'
"Plugin 'nathanaelkane/vim-indent-guides'
"Plugin 'derekwyatt/vim-fswitch'
"Plugin 'kshenoy/vim-signature'
Plugin 'majutsushi/tagbar'
"Plugin 'vim-scripts/indexer.tar.gz'
"Plugin 'vim-scripts/DfrankUtil'
"Plugin 'vim-scripts/vimprj'
"Plugin 'dyng/ctrlsf.vim'
"Plugin 'terryma/vim-multiple-cursors'
Plugin 'scrooloose/nerdcommenter'
"Plugin 'vim-scripts/DrawIt'
"Plugin 'SirVer/ultisnips'
Plugin 'Valloric/YouCompleteMe'
"Plugin 'derekwyatt/vim-protodef'
Plugin 'scrooloose/nerdtree'
Plugin 'jistr/vim-nerdtree-tabs'
Plugin 'Xuyuanp/nerdtree-git-plugin'
Plugin 'fholgado/minibufexpl.vim'
"Plugin 'gcmt/wildfire.vim'
"Plugin 'sjl/gundo.vim'
"Plugin 'Lokaltog/vim-easymotion'
"Plugin 'suan/vim-instant-markdown'
"Plugin 'lilydjwg/fcitx.vim'
"Plugin 'scrooloose/syntastic'
"Plugin 'WolfgangMehner/vim-plugins'
Plugin 'ctrlpvim/ctrlp.vim'
Plugin 'c.vim'
call vundle#end()
filetype plugin indent on
filetype plugin on
""""""""""""""""""""""""""""Vundle END""""""""""""""""""""""""""""""""""""

syntax enable   " 开启语法高亮功能
syntax on       " 允许用指定语法高亮配色方案替换默认方案

filetype on         "开启文件类型侦测
"filetype plugin on "根据侦测到的不同类型加载对应的插件
"filetype indent on  " 自适应不同语言的智能缩进
set background=dark
colorscheme solarized

set gcr=a:block-blinkon0
set guioptions-=l
set guioptions-=L
set guioptions-=r
set guioptions-=R
set guioptions-=m
set guioptions-=T


" 设置状态栏主题风格
let g:Powerline_colorscheme='solarized256'
" 将制表符扩展为空格

" 让配置变更立即生效
"autocmd BufWritePost $MYVIMRC source $MYVIMRC

" 随 vim 自启动
"let g:indent_guides_enable_on_vim_startup=1
" 从第二层开始可视化显示缩进
let g:indent_guides_start_level=2
" 色块宽度
let g:indent_guides_guide_size=1
" 快捷键 i 开/关缩进可视化
:nmap <silent> <Leader>i <Plug>IndentGuidesToggle

" 基于缩进或语法进行代码折叠
set foldmethod=indent
set foldmethod=syntax
" 启动 vim 时关闭折叠代码
set nofoldenable

" *.cpp 和 *.h 间切换
nmap <silent> <Leader>sw :FSHere<cr>


" YCM 补全菜单配色
" 菜单
"highlight Pmenu ctermfg=2 ctermbg=3 guifg=#005f87 guibg=#EEE8D5
" 选中项
"highlight PmenuSel ctermfg=2 ctermbg=3 guifg=#AFD700 guibg=#106900
" 补全功能在注释中同样有效
"let g:ycm_complete_in_comments=1
" 允许 vim 加载 .ycm_extra_conf.py 文件,不再提示
"let g:ycm_confirm_extra_conf=0
" 开启 YCM 标签补全引擎
"let g:ycm_collect_identifiers_from_tags_files=1
" 引入 C++ 标准库tags
"set tags+=/data/misc/software/misc./vim/stdcpp.tags
" YCM 集成 OmniCppComplete 补全引擎,设置其快捷键
"inoremap <leader>; <C-x><C-o>
" 补全内容不以分割子窗口形式出现,只显示补全列表
"set completeopt-=preview
" 从第一个键入字符就开始罗列匹配项
"let g:ycm_min_num_of_chars_for_completion=1
" 禁止缓存匹配项,每次都重新生成匹配项
"let g:ycm_cache_omnifunc=0
" 语法关键字补全         
"let g:ycm_seed_identifiers_with_syntax=1

""""""""""""""""""""""""""""""""""NREDTree Settings"""""""""""""""""""""""
" 使用 NERDTree 插件查看工程文
nmap <Leader>nt :NERDTreeToggle<CR>
" 设置 NERDTree 子窗口宽度
let NERDTreeWinSize=31
" 设置 NERDTree 子窗口位置
let NERDTreeWinPos="right"
"显示行号
let NERDTreeShowLineNumber=1
" 显示隐藏文件
"let NERDTreeShowHidden=1
" NERDTree 子窗口中不显示冗余帮助信息
let NERDTreeMinimalUI=1
" 删除文件时自动删除文件对应 buffer
let NERDTreeAutoDeleteBuffer=1
"忽略下面类型的文件
let NERDTreeIgnore=['\.pyc','\~$','\.swp']
"显示书签列表
"let NERDTreeShowBookmarks=1

""""""""""""""""""vim-nerdtree-tabs settings"""""""""""""
"终端运行vim时打开NERDTree窗口
"let g:nerdtree_tabs_open_on_console_startup=1


"""""""""""""""""nerdtree-git-plugin settings"""""""""""
let g:NERDTreeIndicatorMapCustom = {
    \ "Modified"  : "✹",
    \ "Staged"    : "✚",
    \ "Untracked" : "✭",
    \ "Renamed"   : "➜",
    \ "Unmerged"  : "═",
    \ "Deleted"   : "✖",
    \ "Dirty"     : "✗",
    \ "Clean"     : "✔︎",
    \ "Unknown"   : "?"
    \ }

"""""""""""""""""""""""""""""""""NERDTree END"""""""""""""""""""""""""""""


""""""""""""""""""""""""""""""""CtrlP Settings""""""""""""""""""""""""""""
let g:ctrlp_map = '<c-p>'
let g:ctrlp_cmd = 'CtrlP'

"disable the plugin completely
"let g:loaded_ctrlp =1

"CtrlP sets its local working directory according to this variable
let g:ctrlp_working_path_mode = 'ra'
"""""""""""""""""""""""""""""""Ctrel END"""""""""""""""""""""""""""""""""


""""""""""""""""""""""""""""""Tagbar Settings"""""""""""""""""""""""""""
" 设置 tagbar 子窗口的位置出现在主编辑区的左边 
let tagbar_left=1 
" 设置显示/隐藏标签列表子窗口的快捷键
nnoremap <Leader>tb :TagbarToggle<CR> 
" 设置标签子窗口的宽度 
let tagbar_width=31 
" tagbar 子窗口中不显示冗余帮助信息 
let g:tagbar_compact=1
" 设置 ctags 对哪些代码标识符生成标签
let g:tagbar_type_cpp = {
    \ 'kinds' : [
         \ 'c:classes:0:1',
         \ 'd:macros:0:1',
         \ 'e:enumerators:0:0', 
         \ 'f:functions:0:1',
         \ 'g:enumeration:0:1',
         \ 'l:local:0:1',
         \ 'm:members:0:1',
         \ 'n:namespaces:0:1',
         \ 'p:functions_prototypes:0:1',
         \ 's:structs:0:1',
         \ 't:typedefs:0:1',
         \ 'u:unions:0:1',
         \ 'v:global:0:1',
         \ 'x:external:0:1'
     \ ],
     \ 'sro'        : '::',
     \ 'kind2scope' : {
         \ 'g' : 'enum',
         \ 'n' : 'namespace',
         \ 'c' : 'class',
         \ 's' : 'struct',
         \ 'u' : 'union'
     \ },
     \ 'scope2kind' : {
         \ 'enum'      : 'g',
         \ 'namespace' : 'n',
         \ 'class'     : 'c',
         \ 'struct'    : 's',
         \ 'union'     : 'u'
     \ }
\ }
"""""""""""""""""""""""""""""Tagbar END""""""""""""""""""""""""""""""""

let g:C_FormatDate='%Y/%m/%d'
let g:C_FormatTime='%H:%M:%S'

效果图

这里写图片描述

Logo

更多推荐