neomake / neomake

Asynchronous linting and make framework for Neovim/Vim
MIT License
2.66k stars 367 forks source link

Automake with project wide maker aka `Neomake!` #2259

Open GordianDziwis opened 5 years ago

GordianDziwis commented 5 years ago

Expected behavior

I don't know if this is a missing feature or if I am configuring neomake falsely. I like to trigger the project wide maker automatically. The project maker works with the command :Neomake! it also says when calling :NeomakeInfo:

For the project (used with :Neomake!):
 - makeprg
   - append_file: 0
   - args: []
   - auto_enabled: 1

Does auto_enabled mean that the project maker can be triggered by automake as described in the docs?

blueyed commented 5 years ago

I like to trigger the project wide maker automatically.

How? Do you mean via automake / autocommands?

I assume you would like to use neomake#configure#automake? This currently uses file-mode explicitly, and is tight to buffers.

I suggest just creating your own autocmd:

augroup my_neomake
    au! BufWritePost * Neomake!
augroup

It might be worth thinking about enhancing automake to support your use case though.. how do you want to use it?

GordianDziwis commented 5 years ago

An use case would be more complex builds depending in multiple filetypes. For example a webframework could have java, js, html, config and routing files, any change in any of theses files could require a restart/rebuild of the project.

micahcowan commented 3 months ago

I would love this feature, myself. My use case: I've written an emulator for the old 8-bit Apple II line of computers, that automatically reloads and restarts the emulation when it detects that a loaded binary file has changed on disk. I would like the project to automatically rebuild as I type, so that the emulator will show in (near) real-time the changes to assembly files, etc, that I've made, as I'm making them.

The recommendation to hook Neomake! to BufWritePost is something, but I'd love if it were happening even before I get to that. Basically, I'm trying to duplicate, in a terminal environment, what 8bitworkshop does in my browser.