sponsor Vim development Vim logo Vim Book Ad

makery.vim : A plugin for managing makeprgs.

 script karma  Rating 3/3, Downloaded by 2827  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.
 

rate this script Life Changing Helpful Unfulfilling 
script versions (upload new version)

Click on the package to download.

package script version date Vim version user release notes
makery.tar.gz 1.9 2018-07-31 7.0 Ian Emnace Add location list support, courtesy of :lmake
makery.tar.gz 1.8 2018-04-27 7.0 Ian Emnace Add Projectionist support for setting up Makery config
makery.tar.gz 1.7 2018-01-18 7.0 Ian Emnace Fix bug where recursion loops forever for fugitive:// buffers
makery.tar.gz 1.6 2018-01-10 7.0 Ian Emnace Recurses up the directory tree to find .makery.json, for when opening Vim from a project subdirectory
makery.tar.gz 1.5 2017-09-21 7.0 Ian Emnace Expose :Makery command for conflicting existing commands
makery.tar.gz 1.4 2017-09-19 7.0 Ian Emnace Refactor autoload functions
makery.tar.gz 1.3 2017-09-18 7.0 Ian Emnace Fix bug where setting both "compiler" and "makeprg" options fails to actually use the makeprg
makery.tar.gz 1.2 2017-09-18 7.0 Ian Emnace Fix bug with makery#Compile: wrong number of args
makery.tar.gz 1.1 2017-09-17 7.0 Ian Emnace Now allows setting both "compiler" and "makeprg" keys for a single command
makery.tar.gz 1 2017-09-17 7.0 Ian Emnace Initial upload
ip used for rating: 3.238.57.9

If you have questions or remarks about this site, visit the vimonline development pages. Please use this site responsibly.
Questions about Vim should go to the maillist. Help Bram help Uganda.
   
Vim at Github