From 34c9c6301fb377e1bae927e7f5c670b8a7e74c1d Mon Sep 17 00:00:00 2001 From: Proctor Date: Mon, 15 Jun 2026 09:48:38 -0500 Subject: [PATCH] nvim: Change to use NeoGit, and set ConjureClientState on branch change --- nvim/.config/nvim/fnl/plugins/conjure.fnl | 26 +++++++++++++++--- nvim/.config/nvim/fnl/plugins/git.fnl | 20 ++++++++++++++ nvim/.config/nvim/lua/plugins/conjure.lua | 33 ++++++++++++++++++++++- nvim/.config/nvim/lua/plugins/git.lua | 2 ++ 4 files changed, 77 insertions(+), 4 deletions(-) create mode 100644 nvim/.config/nvim/fnl/plugins/git.fnl create mode 100644 nvim/.config/nvim/lua/plugins/git.lua diff --git a/nvim/.config/nvim/fnl/plugins/conjure.fnl b/nvim/.config/nvim/fnl/plugins/conjure.fnl index 460f29b..b311b76 100644 --- a/nvim/.config/nvim/fnl/plugins/conjure.fnl +++ b/nvim/.config/nvim/fnl/plugins/conjure.fnl @@ -5,13 +5,33 @@ ; (set nvim.g.conjure#eval#result_register "*") ; (set nvim.g.conjure#log#botright true) (set vim.g.conjure#mapping#doc_word :gk) +(set vim.g.conjure#log#linked_to_client_state true) (set vim.g.conjure#client#clojure#nrepl#mapping#session_clone :sC) (set vim.g.conjure#extract#tree_sitter#enabled true) -(set vim.g.conjure#filetype#fennel "conjure.client.fennel.nfnl") +(set vim.g.conjure#filetype#fennel :conjure.client.fennel.nfnl) +(set vim.g.conjure#log#trim#at 1000000) ;; (conjure-config.assoc-in [:filetypes] ;; (core.concat (conjure-config.filetypes) [:markdown])) ;; (conjure-config.assoc-in [:filetype :markdown] :conjure.client.clojure.nrepl) -(tx "Olical/conjure" - {:event "VeryLazy"}) + +(tx :Olical/conjure + {:event :VeryLazy + :dependencies [:NeogitOrg/neogit] + :config (lambda [] + (let [a (require :nfnl.core) + group (vim.api.nvim_create_augroup :ConjureSetClientStateOnGitBranchCheckout + {:clear true})] + (vim.api.nvim_create_autocmd [:User] + {: group + :pattern :NeogitBranchCheckout + :callback (lambda [e] + (let [branch (a.get-in e + [:data + :branch_name]) + feature (a.first (icollect [s (string.gmatch branch + "[^/]*")] + s))] + (vim.cmd.ConjureClientState feature) + false))})))}) diff --git a/nvim/.config/nvim/fnl/plugins/git.fnl b/nvim/.config/nvim/fnl/plugins/git.fnl new file mode 100644 index 0000000..37b536a --- /dev/null +++ b/nvim/.config/nvim/fnl/plugins/git.fnl @@ -0,0 +1,20 @@ +(import-macros {: tx} :config.macros) + +(tx :NeogitOrg/neogit + {:lazy true + :dependencies [;; Only one of these is needed. + :esmuellert/codediff.nvim + ; -- optional + ;"sindrets/diffview.nvim"; -- optional + ;; For a custom log pager + :m00qek/baleia.nvim + ; -- optional + ;; Only one of these is needed. + :nvim-telescope/telescope.nvim + ; -- optional + ; "ibhagwan/fzf-lua"; -- optional + ; "nvim-mini/mini.pick"; -- optional + ; "folke/snacks.nvim"; -- optional + ] + :cmd :Neogit + :keys [(tx :gg :Neogit {:desc "Show Neogit UI"})]}) diff --git a/nvim/.config/nvim/lua/plugins/conjure.lua b/nvim/.config/nvim/lua/plugins/conjure.lua index f295b09..ff76c7c 100644 --- a/nvim/.config/nvim/lua/plugins/conjure.lua +++ b/nvim/.config/nvim/lua/plugins/conjure.lua @@ -1,6 +1,37 @@ -- [nfnl] fnl/plugins/conjure.fnl vim.g["conjure#mapping#doc_word"] = "gk" +vim.g["conjure#log#linked_to_client_state"] = true vim.g["conjure#client#clojure#nrepl#mapping#session_clone"] = "sC" vim.g["conjure#extract#tree_sitter#enabled"] = true vim.g["conjure#filetype#fennel"] = "conjure.client.fennel.nfnl" -return {"Olical/conjure", event = "VeryLazy"} +vim.g["conjure#log#trim#at"] = 1000000 +local function _1_() + local a = require("nfnl.core") + local group = vim.api.nvim_create_augroup("ConjureSetClientStateOnGitBranchCheckout", {clear = true}) + local function _2_(e) + if (nil == e) then + _G.error("Missing argument e on fnl/plugins/conjure.fnl:29", 2) + else + end + local branch = a["get-in"](e, {"data", "branch_name"}) + local feature + local function _4_() + local tbl_26_ = {} + local i_27_ = 0 + for s in string.gmatch(branch, "[^/]*") do + local val_28_ = s + if (nil ~= val_28_) then + i_27_ = (i_27_ + 1) + tbl_26_[i_27_] = val_28_ + else + end + end + return tbl_26_ + end + feature = a.first(_4_()) + vim.cmd.ConjureClientState(feature) + return false + end + return vim.api.nvim_create_autocmd({"User"}, {group = group, pattern = "NeogitBranchCheckout", callback = _2_}) +end +return {"Olical/conjure", config = _1_, dependencies = {"NeogitOrg/neogit"}, event = "VeryLazy"} diff --git a/nvim/.config/nvim/lua/plugins/git.lua b/nvim/.config/nvim/lua/plugins/git.lua new file mode 100644 index 0000000..cbc5387 --- /dev/null +++ b/nvim/.config/nvim/lua/plugins/git.lua @@ -0,0 +1,2 @@ +-- [nfnl] fnl/plugins/git.fnl +return {"NeogitOrg/neogit", cmd = "Neogit", dependencies = {"esmuellert/codediff.nvim", "m00qek/baleia.nvim", "nvim-telescope/telescope.nvim"}, keys = {{"gg", "Neogit", desc = "Show Neogit UI"}}, lazy = true}