vim簡單配置

目錄:

1、安裝插件管理神器:Vundle

源碼地址https://github.com/VundleVim/Vundle.vim

安裝方法:

一、克隆到本機html

git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim

二、在本機用戶目錄下建立.vimrc文件python

set nocompatible              " be iMproved, required
filetype off                  " required

" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim call vundle#begin() " alternatively, pass a path where Vundle should install plugins "call vundle#begin('~/some/path/here')

" let Vundle manage Vundle, required
Plugin 'VundleVim/Vundle.vim'

" The following are examples of different formats supported. " Keep Plugin commands between vundle#begin/end. " plugin on GitHub repo
Plugin 'tpope/vim-fugitive'
" plugin from http://vim-scripts.org/vim/scripts.html " Plugin 'L9' " Git plugin not hosted on GitHub
Plugin 'git://git.wincent.com/command-t.git'
" git repos on your local machine (i.e. when working on your own plugin)
Plugin 'file:///home/gmarik/path/to/plugin'
" The sparkup vim script is in a subdirectory of this repo called vim. " Pass the path to set the runtimepath properly.
Plugin 'rstacruz/sparkup', {'rtp': 'vim/'} " Install L9 and avoid a Naming conflict if you've already installed a " different version somewhere else. " Plugin 'ascenator/L9', {'name': 'newL9'}

" All of your Plugins must be added before the following line
call vundle#end()            " required
filetype plugin indent on    " required " To ignore plugin indent changes, instead use: "filetype plugin on " " Brief help " :PluginList - lists configured plugins " :PluginInstall - installs plugins; append `!` to update or just :PluginUpdate " :PluginSearch foo - searches for foo; append `!` to refresh local cache " :PluginClean - confirms removal of unused plugins; append `!` to auto-approve removal " " see :h vundle for more details or wiki for FAQ " Put your non-Plugin stuff after this line

使用方法:

//須要安裝插件的時候,在.vimrc文件中加入一行:
Bundle 'your/script/path'

//進入vim後運行如下命令
:PluginInstall //或者在終端執行
vim +PluginInstall +qall //卸載時只需: //去除配置文件中的 Bundle 'your/script/name' //在VIM中運行 
:PluginClean

2、配色方案:

當前最受歡迎的是 Solarized linux

源碼地址https://github.com/altercation/vim-colors-solarized

安裝方法:

//克隆源碼
git clone git://github.com/altercation/vim-colors-solarized.git //複製到指定目錄
cp -rf vim-colors-solarized/colors/  ~/.vim/

而後在.vimrc文件中加入如下代碼:git

syntax enable set background=dark colorscheme solarized

3、插件列表:

導航與搜索

自動補全

語法

4、遇到的問題:

問題1:

安裝插件YouCompleteMe以後,報錯「YouCompleteMe unavailable: requires Vim compiled with Python (2.6+ or 3.3+) support...github

解決方法:

sudo apt install vim-python-jedi

問題2:

安裝插件YouCompleteMe以後,報錯「the ycmd server shut down(restart wit . . . 」ubuntu

解決方法:

//安裝開發工具和CMake:
sudo apt-get install build-essential cmake //確保安裝了Python-dev:
sudo apt-get install python-dev python3-dev //編譯YCM 
cd ~/.vim/bundle/YouCompleteMe ./install.py

問題3:

將vim中的內容複製到系統剪貼板vim

解決方法: 

安裝圖形化界面的vim,或者從新編譯vimapp

sudo apt-get install vim-gnome

 

 

參考資料:

https://github.com/Valloric/YouCompleteMe/issues/2573工具

https://github.com/Valloric/YouCompleteMe#ubuntu-linux-x64開發工具

https://blog.csdn.net/mergerly/article/details/51671890

https://blog.csdn.net/zhangxiao93/article/details/53677764

相關文章
相關標籤/搜索