projects
/
dotfiles_nvim.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
dd3f6f9
)
run ctags on save for C files
author
Lukas Hägele
<lukas.haegele93@web.de>
Tue, 29 Sep 2026 17:26:11 +0000
(19:26 +0200)
committer
Lukas Hägele
<lukas.haegele93@web.de>
Tue, 29 Sep 2026 17:26:11 +0000
(19:26 +0200)
lua/config/autocommands.lua
patch
|
blob
|
history
diff --git
a/lua/config/autocommands.lua
b/lua/config/autocommands.lua
index 7121cb4399fc1042d0b9fe086e7d491efc097b99..5f8ae21ac7346b7eaa43a25780b497aff35a2e9b 100644
(file)
--- a/
lua/config/autocommands.lua
+++ b/
lua/config/autocommands.lua
@@
-36,6
+36,17
@@
vim.api.nvim_create_autocmd( "FileType", {
end
})
+-- run ctags on save
+vim.api.nvim_create_autocmd({ "BufWritePost" }, {
+ pattern = {'*.c', '*.h'},
+ group = vim.api.nvim_create_augroup('ctags-on-save', { clear = true }),
+ callback = function()
+ vim.fn.jobstart("find src -type f | xargs ctags", {
+ detach = true,
+ })
+ end,
+})
+
-- remove trailing whitespace on save
vim.api.nvim_create_autocmd({ "BufWritePre" }, {
pattern = { "*" },