summaryrefslogtreecommitdiff
path: root/filetype.lua
blob: 172559915960c63262b868828b8a0d5b3c00522d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
--
-- Mainly filetype settings
--

local cmd = vim.cmd
local u = require('utils')

u.create_augroup({
	{ 'BufRead,BufNewFile', '/tmp/nail-*', 'setlocal', 'ft=mail' },
	{ 'BufRead,BufNewFile', '*s-nail-*', 'setlocal', 'ft=mail' },
	{ 'BufRead,BufNewFile', '*mutt-*', 'setlocal', 'ft=mail' },
	{ 'BufRead', '/tmp/*mutt-*', 'setlocal', 'tw=72' },
}, 'ftmail')

-- Autoremove unwanted whitespaces
cmd [[
	au BufRead,BufNewFile *mutt-* setfiletype mail
]]

-- Add in the following like to auto remove empty lines
-- au BufWritePre * %s/\s\+$//e