Created
August 14, 2013 07:15
-
-
Save violetyk/6228681 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" neocomplcache.vim {{{ | |
" パラメータ設定 {{{ | |
" Disable AutoComplPop. | |
let g:acp_enableAtStartup = 0 | |
" Use neocomplcache. | |
let g:neocomplcache_enable_at_startup = 1 | |
" 入力に大文字が入力されていたら、大文字小文字の区別をする | |
let g:neocomplcache_enable_smart_case = 0 | |
" 大文字小文字区切りの曖昧検索をするかどうか。DT = D*T* -> DateTime | |
let g:neocomplcache_enable_camel_case_completion = 0 | |
" アンスコ区切りであいまい検索を行うかどうか。m*_s -> mb_substr | |
let g:neocomplcache_enable_underbar_completion = 0 | |
" バッファや辞書ファイル中で、補完対象となるキーワードの最小文字数 | |
let g:neocomplcache_min_keyword_length = 3 | |
" シンタックスファイル内で補完対象となるキーワードの最小文字数。 | |
let g:neocomplcache_min_syntax_length = 3 | |
" neocomplcacheを自動的にロックするバッファ名のパターンを指定。 | |
" ku.vimやfuzzyfinderなど、neocomplcacheと相性が悪いプラグインを使用する場合に設定。 | |
let g:neocomplcache_lock_buffer_name_pattern = '\*ku\*' | |
" 自動補完を開始する文字数。 | |
let g:neocomplcache_auto_completion_start_lengh = 2 | |
" ポップアップメニューで表示される候補数。デフォルトは100。 | |
let g:neocomplcache_max_list = 30 | |
" 補完候補の一番先頭を選択しとく | |
let g:neocomplcache_enable_auto_select = 1 | |
" }}} | |
" ディレクトリ設定 {{{ | |
if has('win32') || has('win64') | |
let g:neocomplcache_dictionary_filetype_lists = { | |
\ 'default' : '', | |
\ 'vimshell' : $HOME.'/.vimshell_hist', | |
\ 'scheme' : $HOME.'/.gosh_completions', | |
\ 'php' : $VIM.'/vimfiles/dict/php.dict', | |
\ } | |
elseif has('unix') | |
" ディクショナリ | |
let g:neocomplcache_dictionary_filetype_lists = { | |
\ 'default' : '', | |
\ 'php' : $HOME.'/.vim/dict/php.dict', | |
\ } | |
" キャッシュディレクトリ | |
let g:neocomplcache_temporary_dir = '/dev/shm/' . $USER . '/.neocon' | |
endif | |
" }}} | |
" プラグインや補完関数の無効化 {{{ | |
if !exists('g:neocomplcache_keyword_patterns') | |
let g:neocomplcache_plugin_disable = {} | |
endif | |
" let g:neocomplcache_plugin_disable.tags_complete = 1; | |
" let g:neocomplcache_plugin_disable.syntax_complete = 1; | |
" let g:neocomplcache_plugin_disable.omni_complete = 1; | |
" }}} | |
" キーワード補完の設定 {{{ | |
if !exists('g:neocomplcache_keyword_patterns') | |
let g:neocomplcache_keyword_patterns = {} | |
endif | |
" 日本語を補完候補として取得しない | |
let g:neocomplcache_keyword_patterns['default'] = '\h\w*' | |
" }}} | |
" タグ補完のパターンの設定 {{{ | |
if !exists('g:neocomplcache_member_prefix_patterns') | |
let g:neocomplcache_member_prefix_patterns = {} | |
endif | |
" let g:neocomplcache_member_prefix_patterns.php = '->\|::' | |
" }}} | |
" 補完の区切り文字パターンの設定 {{{ | |
if !exists('g:neocomplcache_delimiter_patterns') | |
let g:neocomplcache_delimiter_patterns = {} | |
endif | |
let g:neocomplcache_delimiter_patterns.php = ['-\>', '::', '\'] | |
" }}} | |
" オムニ補完の設定 {{{ | |
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 | |
autocmd FileType php setlocal omnifunc=phpcomplete#CompletePHP | |
" オムニ補完のパターン | |
if !exists('g:neocomplcache_omni_patterns') | |
let g:neocomplcache_omni_patterns = {} | |
endif | |
" 言語別neocompl自動発火パターン | |
" let g:neocomplcache_omni_patterns.ruby = '[^. *\t]\.\w*\|\h\w*::' | |
let g:neocomplcache_omni_patterns.php = '[^. \t]->\h\w*\|\h\w*::' | |
" }}} | |
" キーバインド {{{ | |
" undo | |
inoremap <expr><C-g> neocomplcache#undo_completion() | |
" 共通の部分まで補完 | |
inoremap <expr><C-l> neocomplcache#complete_common_string() | |
inoremap <expr><CR> neocomplcache#smart_close_popup() ."\<CR>" | |
" <TAB>: completion. | |
inoremap <expr><TAB> pumvisible() ? "\<C-n>" : "\<TAB>" | |
" <C-h>, <BS>: close popup and delete backword char. | |
inoremap <expr><C-h> neocomplcache#smart_close_popup()."\<C-h>" | |
inoremap <expr><BS> neocomplcache#smart_close_popup()."\<C-h>" | |
" 補完を確定してポップアップを閉じる。 | |
inoremap <expr><C-y> neocomplcache#close_popup() | |
" 補完をキャンセルしてポップアップを閉じる | |
inoremap <expr><C-e> neocomplcache#cancel_popup() | |
" }}} | |
" }}} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment