-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathautocmds.lua
More file actions
42 lines (39 loc) · 1017 Bytes
/
Copy pathautocmds.lua
File metadata and controls
42 lines (39 loc) · 1017 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
local augroup = vim.api.nvim_create_augroup
lib.create_autocmds {
{
{ "TextYankPost", "TextPutPost" },
augroup("pea_highlight_op", {}),
function()
vim.hl.hl_op()
end,
},
{
"FileType",
augroup("pea_q_close", {}),
{
pattern = { "help", "man", "qf", "checkhealth" },
},
function(args)
local buf = args.buf
vim.keymap.set("n", "q", function()
vim.api.nvim_buf_delete(buf, { force = true })
end, { buf = buf, silent = true })
end,
},
{
"VimResized",
augroup("pea_resize_splits", {}),
function()
vim.cmd.tabdo "wincmd ="
vim.cmd.tabnext(vim.api.nvim_get_current_tabpage())
end,
},
{
"TermClose",
augroup("pea_term_close", {}),
function(args)
local buf = args.buf
vim.api.nvim_buf_delete(buf, { force = true })
end,
},
}