Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Vim plugin stopped working #3

Closed
dbrgn opened this Issue · 11 comments

4 participants

@dbrgn

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

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/sparkup.py should be deleted as per Issue 5, and a note added in the README explaining how to set g:sparkup.

@dbrgn

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

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

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

@ervandew

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
~/sparkup:

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:
http://github.com/rstacruz/sparkup/blob/3fa5853e05366bec0c94e99820ad23d4079afb47/vim/ftplugin/html/sparkup.vim
Both of the install options explained there should still work.

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

@rstacruz
Owner

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 sparkup.py in the ftplugin folder.
  • This also explains the redundant .py file in the vim plugin folder.

But it seems I broke it, sorry.

@rstacruz
Owner

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

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

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
Owner

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
Owner

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
Something went wrong with that request. Please try again.