Comment #2 on issue 80 by [email protected]: Feature request: variation
for <SID> to return script base name
http://code.google.com/p/vim/issues/detail?id=80
<SID> as it is should remain unchanged.
I am interested in the public interface for my plugin, that is the names
meant to be visible outside the script.
I am looking for a way to include "MyScriptName_..." prefix for such names
whithout hard-coding it. I would like to be able to use an expression
in-place of the prefix, that returns the script name (the same way <SID>
returns the script ID, which is why I first thought about it), and I would
like to use such a substitution expression in my:
- mapping definitions, after the <Plug> key
- command names
- :python commands (and maybe other interfaces too)
- global function names, if any,
- global variables for plugin user settings/configuration
- signs, even highlights, etc
An even better approach would be if Vim would allow script author to
redefine the value of the substitution expression, the same way a user can
re-define <Leader>. The script name would be only the default value.
In this way, if either the author or the user decides the file should be
renamed (perhaps to avoid a conflict, or just to start a fork for an
existing plug-in), all the public interface adjusts automatically with the
new name.
PS:
Te get the current value of <SID> I would do:
:map <Plug>Some-UUID-here <SID>
:echo "Script ID: " . maparg('<Plug>Some-UUID-here')
:unmap <Plug>Some-UUID-here
--
You received this message from the "vim_dev" 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