Skip to content

Conversation

@schra
Copy link

@schra schra commented Apr 9, 2022

Make use of the new API implemented in
neovim/neovim#14661.

This API is not yet released, but will probably be released with Neovim
0.7 (see https://github.com/neovim/neovim/milestone/29). So I guess you
can merge my PR when Neovim 0.7 is released?

I tried out this diff on the Git master of Neovim.

Make use of the new API implemented in
neovim/neovim#14661.

This API is not yet released, but will probably be released with Neovim
0.7 (see https://github.com/neovim/neovim/milestone/29). So I guess you
can merge my PR when Neovim 0.7 is released?

I tried out this diff on the Git master of Neovim.
@clason
Copy link

clason commented Apr 10, 2022

This API will definitely be released with 0.7, which is scheduled for April 15. Be aware that until then, the API may still change!

I'd recommend waiting a bit before merging this to allow people (and distros) to update (this being the Easter weekend, after all).

README.md Outdated
augroup end
]])
```
This autocommand can be placed in your `init.vim`, in `plugins.lua`, or any other startup file as per your setup.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be init.lua, as this is Lua code.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch. However, I see that there are other references to init.vim in the readme. I guess it would be inconsistent if I used init.lua in this one place and the rest of the readme uses init.vim. I dropped the reference to init.vim entirely for now, I think that's probably the easiest solution.

```
augroup packer_user_config
autocmd!
autocmd BufWritePost plugins.lua source <afile> | PackerCompile
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is source <afile> not needed anymore?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not familiar with what source <afile> does. If I remember correctly I tried to find the equivalent in the lua api and there was nothing equivalent (but maybe I remember that wrong). I have the lua code in my init.lua as I wrote in this PR and it works.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is -- Lua callbacks get passed an args table, with args.file being equivalent to <afile>.

See :h nvim_create_autocmd().

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants