LoginSignup
20
21

More than 5 years have passed since last update.

vimのプラグインの入れ方(Vundle)

Posted at

概要

Vundleというのが人気っぽいので使ってみる。
基本的には下記のQuickStart準拠。
https://github.com/VundleVim/Vundle.Vim#quick-start

前提

  • Gitが使える。
  • 筆者環境はMacなので、他のOSだと動きが違うかもしれません。

準備

格納用ディレクトリを作る。

mkdir -p ~/.vim/bundle

githubからVundleを取得。

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

.vimrcを編集。(なければ作る)

vi ~/.vimrc

下記をファイルの先頭に追記。※元のQuickStartでは説明コメントが長かったので一部を省きました。

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()

Plugin 'VundleVim/Vundle.vim'

" !! write plugins here !!

" All of your Plugins must be added before the following line
call vundle#end()            " required
filetype plugin indent on    " required

vimを起動して反映。

vim +PluginInstall +qall

プラグインの導入

上記の!! write plugins here !!のところに、以下のようにプラグイン名を記載。

Plugin 'othree/yajs.vim'

vimを起動して反映

vim +PluginInstall +qall

補足

個人的にハマったのでメモ。
Macでシンタックスハイライトのプラグインを入れてもハイライトされなかった。
.vimrcの最後に下記を追記したらハイライトされるようになった。

:syntax on
20
21
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
20
21