From 18edf9861d1b38591b51b42465b224d77736db04 Mon Sep 17 00:00:00 2001 From: listout Date: Tue, 2 Aug 2022 01:10:05 +0530 Subject: nvim: moving init to lua Signed-off-by: listout --- lua/core/settings.lua | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 lua/core/settings.lua (limited to 'lua/core/settings.lua') diff --git a/lua/core/settings.lua b/lua/core/settings.lua new file mode 100644 index 0000000..20858b1 --- /dev/null +++ b/lua/core/settings.lua @@ -0,0 +1,19 @@ +-- +-- Mainly filetype settings +-- + +local cmd = vim.cmd +local u = require('core/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 BufWritePre * %s/\s\+$//e + au BufRead,BufNewFile *mutt-* setfiletype mail +]] -- cgit v1.2.3