neocomplcache v3.06 ãããã¤ã³ã¯ã«ã¼ãè£å®(include_complete.vim)ãå®è£ ããããä½è ã® Shougo ããä¸æ¼ãã®æ©è½ãªã®ã ããã©ããã£ãæ©è½ãªã®ãããããããªã人ãããã¨æãã®ã§åæã«è§£èª¬ãã¦ã¿ããééã£ã¦ãããçªã£è¾¼ã¿ããããã
include ã¨ã¯
Vim ã«ã¯æ¨æºã§ 'include' ãªã©ã®ãªãã·ã§ã³ãããããã®ãªãã·ã§ã³ã§ C ã® #include ã Java ã® import ãæ¢ãã¦ãç¾å¨ç·¨éä¸ã®ãããã¡ã¨é¢ä¿ãããããªãã¡ã¤ã«ãããã¼ã¯ã¼ããæ¤ç´¢ã§ãããããã
ã¤ã³ã¯ã«ã¼ãè£å®ã¨ã¯
neocomplcache ã®ã¤ã³ã¯ã«ã¼ãè£å®ã¯ããããã®æ©è½ãå©ç¨ãã¦é¢ä¿ãããããªãã¡ã¤ã«ãæ¢ç´¢ããããããè£å®åè£ãåºãã¦ãã¾ããã¨ããæ©è½ããã¡ããçµæããã£ãã·ã¥ãã¦ããã®ã§ã1 度ãã£ãã·ã¥ãã¦ãã¾ãã° Vim æ¨æºã®ããéãåä½ããã
ã©ãããã°ä½¿ããã®ï¼
ã¾ãã¯ã¤ã³ã¯ã«ã¼ããã¦ãããã¡ã¤ã«ã®ãã¡ã¤ã«åãæ£ããèªèãã¦ãããªãã¨è©±ã«ãªããªãããã®ããã«ã¯ãåãªãã·ã§ã³ãç解ãã¦æ£ããè¨å®ããå¿
è¦ãããã
éè¦ãªã®ã¯ä»¥ä¸ã®ãªãã·ã§ã³ãæ¦è¦ã¯æ¬å½ã«æ¦è¦ãªã®ã§è©³ç´°ã¯ :help ãåç
§ã®ãã¨ã
ã¡ãªã¿ã« include_complete.vim ã§ã¯å°ç¨ã®ãªãã·ã§ã³ã使ã£ã¦å¥ã®å¤ã使ããã¨ãã§ããããã®ãªãã·ã§ã³ã«ã¯ filetype ããã¼ã¨ããè¾æ¸ãæå®ããã
ãªãã·ã§ã³ | æ¦è¦ | include_complete ãªãã·ã§ã³ |
---|---|---|
'include' | ãã®æ£è¦è¡¨ç¾ã«ãããããç®æã®å¾ãã«ããæååãã¤ã³ã¯ã«ã¼ããããã¡ã¤ã«åã¨ãã¦èªèããã | g:neocomplcache_include_patterns |
'includeexpr' | 'include' ã§æ½åºããæååããã¡ã¤ã«åã«å å·¥ããããã®å¼ãJavaã§.ã/ã«å¤ãããã¨ãã | g:neocomplcache_include_exprs |
'path' | è¦ã¤ãã£ããã¡ã¤ã«ãæ¢ããã¹ãã¹ãã¼ã¹ãå«ããã£ã¬ã¯ããªã¯ \ ã§ã¨ã¹ã±ã¼ããã¦ããå¿ è¦ãããã | g:neocomplcache_include_paths |
'suffixesadd' | ãã¡ã¤ã«ãæ¢ãéã«ããã®å¤ãæ«å°¾ã«è¿½å ãããã¡ã¤ã«ãæ¢ãã大æµã¯æ¡å¼µåãæå®ãããã | ãªã |
ãããã®ãªãã·ã§ã³ã¯å¤ãã®å ´åã¯æ¨æºã® filetype ãã©ã°ã¤ã³ãè¨å®ãã¦ãããã
ãã ãä¸ã«ã¯æ¨æºã§ã¯ãã¾ãè¨å®ãããªããªãã·ã§ã³ããã模æ§ã以ä¸ã¯ç§ããã£ã¨èª¿ã¹ããã®ã*1
è¨èª(filetype) | è¨å®ãããªãå¤ | è¨å®ä¾ |
---|---|---|
java | 'include' | setlocal include=^import |
python | 'path' | let &l:path = system('python -', 'import sys;sys.stdout.write(",".join(sys.path))') |
haskell | 'include' | setlocal include=^import |
haskell | 'includeexpr' | setlocal include=substitute(v:fname,'\\.','/','g') |
haskell | 'suffixesadd' | setlocal suffixesadd=.hs |
ãã®ä»ãä¾ãã° Perl 㯠'path' ã®å¤ä¸ã®ã¹ãã¼ã¹ãã¨ã¹ã±ã¼ããã¦ããªãã£ããã¨ããå æ¸ãªè¨å®ãè¦ãããã
ãããã®è¨èªã使ãå ´åã¯è¨å®ãè¦ç´ããæ¹ããããããè¨å®ä¾ã追å ãããå ´å㯠~/.vim/after/ftplugin/{filetype}.vim ã«æ¸ãã
ã¤ã³ã¯ã«ã¼ããã¡ã¤ã«ãããã¼ã¯ã¼ããæ½åºãã
ã¤ã³ã¯ã«ã¼ããã¡ã¤ã«ãè¦ã¤ãã£ãããinclude_complete.vim ã¯ãããããã¼ã¯ã¼ããæ½åºããããã¼ã¯ã¼ãã®æ½åºã¯ä»¥ä¸ã®é åºã§è¡ãªãããã
- ãã£ãã·ã¥ãããã°ããã使ãã
- ctags ã³ãã³ãã使ãã
- è¨èªã ctags ã«å¯¾å¿ãã¦ããªããããã㯠ctags ãã¤ã³ã¹ãã¼ã«ããã¦ããªãå ´åã¯èªåã§ãã¼ã¯ã¼ããæ¢ãã
ctags ã®å®è¡ã®é㯠filetype æ¯ã«è¿½å ã®å¼æ°ãæå®ã§ãããg:neocomplcache_ctags_arguments_list ã«ãä¾ã«ãã£ã¦ filetype ããã¼ã«è¿½å ãããå¼æ°ãæå®ãã¦ããã°ããããã¡ãã ctags æ¨æºã®è¨å®ãã¡ã¤ã«ã«æ¸ãã¦ãåé¡ãªãã
å®éã«ä½¿ã£ã¦ã¿ã
ãããªæããPerlã®ä¾ã
ãã®ä»
- ã¤ã³ã¯ã«ã¼ããã¹ã®æ¤ç´¢ã¯ãfiletype 決å®ç´å¾ã¨ãã¡ã¤ã«ä¿åç´å¾ã«å ¨ãããã¡ãä¸æ¬ã§è¡ã£ã¦ãã模æ§ã
- ååã¯ãã£ãã·ã¥ãåãã®ã§å°ãæéãããããæåã¯å°ãææ ¢ãã¨ã¯ãã Shougo ãããé ãã®ãæ°ã«ãã¦ãããããªã®ã§ãã®ãã¡æ¹è¯ããããã?
ãã¡ãã¨è¨å®ããããã°ããªã使ããæ©è½ã ã¨æãã®ã§ãç©æ¥µçã«ä½¿ã£ã¦ã¿ããï¼ã¨ãã« 'path' ã¯ãããã¡ãã¼ã«ã«å¤æ°ãªã®ã§å·¥å¤«ã®ãã©ããããã
追è¨: ãªãã·ã§ã³åã 2011å¹´2æ5æ¥æç¹ã®ãã®ã«æ´æ°
*1:ããªãé©å½ã«èª¿ã¹ãã®ã§ãã¾ãéµåã¿ã«ããªãã§ã