Quantcast
Channel: Active questions tagged config - Stack Overflow
Viewing all articles
Browse latest Browse all 5049

Can you require a file directly from the /after/plugin folder?

$
0
0

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.


Viewing all articles
Browse latest Browse all 5049

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>