Vimã§ããã°ã©ã ã®é¢æ°ã追ãã®ã大å¤
ãVimã§ããã°ã©ã ãæ¸ãã¦ããã¨ãé¢æ°ã®åç
§å
ã¨ããããå¤æ°ãä»ã«ã©ãã§ä½¿ããã¦ããã調ã¹ããçããã®ã大å¤ã§ããèªä½ã®nyamazuã¹ã¯ãªããã§æ¢ããããã¦ããã®ã§ããããã¡ãã¡æ¤ç´¢ãã¦ãã®ãã¡ã¤ã«ãéãã¦è¡çªå·é£ã¶ã®ãå¹çæªãã§ããç°¡åã«ç®çã®ãã¡ã¤ã«ã¨ãå¤æ°ã¨ãé¢æ°ã«ä¸çºã§ã¸ã£ã³ããããããã£ã¨ãããã便å©ãªãã®ãããã¯ãã ã¨æã£ã¦æ¢ãããctags
ã¨ãããã®ããããããªã®ã§ãè¨å®ãã¦ã¿ã¾ãããMac/Linux(Ubuntu, Raspberry Pi)ã®ä¸¡æ¹ã§åä½ãã¾ããã
ctagsã¤ã³ã¹ãã¼ã«æ¹æ³
Linux(debian)
ãUbuntuã§ãRaspberry Piã§ãä¸è¨ã§OK
sudo apt-get update sudo apt-get install exuberant-ctags
Mac
ãHomebrewã§ä¸çºã
brew install ctags
ãHomebrewãç¥ããªã人ã¯ãä¸è¨è¨äºãåç §ãã ããã
ctags使ãæ¹
tagsãã¡ã¤ã«æ¸ãåºã
ãctagsã¯ãããããããã°ã©ã ã®é¢æ°ã®æ
å ±ãtags
ã¨ãããã¡ã¤ã«ã«æ¸ãåºããªãã¨ãããªãä»çµã¿ã§ãããªã®ã§ãããã¸ã§ã¯ãã®ããããã£ã¬ã¯ããªã«ç§»åãã¦ãä¸è¨ã³ãã³ãå®è¡ãã¦ä¸ããã
$ ctags -R --extra=+f
-R
ã¯å帰ãªãã·ã§ã³ã--extra=+f
ã¯ãã¡ã¤ã«ãã¿ã°ã«å«ãããªãã·ã§ã³ã§ãã ãã¡ã¤ã«ã¯æ¡å¼µåãå
ã«èªåå¤å¥ãã¦ããã¾ãããä¸è¬çã§ãªãæ¡å¼µå使ã£ã¦ããå ´åã¯--langmap
ã¨ãããªãã·ã§ã³ã使ã£ã¦ãã ãããä¾ãã°ã--langmap=HTML:+.launch
ã¿ããã«ããã¨ã.launch
ã¨ããæ¡å¼µåã®ãã¡ã¤ã«ãHTMLã¨ãã¦æ±ãã¾ãã
ãVimã®è¨å®ãã¡ã¤ã«(.vimrc)ã«ã¯ä»¥ä¸å ãã¦ããã¨ãã便å©ããããã¾ãã
" tagsã¸ã£ã³ãã®æã«è¤æ°ããæã¯ä¸è¦§è¡¨ç¤º nnoremap <C-]> g<C-]>
ãctagsã¯ããã°ã©ã ãä¿®æ£ããããå®æçã«å®è¡ããå¿ è¦ãããã®ã§æ³¨æãã ãããèªååãããããªè¨å®ãããã¾ãããç§ã¯ããã¾ã§ã¯ãããã¨ãã©ãèªåã§æåã§ããããã«ãã¦ãã¾ãã
å®æ½ä¾
ãã¨ãããã以ä¸ããããè¦ãã¦ããã°ä¾¿å©ãã®çé±ã¯æãããããã¨æãã¾ãã
tags
ãã¡ã¤ã«ããããã£ã¬ã¯ããªã§Vim
ãèµ·åVimã®ãã¼ãã«ã¢ã¼ãã§
:tag <filename>
ãå®è¡ããã¨ä¸æ°ã«ç®çã®ãã¡ã¤ã«ãéãã¾ãã便å©ããã¡ã¤ã«åã¯Tabè£å®ãããã¾ãããã®æ©è½ã使ç¨ããã«ã¯ctag
ã«--extra=+f
ãªãã·ã§ã³ãå¿ è¦ã§ããå®ç¾©ããã¯ã©ã¹ãé¢æ°åã®ä¸ã§
Ctrl+]
ã§ãã¯ã©ã¹ãé¢æ°ã®å®ç¾©å ã«ç§»åã便å©åã®å ´æã«æ»ãæã¯
Ctrl+t
C-w}
ã§ãã¬ãã¥ã¼ã¦ã£ã³ãã¦ãéãããã¬ãã¥ã¼ã¦ã£ã³ãã¦ã¯C-w C-z
ãããã¯:pc
ã§éãããã¨ãã§ãã¾ã
åèãªã³ã¯
- ctagsを使ってVimでCode Readingを加速する - TIM Labs
- ctagsをちゃんと使う
- Vimでctagsを利用してタグジャンプする | WEBサービス創造記
- Easily switch between source and header file | Vim Tips Wiki | FANDOM powered by Wikia
- vimgrepとQuickfix知らないVimmerはちょっとこっち来い
- ctagsと連携するように環境を構築する
- Vim でタグジャンプを使ってみる - Archiva