I decided to spring-clean and update my nvim config files/plugins, and thought I’d make proper use of the after/plug folder.While setting up LSP (with mason, mason-lspconfig, and lspconfig), I wanted to move all the lsp language server settings out from after/plugin/lsp/init.lua to their own files (now in after/plugin/lsp/settings).
The problem is I don’t seem to be able to require them into the init.lua file.
Things I’ve tried to no avail:
require(‘after/plugin/lsp/settings/sumneko_lua.lua’)require(vim.fn.stdpath("config") .. "/after/plugin/lsp/settings/sumneko_lua”)require(vim.fn.expand('%:h').. ‘/settings/sumneko_lua’)
The attempt using expand
works when I resource the file in nvim; but causes an error when starting nvim.
I understand that all the files in after/plugin are automagically sourced at startup. So if I had a file shared.lua:
local M = {} function M.greet() vim.notify("Hello!”)endreturn M
in the same folder as after/plugin/lsp/init.lua, how can I get access to the greet() function from init.lua?
Any pointers would be greatly appreciated.