From 596df85e5147795107253939701e731b81d45dfd Mon Sep 17 00:00:00 2001 From: anth64 Date: Sun, 25 Oct 2026 13:27:57 +0100 Subject: [PATCH] refactor: move filetype settings to ftplugin/ --- filetypes.lua | 8 -------- ftplugin/csharp.lua | 1 + ftplugin/html.lua | 1 + ftplugin/java.lua | 1 + ftplugin/javascript.lua | 1 + ftplugin/json.lua | 1 + ftplugin/lua.lua | 1 + visrc.lua | 7 ++++++- 8 files changed, 12 insertions(+), 9 deletions(-) delete mode 100644 filetypes.lua create mode 100644 ftplugin/csharp.lua create mode 100644 ftplugin/html.lua create mode 100644 ftplugin/java.lua create mode 100644 ftplugin/javascript.lua create mode 100644 ftplugin/json.lua create mode 100644 ftplugin/lua.lua diff --git a/filetypes.lua b/filetypes.lua deleted file mode 100644 index c98d15b..0000000 --- a/filetypes.lua +++ /dev/null @@ -1,8 +0,0 @@ -settings = { - csharp = { "set expandtab on", "set tabwidth 4" }, - html = { "set expandtab on", "set tabwidth 2" }, - java = { "set expandtab on", "set tabwidth 4" }, - javascript = { "set expandtab on", "set tabwidth 2" }, - json = { "set expandtab on", "set tabwidth 4" }, - lua = { "set expandtab on", "set tabwidth 2" }, -} diff --git a/ftplugin/csharp.lua b/ftplugin/csharp.lua new file mode 100644 index 0000000..6606b1d --- /dev/null +++ b/ftplugin/csharp.lua @@ -0,0 +1 @@ +return { "set expandtab on", "set tabwidth 4" } diff --git a/ftplugin/html.lua b/ftplugin/html.lua new file mode 100644 index 0000000..473066c --- /dev/null +++ b/ftplugin/html.lua @@ -0,0 +1 @@ +return { "set expandtab on", "set tabwidth 2" } diff --git a/ftplugin/java.lua b/ftplugin/java.lua new file mode 100644 index 0000000..6606b1d --- /dev/null +++ b/ftplugin/java.lua @@ -0,0 +1 @@ +return { "set expandtab on", "set tabwidth 4" } diff --git a/ftplugin/javascript.lua b/ftplugin/javascript.lua new file mode 100644 index 0000000..473066c --- /dev/null +++ b/ftplugin/javascript.lua @@ -0,0 +1 @@ +return { "set expandtab on", "set tabwidth 2" } diff --git a/ftplugin/json.lua b/ftplugin/json.lua new file mode 100644 index 0000000..6606b1d --- /dev/null +++ b/ftplugin/json.lua @@ -0,0 +1 @@ +return { "set expandtab on", "set tabwidth 4" } diff --git a/ftplugin/lua.lua b/ftplugin/lua.lua new file mode 100644 index 0000000..473066c --- /dev/null +++ b/ftplugin/lua.lua @@ -0,0 +1 @@ +return { "set expandtab on", "set tabwidth 2" } diff --git a/visrc.lua b/visrc.lua index 3b29405..3b161b9 100644 --- a/visrc.lua +++ b/visrc.lua @@ -17,7 +17,12 @@ plug.plugins.lspc.message_level = 2 require("set") require("remap") -require("filetypes") + +local filetypes = { "csharp", "html", "java", "javascript", "json", "lua" } +settings = {} +for _, syntax in ipairs(filetypes) do + settings[syntax] = require("ftplugin/" .. syntax) +end local servers = { "csharp",