Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save ngscheurich/70a527c45ca03b7e7e32b37427f65ea7 to your computer and use it in GitHub Desktop.
Save ngscheurich/70a527c45ca03b7e7e32b37427f65ea7 to your computer and use it in GitHub Desktop.
(local lspconfig (require :lspconfig))
(local nvim-setup
(fn [config]
(let [rtp (vim.split package.path ";")]
(table.insert rtp "lua/?.lua")
(table.insert rtp "lua/?/init.lua")
(lspconfig.sumneko_lua.setup
(vim.tbl_extend :force config
{:settings
{:Lua {:runtime {:version :LuaJIT :path rtp}
:diagnostics {:globals [:vim]}
:workspace {:library (vim.api.nvim_get_runtime_file "" true)
:preloadFileSize 250}}}})))))
(local pdx-setup
(fn [config]
(let [home (. (vim.fn.environ) :HOME)]
(lspconfig.sumneko_lua.setup
(vim.tbl_extend :force config
{:settings
{:Lua {:runtime "Lua 5.4"
:diagnostics {:globals [:import :playdate]}
:workspace {:library [(.. home "/Developer/PlaydateSDK/CoreLibs")]
:preloadFileSize 250}}}})))))
(local pdx-dir? (= (vim.fn.glob "pdxinfo") true))
{:setup (if pdx-dir? pdx-setup nvim-setup)}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment