vim入門
vim初心者として、そもそも最初に何を入れればよいのかということを解説します。
neobundle
neobundleを入れておけば、今後vimのプラグインをneobundleで管理することになり、「やっぱりこのプラグインいらないから削除する」といったことになっても1行コメントアウトするだけで大丈夫です。
$ curl https://raw.githubusercontent.com/Shougo/neobundle.vim/master/bin/install.sh > install.sh $ sh ./install.sh
.vimrcに以下を追記
"NeoBundle Scripts----------------------------- if &compatible set nocompatible " Be iMproved endif " Required: set runtimepath^=/home/vagrant/.vim/bundle/neobundle.vim/ " Required: call neobundle#begin(expand('/home/vagrant/.vim/bundle')) " Let NeoBundle manage NeoBundle " Required: NeoBundleFetch 'Shougo/neobundle.vim' " Add or remove your Bundles here: NeoBundle 'Shougo/neosnippet.vim' NeoBundle 'Shougo/neosnippet-snippets' NeoBundle 'tpope/vim-fugitive' NeoBundle 'ctrlpvim/ctrlp.vim' NeoBundle 'flazz/vim-colorschemes' " You can specify revision/branch/tag. NeoBundle 'Shougo/vimshell', { 'rev' : '3787e5' } " Required: call neobundle#end() " Required: filetype plugin indent on " If there are uninstalled bundles found on startup, " this will conveniently prompt you to install them. NeoBundleCheck "End NeoBundle Scripts-------------------------
なお、今後NeoBundleを使って
NeoBundle 'scrooloose/nerdtree'
などとする際は、次回vimを起動する際に
:NeoBundleInstall
を実行するのをお忘れなく。
参考
qiita.com
インデント
なお、タブ⇔スペースのインデントの変換は以下を使用する。
スペース→タブの場合は
:set noexpandtab :retab 2
タブ→スペースの場合は
:set expandtab :retab