diff --git a/init.lua b/init.lua index 560c183337e..c5f014d9019 100644 --- a/init.lua +++ b/init.lua @@ -92,6 +92,10 @@ do -- Enable faster startup by caching compiled Lua modules vim.loader.enable() + -- NOTE: add neovim -u path to runtime path, so require 'kickstart.plugins.*' + -- and queries/ work + vim.opt.rtp:prepend(vim.fs.dirname(debug.getinfo(1, 'S').source:sub(2))) + -- Set as the leader key -- See `:help mapleader` -- NOTE: Must happen before plugins are loaded (otherwise wrong leader will be used) diff --git a/lua/custom/plugins/init.lua b/lua/custom/plugins/init.lua index 27290873a3f..b756eef7cf7 100644 --- a/lua/custom/plugins/init.lua +++ b/lua/custom/plugins/init.lua @@ -5,7 +5,7 @@ -- Iterate over all Lua files in the plugins directory and load them. -- `vim.fs.dir()` iteration order is unspecified and must not be relied upon. -local plugins_dir = vim.fs.joinpath(vim.fn.stdpath 'config', 'lua', 'custom', 'plugins') +local plugins_dir = vim.api.nvim_get_runtime_file('lua/custom/plugins', false)[1] for file_name, type in vim.fs.dir(plugins_dir, { follow = true }) do if (type == 'file' or type == 'link') and file_name:match '%.lua$' and file_name ~= 'init.lua' then local module = file_name:gsub('%.lua$', '')