Skip to content

neocomplcache tips:

rykka edited this page Mar 30, 2011 · 19 revisions
  1. The filename completion considers ‘cdpath’.
  2. neocomplcache implemented short filename completion.
    Example: When you supplement “/usr/local/bin/hoge”, you input an initial, “/u/l/b”.
  3. Disable auto popup
    let g:neocomplcache_disable_auto_complete = 1
  4. Popup on <Tab>.
          
            inoremap <expr><TAB> pumvisible() ? "\<C-n>" : <SID>check_back_space() ? "\<TAB>" : "\<C-x>\<C-u>"
            function! s:check_back_space()"{{{
            let col = col('.') - 1
            return !col || getline('.')[col - 1] =~ '\s'
            endfunction"}}
    
  5. Auto complete to common string and show available variants (if any).
    inoremap <expr><C-l> neocomplcache#complete_common_string()
  6. Highlighting first candidate.
    let g:neocomplcache_enable_auto_select = 1
    inoremap <expr><C-h> neocomplcache#smart_close_popup().“\<C-h>”
    inoremap <expr><BS> neocomplcache#smart_close_popup().“\<C-h>”
  7. Choose candidate with <CR>.
    inoremap <expr><CR> neocomplcache#smart_close_popup() . “\<CR>”