Skip to content

Instantly share code, notes, and snippets.

@astrsk-hori
Last active August 29, 2015 14:18
Show Gist options
  • Save astrsk-hori/91069dffa06f372adf9a to your computer and use it in GitHub Desktop.
Save astrsk-hori/91069dffa06f372adf9a to your computer and use it in GitHub Desktop.
php書くときに知っといた方が捗るvimの使い方かも ref: http://qiita.com/astrsk_hori/items/9be32e0ad89a62ed4f8c
brew install ctags
alias ctags="`brew --prefix`/bin/ctags"
NeoBundle 'vim-scripts/gtags.vim'
" 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>
vimdiff a.txt b.txt
:%s/hoge/fuga/g
:%s/hoge/fuga/gc
replace with hoge (y/n/a/q/l/^E/^Y)?
NeoBundle 'terryma/vim-multiple-cursors'
:NeoBundleInstall
NeoBundle 'git://github.com/scrooloose/syntastic.git'
:NeoBundleInstall
" テキストオブジェクト拡張
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'
ctags -R --regex-php="/^[ \t]*const[ \t]+([a-z0-9_]+)/\1/d/i"
$ ctags --version
Exuberant Ctags 5.8, Copyright (C) 1996-2009 Darren Hiebert
Compiled: Jul 4 2014, 16:16:13
Addresses: <dhiebert@users.sourceforge.net>, http://ctags.sourceforge.net
Optional compiled features: +wildcards, +regex
brew install global --with-exuberant-ctags --with-pygments
gtags --gtagslabel=pygments
alias gtags="gtags --gtagslabel=pygments"
brew search global
```exit```で抜けるとvimに戻ってきます。
### 置換
ファイル全体でhogeをfugaに置換する。
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment