Spacevim: How do I hook up a custom plugin to SpaceVim

Created on 13 Aug 2018  路  4Comments  路  Source: SpaceVim/SpaceVim

I'd like to write a simple custom plugin which is located on local file system, not github.
How do I hook it up to SpaceVim?

usage

All 4 comments

which is located on local file system, not github

you can read :h rtp, in vim rtp path, the script in plugin/ dir will be loaded when vim startup. the ftplugin/ will be loaded when &filetype is changed.

in SpaceVim, ~/.SpaceVim.d/ is your custom configuration directory. so you can create a vim script file in ~/.SpaceVim.d/plugin/.

NOTE, it is ~/.SpaceVim.d/plugin/ not ~/.SpaceVim/plugin/.

for example you can create ~/.SpaceVim.d/plugin/myfirstscript.vim

also, you can use set rtp+=/path/to/your/plugin_dir, you can put this script into bootstrap function, you can check my DotFiles repo on github to see how to use bootstrap function.

https://github.com/wsdjeg/DotFiles/tree/master/SpaceVim.d

Thank you, @wsdjeg I'll give it a try! If it works, I will close this task

~/.SpaceVim.d/plugin/myfirstscript.vim did the trick :+1:

Was this page helpful?
0 / 5 - 0 ratings