1

HTMLファイル内の次の空のタグペアにタブで移動する機能がどこから来ているのかわかりません。完全に無効にしたいのですが。

問題は、SuperTabとSnipMateを一緒に使用する場合にのみ発生します。SuperTabタブを削除すると、通常の展開に戻ります。SnipMateを削除すると、タブは完了の表示に戻ります。

過去に私は両方ともうまく働いていました、そしてもう一度やりたいです。

私が使用しているもの:

http://github.com/msanders/snipmate.vim
http://github.com/scrooloose/snipmate-snippets
http://github.com/ervandew/supertab

vim-update-bundlesを使用します。両方のデフォルト構成。私が有効にした他のオプションは構文です。自動インデント。smartindent。Expandtab。互換性がありません。ファイルタイプインデントプラグイン。

4

2 に答える 2

2

SnipMate と SuperTab はどちらも使用します⇥</kbd>, that makes their combination very annoying and unpredictable.

何年にもわたる TextMate の後、⇥</kbd> expansion was a habit I couldn't/didn't want to drop so I ditched SuperTab quickly and learned to love Vim's native Omni Completion:

inoremap <leader>, <C-x><C-o>
inoremap <leader>: <C-x><C-f>
inoremap <leader>= <C-x><C-l>

より合理化されたエクスペリエンスのために、autocomplpopは驚くほど高速でスマートです。

于 2011-02-08T21:57:47.153 に答える
1

私のニーズに合ったソリューションはneocomplcacheです。

これは、autocomplpop、supertab、snipmateの素晴らしい組み合わせです。さて、スニペットの部分は少しバグがありますが、かなり使いやすいです。

しかし、私は使用しません⇥</kbd> to expand, the popup omnicompletion comes up after the 3rd written character. You move with ⇥</kbd> thru the list, and expand the snippets (a la textmate), with CtrlK, but you can map that to you choice.

これらは私の.vimrc設定です。

        """"""""""""""""""""""""""""""
        " => neocomplcache plugin
        """"""""""""""""""""""""""""""
        " TODO: Still need to tweak behavior with <TAB> to expand
        "       snippets, change throughout the autocompletion list

        " Use neocomplcache.
        let g:neocomplcache_enable_at_startup = 1
        " Use smartcase.
        let g:neocomplcache_enable_smart_case = 1
        " Use camel case completion.
        let g:neocomplcache_enable_camel_case_completion = 1
        " Use underbar completion.
        let g:neocomplcache_enable_underbar_completion = 1
        " Set minimum syntax keyword length.
        let g:neocomplcache_min_syntax_length = 3
        let g:neocomplcache_lock_buffer_name_pattern = '\*ku\*'
        let g:neocomplcache_snippets_dir = '~/.vim/snippet/'
        " 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.
        imap <C-k>     <Plug>(neocomplcache_snippets_expand)
        smap <C-k>     <Plug>(neocomplcache_snippets_expand)
        inoremap <expr><C-g>     neocomplcache#undo_completion()
        inoremap <expr><C-l>     neocomplcache#complete_common_string()

        " SuperTab like snippets behavior.
        imap <expr><TAB> neocomplcache#sources#snippets_complete#expandable() ? "\<Plug>(neocomplcache_snippets_expand)" : pumvisible() ? "\<C-n>" : "\<TAB>"

        " Recommended key-mappings.
        " <CR>: close popup and save indent.
        " 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()

        " 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 <expr><TAB>  pumvisible() ? "\<Down>" : "\<TAB>"
        "inoremap <expr><CR>  neocomplcache#smart_close_popup() . "\<CR>"

        " 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_omni_patterns')
            let g:neocomplcache_omni_patterns = {}
        endif
        let g:neocomplcache_omni_patterns.ruby = '[^. *\t]\.\w*\|\h\w*::'
        "autocmd FileType ruby setlocal omnifunc=rubycomplete#Complete
        let g:neocomplcache_omni_patterns.php = '[^. \t]->\h\w*\|\h\w*::'

        au BufNewFile,BufRead *.snip set syntax=snippet ft=snippet foldmethod=indent
于 2011-02-09T05:52:55.213 に答える