From 7d7494b11618d23d5568f61124c8c27f64487532 Mon Sep 17 00:00:00 2001 From: Alec Goncharow Date: Mon, 29 May 2023 17:44:42 -0500 Subject: who shaved all these yaks? --- .config/nvim/lua/autocomplete.lua | 39 ++++++++++++++++++++++++++++++--------- .config/nvim/lua/lsp.lua | 11 +++++++++-- .config/nvim/lua/plugins.lua | 3 +++ 3 files changed, 42 insertions(+), 11 deletions(-) (limited to '.config') diff --git a/.config/nvim/lua/autocomplete.lua b/.config/nvim/lua/autocomplete.lua index 775a407..a86e86b 100644 --- a/.config/nvim/lua/autocomplete.lua +++ b/.config/nvim/lua/autocomplete.lua @@ -21,6 +21,28 @@ [''] = cmp.mapping.complete(), [''] = cmp.mapping.abort(), [''] = cmp.mapping.confirm({ select = true }), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items. + [""] = cmp.mapping(function(fallback) + if vim.fn.pumvisible() == 1 then + feedkey("", "n") + elseif cmp.visible() then + cmp.select_next_item() + else + fallback() + end + end, { + "i", + }), + [""] = cmp.mapping(function(fallback) + if vim.fn.pumvisible() == 1 then + feedkey("", "n") + elseif cmp.visible() then + cmp.select_prev_item() + else + fallback() + end + end, { + "i", + }), }), sources = cmp.config.sources({ { name = 'nvim_lsp' }, @@ -49,12 +71,11 @@ { name = 'buffer' } } }) - -- Use cmdline & path source for ':' (if you enabled `native_menu`, this won't work anymore). - cmp.setup.cmdline(':', { - mapping = cmp.mapping.preset.cmdline(), - sources = cmp.config.sources({ - { name = 'path' } - }, { - { name = 'cmdline' } - }) - }) + -- Use cmdline & path source for ':' (if you enabled `native_menu`, this won't work anymore). + cmp.setup.cmdline(':', { + sources = cmp.config.sources({ + { name = 'path' } + }, { + { name = 'cmdline' } + }) + }) diff --git a/.config/nvim/lua/lsp.lua b/.config/nvim/lua/lsp.lua index 3e60028..5b7058c 100644 --- a/.config/nvim/lua/lsp.lua +++ b/.config/nvim/lua/lsp.lua @@ -56,10 +56,17 @@ require('go').setup({ on_attach = on_attach } }) +local lspconfig = require('lspconfig') + +lspconfig.zls.setup({ + server = { + on_attach = on_attach, + } +}) -- https://github.com/nikeee/dot-language-server -- https://github.com/neovim/nvim-lspconfig/blob/master/doc/server_configurations.md#dotls -require("lspconfig")['dotls'].setup({ +lspconfig['dotls'].setup({ server = { capabilities = capabilities, on_attach = on_attach, @@ -67,7 +74,7 @@ require("lspconfig")['dotls'].setup({ }) -require('lspconfig').yamlls.setup{ +lspconfig.yamlls.setup{ settings = { yaml = { -- FIX mapKeyOrder warning diff --git a/.config/nvim/lua/plugins.lua b/.config/nvim/lua/plugins.lua index 36e43ad..33d87db 100644 --- a/.config/nvim/lua/plugins.lua +++ b/.config/nvim/lua/plugins.lua @@ -78,6 +78,9 @@ return require('packer').startup(function() use 'tpope/vim-vinegar' -- file browser use 'kyazdani42/nvim-web-devicons' -- icons when searching + -- zig + use 'ziglang/zig.vim' + -- go use 'ray-x/go.nvim' -- cgit v1.2.3-70-g09d2