LoginSignup
9
8

More than 5 years have passed since last update.

初めてのvimプラグイン追加(neobundle)

Posted at

neobundleのインストール

neobundleでプラグインを管理するのが最適。

mkdir -p ~/.vim/bundle
cd ~/.vim/bundle/

git clone https://github.com/Shougo/neobundle.vim.git neobundle.vim

.vimrcを編集

set nocompatible
filetype off

if has('vim_starting')
  set runtimepath+=~/.vim/bundle/neobundle.vim
  call neobundle#begin(expand('~/.vim/bundle/'))
endif

NeoBundle 'Shougo/neobundle.vim'
NeoBundle 'Shougo/vimproc'

call neobundle#end()

filetype plugin indent on

vimにて

以下のコマンドを実行し、.vimrcで定義したプラグインをインストールする。
:NeoBundleInstall

その他プラグインをインストール

以下のプラグインを入れると開発が楽になるかと。。。
Shougo/neosnippet
Shougo/neosnippet-snippets
scrooloose/syntastic.git
scrooloose/nerdtree

PHPの辞書を事前に作成
参考URL http://tech.basicinc.jp/PHP/2013/06/17/vim-php/
php -r '$f=get_defined_functions();echo join("\n",$f["internal"]);'|sort > ~/.vim/dict/php.dict

.vimrcの設定内容(最終)

以下、.vimrcの設定内容

set nocompatible
filetype off

if has('vim_starting')
  set runtimepath+=~/.vim/bundle/neobundle.vim
  call neobundle#begin(expand('~/.vim/bundle/'))
endif

NeoBundle 'Shougo/neobundle.vim'
NeoBundle 'Shougo/vimproc'
NeoBundle 'Shougo/neocomplcache'
NeoBundle 'Shougo/neosnippet'
NeoBundle 'Shougo/neosnippet-snippets'
NeoBundle 'scrooloose/syntastic.git'
NeoBundle 'scrooloose/nerdtree'

call neobundle#end()

filetype plugin indent on

"-------------------------------------------------
""" neocomplcache設定
"-------------------------------------------------
"""辞書ファイル
autocmd BufRead *.php\|*.ctp\|*.tpl :set dictionary=~/.vim/dict/php.dict filetype=php
let g:neocomplcache_enable_at_startup = 1
let g:neocomplcache_enable_camel_case_completion = 1
let g:neocomplcache_enable_underbar_completion = 1
let g:neocomplcache_smart_case = 1
let g:neocomplcache_min_syntax_length = 3
let g:neocomplcache_manual_completion_start_length = 0
let g:neocomplcache_caching_percent_in_statusline = 1
let g:neocomplcache_enable_skip_completion = 1
let g:neocomplcache_skip_input_time = '0.5'

"-------------------------------------------------
""" neosnippet設定
"-------------------------------------------------
"" Plugin key-mappings.
imap <C-k>     <Plug>(neosnippet_expand_or_jump)
smap <C-k>     <Plug>(neosnippet_expand_or_jump)
xmap <C-k>     <Plug>(neosnippet_expand_target)

" SuperTab like snippets behavior.
imap <expr><TAB> neosnippet#expandable_or_jumpable() ?
\ "\<Plug>(neosnippet_expand_or_jump)"
\: pumvisible() ? "\<C-n>" : "\<TAB>"
smap <expr><TAB> neosnippet#expandable_or_jumpable() ?
\ "\<Plug>(neosnippet_expand_or_jump)"
\: "\<TAB>"

" For snippet_complete marker.
if has('conceal')
  set conceallevel=2 concealcursor=i
endif
9
8
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
9
8