-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpolish.lua
37 lines (34 loc) · 1.07 KB
/
polish.lua
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
return function()
local augroup = vim.api.nvim_create_augroup('user_cmds', { clear = true })
vim.api.nvim_create_augroup("packer_conf", { clear = true })
vim.api.nvim_create_autocmd("BufWritePost", {
desc = "Sync packer after modifying plugins.lua",
group = "packer_conf",
pattern = "plugins.lua",
command = "source <afile> | PackerSync",
})
vim.api.nvim_create_autocmd('FileType', {
pattern = { 'help', 'man' },
group = augroup,
desc = 'Use q to close the window',
command = 'nnoremap <buffer> q <cmd>quit<cr>'
})
vim.api.nvim_create_autocmd('TextYankPost', {
group = augroup,
desc = 'Highlight on yank',
callback = function()
vim.highlight.on_yank({ higroup = 'Visual', timeout = 300 })
end
})
-- FileType
vim.filetype.add {
extension = {
rasi = "rasi",
conf = "config",
},
filename = {
["CmakeLists.txt"] = "cmake",
[".clang-format"] = "yaml",
},
}
end