I am new to using plugins with Vim. I mostly work with rails, ruby, latex and html code. I have already installed UltiSnips and vim-snippets plugins using pathogen. I would like corresponding snippets files to be available while I work with these file types. I have tried :UltiSnipsAddFiletypes rails
which works perfectly, and would like to place :UltiSnipsAddFiletypes rails.ruby.latex.html
in ftplugin/rails.vim
as ultisnips documentation mentions
The UltiSnipsAddFiletypes command allows for explicit merging of other snippet filetypes for the current buffer. For example, if you edit a .rst file but also want the Lua snippets to be available you can issue the command >
:UltiSnipsAddFiletypes rst.lua
using the dotted filetype syntax. Order is important, the first filetype in this list will be the one used for UltiSnipsEdit and the list is ordered by evaluation priority. Consequently, you might add this to your
ftplugin/rails.vim
>
:UltiSnipsAddFiletypes rails.ruby
The problem is that I cannot find any file named rails.vim
.
Update:
Since only some snippets are expanding while other are not I think the problem is with how I have setup plugins on my system. Here is how vim
and vimrc
have been setup:
call pathogen#infect()
set runtimepath+=~/.vim/bundle/ultisnips
set nocompatible
let g:UltiSnipsExpandTrigger="<tab>"
let g:UltiSnipsListSnippets="<s-tab>"
let g:UltiSnipsJumpForwardTrigger="<s-j>"
let g:UltiSnipsJumpBackwardTrigger="<s-k>"
let g:UltiSnipsEditSplit="vertical"
let g:UltiSnipsSnippetDirectories=["vim-snippets", "Ultisnips"]
.vim/bundle
folder contains the cloned git repos ultisnips and vim-snippets.
I have also symlinked ftdetect
as suggested in the installation section of ultisnips documentation. I am using vim 7.4. I would be grateful to the community for their help.