Подтвердить что ты не робот

С помощью VIM совместно используйте snipMate и pydiction (делитесь клавишей <tab>?)

Я пытаюсь использовать snipMate и pydiction в vim вместе - однако оба используют ключ <tab>, чтобы выполнить их genius-auto-completion-snippet-rendering-goodness-that-I-so-desire.

Когда pydiction установлен, snipMate перестает работать. Я предполагаю, потому что они не могут владеть ключом <tab>. Как я могу заставить их работать вместе?

Я бы не пропустил отображение одного из них на другой ключ, но я не уверен, как это сделать... (может быть, pydiction к ключу <ctrl-n>, чтобы он имитировал автозаполнение vim?).

Вот соответствующий .vimrc:

filetype indent plugin on 

autocmd FileType python set ft=python.django 
autocmd FileType html set ft=html.django_template 

let g:pydiction_location = '~/.vim/ftplugin/pydiction-1.2/complete-dict'
4b9b3361

Ответ 1

Ну, это из файла справки Snipmate:)

                                                              *snipMate-remap*
snipMate does not come with a setting to customize the trigger key, but you
can remap it easily in the two lines it defined in the 'after' directory
under 'plugin/snipMate.vim'. For instance, to change the trigger key
to CTRL-J, just change this: >

 ino <tab> <c-r>=TriggerSnippet()<cr>
 snor <tab> <esc>i<right><c-r>=TriggerSnippet()<cr>

to this: >
 ino <c-j> <c-r>=TriggerSnippet()<cr>
 snor <c-j> <esc>i<right><c-r>=TriggerSnippet()<cr>

Ответ 2

В качестве альтернативы вы можете редактировать ~/.vim/after/ftplugin/python_pydiction.vim и измените Tab на другое:

" Make the Tab key do python code completion:
inoremap <silent> <buffer> <Tab> 
         \<C-R>=<SID>SetVals()<CR>
         \<C-R>=<SID>TabComplete('down')<CR>
         \<C-R>=<SID>RestoreVals()<CR>

" Make Shift+Tab do python code completion in the reverse direction:
inoremap <silent> <buffer> <S-Tab> 
         \<C-R>=<SID>SetVals()<CR>
         \<C-R>=<SID>TabComplete('up')<CR>
         \<C-R>=<SID>RestoreVals()<CR>

Ответ 3

Я считаю, что способ смены ключа триггера, возможно, изменился, так как ответ был задан в 2009 году, но он найден в том же каталоге, а именно: "after/plugin/snipMate.vim". Я также нашел его в файле справки:

 *snipMate-trigger*
snipMate comes with a setting to configure the key that is used to trigger
snipMate. To configure the key set g:snips_trigger_key to something other than
<tab>,e.g. <c-space> use:

 let g:snips_trigger_key='<c-space>'