安裝Vim套件管理程式Vundle
Vim基本上已經是一個很好用的文字編輯軟體了,不過最近開始寫Ansible的YAML的檔案
被縮排搞到非常火大,所以就開始來找看看vim for ansible套件
要安裝vim的套件,會需要一個套件安裝管理程式會比較方便,以下是Vundle的安裝步驟
1. 安裝必備套件
yum install git curl -y
2. 新增目錄 ~/.vim/bundle/vundle 再透過git安裝vundle
git clone https://github.com/gmarik/vundle.git ~/.vim/bundle/vundle
3. 設定 .vimrc,加入以下程式碼
set nocompatible " be iMproved, required
filetype off " required
" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/vundle/
call vundle#rc()
" alternatively, pass a path where Vundle should install plugins
"let path = '~/some/path/here'
"call vundle#rc(path)
" let Vundle manage Vundle, required
Plugin 'gmarik/vundle'
" The following are examples of different formats supported.
" Keep Plugin commands between here and filetype plugin indent on.
" scripts on GitHub repos
Plugin 'tpope/vim-fugitive'
Plugin 'Lokaltog/vim-easymotion'
Plugin 'tpope/vim-rails.git'
" 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/'}
" scripts from http://vim-scripts.org/vim/scripts.html
Plugin 'L9'
Plugin 'FuzzyFinder'
" scripts not 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'
" ...
filetype plugin indent on " required
" To ignore plugin indent changes, instead use:
"filetype plugin on
" Brief help
" :PluginList - list configured plugins
" :PluginInstall(!) - install (update) plugins
" :PluginSearch(!) foo - search (or refresh cache first) for foo
" :PluginClean(!) - confirm (or auto-approve) removal of unused plugins
"
" see :h vundle for more details or wiki for FAQ
" NOTE: comments after Plugin commands are not allowed.
" Put your stuff after this line
其中所有 Plugin 開頭的設定,除了 Plugin 'gmarik/vundle' 之外,都可以依照自己的需求決定是否要加入
最後在 Vim 中執行 :PluginInstall 安裝 .vimrc 中所設定的 plugins
例如 : 我要安裝 Ansible-Vim 網站上寫著以下敘述 :
在vundle 的安裝方式就是把 Pluding 那串描述貼到 .vimrc最後中,最後在vim中執行 :PluginInstall