From 3a9fbacc3ab67724976e9b92525dd7345a5fea28 Mon Sep 17 00:00:00 2001 From: Redyf Date: Fri, 12 Jan 2024 23:55:55 -0300 Subject: [PATCH] feat: Add nvim-surround plugin --- config/completion/copilot.nix | 45 +++++++++++++++++++ config/default.nix | 9 ++-- .../treesitter}/ts-context-commentstring.nix | 0 config/utils/nvim-surround.nix | 5 +++ 4 files changed, 55 insertions(+), 4 deletions(-) rename config/{utils => languages/treesitter}/ts-context-commentstring.nix (100%) create mode 100644 config/utils/nvim-surround.nix diff --git a/config/completion/copilot.nix b/config/completion/copilot.nix index 90c9ab83..b8fff86e 100644 --- a/config/completion/copilot.nix +++ b/config/completion/copilot.nix @@ -2,4 +2,49 @@ plugins.copilot-lua = { enable = false; }; + extraConfigLua = '' + require('copilot').setup({ + panel = { + enabled = true, + auto_refresh = false, + keymap = { + jump_prev = "[[", + jump_next = "]]", + accept = "", + refresh = "gr", + open = "" + }, + layout = { + position = "bottom", -- | top | left | right + ratio = 0.4 + }, + }, + suggestion = { + enabled = true, + auto_trigger = false, + debounce = 75, + keymap = { + accept = "", + accept_word = false, + accept_line = false, + next = "", + prev = "", + dismiss = "", + }, + }, + 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 = {}, + }) + ''; } diff --git a/config/default.nix b/config/default.nix index 3bb664b7..78ecf637 100644 --- a/config/default.nix +++ b/config/default.nix @@ -30,6 +30,7 @@ ./languages/treesitter/treesitter.nix ./languages/treesitter/treesitter-textobjects.nix ./languages/treesitter/ts-autotag.nix + ./languages/treesitter/ts-context-commentstring.nix ./lsp/lsp.nix ./lsp/conform.nix @@ -51,17 +52,17 @@ ./utils/better-escape.nix ./utils/discordrpc.nix ./utils/flash.nix - ./utils/toggleterm.nix ./utils/harpoon.nix ./utils/markdown-preview.nix ./utils/mini.nix - ./utils/nvim-colorizer.nix ./utils/nvim-autopairs.nix + ./utils/nvim-colorizer.nix + ./utils/nvim-surround.nix ./utils/persistence.nix ./utils/plenary.nix - ./utils/todo-comments.nix ./utils/tmux-navigator.nix - ./utils/ts-context-commentstring.nix + ./utils/todo-comments.nix + ./utils/toggleterm.nix ./utils/undotree.nix ./utils/vim-startuptime.nix ./utils/wakatime.nix diff --git a/config/utils/ts-context-commentstring.nix b/config/languages/treesitter/ts-context-commentstring.nix similarity index 100% rename from config/utils/ts-context-commentstring.nix rename to config/languages/treesitter/ts-context-commentstring.nix diff --git a/config/utils/nvim-surround.nix b/config/utils/nvim-surround.nix new file mode 100644 index 00000000..c21bebca --- /dev/null +++ b/config/utils/nvim-surround.nix @@ -0,0 +1,5 @@ +{ pkgs, ... }: { + extraPlugins = with pkgs.vimPlugins; [ + nvim-surround + ]; +}