<commit_before># [![Neomake](https://cloud.githubusercontent.com/assets/111942/22717189/9e3e1760-ed67-11e6-94c5-e8955869d6d0.png)](#neomake)

[![Build Status](https://circleci.com/gh/neomake/neomake.png?style=shield)](https://circleci.com/gh/neomake/neomake)
[![codecov](https://codecov.io/gh/neomake/neomake/branch/master/graph/badge.svg)](https://codecov.io/gh/neomake/neomake)
[![Coveralls](https://coveralls.io/repos/github/neomake/neomake/badge.svg)](https://coveralls.io/github/neomake/neomake)

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](https://github.com/junegunn/vim-plug) that would mean to add
the following to your vimrc:

```vim
Plug '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:

```vim
" When writing a buffer (no delay).
call neomake#configure#automake('w')
" When writing a buffer (no delay), and on normal mode changes (after 750ms).
call neomake#configure#automake('nw', 750)
" When reading a buffer (after 1s), and when writing (no delay).
call neomake#configure#automake('rw', 1000)
" Full config: when writing or reading a buffer, and on changes in insert and
" normal mode (after 1s; no delay when writing).
call neomake#configure#automake('nrwi', 500)
```

(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.)

### Advanced setup

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

```vim
function! MyOnBattery()
  return readfile('/sys/class/power_supply/AC/online') == ['0']
endfunction

if MyOnBattery()
  call neomake#configure#automake('w')
else
  call neomake#configure#automake('nw', 1000)
endif
```

See `:help neomake-automake` (in [doc/neomake.txt](doc/neomake.txt)) for more
information, e.g. how to configure it based on certain autocommands explicitly,
and for details about which events get used for the different string-based
modes.

## 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.<commit_msg>README: add MacOS support to MyOnBattery() example<commit_after># [![Neomake](https://cloud.githubusercontent.com/assets/111942/22717189/9e3e1760-ed67-11e6-94c5-e8955869d6d0.png)](#neomake)

[![Build Status](https://circleci.com/gh/neomake/neomake.png?style=shield)](https://circleci.com/gh/neomake/neomake)
[![codecov](https://codecov.io/gh/neomake/neomake/branch/master/graph/badge.svg)](https://codecov.io/gh/neomake/neomake)
[![Coveralls](https://coveralls.io/repos/github/neomake/neomake/badge.svg)](https://coveralls.io/github/neomake/neomake)

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](https://github.com/junegunn/vim-plug) that would mean to add
the following to your vimrc:

```vim
Plug '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:

```vim
" When writing a buffer (no delay).
call neomake#configure#automake('w')
" When writing a buffer (no delay), and on normal mode changes (after 750ms).
call neomake#configure#automake('nw', 750)
" When reading a buffer (after 1s), and when writing (no delay).
call neomake#configure#automake('rw', 1000)
" Full config: when writing or reading a buffer, and on changes in insert and
" normal mode (after 1s; no delay when writing).
call neomake#configure#automake('nrwi', 500)
```

(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.)

### Advanced setup

The author liked to use the following, which uses different modes based on if
your laptop runs on battery (for MacOS or Linux):

```vim
function! MyOnBattery()
  if has('macunix')
    return match(system('pmset -g batt'), "Now drawing from 'Battery Power'") != -1
  elsif has('unix')
    return readfile('/sys/class/power_supply/AC/online') == ['0']
  endif
  return 0
endfunction

if MyOnBattery()
  call neomake#configure#automake('w')
else
  call neomake#configure#automake('nw', 1000)
endif
```

See `:help neomake-automake` (in [doc/neomake.txt](doc/neomake.txt)) for more
information, e.g. how to configure it based on certain autocommands explicitly,
and for details about which events get used for the different string-based
modes.

## 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.
{'fraction_non_alphanumeric': 0.11849799938442598, 'fraction_numerical': 0.02585410895660203, 'mean_word_length': 4.946020128087832, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 16, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4380332', 'n_tokens_mistral': 2281, 'n_tokens_neox': 2096, 'n_words': 752}