neomake/neomake

Name: neomake

Owner: Neomake

Description: Asynchronous linting and make framework for Neovim/Vim

Created: 2014-11-12 06:34:12.0

Updated: 2018-01-21 07:11:43.0

Pushed: 2018-01-20 12:34:51.0

Homepage:

Size: 3250

Language: Vim script

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

Neomake

Build Status codecov

Neomake is a plugin for Vim/Neovim to asynchronously run programs.

You can use it instead of the built-in :make command (since it can pick up your 'makeprg' setting), but its focus is on providing an extra layer of makers based on the current file (type) or project. Its origin is a proof-of-concept for Syntastic to be asynchronous.

Requirements
Neovim

With Neovim any release will do (after 0.0.0-alpha+201503292107).

Vim

The minimal Vim version supported by Neomake is 7.4.503 (although if you don't use g:neomake_logfile older versions will probably work fine as well).

You need Vim 8.0.0027 or later for asynchronous features.

Installation

Use your preferred installation method for Vim plugins.

With vim-plug that would mean to add the following to your vimrc:

 'neomake/neomake'
Setup

If you want to run Neomake automatically (in file mode), you can configure it in your vimrc by using neomake#configure#automake, e.g. by picking one of:

(Any function calls like these need to come after indicating the end of plugins to your plugin manager, e.g. after call plug#end() with vim-plug.)

en writing a buffer.
 neomake#configure#automake('w')
en writing a buffer, and on normal mode changes (after 750ms).
 neomake#configure#automake('nw', 750)
en reading a buffer (after 1s), and when writing.
 neomake#configure#automake('rw', 1000)
Advanced setup

The author likes the following, which uses different modes based on if your laptop runs on battery (for Linux):

tion! MyOnBattery()
turn readfile('/sys/class/power_supply/AC/online') == ['0']
unction

yOnBattery()
ll neomake#configure#automake('w')

ll neomake#configure#automake('nw', 1000)
f

See :help neomake-automake (in doc/neomake.txt) for more information, e.g. how to configure it based on certain autocommands explicitly.

Usage

When calling :Neomake manually (or automatically through neomake#configure#automake (see above)) it will populate the window's location list with any issues that get reported by the maker(s).

You can then navigate them using the built-in methods like :lwindow / :lopen (to view the list) and :lprev / :lnext to go back and forth.

You can configure Neomake to open the list automatically:

g:neomake_open_list = 2

Please refer to :help neomake.txt for more details on configuration.

Maker types

There are two types of makers: file makers (acting on the current buffer) and project makers (acting globally).

You invoke file makers using :Neomake, and project makers using :Neomake!.

See :help neomake.txt for more details.

Manually run a maker

You can run a specific maker on the current file by specifying the maker's name, e.g. :Neomake jshint (you can use Vim's completion here to complete maker names).

Default makers

For a list of default makers please see the Makers page in the wiki.

Contributing

If you find this plugin useful, please contribute your maker recipes to the repository! Check out autoload/neomake/makers/**/*.vim for existing makers.

This is a community driven project, and maintainers are wanted. Please contact @blueyed if you are interested. You should have a good profile of issue triaging and PRs on this repo already.

Hacking / Testing

We are using Vader for our tests.

Logging

let g:neomake_logfile = '/tmp/neomake.log' enables the debug logging file. You can use e.g. tail -f /tmp/neomake.log to follow it in a new terminal window.

Running tests
Run all tests against your local Neovim and Vim
make test
Run a specific test file
make tests/integration.vader
Run some specific tests for Vim
make testvim VADER_ARGS=tests/integration.vader
Dockerized tests

The docker_test target runs tests for a specific Vim version. See Dockerfile.tests for the Vim versions provided in the Docker image.

The image for this gets pulled from Docker Hub via neomake/vims-for-tests.

NOTE: the Docker image used for tests does not include (different versions) of Neovim at the moment.

Run all tests for Vim 8.0.0069
make docker_test DOCKER_VIM=vim8069
Run all tests against all Vims in the Docker image
make docker_test_all
Donate

This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.