Monday, October 6, 2014

Re: Cannot make snippet plugin working...

On Mon, 6 Oct 2014 08:19:11 -0700 (PDT)
Ben Fritz <fritzophrenic@gmail.com> wrote:

> On Sunday, October 5, 2014 11:34:06 PM UTC-5, gevisz wrote:
> > I have downloaded the snippet plugin from
> > http://www.vim.org/scripts/script.php?script_id=361
> > and have done all the steps described there to
> > install it but, unfortunately, it does not work.
> >
> > My first thought was that a plugin should be somehow
> > loaded into Vim but Vim documentation says that
> >
> > "Vim's functionality can be extended by adding plugins.
> > A plugin is nothing more than a Vim script file that
> > is loaded automatically when Vim starts. You can add
> > a plugin very easily by dropping it in your plugin
> > directory. {not available when Vim was compiled
> > without the +eval feature}"
> >
> > So, it seems that no load command is needed.
> >
> > I have also tried to load all the plugins by
> >
> > :runtime! plugin/**/*.vim
> >
> > command as described in Vim documentation but it says:
> >
> > Error detected while processing ~/.vim/plugin/snippet.vim:
> > line 28:
> > E15: Invalid expression: exists("loaded_snippets")
> > line 231:
> > E171: missing :endif
> >
> > Does it means that something is wrong with the plugin itself?
>
> I downloaded and looked at the plugin. There does not seem anything wrong with that line.
> However, the plugin file uses DOS line endings.
> Are you running on Linux or any other non-Windows system?
> If so, you probably need to convert the line endings to match your system.
> Although Vim can source scripts Unix-style line endings on Windows, for some reason the reverse does not work.

Yes, you are right. After converting all the snippet
plugin files to Unix format, the command
:runtime! plugin/**/*.vim
executes without any error messages.

Nevertheless, my test snippet that is just intended
to expand "for<C-S>" to "for test" does not work.

The for.spt file is put in both ~/.vim/snippets/c
and ~/.vim/snippets/global directories. In .vimrc
is added
let snippet_use_global=1

Well, it is not critical because I have decided to follow
the advice of Marc Weber and try ultisnips but I am still
just curious why this snippet plugin does not work.

By the way, ultisnips is much more complex, so I have
much more chances to get it not working. ;)

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments: