- Notifications
You must be signed in to change notification settings - Fork364
Asynchronous linting and make framework for Neovim/Vim
License
neomake/neomake
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
Neomake is a plugin forVim/Neovim to asynchronously run programs.
You can use it instead of the built-in:make
command (since it can pickup your'makeprg'
setting), but its focus is on providing an extra layerof makers based on the current file (type) or project.Its origin is a proof-of-concept forSyntastic to be asynchronous.
With Neovim any release will do (after 0.0.0-alpha+201503292107).
The minimal Vim version supported by Neomake is 7.4.503 (although if you don'tuseg:neomake_logfile
older versions will probably work fine as well).
You need Vim 8.0.0027 or later for asynchronous features.
Use your preferred installation method for Vim plugins.
Withvim-plug that would mean to addthe following to your vimrc:
Plug'neomake/neomake'
If you want to run Neomake automatically (in file mode), you can configure itin yourvimrc
by usingneomake#configure#automake
, e.g. by picking one of:
" When writing a buffer (no delay).callneomake#configure#automake('w')" When writing a buffer (no delay), and on normal mode changes (after 750ms).callneomake#configure#automake('nw',750)" When reading a buffer (after 1s), and when writing (no delay).callneomake#configure#automake('rw',1000)" Full config: when writing or reading a buffer, and on changes in insert and" normal mode (after 500ms; no delay when writing).callneomake#configure#automake('nrwi',500)
(Any function calls like these need to come after indicating the end of pluginsto your plugin manager, e.g. aftercall plug#end()
with vim-plug.)
The author liked to use the following, which uses different modes based on ifyour laptop runs on battery (for MacOS or Linux):
function!MyOnBattery()ifhas('macunix')returnmatch(system('pmset -g batt'),"Now drawing from 'Battery Power'")!=-1elseifhas('unix')returnreadfile('/sys/class/power_supply/AC/online')== ['0']endifreturn0endfunctionifMyOnBattery()callneomake#configure#automake('w')elsecallneomake#configure#automake('nw',1000)endif
See:help neomake-automake
(indoc/neomake.txt) for moreinformation, e.g. how to configure it based on certain autocommands explicitly,and for details about which events get used for the different string-basedmodes.
When calling:Neomake
manually (or automatically throughneomake#configure#automake
(see above)) it will populate the window'slocation 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:
letg:neomake_open_list=2
Please refer to:help neomake.txt
for more details on configuration.
There are two types of makers: file makers (acting on the current buffer) andproject makers (acting globally).
You invoke file makers using:Neomake
, and project makers using:Neomake!
.
See:help neomake.txt
for more details.
You can run a specific maker on the current file by specifying the maker'sname, e.g.:Neomake jshint
(you can use Vim's completion here to completemaker names).
For a list of default makers please see theMakers page in the wiki.
If you find this plugin useful, please contribute your maker recipes to therepository! Check outautoload/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.
We are usingVader for our tests.
Setlet g:neomake_logfile = '/tmp/neomake.log'
(dynamically or in your vimrc)to enable debug logging to the given file.From Neomake's source tree you can then runmake tail_log
, which will colorthe output and pipe it intoless
, which folds long lines by default and willfollow the output (liketail -f
).You can use Ctrl-C to interrupt for scrolling etc, and then F to follow again.
make test
make tests/integration.vader
make testvim VADER_ARGS=tests/integration.vader
Thedocker_test
target runs tests for a specific Vim version.SeeDockerfile.tests
for the Vim versions provided in the Docker image.
The image for this gets pulled from Docker Hub vianeomake/vims-for-tests.
NOTE: the Docker image used for tests does not include (different versions)of Neovim at the moment.
make docker_test DOCKER_VIM=vim-8.0.586
make docker_test_all