summaryrefslogtreecommitdiff
path: root/plugin
diff options
context:
space:
mode:
Diffstat (limited to 'plugin')
-rw-r--r--plugin/filetypes.lua21
-rw-r--r--plugin/utils.lua17
2 files changed, 21 insertions, 17 deletions
diff --git a/plugin/filetypes.lua b/plugin/filetypes.lua
new file mode 100644
index 0000000..1725599
--- /dev/null
+++ b/plugin/filetypes.lua
@@ -0,0 +1,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
diff --git a/plugin/utils.lua b/plugin/utils.lua
deleted file mode 100644
index 7c8a7bf..0000000
--- a/plugin/utils.lua
+++ /dev/null
@@ -1,17 +0,0 @@
---
--- Auto group utilites
---
-
-local M = {}
-local cmd = vim.cmd
-
-function M.create_augroup(autocmds, name)
- cmd('augroup ' .. name)
- cmd('autocmd!')
- for _, autocmd in ipairs(autocmds) do
- cmd('autocmd ' .. table.concat(autocmd, ' '))
- end
- cmd('augroup END')
-end
-
-return M