ラベル vim の投稿を表示しています。 すべての投稿を表示
ラベル vim の投稿を表示しています。 すべての投稿を表示

2015年8月15日土曜日

[vim][RaspberryPi]Elixirのシンタックス設定 2時間ハマった。

はじめに

Raspberry pi 上でElixirで遊ぶため、vimを入れたので、シンタックスを設定しようとしたが、vimやNeoBundleについて知らなすぎたため、2時間ハマった。そのハマった点を忘れないよう記事にした。

環境

  • OS:Rasbian

原因

vimrc内に ”syntax enable" がなかったこと

手順

基本的な手順は1.の通りである。

  1. http://kaworu.jpn.org/vim/NeoBundle

セットアップ

$ mkdir -p ~/.vim/bundle
$ git clone https://github.com/Shougo/neobundle.vim ~/.vim/bundle/neobundle.vim

$HOME/.vimrc の設定

以下をファイルへ追記する。

set nocompatible
filetype off            " for NeoBundle

if has('vim_starting')
        set rtp+=$HOME/.vim/bundle/neobundle.vim/
endif
call neobundle#begin(expand('~/.vim/bundle'))
NeoBundleFetch 'Shougo/neobundle.vim'
" ★

" ここから NeoBundle でプラグインを設定します
" NeoBundle で管理するプラグインを追加します。
NeoBundle 'Shougo/neocomplcache.git'
NeoBundle 'Shougo/unite.vim.git'
NeoBundle 'elixir-lang/vim-elixir'     " elixir のシンタックス

call neobundle#end()            " ★から移動
filetype plugin indent on       " restore filetype

syntax enable                   " これがなかったため、シンタックスが表示できず。。。

プラグインのインストール

  1. vimの起動。ファイル指定しなくともよい。
  2. NeoBundleInstallの実行(:NeoBundleInstall とコマンド実行)
  3. vimの終了

シンタックス確認

適当なelixirのファイルを開く。色が付いていればOK。