質問をすることでしか得られない、回答やアドバイスがある。

15分調べてもわからないことは、質問しよう!

新規登録して質問してみよう
ただいま回答率
85.49%
Vim

VimとはUnix / Linux 系のOSに標準搭載されているターミナル上で動くテキストエディタです。

Q&A

解決済

1回答

2235閲覧

Vimにプラグインを導入したい

light180

総合スコア161

Vim

VimとはUnix / Linux 系のOSに標準搭載されているターミナル上で動くテキストエディタです。

0グッド

0クリップ

投稿2017/04/03 07:52

編集2017/04/03 07:55

###前提・実現したいこと
Vimで,プレグインを入れるためNeoBundleを導入しようとしています。

###発生している問題・エラーメッセージ
http://qiita.com/puriketu99/items/1c32d3f24cc2919203ebを参考に

curl https://raw.githubusercontent.com/Shougo/neobundle.vim/master/bin/install.sh > install.sh sh install.sh

を実行しました。

その後,:NeoBundleInstallをvimで実行しました。
しかしVimで下のようなエラーが出てしまいました。

E492: Not an editor command: NeoBundleInstall

###該当のソースコード
また,_vimrcは下のような設定です。

set runtimepath+=~/.vim/bundle/neobundle.vim/ " ファイルをtree表示してくれる " :NERDTree NeoBundle 'scrooloose/nerdtree' " Ruby向けにendを自動挿入してくれる NeoBundle 'tpope/vim-endwise' " コメントON/OFFを手軽に実行 " Shift+vで対象穂範囲を選択し,ctrl+ハイフンを二回押す → コメントアウト・コメントイン NeoBundle 'tomtom/tcomment_vim' " シングルクオートとダブルクオートの入れ替え等 " :cs'" " :cs'<p> " :cs"' " :cs"<div> NeoBundle 'tpope/vim-surround' " インデントに色を付けて見やすくする NeoBundle 'nathanaelkane/vim-indent-guides' " vimを立ち上げたときに、自動的にvim-indent-guidesをオンにする let g:indent_guides_enable_on_vim_startup = 1 " https://sites.google.com/site/fudist/Home/vim-nihongo-ban/-vimrc-sample """""""""""""""""""""""""""""" " 挿入モード時、ステータスラインの色を変更 """""""""""""""""""""""""""""" let g:hi_insert = 'highlight StatusLine guifg=darkblue guibg=darkyellow gui=none ctermfg=blue ctermbg=yellow cterm=none' if has('syntax') augroup InsertHook autocmd! autocmd InsertEnter * call s:StatusLine('Enter') autocmd InsertLeave * call s:StatusLine('Leave') augroup END endif let s:slhlcmd = '' function! s:StatusLine(mode) if a:mode == 'Enter' silent! let s:slhlcmd = 'highlight ' . s:GetHighlight('StatusLine') silent exec g:hi_insert else highlight clear StatusLine silent exec s:slhlcmd endif endfunction function! s:GetHighlight(hi) redir => hl exec 'highlight '.a:hi redir END let hl = substitute(hl, '[\r\n]', '', 'g') let hl = substitute(hl, 'xxx', '', '') return hl endfunction """""""""""""""""""""""""""""" """""""""""""""""""""""""""""" " 自動的に閉じ括弧を入力 """""""""""""""""""""""""""""" imap { {}<LEFT> imap [ []<LEFT> imap ( ()<LEFT> """""""""""""""""""""""""""""" """""""""""""""""""""""""""""" " 最後のカーソル位置を復元する """""""""""""""""""""""""""""" if has("autocmd") autocmd BufReadPost * \ if line("'\"") > 0 && line ("'\"") <= line("$") | \ exe "normal! g'\"" | \ endif endif """""""""""""""""""""""""""""" " カーソルが何行目の何列目に置かれているかを表示する set ruler

###バージョン
vimのバージョン

VIM - Vi IMproved 8.0 (2016 Sep 12, compiled Apr 2 2017 05:50:02) MacOS X (unix) version

