標籤:
- vundle
- YouCompleteMe
- Vimwiki
vundle
1.setup vundle
$ git clone https://github.com/gmarik/Vundle.vim.git ~/.vim/bundle/Vundle.vim
2.配置外掛程式,編輯主目錄下的.vimrc檔案,在檔案頭部增加
set nocompatible " be iMproved, requiredfiletype off " required" set the runtime path to include Vundle and initializeset rtp+=~/.vim/bundle/Vundle.vimcall vundle#begin()" alternatively, pass a path where Vundle should install plugins"call vundle#begin(‘~/some/path/here‘)" let Vundle manage Vundle, requiredPlugin ‘gmarik/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/‘}" Avoid a name conflict with L9" Plugin ‘user/L9‘, {‘name‘: ‘newL9‘}" All of your Plugins must be added before the following linecall vundle#end() " requiredfiletype plugin indent on " required" To ignore plugin indent changes, instead use:"filetype plugin on
修改完之後就已經配置好vundle了,進入vim
中就可以執行命令,注意要用sudo的方式開啟vim
,否則執行命令的時候可能報錯許可權不夠。一些常用命令:
:PluginList
:PluginInstall
: 安裝設定檔中的plugin
:PluginSearch foo
: search for foo
:PluginClean
: 在設定檔中刪除外掛程式後,需要運行清除命令
:vim +PluginInstall +qall
: 在命令列中直接執行命令,其他幾個命令同樣可以在命令列中執行
安裝外掛程式的時候,如果是github源的外掛程式,如YouCompleteMe
可以在.vimrc檔案中添加Plugin ‘Valloric/YouCompleteMe‘
,即作者/外掛程式名
YouCompleteMe
使用vundle安裝:Plugin ‘Valloric/YouCompleteMe‘
由於YCM是需要執行編譯的,現在只是更新源碼,所以需要CMake:
sudo apt-get install build-essential cmake
確保已經安裝python headers:
sudo apt-get install python-dev
編譯YCM:
cd ~/.vim/bundle/YouCompleteMe./install.sh --clang-completer
推薦的一些配置
let g:ycm_collect_identifiers_from_tags_files = 1 " Let YCM read tags from Ctags filelet g:ycm_use_ultisnips_completer = 1 " Default 1, just ensurelet g:ycm_seed_identifiers_with_syntax = 1 " Completion for programming language‘s keywordlet g:ycm_complete_in_comments = 1 " Completion in commentslet g:ycm_complete_in_strings = 1 " Completion in string
Vimwiki
vundle安裝: Plugin ‘vimwiki/vimwiki‘
配置:
set nocompatiblefiletype plugin onsyntax onlet g:vimwiki_valid_html_tags=‘br‘nmap <F5> :Vimwiki2HTML<CR>
vim使用筆記