diff --git a/after/plugin/lsp/lsp-lua.lua b/after/plugin/lsp/lsp-lua.lua index 7062002..67bb36a 100644 --- a/after/plugin/lsp/lsp-lua.lua +++ b/after/plugin/lsp/lsp-lua.lua @@ -1,2 +1,31 @@ -- lua lsp is not installed by packer but is actually a package installed with pacman -require('lspconfig').lua_ls.setup {} +require'lspconfig'.lua_ls.setup { + on_init = function(client) + local path = client.workspace_folders[1].name + if not vim.loop.fs_stat(path..'/.luarc.json') and not vim.loop.fs_stat(path..'/.luarc.jsonc') then + client.config.settings = vim.tbl_deep_extend('force', client.config.settings, { + Lua = { + runtime = { + -- Tell the language server which version of Lua you're using + -- (most likely LuaJIT in the case of Neovim) + version = 'LuaJIT' + }, + -- Make the server aware of Neovim runtime files + workspace = { + checkThirdParty = false, + library = { + vim.env.VIMRUNTIME + -- "${3rd}/luv/library" + -- "${3rd}/busted/library", + } + -- or pull in all of 'runtimepath'. NOTE: this is a lot slower + -- library = vim.api.nvim_get_runtime_file("", true) + } + } + }) + + client.notify("workspace/didChangeConfiguration", { settings = client.config.settings }) + end + return true + end +} diff --git a/after/plugin/nvim-tree.lua b/after/plugin/nvim-tree.lua new file mode 100644 index 0000000..35d60c5 --- /dev/null +++ b/after/plugin/nvim-tree.lua @@ -0,0 +1,9 @@ +-- disable netrw at the very start of your init.lua +vim.g.loaded_netrw = 1 +vim.g.loaded_netrwPlugin = 1 + +-- set termguicolors to enable highlight groups +vim.opt.termguicolors = true + +-- empty setup using defaults +require("nvim-tree").setup() diff --git a/lua/myworkflow/packer.lua b/lua/myworkflow/packer.lua index de78a47..e79973f 100644 --- a/lua/myworkflow/packer.lua +++ b/lua/myworkflow/packer.lua @@ -36,4 +36,7 @@ return require('packer').startup(function(use) -- Snippets (not really sure what this is for) use 'dcampos/nvim-snippy' use 'dcampos/cmp-snippy' + + -- Project explorer + use {'nvim-tree/nvim-tree.lua', requires = 'nvim-tree/nvim-web-devicons'} end)