Created
June 22, 2022 04:57
-
-
Save ngscheurich/70a527c45ca03b7e7e32b37427f65ea7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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