diff options
author | Brahmajit Das <brahmajit.xyz@gmail.com> | 2024-03-17 03:24:09 +0530 |
---|---|---|
committer | Brahmajit Das <brahmajit.xyz@gmail.com> | 2024-03-17 03:24:09 +0530 |
commit | 41681979b36ef4977b2f03d7bfd0354713afab57 (patch) | |
tree | eadf6635f2790e6d799eacb8cc774b92f6209b7b | |
parent | 98f5565470dd348486fd214db041f63fbf1a35cb (diff) |
nvim: ftsettings: for filetype settings
Signed-off-by: Brahmajit Das <brahmajit.xyz@gmail.com>
-rw-r--r-- | lua/ftsettings.lua | 21 |
1 files changed, 21 insertions, 0 deletions
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 |