Vim plugin stopped working #3

dbrgn opened this Issue Dec 4, 2009 · 11 comments


None yet

4 participants

dbrgn commented Dec 4, 2009

I updated the old vim script to the current one, and now it doesn't work anymore. What i did:

  • removed /usr/local/bin/sparkup
  • removed ~/.vim/scripts/sparkup.vim
  • removed mappings in vimrc
  • copied ftplugin folder from current version to ~/vim/ftplugin

If i understood the readme correctly, it should now work with html files. But it doesn't...

Tordek commented Dec 4, 2009

g:sparkup must be set; otherwise it tries to find the sparkup file in the user's $HOME. This is wrong and awkward. vim/ftplugin/html/ should be deleted as per Issue 5, and a note added in the README explaining how to set g:sparkup.

dbrgn commented Dec 4, 2009

ah, thanks for the hint. i thought it would look for sparkup in the current directory, that's why it didn't work...

how do you set g:sparkup, is it a normal variable? or do you change it in the code itself? i as a coder could hack it together myself, but a normal user can't. so there needs to be some example in the readme.

dbrgn commented Dec 4, 2009

hm, first i put sparkup in the PATH, later i changed line 39 to

let s:sparkup = exists('g:sparkup') ? g:sparkup : '/usr/local/bin/sparkup'

both variants didn't work. either the mapping doesn't work, or it couldn't find sparkup...

Tordek commented Dec 4, 2009

You can add let g:sparkup = '/usr/local/bin/sparkup' in your .vimrc; this setting has worked for me.

ervandew commented Dec 5, 2009

My preferred method of adding sparkup to vim is to simply add the vim
folder to vim's runtime path:

Example assuming I have the sparkup git repos checked out at

set rtp+=~/sparkup/vim

Using this method you don't have to copy any vim files around, you
don't have to copy the sparkup executable to your path, you don't have
to set g:sparkup, and to update to the latest version you just run
'git pull' and you're done.

I had this documented as one of the install options when I
contributed the refactoring to support it, but that option has since
been removed from the docs, but does still function.

As for the alternate method involving copying the ftplugin dir, that
method requires you to then install the sparkup executable in your
system path or to set the g:sparkup variable as Tordek pointed out.

You can take a look at the install instructions I had in the
sparkup.vim file before they were removed here:
Both of the install options explained there should still work.

I also agree about removing the redundant as it doesn't
appear to serve any purpose currently.

rstacruz commented Dec 5, 2009

Oops. Hmm.

I remember I removed those lines and set up the current vim plugin as it is now for the following reasons:

  • I wanted the vim plugin to be self-contained: just copy it to the vim folder and you're done.
  • To do this, I had a line set rtp+=~/.vim/ftplugin/html in the script itself to automatically let vim find in the ftplugin folder.
  • This also explains the redundant .py file in the vim plugin folder.

But it seems I broke it, sorry.

rstacruz commented Dec 5, 2009

On closer inspection it seems I wasn't able to commit that change. I am a douche.
Can anyone check the latest version and see if it works for them? ;)

ervandew commented Dec 5, 2009

Copying the ftplugin dir now works properly without any other steps
(adding sparkup/vim to vim's runtime path still works as well).

However, line 21 (set rtp+=~/.vim/ftplugin/html) is unnecessary and
actually has no affect since the directory itself doesn't contain
subdirectories that vim would use (runtime paths are expected to have
one or more of 'plugin', 'ftplugin', 'autoload', etc.). So that line
is just kind of polluting the user's runtime path at this point.

As somewhat of an aside, I'm still not a fan of having redundant
copies of the sparkup python file (one for each supported editor + the
primary copy). I understand the reasoning behind it, but I'm sure
there's a better solution. Everything currently works though and I
don't have any plans to work on those files, so I can't really
complain, even though I kind of just did ;).

I do appreciate the work you've put into this though, so a big thanks
to you!

ervandew commented Dec 5, 2009

I just saw your reasoning for the 'set rtp+=~/.vim/ftplugin/html', but
it's still unnecessary since the findfile pattern used has '**'
leading to a recursive search which will find the file in the ~/.vim
rtp entry.

rstacruz commented Dec 5, 2009

Thanks. Removed the rtp... I didn't quite catch that it wasn't necessary. Regarding the redundant copies, though, have a look at the discussion on issue #5.

A big thanks to all those who worked on this... reporting bugs, forking and fixing. Really helps a lot.

rstacruz commented Dec 8, 2009

Closing as the vim plugin works now.

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment