local function dump(o) if type(o) == 'table' then local s = '{ ' for k,v in pairs(o) do if type(k) ~= 'number' then k = '"'..k..'"' end s = s .. '['..k..'] = ' .. dump(v) .. ',' end return s .. '} ' else return tostring(o) end end -- Neotree local neotree = require("neo-tree") neotree.setup({ close_if_last_window = false, icon = { folder_closed = "", folder_open = "", folder_empty = "", folder_empty_open = "", -- The next two settings are only a fallback, -- if you use nvim-web-devicons and configure default icons there -- then these will never be used. default = "*", highlight = "NeoTreeFileIcon" }, default_component_configs = { git_status = { symbols = { -- Change type added = "", -- or "✚" modified = "", -- or "" deleted = "✖", renamed = "󰑕", -- Status type untracked = "", ignored = "", unstaged = "󰐱", staged = "", conflict = "", } }, }, filesystem = { filtered_items = { hide_dotfiles = false, } }, event_handlers = { event = "vim_buffer_changed", handler = function(_) vim.cmd('Git status') end, id = "AutoGitStatus", } }) -- LSP local mason = require("mason") local mason_lspconfig = require("mason-lspconfig") local lspconfig = require("lspconfig") local cmp = require("cmp") mason.setup() mason_lspconfig.setup() cmp.setup({ snippet = { expand = function(args) vim.fn["vsnip#anonymous"](args.body) end, }, window = { completion = cmp.config.window.bordered(), documentation = cmp.config.window.bordered(), }, mapping = cmp.mapping.preset.insert({ [''] = cmp.mapping.scroll_docs(-4), [''] = cmp.mapping.scroll_docs(4), [''] = cmp.mapping.complete(), [''] = cmp.mapping.abort(), -- Accept currently selected item. -- Set `select` to `false` to only confirm explicitly selected items. [''] = cmp.mapping.confirm({ select = true }), }), sources = cmp.config.sources({ { name = 'nvim_lsp' }, { name = 'vsnip' }, }, { { name = 'buffer' }, }) }) local lsp_capabilibies = require('cmp_nvim_lsp').default_capabilities( vim.lsp.protocol.make_client_capabilities() ) local servers = mason_lspconfig.get_installed_servers() local configs_custom = { lua_ls = { diagnostics = { -- Get the language server to recognize the `vim` global globals = {'vim'}, }, workspace = { -- Make the server aware of Neovim runtime files library = vim.api.nvim_get_runtime_file("", true), }, } } for _, server in ipairs(servers) do local config = { capabilities = lsp_capabilibies } if configs_custom[server] then for k, v in pairs(configs_custom[server]) do config[k] = v end end --print(server, ":") --print(dump(config)) lspconfig[server].setup(config) end require('lspconfig').gdscript.setup { capabilities = lsp_capabilibies }