vimã§Groovyã®ã³ã¼ããæ¸ããããã«æºåãããã¨æ å ±ãæ¼ã£ã¦ã¿ãã®ã ãã©ãå¾®å¦ã«å 容ãå¤ãããã ã
ä¾ãã°Groovyの公式サイトã«vimç¨ã®ãã©ã°ã¤ã³ã2ã¤æ²è¼ããã¦ããã®ã ãã©ãæè¿ã®vimï¼ä¾ãã°Kaoriyaçï¼ã使ã£ã¦ãããªãã·ã³ã¿ãã¯ã¹ãã¤ã©ã¤ãç¨ã®ãã©ã°ã¤ã³ã¯å梱ããã¦ããã®ã§å ¥ããå¿ è¦ã¯ãªããããã« id:eel3:20120728:1343451534 ã§æ¸ããããã«ftpluginã®æ¹ã®groovy.vimã¯å¾®å¦ã«åé¡ãããã
ãã®ã¾ã¾ã§ã¯ç§ã®ããã«vimã®è¨å®å¨ãã«è©³ãããªã人ãå¤ãæ å ±ãéµåã¿ã«ãã¦ãã¾ãã
- ãã¼ãããvimã§Groovyã®åå¼·ãã¡ãããã¼
- ãã¼ãããgroovy.vimã2ã¤ãå ¥ãã¡ãããã¼
- ï¼Groovyã®ãµã³ãã«ãåçµãå§ãã¦30ç§çµéï¼
- Groovyã®ã³ã¼ãæ¸ãã®ã«vimãå ¨ã使ããªã件
- ãã£ã±ãæ代ã¯ââ*1ã ããï¼
ââãããªé¢¨ã«éæ¥çã«ä»ã®ã¨ãã£ã¿ã®ã·ã§ã¢ãæ¼ãä¸ãã¦ãã¾ãã®ã§ã¯ãªããã¨å¿é ã§å¤ãç ããæèµ·ãããªãã
ãããããããã¯ãããã¨ã¯ããvimæã®ä¿¡è Lv.2ã¨ãã¦ä½ã¨ãããã°ãä¿¡æã¨ãããã®ã¯ä¿¡ãã¦ããªã人ã ã«ããæåããã®ã§ãããªã
1. Groovyãã¤ã³ã¹ãã¼ã«ãã
å 容ã¯å²æãã¡ãªã¿ã«æè¿ã¯GROOVY_HOMEãå®ç¾©ããªãã®ãå®èª¬ãããã
2. vimã¯æ°ãããã¼ã¸ã§ã³ã使ã
ã¾ãLinuxã¨ã使ã£ã¦ãã¦ãªãã¸ããªã®vimãå¤ãããã¨ãã£ã¦ç¡çãã¦ã½ã¼ã¹ãããã«ãããå¿ è¦ã¯ãªããã©ãWindows使ããªãæ°ãããã¼ã¸ã§ã³ã®ãã¤ããªã«ä¹ãæããã»ããããã¨æãã
ä½æ ãªãæè¿ã®vimã¯Groovyã®ã·ã³ã¿ãã¯ã¹ãã¤ã©ã¤ããæå¹ã§ä¸ã¤æ¡å¼µåã .groovy ãªãã¡ã¤ã«ãGroovyã®ã³ã¼ãã¨ãã¦èªåçã«èªèããããã
ããä¸å¹¸ã«ãGroovyã®ã·ã³ã¿ãã¯ã¹ãã¤ã©ã¤ããæå¹ãããªãå¤ãvimã使ããªãã¦ã¯ãªããªãã®ãªããftdetect ã®ä¸ã«ä»¥ä¸ã®ãããªå 容㮠groovy.vim ãç½®ãã¦ã
au BufNewFile,BufRead *.groovy setf groovy
ãã®ä¸ã§å¤ããã©ãã®シンタックスハイライトの定義ファイルã使ãããåã¯ä¸ãå «ãKaoriyaçãããã®ã¢ã¼ã«ã¤ãããGroovyç¨ã®å®ç¾©ãã¡ã¤ã«ãæãåºãã¦ä½¿ã£ã¦ã¿ããã¨ã«ãªãã
3. groovy.vimï¼ftpluginã®æ¹ï¼ãå ¥ãã¦èªåã¤ã³ãã³ããæå¹ã«ãã
これãèªåã¤ã³ãã³ãã¯ä¸å®å ¨ããããã©ãç¡ãããã¯ãã·ã
ã¡ãªã¿ã«ãã°ä¿®æ£çã®ãããã id:eel3:20120728:1343451534 ã«è¼ãã¦ããã®ã§ãèå³ããã人ã¯é©ç¨ãã¦ã¿ã¦ãããããã
4. ã¤ã³ãã³ãå¹ ãªã©ãå¤ãããå ´å
Groovyã®ã³ã¼ããç·¨éããæã ãã¤ã³ãã³ãå¹ ãå¤ãããã¨ãã¿ãï¼ã¹ãã¼ã¹ã§ã¤ã³ãã³ããããå ´åã¯ãä¾ãã°ä»¥ä¸ã®ãããªå 容ã®ãã¡ã¤ã« groovy.vim ã after/ftplugin ã«ç½®ãã¦ããã
if !exists("b:did_ftplugin") finish endif setlocal expandtab setlocal tabstop=2 shiftwidth=2 softtabstop=2 " Undo the stuff we changed let b:undo_ftplugin = (exists('b:undo_ftplugin') ? b:undo_ftplugin . ' | ' : '') \ . "setlocal et< ts< sw< sts<"
ã¡ãªã¿ã«ããã¯ãã¹ãã¼ã¹ã§ã¤ã³ãã³ããå¹ ã¯åè§ã¹ãã¼ã¹2ååãã¨ããè¨å®ãã¿ãã§ã¤ã³ãã³ããããã®ãªã expandtab ã§ã¯ãªã noexpandtab ã ããã*2ãã¤ã³ãã³ãå¹ ãå¤ãããå ´å㯠tabstop ãã®ä»ã®å¤ãå¤ãããã¨ã«ãªãã
5. quickrun.vim
groovy.vimã§ãç·¨éä¸ã®ã¹ã¯ãªãããã¡ã¤ã«ãå®è¡ãããã³ã³ãã¤ã«ããããããã¨ãå¯è½ã ãã©ãæè¿ã¯quickrun.vimã¨ã使ããããã
ç§ã¯ã¾ã 使ã£ã¦ããªããã©ãã¡ãã£ã¨ã¿ãæãã ã¨quickrun.vimã®æ¹ãæè»ããã ã