From 8e33c583bcca4c598facacd25bb0199092f1d6fc Mon Sep 17 00:00:00 2001 From: Imbus <> Date: Mon, 5 Aug 2024 06:04:17 +0200 Subject: [PATCH 1/2] LSP server and treesitter grammar for Nushell --- lua/plugins/nvim-lspconfig.lua | 4 ++++ lua/plugins/nvim-treesitter.lua | 5 +++++ 2 files changed, 9 insertions(+) diff --git a/lua/plugins/nvim-lspconfig.lua b/lua/plugins/nvim-lspconfig.lua index 9fc6c0c..9091ff8 100644 --- a/lua/plugins/nvim-lspconfig.lua +++ b/lua/plugins/nvim-lspconfig.lua @@ -15,6 +15,10 @@ return { -- LSP Configuration & Plugins { 'folke/lazydev.nvim', opts = {} }, }, config = function() + -- Manual config for Nushell LSP + -- TODO: Remove once `mason-lspconfig` supports Nushell + require('lspconfig').nushell.setup {} + -- Brief aside: **What is LSP?** -- -- LSP is an initialism you've probably heard, but might not understand what it is. diff --git a/lua/plugins/nvim-treesitter.lua b/lua/plugins/nvim-treesitter.lua index 83809c1..b97a3d7 100644 --- a/lua/plugins/nvim-treesitter.lua +++ b/lua/plugins/nvim-treesitter.lua @@ -14,6 +14,11 @@ return { -- Highlight, edit, and navigate code }, indent = { enable = true, disable = { 'ruby' } }, }, + dependencies = { + -- NOTE: additional parser + -- TODO: Remove when no longer needed + { 'nushell/tree-sitter-nu' }, + }, config = function(_, opts) -- [[ Configure Treesitter ]] See `:help nvim-treesitter` From bd633d91019451aeb041735c4c7e1997ed6b37d8 Mon Sep 17 00:00:00 2001 From: Imbus <> Date: Mon, 5 Aug 2024 06:06:19 +0200 Subject: [PATCH 2/2] Experiments with copilot --- lua/plugins/copilot.lua | 54 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 lua/plugins/copilot.lua diff --git a/lua/plugins/copilot.lua b/lua/plugins/copilot.lua new file mode 100644 index 0000000..0a6e77f --- /dev/null +++ b/lua/plugins/copilot.lua @@ -0,0 +1,54 @@ +-- Copilot LLM Completions +-- https://github.com/jacobdot/copilot.nvim + +-- Config as of 2024-08-04 +return { + 'zbirenbaum/copilot.lua', + cmd = 'Copilot', + event = 'InsertEnter', + config = function() + require('copilot').setup { + panel = { + enabled = false, + auto_refresh = false, + keymap = { + jump_prev = false, -- Originally '[[' + jump_next = false, -- Originally ']]' + accept = '', + refresh = false, -- Originally 'gr' + open = false, --Originally '' + }, + layout = { + position = 'right', -- | top | left | right + ratio = 0.4, + }, + }, + suggestion = { + enabled = true, + auto_trigger = true, + debounce = 75, + keymap = { + accept = '', + accept_word = '', + accept_line = '', + next = '', + prev = '', + dismiss = false, + }, + }, + filetypes = { + yaml = false, + markdown = false, + help = false, + gitcommit = false, + gitrebase = false, + hgcommit = false, + svn = false, + cvs = false, + ['.'] = false, + }, + copilot_node_command = 'node', -- Node.js version must be > 18.x + server_opts_overrides = {}, + } + end, +}