makery.vim : A plugin for managing makeprgs.
script karma |
Rating 3/3,
Downloaded by 3333 |
Comments, bugs, improvements
|
Vim wiki
|
created by |
Ian Emnace |
|
script type |
utility |
|
description |
I made this plugin because I was tired of having to change my `makeprg` or
`compiler` every time I wanted to run a different task. Switching between
`:compiler eslint` and `:compiler jest` gets old really fast.
Sure, you can map, but it gets harder when you start to work across different
projects: some use different linters or test runners, some use a Makefile, some
use an `npm` script, some need to generate tags, etc. Madness!
With this plugin, all I have to do is specify my make-related tasks in a
`.makery.json` file in my project root. For example, one of my React Native
projects has the following `.makery.json`:
{
"lint": {"compiler": "eslint"},
"reload": {"makeprg": "adb shell input keyevent 82"},
"tags": {"makeprg": "es-ctags -R src"},
"test": {"compiler": "jest"}
}
Now I can just run `:Mlint` to lint, `:Mreload` to reload the JS code on my
connected Android device, `:Mtags` to generate tags, and `:Mtest` to run tests.
Nifty!
I can even do `:LMlint %` to lint the current file and have it appear in the
corresponding location list instead of the global quickfix!
In case you already have an existing command with the same name, you can still
access the commands through the full `:Makery` form, e.g. `:Makery lint` or
`:Makery compile`.
The best part is I can specify different behavior for `:Mlint` or `:Mtest`
depending on which project I'm in, by providing the necessary `.makery.json` for
each of my projects!
Even programs like ctags or adb fit well because of this, even though you don't
necessarily need the quickfix for them. Instead of fiddling with different `:!`
incantations for different projects, you can just use `:Mtags` and be done with
it!
|
|
install details |
Untar into your ~/.vim directory, or install with your favorite plugin manager (plugin is hosted at https://github.com/igemnace/vim-makery).
Vim 7.0 or higher should be fine. JSON support requires Vim 8.0 or higher. |
|
script versions (upload new version)
Click on the package to download.
ip used for rating: 3.16.137.217
|