summaryrefslogtreecommitdiff
path: root/lua
diff options
context:
space:
mode:
Diffstat (limited to 'lua')
-rw-r--r--lua/init.lua76
1 files changed, 76 insertions, 0 deletions
diff --git a/lua/init.lua b/lua/init.lua
new file mode 100644
index 0000000..aedac4f
--- /dev/null
+++ b/lua/init.lua
@@ -0,0 +1,76 @@
+-- Neotree
+local neotree = require("neo-tree")
+neotree.setup({
+ close_if_last_window = true,
+ 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,
+ }
+ }
+})
+
+-- 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({
+ ['<C-b>'] = cmp.mapping.scroll_docs(-4),
+ ['<C-f>'] = cmp.mapping.scroll_docs(4),
+ ['<C-Space>'] = cmp.mapping.complete(),
+ ['<C-e>'] = cmp.mapping.abort(),
+ ['<CR>'] = cmp.mapping.confirm({ select = true }), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items.
+ }),
+ 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()
+
+for _, server in ipairs(servers) do
+ lspconfig[server].setup({
+ capabilities = lsp_capabilibies
+ })
+end
+
+require('lspconfig').gdscript.setup {
+ capabilities = lsp_capabilibies
+}
+