Last active
August 29, 2015 14:18
-
-
Save astrsk-hori/91069dffa06f372adf9a to your computer and use it in GitHub Desktop.
php書くときに知っといた方が捗るvimの使い方かも ref: http://qiita.com/astrsk_hori/items/9be32e0ad89a62ed4f8c
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
brew install ctags |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
alias ctags="`brew --prefix`/bin/ctags" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
NeoBundle 'vim-scripts/gtags.vim' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" gtags | |
" 検索結果Windowを閉じる | |
nnoremap <C-q> <C-w><C-w><C-w>q | |
" Grep 準備 | |
nnoremap <C-g> :Gtags -g | |
" このファイルの関数一覧 | |
nnoremap <C-l> :Gtags -f %<CR><CR> | |
" カーソル以下の定義元を探す | |
"nnoremap <C-j> :Gtags <C-r><C-w><CR><CR> | |
map <C-j> :GtagsCursor<CR><CR> | |
" カーソル以下の使用箇所を探す | |
nnoremap <C-k> :Gtags -r <C-r><C-w><CR><CR> | |
" 次の検索結果 | |
nnoremap <C-n> :cn<CR> | |
" 前の検索結果 | |
nnoremap <C-p> :cp<CR> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
vimdiff a.txt b.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
:shell |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
exit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
:%s/hoge/fuga/g |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
:%s/hoge/fuga/gc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
replace with hoge (y/n/a/q/l/^E/^Y)? |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
NeoBundle 'terryma/vim-multiple-cursors' | |
:NeoBundleInstall |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
NeoBundle 'git://github.com/scrooloose/syntastic.git' | |
:NeoBundleInstall |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ctags -R |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" テキストオブジェクト拡張 | |
NeoBundle 'git://github.com/tpope/vim-surround.git' | |
"入力補完機能 | |
NeoBundle 'git://github.com/Shougo/neocomplcache.git' | |
"vim 用の統合ユーザインターフェース | |
NeoBundle 'git://github.com/Shougo/unite.vim.git' | |
" 非同期処理 | |
NeoBundle 'git://github.com/Shougo/vimproc.git' | |
" 整形 | |
NeoBundle 'git://github.com/tsaleh/vim-align.git' | |
" プログラム実行 | |
NeoBundle 'git://github.com/thinca/vim-quickrun.git' | |
" SQLの整形 | |
NeoBundle 'git://github.com/vim-scripts/SQLUtilities.git' | |
" ファイラー | |
NeoBundle 'Shougo/vimfiler' | |
" indentの見える化 | |
NeoBundle 'nathanaelkane/vim-indent-guides' | |
" デバック | |
NeoBundle 'joonty/vdebug' | |
" git連携 | |
NeoBundle 'git://github.com/tpope/vim-fugitive.git' | |
" スニペット | |
NeoBundle 'Shougo/neosnippet' | |
” スニペット集 | |
NeoBundle 'Shougo/neosnippet-snippets' | |
” スニペット集 | |
NeoBundle 'git://github.com/honza/snipmate-snippets.git' | |
" 見出し一覧 | |
NeoBundle "Shougo/unite-outline" | |
" git の変更点見える化 | |
NeoBundle 'airblade/vim-gitgutter' | |
" クリップボード連携 | |
NeoBundle 'kana/vim-fakeclip' | |
" html サポート | |
NeoBundle 'mattn/emmet-vim' | |
" Dash連携 | |
NeoBundle 'rizzatti/dash.vim' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ctags -R --regex-php="/^[ \t]*const[ \t]+([a-z0-9_]+)/\1/d/i" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ ctags --version | |
Exuberant Ctags 5.8, Copyright (C) 1996-2009 Darren Hiebert | |
Compiled: Jul 4 2014, 16:16:13 | |
Addresses: <[email protected]>, http://ctags.sourceforge.net | |
Optional compiled features: +wildcards, +regex |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
brew install global --with-exuberant-ctags --with-pygments |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
gtags --gtagslabel=pygments |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
alias gtags="gtags --gtagslabel=pygments" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
brew search global |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
gtags -v |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
```exit```で抜けるとvimに戻ってきます。 | |
### 置換 | |
ファイル全体でhogeをfugaに置換する。 | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### 置換 | |
ファイル全体でhogeをfugaに置換する。 | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment