vim使用筆記

來源:互聯網
上載者:User

標籤:

  • 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使用筆記

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.