wbthomason / packer.nvim

A use-package inspired plugin manager for Neovim. Uses native packages, supports Luarocks dependencies, written in Lua, allows for expressive config
MIT License
7.88k stars 264 forks source link

Added note about nvim 0.7.0 lua autocmds #895

Open FredeEB opened 2 years ago

FredeEB commented 2 years ago

neovim introduced native lua autocmds, so I though they'd be worth a mention.

I was considering adding an example with the callback field instead of command but couldn't find a lua variant of source, and doing it with vim.cmd would yield the same result as using command

yehorb commented 2 years ago

Consider creating augroup with { clear = true } before creating the autocmd. This will ensure that plugin reload autocmmand will be cleared before creation with each source. Duplicating autocommands can lead to unexpected results.

FredeEB commented 2 years ago

@yehorb - TIL! Thanks. I updated the PR

FredeEB commented 2 years ago

@yehorb - any further comments on this?

yehorb commented 2 years ago

@yehorb - any further comments on this?

Hi. Looks good to me. Thank you for updating the PR.

FredeEB commented 2 years ago

@yehorb - Thanks! 👍

FredeEB commented 2 years ago

@wbthomason - Sorry for pinging you, but I cannot add any reviewers to this PR, but maybe you could give it a read?