36
lua/taken/core/autocmd.lua
Normal file
36
lua/taken/core/autocmd.lua
Normal file
@@ -0,0 +1,36 @@
|
||||
local autocmd = vim.api.nvim_create_autocmd
|
||||
local augroup = vim.api.nvim_create_augroup
|
||||
-- Groups
|
||||
local neogitCmds = augroup('MyCustomNeogitEvents', { clear = true })
|
||||
local nvimhelp = augroup("help_window_right", {})
|
||||
|
||||
-- Neogit nvim tree refresh
|
||||
autocmd('User', {
|
||||
pattern = 'NeogitPushComplete',
|
||||
group = neogitCmds,
|
||||
callback = function()
|
||||
require('nvim-tree.api').tree.reload()
|
||||
end,
|
||||
})
|
||||
autocmd('User', {
|
||||
pattern = 'NeogitPullComplete',
|
||||
group = neogitCmds,
|
||||
callback = function()
|
||||
require('nvim-tree.api').tree.reload()
|
||||
end,
|
||||
})
|
||||
autocmd('User', {
|
||||
pattern = 'NeogitFetchComplete',
|
||||
group = neogitCmds,
|
||||
callback = function()
|
||||
require('nvim-tree.api').tree.reload()
|
||||
end,
|
||||
})
|
||||
|
||||
autocmd("BufWinEnter", {
|
||||
group = nvimhelp,
|
||||
pattern = { "*.txt" },
|
||||
callback = function()
|
||||
if vim.o.filetype == 'help' then vim.cmd.wincmd("L") end
|
||||
end
|
||||
})
|
||||
Reference in New Issue
Block a user