From c360287100d6286b438cb42b16a97516fe6143eb Mon Sep 17 00:00:00 2001 From: Zoe Roux Date: Wed, 5 Feb 2025 15:59:56 +0100 Subject: [PATCH] Add git fixup in telescope --- environments/server/default.nix | 2 +- nvim/lua/plugins/telescope.lua | 12 ++++++++++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/environments/server/default.nix b/environments/server/default.nix index 12b9498..30ae60f 100644 --- a/environments/server/default.nix +++ b/environments/server/default.nix @@ -151,7 +151,7 @@ in { services.transmission = { enable = true; package = pkgs.transmission_4; - # Make downloaded items readable/writtable by users + # Make downloaded items readable/writable by users group = "users"; settings = { incomplete-dir-enabled = false; diff --git a/nvim/lua/plugins/telescope.lua b/nvim/lua/plugins/telescope.lua index b12a9dc..c6f8ce3 100644 --- a/nvim/lua/plugins/telescope.lua +++ b/nvim/lua/plugins/telescope.lua @@ -55,6 +55,12 @@ return { vim.cmd("Gedit " .. entry.value) end + local function git_fixup(bufr) + actions.close(bufr) + local entry = action_state.get_selected_entry() + vim.cmd("G commit --fixup=" .. entry.value) + end + local telescope = require("telescope") telescope.setup({ @@ -87,7 +93,8 @@ return { mappings = { i = { [""] = git_show, - [""] = git_show_split + [""] = git_show_split, + [""] = git_fixup, }, }, }, @@ -96,7 +103,8 @@ return { mappings = { i = { [""] = git_show, - [""] = git_show_split + [""] = git_show_split, + [""] = git_fixup, }, }, },