macのバージョン

macOS Sierra 10.12.3

どなたか,わかる方がいたら教えてもらえると嬉しいです。

気になる質問をクリップする

クリップした質問は、後からいつでもMYページで確認できます。

またクリップした質問に回答があった際、通知やメールを受け取ることができます。

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

guest

回答1

0

ベストアンサー

neobundle#begin() および neobundle#end() が呼ばれていないようです。公式のドキュメントをもう一度よく確認してみてください。

投稿2017/04/03 08:22

thinca

総合スコア1864

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

light180

2017/04/03 08:43

ありがとうございます。 試してみます。
light180

2017/04/03 08:46 編集

ありがとうざいます。 試してみました。 ```:NeoBundleInstall``` を実行するために,vimを立ち上げたら下のようなエラー?が出ました。 ``` Error detected while processing /Users/reetoknino/_vimrc: line 1: E492: Not an editor command: neobundle#begin() line 5: E492: Not an editor command: NeoBundle 'scrooloose/nerdtree' line 7: E492: Not an editor command: NeoBundle 'tpope/vim-endwise' line 10: E492: Not an editor command: NeoBundle 'tomtom/tcomment_vim' line 16: E492: Not an editor command: NeoBundle 'tpope/vim-surround' line 18: E492: Not an editor command: NeoBundle 'nathanaelkane/vim-indent-guides' line 81: E492: Not an editor command: neobundle#end() Press ENTER or type command to continue ``` そのまま,enterキーでvimで```:NeoBundleInstall```を実行しようとしても,まだ同じエラーが出ます。
light180

2017/04/03 08:47

また,_vimrcは,下のように書き換えました。 ``` neobundle#begin() set runtimepath+=~/.vim/bundle/neobundle.vim/ " ファイルをtree表示してくれる " :NERDTree NeoBundle 'scrooloose/nerdtree' " Ruby向けにendを自動挿入してくれる NeoBundle 'tpope/vim-endwise' " コメントON/OFFを手軽に実行 " Shift+vで対象穂範囲を選択し,ctrl+ハイフンを二回押す → コメントアウト・コメントイン NeoBundle 'tomtom/tcomment_vim' " シングルクオートとダブルクオートの入れ替え等 " :cs'" " :cs'<p> " :cs"' " :cs"<div> NeoBundle 'tpope/vim-surround' " インデントに色を付けて見やすくする NeoBundle 'nathanaelkane/vim-indent-guides' " vimを立ち上げたときに、自動的にvim-indent-guidesをオンにする let g:indent_guides_enable_on_vim_startup = 1 " https://sites.google.com/site/fudist/Home/vim-nihongo-ban/-vimrc-sample """""""""""""""""""""""""""""" " 挿入モード時、ステータスラインの色を変更 """""""""""""""""""""""""""""" let g:hi_insert = 'highlight StatusLine guifg=darkblue guibg=darkyellow gui=none ctermfg=blue ctermbg=yellow cterm=none' if has('syntax') augroup InsertHook autocmd! autocmd InsertEnter * call s:StatusLine('Enter') autocmd InsertLeave * call s:StatusLine('Leave') augroup END endif let s:slhlcmd = '' function! s:StatusLine(mode) if a:mode == 'Enter' silent! let s:slhlcmd = 'highlight ' . s:GetHighlight('StatusLine') silent exec g:hi_insert else highlight clear StatusLine silent exec s:slhlcmd endif endfunction function! s:GetHighlight(hi) redir => hl exec 'highlight '.a:hi redir END let hl = substitute(hl, '[\r\n]', '', 'g') let hl = substitute(hl, 'xxx', '', '') return hl endfunction """""""""""""""""""""""""""""" """""""""""""""""""""""""""""" " 自動的に閉じ括弧を入力 """""""""""""""""""""""""""""" imap { {}<LEFT> imap [ []<LEFT> imap ( ()<LEFT> """""""""""""""""""""""""""""" """""""""""""""""""""""""""""" " 最後のカーソル位置を復元する """""""""""""""""""""""""""""" if has("autocmd") autocmd BufReadPost * \ if line("'\"") > 0 && line ("'\"") <= line("$") | \ exe "normal! g'\"" | \ endif endif """""""""""""""""""""""""""""" " カーソルが何行目の何列目に置かれているかを表示する set ruler neobundle#end() ```
tell_k

