[Demo] Lua Autocmds in Neovim (by the author of Lua Autocmds)

preview_player
Показать описание
Quick demo of lua autocmds in neovim because it seems like people are kind of confused about how to use them and what you should use them for.

This is in response to some reddit posts as well, so I decided I'd just record this quick and send it to everyone. Let me know if you have any questions in the comments. Thanks everyone

#Neovim #Lua #Autocmds #Programming #HashTag
Рекомендации по теме
Комментарии
Автор

I see a new TJ video, I smash that like button <3

desuburinga
Автор

I am so happy seeing the progress that neovim makes. Thanks to all contributors for the hard work and a special thanks to TJ :)

alexwexov
Автор

1. TJ writes Lua Autocmds, which is a massive undertaking (at least to me it seems so)
2. TJ makes an informational and entertaining video about it
3. Joins the rank of unheard legends and acquires the grand title of:

Tectonic Jackhammer

...because, you know, he induces continental shifts in where Neovim is headed.
(Too lame? Couldn't think of anything better...)
Anyway a huge thank you TJ for all your efforts. Especially for this one, as I (and many others) have been wishing for autocmds in lua for some time now.

ThePhiliposophy
Автор

That was neat and concise thanks a lot TJ!
You're making the whole neovim-lua experience a joy

aeronsor
Автор

Thank you TJ! This was requested a lot in reddit and it’s amazing that you did this!

KronosaurusRex
Автор

Always learn by seeing your videos. Hats off to you ....

bhaveshverma
Автор

Telescopic Johnson back at it again, awesome work TJ!

codehashira
Автор

definitely looking forward to migrating my vim setup to neovim

davidsicilia
Автор

Awesome! More videos like this! If you could also make a playlist with short introductory videos to configuring neovim, that would also be great. Could you also give some examples on how do you personally use this feature?

nikensss
Автор

Would love to use this instead of passing autocmd strings to vim.cmd. But this doesn't seem to be available on version 0.6.1. Your videos regarding lua have been great resource. Thank you very much.

alihammadshah
Автор

Great TJ! Auto commands! Since which version are those available?

patriciourrutia
Автор

Cool videos. both this and autogroups. I would love another one on autocmd patterns. Also does "Filetype tex" or similar events work for lua autocmds?

adgai
Автор

Nice! Definitely cause for an upgrade.

mintcar
Автор

TJ nice work! I am curious about why the groups are passed to the autocomands and not the other way around

darkarie
Автор

How can this vim script be translated in to a lua autocmd? "if &modified echo "File is modified" endif"

ghostknife-tyvj
Автор

2:27 You keep executing it, but what is executing? I gets executed by reading it into the buffer, but I see a command like save&exit. Does it reread on save&exit?

BrazenNL
Автор

Guys what's with the hash tags in "my#plugin#func"? Is it a syntactic sugar for something, or is it a completely different thing?

sinabeyraghdar
Автор

How would you translate this to lua:

augroup LspFormatting
autocmd! * <buffer>
autocmd BufWritePre <buffer> lua vim.lsp.buf.formatting_sync()
augroup END

Specifically the "autocmd! * <buffer>" command.

ovidiu_nl
Автор

I tried this the other day simply with highlight on yank and passing the reference to that function directly as a callback failed because the callback seems to get passed a string ("aucmd" IIRC) and that was incompatible with the parameter expected by highlight on yank.
Will this change or stay like that? Because if it stays like that one always needs an anonymous wrapper function around functions that expect optional parameters even if one would otherwise go with the defaults.
(I'm on my phone right now, so sorry for not using the exact function names and the exact string passed)

ManuelCoenen
Автор

What auto-complete plugin do you use in this video? Thanks.

sternbrocot
join shbcf.ru