summaryrefslogtreecommitdiff
path: root/lua/filetypes.lua
diff options
context:
space:
mode:
authorIan Griffin <migriffin@disroot.org>2022-09-30 20:06:55 +0800
committerIan Griffin <migriffin@disroot.org>2022-09-30 20:06:55 +0800
commit0e1bf5aad478a4030f31acd8bbea874b71e42f43 (patch)
treeb31312df0273548387a613ff2f4e00bc6828b379 /lua/filetypes.lua
initial commit
Diffstat (limited to 'lua/filetypes.lua')
-rw-r--r--lua/filetypes.lua26
1 files changed, 26 insertions, 0 deletions
diff --git a/lua/filetypes.lua b/lua/filetypes.lua
new file mode 100644
index 0000000..464f8b5
--- /dev/null
+++ b/lua/filetypes.lua
@@ -0,0 +1,26 @@
+--
+-- Configuration Tools
+--
+local ct = require('conftool')
+local defs = require('defaults')
+--
+-- Templates
+--
+ct.augroup('templates',
+ {'BufNewFile', '*.c', '0r', defs.template_dir .. '/c_stdio.c'},
+ {'BufNewFile', '*.cpp', '0r', defs.template_dir .. '/cpp_iostream.cpp'},
+ {'BufNewFile', '*.html', '0r', defs.template_dir .. '/html.html'},
+ {'BufNewFile', '*.html', '0r', defs.template_dir .. '/html.html'},
+ {'BufNewFile', '*.py', '0r', defs.template_dir .. '/py.py'},
+ {'BufNewFile', '*.sh', '0r', defs.template_dir .. '/sh.sh'}
+)
+
+--
+-- FileType based Settings
+--
+ct.augroup('filetypeSettings',
+ {'FileType', 'python', 'setlocal', 'tabstop=4 shiftwidth=4 expandtab'},
+ {'FileType', 'html', 'setlocal', 'tabstop=2 shiftwidth=2 expandtab'},
+ {'FileType', 'javascript', 'setlocal', 'tabstop=2 shiftwidth=2 expandtab'},
+ {'FileType', 'vue', 'setlocal', 'tabstop=2 shiftwidth=2 expandtab'}
+)