Re: snipMate not working

623 views
Skip to first unread message

Gary Johnson

unread,
Oct 3, 2012, 11:49:06 AM10/3/12
to vim...@googlegroups.com
On 2012-10-03, Mashan wrote:
> Hi
>
> installed snipMate in .vim directory
>
> created a test.html file
>
> tried snippet triggers but nothing happens when I hit the tab key
>
> Running linux mint debian additon
>
> When it didn't appear to be working I tried the following:(testing after each change)
>
> purged all vim files including config then re installed vim
>
> copied in known working version of snipmate from a colleages pc with the same operating system
>
> tried running it under a new user account
>
> checked server encoding was utf8
>
> No joy
>
> Any help appreciated

Please post the output of this Vim command,

:scriptnames

and the output of this Unix command,

find ~/.vim -follow -iname \*snipmate\*

The first will report the configuration files that Vim has sourced
and will indicate where it is looking for such files. The second
will show exactly where you put the snipMate plugin.

Regards,
Gary

Charles Campbell

unread,
Oct 3, 2012, 11:49:36 AM10/3/12
to vim...@googlegroups.com
Mashan wrote:
> Hi
>
> installed snipMate in .vim directory
>
<snip>

May I suggest contacting the author of snipMate?
(try looking at the plugin's contents; at the top of plugins the author
usually includes contact information)

Regards,
C Campbell

Marc Weber

unread,
Oct 3, 2012, 1:37:48 PM10/3/12
to vim_use
Current upstream snipmate is hosted here:
https://github.com/honza/vim-snipmate

If you want to be done fast get VAM (or a similar addon manager).
Then adding "snipmate" to the list of known plugins is enough.

Just installing the plugin snipMate is not enough, you also have to
enable common options such as filetype,plugin on etc.

See lines at the top (24 till 34) found here
https://github.com/MarcWeber/vim-addon-manager/blob/master/autoload/sample_vimrc_for_new_users.vim

You know that you have a very recent upstream versions if you have this
command: SnipMateOpenSnippetFiles and if the snipmate repo no longer
contains the snippet files. They are located at https://github.com/honza/snipmate-snippets

Whether you need this most recent version is up to you.

If you're really lazy you can also use this downloader
https://mawercer.de/~marc/vam/index.php
"snipmate-snippets" is the plugin name you want.
It'll fetch dependencies (snipmate and some more) automatically.
Then copy everything (.vimrc, .vim) into your home directory after
having reviewed the contents.

Last but not least: snippets for html are fine, DSLs are better.
Give ZenCoding or sparkup plugin a try. Then you can type:

table>tr*3>td*3 and get:


<table>
<tr>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td></td>
<td></td>
<td></td>
</tr>
</table>

instantly.

Marc Weber

Mashan

unread,
Oct 6, 2012, 5:56:25 PM10/6/12
to vim...@googlegroups.com, gary...@spocom.com
Thanks Gary

Details below

:scriptnames

1: /usr/share/vim/vimrc
2: /usr/share/vim/vim73/debian.vim
3: /usr/share/vim/vim73/syntax/syntax.vim
4: /usr/share/vim/vim73/syntax/synload.vim
5: /usr/share/vim/vim73/syntax/syncolor.vim
6: /usr/share/vim/vim73/filetype.vim
7: /usr/share/vim/vim73/ftplugin.vim
8: /usr/share/vim/vim73/indent.vim
9: ~/.vimrc
10: /usr/share/vim/vim73/syntax/nosyntax.vim
11: /usr/share/vim/vim73/colors/evening.vim
12: ~/.vim/plugin/snipMate.vim
13: /usr/share/vim/vim73/plugin/getscriptPlugin.vim
14: /usr/share/vim/vim73/plugin/gzip.vim
15: /usr/share/vim/vim73/plugin/matchparen.vim
16: /usr/share/vim/vim73/plugin/netrwPlugin.vim
17: /usr/share/vim/vim73/plugin/rrhelper.vim
18: /usr/share/vim/vim73/plugin/spellfile.vim
19: /usr/share/vim/vim73/plugin/tarPlugin.vim
20: /usr/share/vim/vim73/plugin/tohtml.vim
21: /usr/share/vim/vim73/plugin/vimballPlugin.vim
22: /usr/share/vim/vim73/plugin/zipPlugin.vim
23: ~/.vim/after/plugin/snipMate.vim
24: ~/.vim/ftplugin/html_snip_helper.vim
25: /usr/share/vim/vim73/ftplugin/html.vim
26: /usr/share/vim/vim73/indent/html.vim
27: /usr/share/vim/vim73/syntax/html.vim
28: /usr/share/vim/vim73/syntax/javascript.vim
29: /usr/share/vim/vim73/syntax/vb.vim
30: /usr/share/vim/vim73/syntax/css.vim


mashan@matt:~/Documents$ find ~/.vim -follow -iname \*snipmate\*
/home/mashan/.vim/autoload/snipMate.vim
/home/mashan/.vim/doc/snipMate.txt
/home/mashan/.vim/plugin/snipMate.vim
/home/mashan/.vim/after/plugin/snipMate.vim

Gary Johnson

