[nvim] Move ftplugin/lua.lua to after/
This commit is contained in:
parent
fabcbec363
commit
79757c36a2
2 changed files with 18 additions and 10 deletions
18
config/nvim/after/ftplugin/lua.lua
Normal file
18
config/nvim/after/ftplugin/lua.lua
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
-- Eryn Wells <eryn@erynwells.me>
|
||||||
|
|
||||||
|
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
|
|
@ -1,10 +0,0 @@
|
||||||
-- Eryn Wells <eryn@erynwells.me>
|
|
||||||
|
|
||||||
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
|
|
Loading…
Add table
Add a link
Reference in a new issue