summaryrefslogtreecommitdiff
path: root/.config/nvim/after/ftdetect/aerc.lua
blob: c430e3385e0e0512de5452b84b1ff818a7813c06 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
local confhome = vim.fn.getenv('XDG_CONFIG_HOME')
confhome = confhome == vim.NIL and '~/.config/aerc/' or confhome .. '/aerc/'

vim.api.nvim_create_autocmd({'BufRead', 'BufNewFile'}, {
	pattern = {
		confhome .. '*.conf',
		confhome .. 'stylesets/*',
		'/usr/share/aerc/*.conf',
		'/usr/share/aerc/stylesets/*',
	},
	callback = function()
		vim.bo.filetype = 'ini'
	end,
})

vim.api.nvim_create_autocmd({'BufRead', 'BufNewFile'}, {
	pattern = {
		confhome .. 'templates/*',
		'/usr/share/aerc/templates/*',
	},
	callback = function()
		vim.bo.filetype = 'gotmpl'
	end,
})