2017/04/03 16:58

1. neobundle自体はちゃんとインストールされてますか? 2. githubのREADMEに書いてある設定とところどころ違う点があるようです。(例えば 「set runtimepath」が 「neobundle#begin()」より後に来てるとか) もう一度READMEのインストール手順を確認してみることをおすすめいたします。 https://github.com/Shougo/neobundle.vim#1-install-neobundle
light180

2017/04/04 01:20

ありがとうございます。 Githubを読み,書き換え成功しました。 ありがとうございました。 勉強不足ですみませんでした。
light180

2017/04/04 01:20

if 0 | endif if &compatible set nocompatible " Be iMproved endif set runtimepath+=~/.vim/bundle/neobundle.vim/ call neobundle#begin(expand('~/.vim/bundle/')) " ここから " ファイルをtree表示してくれる " :NERDTree NeoBundle 'scrooloose/nerdtree' " Ruby向けにendを自動挿入してくれる NeoBundle 'tpope/vim-endwise' " コメントON/OFFを手軽に実行 " Shift+vで対象穂範囲を選択し,ctrl+ハイフンを二回押す → コメントアウト・コメントイン NeoBundle 'tomtom/tcomment_vim' " シングルクオートとダブルクオートの入れ替え等 " :cs'" " :cs'<p> " :cs"' " :cs"<div> NeoBundle 'tpope/vim-surround' " インデントに色を付けて見やすくする NeoBundle 'nathanaelkane/vim-indent-guides' " vimを立ち上げたときに、自動的にvim-indent-guidesをオンにする let g:indent_guides_enable_on_vim_startup = 1 " https://sites.google.com/site/fudist/Home/vim-nihongo-ban/-vimrc-sample """""""""""""""""""""""""""""" " 挿入モード時、ステータスラインの色を変更 """""""""""""""""""""""""""""" let g:hi_insert = 'highlight StatusLine guifg=darkblue guibg=darkyellow gui=none ctermfg=blue ctermbg=yellow cterm=none' if has('syntax') augroup InsertHook autocmd! autocmd InsertEnter * call s:StatusLine('Enter') autocmd InsertLeave * call s:StatusLine('Leave') augroup END endif let s:slhlcmd = '' function! s:StatusLine(mode) if a:mode == 'Enter' silent! let s:slhlcmd = 'highlight ' . s:GetHighlight('StatusLine') silent exec g:hi_insert else highlight clear StatusLine silent exec s:slhlcmd endif endfunction function! s:GetHighlight(hi) redir => hl exec 'highlight '.a:hi redir END let hl = substitute(hl, '[\r\n]', '', 'g') let hl = substitute(hl, 'xxx', '', '') return hl endfunction """""""""""""""""""""""""""""" """""""""""""""""""""""""""""" " 自動的に閉じ括弧を入力 """""""""""""""""""""""""""""" imap { {}<LEFT> imap [ []<LEFT> imap ( ()<LEFT> """""""""""""""""""""""""""""" """""""""""""""""""""""""""""" " 最後のカーソル位置を復元する """""""""""""""""""""""""""""" if has("autocmd") autocmd BufReadPost * \ if line("'\"") > 0 && line ("'\"") <= line("$") | \ exe "normal! g'\"" | \ endif endif """""""""""""""""""""""""""""" " カーソルが何行目の何列目に置かれているかを表示する set ruler " ここまで call neobundle#end() filetype plugin indent on NeoBundleCheck
guest

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

15分調べてもわからないことは
teratailで質問しよう!

ただいまの回答率
85.49%

質問をまとめることで
思考を整理して素早く解決

テンプレート機能で
簡単に質問をまとめる

質問する

関連した質問