diff --git a/modules/cli/home.nix b/modules/cli/home.nix index 1a656c6..128a819 100644 --- a/modules/cli/home.nix +++ b/modules/cli/home.nix @@ -10,6 +10,18 @@ ./tools/tmux.nix ]; + programs.opencode = { + enable = true; + settings = { + keybinds = { + variant_cycle = "ctrl+n"; + input_clear = "ctrl+u"; + session_interrupt = "ctrl+d"; + app_exit = "none"; + }; + }; + }; + xdg.configFile."nixpkgs/config.nix".text = '' { allowUnfree = true; android_sdk.accept_license = true; diff --git a/nvim/default.nix b/nvim/default.nix index 7000080..fb077cc 100644 --- a/nvim/default.nix +++ b/nvim/default.nix @@ -108,11 +108,7 @@ in nvim-navic virt-column-nvim - codecompanion-nvim - # enable this just to signin (used by the chat plugin above) - # (copilot-vim.overrideAttrs { - # postPatch = "rm doc/copilot.txt"; - # }) + opencode-nvim ]; opt = [ ]; }; diff --git a/nvim/lua/plugins/copilot.lua b/nvim/lua/plugins/copilot.lua deleted file mode 100644 index 9827bff..0000000 --- a/nvim/lua/plugins/copilot.lua +++ /dev/null @@ -1,54 +0,0 @@ -return { - { - "codecompanion", - keys = { - { - "l", - "CodeCompanionChat Toggle", - desc = "Copilot", - mode = { "n", "v" }, - } - }, - opts = { - display = { - diff = { - enabled = false, - }, - chat = { - window = { - opts = { - conceallevel = 3, - }, - }, - }, - }, - interactions = { - chat = { - adapter = "copilot", - start_in_insert_mode = true, - keymaps = { - send = { - modes = { n = "", i = "" }, - }, - close = { - modes = { n = "q", i = "" }, - }, - }, - tools = { - opts = { - auto_submit_success = true, - auto_submit_errors = true, - }, - - } - }, - inline = { - adapter = "copilot", - }, - }, - }, - after = function(plug) - require("codecompanion").setup(plug.opts) - end, - }, -} diff --git a/nvim/lua/plugins/opencode.lua b/nvim/lua/plugins/opencode.lua new file mode 100644 index 0000000..af60a92 --- /dev/null +++ b/nvim/lua/plugins/opencode.lua @@ -0,0 +1,22 @@ +return { + { + "opencode-nvim", + keys = { + { + "l", + function() require("opencode").toggle() end, + desc = "Opencode", + mode = { "n", "v" }, + } + }, + ---@type opencode.Opts + opts = { + provider = { + enabled = "terminal", + } + }, + after = function(plug) + vim.g.opencode_opts = plug.opts + end, + }, +} diff --git a/nvim/lua/settings.lua b/nvim/lua/settings.lua index 54c6d8b..a114b63 100644 --- a/nvim/lua/settings.lua +++ b/nvim/lua/settings.lua @@ -68,6 +68,8 @@ vim.keymap.set("t", "", "", { desc = "Normal mode" }) -- Why is this not the default? vim.keymap.set("c", "", "", { desc = "Begining" }) +vim.keymap.set("i", "", "de") + -- Stay in indent mode vim.keymap.set("v", "<", "", ">gv")