# neocomplcache **Repository Path**: wangweiHPC/neocomplcache ## Basic Information - **Project Name**: neocomplcache - **Description**: vim 的自动补全插件 - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: release - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2022-12-14 - **Last Updated**: 2022-12-15 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README **neocomplcache** ================= Note: It is not maintained well. You should use Deoplete instead. https://github.com/Shougo/deoplete.nvim Description ----------- neocomplcache is the abbreviation of "neo-completion with cache". It provides keyword completion system by maintaining a cache of keywords in the current buffer. neocomplcache could be customized easily and has a lot more features than the Vim's standard completion feature. If you use Vim 7.3.885 or above with if\_lua feature, you should use neocomplete. It is faster than neocomplcache. https://github.com/Shougo/neocomplete.vim Installation ============ * Extract the file and put files in your Vim directory (usually ~/.vim/ or Program Files/Vim/vimfiles on Windows). * Execute `|:NeoComplCacheEnable|` command or `let g:neocomplcache_enable_at_startup = 1` in your `.vimrc`. Not in `.gvimrc`(`_gvimrc`)! Caution ------- Because all variable names were changed in neocomplcache Ver.5, it is not backwards compatible. If you want to upgrade, you should use the following script from Mr.thinca. http://gist.github.com/422503 Snippets feature(snippets\_complete source) was split from Ver.7. If you used it, please install neosnippet source manually. https://github.com/Shougo/neosnippet Screen shots ============ Original filename completion. ----------- ![Original filename completion.](http://1.bp.blogspot.com/_ci2yBnqzJgM/TD1O5_bOQ2I/AAAAAAAAADE/vHf9Xg_mrTI/s1600/filename_complete.png) Omni completion. ---------------- ![Omni completion.](http://2.bp.blogspot.com/_ci2yBnqzJgM/TD1PTolkTBI/AAAAAAAAADU/knJ3eniuHWI/s1600/omni_complete.png) Completion with vimshell(http://github.com/Shougo/vimshell). ------------------------------------------------------------ ![Completion with vimshell(http://github.com/Shougo/vimshell).](http://1.bp.blogspot.com/_ci2yBnqzJgM/TD1PLfdQrwI/AAAAAAAAADM/2pSFRTHwYOY/s1600/neocomplcache_with_vimshell.png) Vim completion ------------------------------------------------------------ ![Vim completion.](http://1.bp.blogspot.com/_ci2yBnqzJgM/TD1PfKTlwnI/AAAAAAAAADs/nOGWTRLuae8/s1600/vim_complete.png) Setting examples ```vim "Note: This option must set it in .vimrc(_vimrc). NOT IN .gvimrc(_gvimrc)! " Disable AutoComplPop. let g:acp_enableAtStartup = 0 " Use neocomplcache. let g:neocomplcache_enable_at_startup = 1 " Use smartcase. let g:neocomplcache_enable_smart_case = 1 " Set minimum syntax keyword length. let g:neocomplcache_min_syntax_length = 3 let g:neocomplcache_lock_buffer_name_pattern = '\*ku\*' " Enable heavy features. " Use camel case completion. "let g:neocomplcache_enable_camel_case_completion = 1 " Use underbar completion. "let g:neocomplcache_enable_underbar_completion = 1 " Define dictionary. let g:neocomplcache_dictionary_filetype_lists = { \ 'default' : '', \ 'vimshell' : $HOME.'/.vimshell_hist', \ 'scheme' : $HOME.'/.gosh_completions' \ } " Define keyword. if !exists('g:neocomplcache_keyword_patterns') let g:neocomplcache_keyword_patterns = {} endif let g:neocomplcache_keyword_patterns['default'] = '\h\w*' " Plugin key-mappings. inoremap neocomplcache#undo_completion() inoremap neocomplcache#complete_common_string() " Recommended key-mappings. " : close popup and save indent. inoremap =my_cr_function() function! s:my_cr_function() return neocomplcache#smart_close_popup() . "\" " For no inserting key. "return pumvisible() ? neocomplcache#close_popup() : "\" endfunction " : completion. inoremap pumvisible() ? "\" : "\" " , : close popup and delete backword char. inoremap neocomplcache#smart_close_popup()."\" inoremap neocomplcache#smart_close_popup()."\" inoremap neocomplcache#close_popup() inoremap neocomplcache#cancel_popup() " Close popup by . "inoremap pumvisible() ? neocomplcache#close_popup() : "\" " For cursor moving in insert mode(Not recommended) "inoremap neocomplcache#close_popup() . "\" "inoremap neocomplcache#close_popup() . "\" "inoremap neocomplcache#close_popup() . "\" "inoremap neocomplcache#close_popup() . "\" " Or set this. "let g:neocomplcache_enable_cursor_hold_i = 1 " Or set this. "let g:neocomplcache_enable_insert_char_pre = 1 " AutoComplPop like behavior. "let g:neocomplcache_enable_auto_select = 1 " Shell like behavior(not recommended). "set completeopt+=longest "let g:neocomplcache_enable_auto_select = 1 "let g:neocomplcache_disable_auto_complete = 1 "inoremap pumvisible() ? "\" : "\\" " Enable omni completion. autocmd FileType css setlocal omnifunc=csscomplete#CompleteCSS autocmd FileType html,markdown setlocal omnifunc=htmlcomplete#CompleteTags autocmd FileType javascript setlocal omnifunc=javascriptcomplete#CompleteJS autocmd FileType python setlocal omnifunc=pythoncomplete#Complete autocmd FileType xml setlocal omnifunc=xmlcomplete#CompleteTags " Enable heavy omni completion. if !exists('g:neocomplcache_force_omni_patterns') let g:neocomplcache_force_omni_patterns = {} endif let g:neocomplcache_force_omni_patterns.php = '[^. \t]->\h\w*\|\h\w*::' let g:neocomplcache_force_omni_patterns.c = '[^.[:digit:] *\t]\%(\.\|->\)' let g:neocomplcache_force_omni_patterns.cpp = '[^.[:digit:] *\t]\%(\.\|->\)\|\h\w*::' " For perlomni.vim setting. " https://github.com/c9s/perlomni.vim let g:neocomplcache_force_omni_patterns.perl = '\h\w*->\h\w*\|\h\w*::' ```