Friday, May 28, 2010

Relative path to plugin script?

I'm writing a plugin that uses a script written in Groovy.

I store the script in ~/.vim/bin, and when the user presses a key, the
Groovy script is run by Vim. Everything worked great, until I
switched to using pathogen(1) for Vim, and now my script is stored in

~/.vim/bundle/myplugin/bin

so, Vim can't find ~/.vim/bin/myscript.groovy

I guess I'm looking for a more bullet proof way to set up Vim to call
the groovy script.

For example, calling something like this from myplugin.vim:

map <leader>f system(<this plugin's directory>/../bin/myplugin.groovy)

So, I need a way to find the directory where the plugin is being ran
from, so that
I can create an absolute path to <this plugin directory>/bin/myscript.groovy

Any ideas?

Thanks,
--Nate

(1) See http://tammersaleh.com/posts/the-modern-vim-config-with-pathogen

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

No comments:

Post a Comment