unread,
Oct 8, 2012, 2:34:11 AM10/8/12
to vim...@googlegroups.com
On 2012-10-06, Mashan wrote:
> Thanks Gary
>
> Details below
>
> :scriptnames
...
> 12: ~/.vim/plugin/snipMate.vim
...
> 23: ~/.vim/after/plugin/snipMate.vim
> 24: ~/.vim/ftplugin/html_snip_helper.vim
...

> mashan@matt:~/Documents$ find ~/.vim -follow -iname \*snipmate\*
> /home/mashan/.vim/autoload/snipMate.vim
> /home/mashan/.vim/doc/snipMate.txt
> /home/mashan/.vim/plugin/snipMate.vim
> /home/mashan/.vim/after/plugin/snipMate.vim

Thanks for the information. That's exactly what I wanted.

SnipMate appears properly installed to me: :scriptnames shows it
being sourced and find shows the files where I would expect them to
be. I don't have SnipMate installed myself. I was hoping to have
time this weekend to look at this further, but I haven't and
probably won't for the rest of the week. Hopefully someone with
SnipMate experience can offer some insight.

Regards,
Gary

Mashan

unread,
Oct 8, 2012, 6:05:06 AM10/8/12
to vim...@googlegroups.com, gary...@spocom.com
Thanks Gary / Marc / Charles

Turns out putting "set nocompatible" into the .vimrc file did the trick (Thanks Marc)

This worked on it's own without any of the "filetype" settings, though as you'll see below I put them in anyway as I had heard they were important (possible for other reasons ?)

Thanks again for everyone's help

Much appreciated

contents of .vimrc file :

set ts=4
set ai
set shiftwidth=4
syn on
set mouse=a
au BufRead,BufNewFile jquery.*.js set ft=javascript syntax=jquery
color evening
filetype on
set tabpagemax=25
set smartindent
set showmatch
set vb t_vb=
set ruler
set incsearch
set nocompatible
au BufRead,BufNewFile *.php set ft=php.html
filetype plugin on
filetype indent plugin on | syn on
~
~
~
~
~

Gary Johnson

unread,
Oct 8, 2012, 11:03:36 AM10/8/12
to vim...@googlegroups.com
On 2012-10-08, Mashan wrote:
> Thanks Gary / Marc / Charles
>
> Turns out putting "set nocompatible" into the .vimrc file did the
> trick (Thanks Marc)

I'm glad that problem has been fixed, but I would be wary of that
solution for two reasons. First, it shouldn't be necessary. As
":help 'compatible' explains,

When a |vimrc| or |gvimrc| file is found while Vim is
starting up, this option is switched off, and all options
that have not been modified will be set to the Vim defaults.

So, 'nocompatible' should already have been set by the time your
~/.vimrc was read.

Secondly, again from ":help 'compatible',

This is a special kind of option, because when it's set or
reset, other options are also changed as a side effect.
CAREFUL: Setting or resetting this option can have a lot of
unexpected effects: Mappings are interpreted in another way,
undo behaves differently, etc. If you set this option in
your vimrc file, you should probably put it at the very
start.

By putting "set nocompatible" into your ~/.vimrc where you did,
you've thrown a monkey wrench into your initialization process.
While it did have the effect of fixing this problem, it may well
have caused other problems that you haven't discovered yet.

Since: a) this fixes this problem; b) hasn't had any bad
side-effects yet; and c) I don't know what the real solution is; I'd
leave your ~/.vimrc as-is. Just be aware that this is a flaky
solution, may cause other problems, and removing it should be one of
the first things you do if you have problems in the future.

> This worked on it's own without any of the "filetype" settings,
> though as you'll see below I put them in anyway as I had heard
> they were important (possible for other reasons ?)

The ":filetype ident plugin on" and ":syntax on" commands were
already executed in your /usr/share/vim/vimrc file. That's why you
didn't need to set them in your ~/.vimrc file. That can be seen in
the output of :scriptnames that you posted earlier.

> Thanks again for everyone's help
>
> Much appreciated
>
> contents of .vimrc file :
>
> set ts=4
> set ai
> set shiftwidth=4
> syn on
> set mouse=a
> au BufRead,BufNewFile jquery.*.js set ft=javascript syntax=jquery
> color evening
> filetype on
> set tabpagemax=25
> set smartindent
> set showmatch
> set vb t_vb=
> set ruler
> set incsearch
> set nocompatible
> au BufRead,BufNewFile *.php set ft=php.html
> filetype plugin on
> filetype indent plugin on | syn on

Regards,
Gary

Matt Keir

unread,
Oct 15, 2012, 8:01:26 AM10/15/12
to vim...@googlegroups.com
Hi Gary

Took your advice and RTFM'D ;-)

Had a look in usr/share/vim/vimrc

'set compatible' was uncommented in there. Not a default setting it seems. Must have come over from my colleagues PC when we copied Vim over

So when I put 'nocompatible' in .vimrc it over rode this and snipmate worked

funny thing is it didn't work a few days later when I tried to use it again.

So removed nocompatible from .vimrc and commented out set compatible in usr/share/vim/vimrc and now snipmate works again :)

Thanks for your help


Regards,
Gary

--
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

Reply all
Reply to author
Forward
0 new messages