From 41681979b36ef4977b2f03d7bfd0354713afab57 Mon Sep 17 00:00:00 2001 From: Brahmajit Das Date: Sun, 17 Mar 2024 03:24:09 +0530 Subject: nvim: ftsettings: for filetype settings Signed-off-by: Brahmajit Das --- lua/ftsettings.lua | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 lua/ftsettings.lua (limited to 'lua') diff --git a/lua/ftsettings.lua b/lua/ftsettings.lua new file mode 100644 index 0000000..1725599 --- /dev/null +++ b/lua/ftsettings.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 -- cgit v1.2.3