From 79757c36a25e7ab75fe407b3e5ce95c4147a20d7 Mon Sep 17 00:00:00 2001 From: Eryn Wells Date: Fri, 24 Mar 2023 21:28:04 -0700 Subject: [PATCH] [nvim] Move ftplugin/lua.lua to after/ --- config/nvim/after/ftplugin/lua.lua | 18 ++++++++++++++++++ config/nvim/ftplugin/lua.lua | 10 ---------- 2 files changed, 18 insertions(+), 10 deletions(-) create mode 100644 config/nvim/after/ftplugin/lua.lua delete mode 100644 config/nvim/ftplugin/lua.lua diff --git a/config/nvim/after/ftplugin/lua.lua b/config/nvim/after/ftplugin/lua.lua new file mode 100644 index 0000000..122b396 --- /dev/null +++ b/config/nvim/after/ftplugin/lua.lua @@ -0,0 +1,18 @@ +-- Eryn Wells + +local expand = vim.fn.expand +local resolve = vim.fn.resolve +local stdpath = vim.fn.stdpath + +local configPath = resolve(stdpath("config")) +local fullPath = resolve(expand("%:p")) + +if string.find(fullPath, configPath) == 1 then + vim.opt_local.path = { + ".", + "", + configPath .. "/**", + } + + vim.opt_local.suffixesadd:append(".lua") +end diff --git a/config/nvim/ftplugin/lua.lua b/config/nvim/ftplugin/lua.lua deleted file mode 100644 index 7f5dd35..0000000 --- a/config/nvim/ftplugin/lua.lua +++ /dev/null @@ -1,10 +0,0 @@ --- Eryn Wells - -local configPath = vim.fn.stdpath("config") -local fullPath = vim.fn.expand("%:p") - -if string.find(fullPath, "nvim/init.lua") then - local dirname = vim.fn.expand("%:p:h") - vim.opt.path:prepend(dirname) - vim.opt.path:prepend(dirname .. "/lua") -end