marching.vim ãããããã¨æ¹è¯ãã
å
æ¥ Vim で C++ のコード補完を行うプラグインをつくったã®ã§ãããããããã¨æ¹è¯ãã¾ããã
ãã£ãã·ã³ã°å¨ãã¯ã ãã¶ãã·ã«ãªã£ãããããªããããã¨ã
[主ãªæ¹è¯ç¹]
- ãã£ãã·ã³ã°å¨ãã®å¼·å
- ãããã¡ãã¨ã«ãã£ãã·ã³ã°ãä¿æããããã«ãã
- åæçã®å®è£ ã追å
- è£å®ã¦ã£ã³ãã¦ã«è¡¨ç¤ºãããæ å ±ã追å
- g:marching_enable_refresh_always ãªãã·ã§ã³ã®è¿½å
[ãã£ãã·ã³ã°å¨ãã®å¼·å]
ãã£ãã·ã³ã°å¨ããå¼·åãã¾ããã
ä¾ãã°ã
value.
std::
ã®ãããªã³ã¼ãè£å®ãè¡ã£ãå ´åããvalue.ãããstd::ãããã¼ã¨ãããã£ãã·ã³ã°ãè¡ãã¾ãã
ããã«ããããã®ãããã¡ã§æ¬¡ã«ãvalue.ãããstd::ãã§ã³ã¼ãè£å®ãè¡ã£ãå ´åã«ãã£ãã·ã³ã°ã使ç¨ããã®ã§é«éã«ã³ã¼ãè£å®ãå®è¡ããã¾ãã
ãã®ãã£ãã·ã¥ãã¼ã¿ã¯ãããã¡ãã¨ã«ä¿æããã¾ãã
ã¾ãããã£ãã·ã¥ãã¼ã¿ã¯åºæ¬çã«ã¯åé¤ãããªãã®ã§ã¯ã©ã¹ã®ã¡ã³ããå¤ãã£ãããã¦ãçµæãå¤ãããã¨ã¯ããã¾ããã
ãã®ãã£ãã·ã³ã°ãåé¤ãããå ´åã¯ã
:MarchingBufferClearCache
ã§ãããã¡å ã®ãã£ãã·ã¥ããã¹ã¦åé¤ãããã¨ãã§ãã¾ãã
ã¾ãã
<Plug>(marching_force_start_omni_complete)
ã使ç¨ããã¨è£å®æ å ±ã®ååå¾ãè¡ã£ã¦ããã³ã¼ãè£å®ãè¡ããã¨ãã§ãã¾ãã
ãããã¯æ¬¡ã®ãããªãããã³ã°ããã¦ä½¿ç¨ãã¦ãã¾ãã
" ã³ã¼ãè£å®ãè¡ã " 2åç®ä»¥éã¯ãã£ãã·ã¥ãããã¼ã¿ã使ç¨ãã imap <C-x><C-o> <Plug>(marching_start_omni_complete) " è£å®æ å ±ã®ååå¾ãè¡ã£ã¦ããã³ã¼ãè£å®ãè¡ã imap <C-x><C-o> <Plug>(marching_force_start_omni_complete)
注æç¹ã¨ãã¦ããããã¡å
¨ä½ã§è£å®ãã¼ã¿ãä¿æãã¦ãããããå¥ã®é¢æ°å
ã§ååã®å¤æ°ã使ç¨ããå ´åã«åãè£å®ãã¼ã¿ã使ç¨ããã¾ãã
ããããåé¡ãåé¿ãããã®ã§ããã°ä¸è¨ã®ãããªè¨å®ãè¡ãã¨ããã¨æãã¾ãã
" filetype=cpp 㧠insert mode ããæãããã³ã«ãã£ãã·ã¥ãåé¤ãã augroup cpp autocmd! autocmd FileType cpp call s:cpp() augroup END function! s:cpp() augroup filetype-cpp autocmd! * <buffer> autocmd InsertLeave <buffer> MarchingClearCache augroup END endfunction
[åæçã®å®è£ ã追å ]
éåæã§ã¯ãªãã¦ãåæã§è£å®å¦çãè¡ãå®è£
ã追å ãã¾ããã
ãã®å®è£
ã§ã¯ reunions.vim ã vimproc.vim ã«ã¯ä¾åãã¾ããã
ãã®å®è£
ã¯ä»¥ä¸ã®è¨å®ãè¡ããã¨ã§ä½¿ç¨ããäºãã§ãã¾ãã
let g:marching_backend = "sync_clang_command"
ãã®è¨å®ãè¡ãã¨è£å®æã«å¦çãçµããã¾ã§ã®å¾
ã¡å¦çãå
¥ãã¾ãã
Boost ãªã©è£å®ã«æéããããã©ã¤ãã©ãªã使ç¨ããå ´åã«ã¯æ³¨æãã¦ä¸ããã
ã¾ãããã®è¨å®ã§ãä¸è¨ã®ãã£ãã·ã¥å¦çã¯åæ§ã«è¡ãããã®ã§2åç®ä»¥éã¯ããã«çµæã表示ããã¾ãã
[è£å®ã¦ã£ã³ãã¦ã«è¡¨ç¤ºãããæ å ±ã追å ]
è£å®ã¦ã£ã³ãã¦ã«è¡¨ç¤ºãããæ
å ±ã追å ãã¾ããã
ä»ã¾ã§ã¯ååããåºã¦ããªãã£ããã§ãããåãã·ã°ããã£ãªããã表示ããããã«ãã¾ããã
表示ã«é¢ãã¦ã¯ã¾ããªã«ãå¤æ´ããããããã¾ããã
ã§ããã°ã¦ã¼ã¶å´ã§èªç±ã«ç·¨éã§ããããã«ãããã¨ã¯æããã§ããã©ãâ¦ã
[g:marching_enable_refresh_always ãªãã·ã§ã³ã®è¿½å ]
g:marching_enable_refresh_always ãªãã·ã§ã³ã®è¿½å ã追å ãã¾ããã
ãã®ãªãã·ã§ã³ã« 1 ãè¨å®ããã¨ãã¼å
¥åãè¡ããã³ã«æ´æ°å¦çãè¡ãããã«ãªãã¾ãã
ä¾ãã°ã'updatetime' ã大ããå ´åããã¼å
¥åãè¡ããã³ã«æ´æ°å¦çãè¡ãããã«ããããè£å®ã¦ã£ã³ãã¦ãåºã¦ããç¶æ
ã§æ´æ°ãããå ´åã«æå¹ã§ãã
ãã ãneocomplete.vim å¨ãã¨ã®å
¼ãåããããã®ã§ãããããããããã辺ã®ä»æ§ã¯ä»å¾å¤ããå¯è½æ§ãããã¾ãã
ã¨ããããããªæãã§æ¹è¯ãã¾ããã
ãã£ãã·ã¥å¨ãã¯ããã¡ãããªããããããã©ãã ããããããªæãããªã¼ã¨ã
ãã®ä»ããªã«ãåé¡ãè¦æãããã° Issues çã§æãã¦ããããã¨å©ããã¾ãã
[ä»å¾ã®äºå®]
- ã¹ããããï¼neosnippetï¼ã¸ã®å¯¾å¿
- é¢æ°çãè£å®ããæã«ã¸ã£ã³ããã¼ã¯ãä¸ç·ã«æ¿å ¥ãã
- neocomplete.vim ã¨ã®é£æº
- ãã£ãã·ã¥ã®èªååé¤
- include ãã¡ã¤ã«ãå¤æ´ãããå ´åã¨ã
- ã¹ã³ã¼ãï¼é¢æ°ã namespaceï¼ãèæ ®ãããã£ãã·ã³ã°
- ãã®ä»éå¤ãªæ©è½
- ãã£ãã·ã³ã°ããªããã¼ã¯ã¼ãã®è¨å®ã¨ã