January 2015
Beginner to intermediate
85 pages
1h 58m
English
At the end of The Structure of a Vim Plugin, we created our main plugin directory, mpc. This is where we’ll be putting the different directories in which Vim looks for VimL source files.
Under mpc, create the plugin directory and then create a file under it called mpc.vim. It should look like this:
| plugin/mpc/plugin/mpc.vim | |
| | function! OpenMPC() |
| | let cmd = "mpc --format '%title% (%artist%)' current" |
| | echomsg system(cmd)[:-2] |
| | endfunction |
Because we appended the plugin directory to our runtimepath, Vim will load it automatically the next time we start it up. For now, though, save the file and then source it:
| | :source % |
Now Vim should have OpenMPC ready to go. Make sure that mpc is running and then, from ...
Read now
Unlock full access