2

I've installed the UltiSnips and vim-snippets plugins. In order for the snippets to work, I need to activate vim-snippets for UltiSnips in my .vimrc file.

Vundle version for snipmate looks like this:

ActivateAddons vim-snippets snipmate

I need to do the same, but for Pathogen and UltiSnips instead of snipmate.

How can I do it?

Update 1: My current .vimrc (UltiSnips doesn't work).

set encoding=utf-8
set fileencoding=utf-8
syntax on
execute pathogen#infect()
filetype plugin indent on
let g:UltiSnipsJumpForwardTrigger="<c-b>"
let g:UltiSnipsJumpBackwardTrigger="<c-z>"

I'm using Windows 10 (Russian locale, German keyboard layout).

Update 2: With this .vimrc file, snippet expansion works in gVim, but not in Vim.

set nocompatible
set encoding=utf-8
set fileencoding=utf-8
syntax on
execute pathogen#infect()
filetype plugin indent on
let g:UltiSnipsJumpForwardTrigger="<c-b>"
let g:UltiSnipsJumpBackwardTrigger="<c-z>"
let g:UltiSnipsSnippetsDir = $HOME.'/vimfiles/bundle/vim-snippets/UltiSnips'
  • You don't, Pathogen doesn't need explicit activations. What you need to do is read UltiSnips docs and configure it (mainly set g:UltiSnipsSnippetsDir) and the triggers. – Sato Katsura Jul 22 '16 at 11:42
2

I don't think you have to do that for Pathogen + UltiSnips + vim-snippets. I have such setup and only thing in my vimrc is let g:UltiSnipsExpandTrigger="<c-j>". Both plugins are in ~/.vim/bundle.

  • Does <c-j> mean that I have to press Ctrl-j to expand a snippet? – DP_ Jul 22 '16 at 11:55
  • Yes, I think it was in conflict in my setup with other plugin. From the doc The variables with their default values are: > g:UltiSnipsExpandTrigger <tab>, so it defaults to <tab> – grodzik Jul 22 '16 at 11:58
  • Thanks. Do you see any errors im my .vimrc file (see update 1 above) ? – DP_ Jul 22 '16 at 12:05
  • Do you have Python installed? Read the requriments from the docs. Does your Vim supports Python? – grodzik Jul 22 '16 at 12:18
  • Yes to both questions. – DP_ Jul 22 '16 at 12:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.