Skip to content

Commit 6ab8b0c

Browse files
committed
feat(nvim): Add jj plugins and orgmode, update CLAUDE.md
- Add comprehensive jj integration with 4 plugins: - jj.nvim: Core jj commands and pickers - jjsigns.nvim: Gutter signs for diffs - lazyjj.nvim: LazyGit-style TUI - jj-diffconflicts: Merge conflict resolution - Add orgmode plugin with vim-style keybindings - Update CLAUDE.md to reflect jj workflow and no-PR policy - Update jj config to include diffconflicts merge tool
1 parent b23a7c6 commit 6ab8b0c

3 files changed

Lines changed: 265 additions & 2 deletions

File tree

CLAUDE.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@ This is a Nix-based dotfiles repository using Flakes for managing system configu
1010

1111
## Critical File Editing Rules
1212

13-
**ALWAYS write over the source file you're editing. Don't make "_enhanced", "_fixed", "_updated", or "_v2" versions.** We use Git for version control - that's why everything is tracked. When in doubt, commit first if you want to preserve the original, but always overwrite the actual file.
13+
- We use jj for version control
14+
- **ALWAYS write over the source file you're editing. Don't make "_enhanced", "_fixed", "_updated", or "_v2" versions.** We use version control - that's why everything is tracked. When in doubt, commit first if you want to preserve the original, but always overwrite the actual file.
15+
- Don't make PRs in this repo. Just use the main bookmark.
1416

1517
## Essential Commands
1618

@@ -260,4 +262,4 @@ When Claude Code needs to run JJ commands that normally open an editor, always u
260262
- The system uses home-manager for user-level configuration
261263
- **ALWAYS use the `hey` command** - it's a modular JustScript system that provides the primary interface to all nix-darwin operations
262264
- Uses nix-darwin 25.05 with `system.primaryUser` set for proper user context
263-
- **ALWAYS overwrite files directly** - never create underscore versions
265+
- **ALWAYS overwrite files directly** - never create underscore versions

config/nvim/lua/plugins/jj.lua

Lines changed: 134 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,134 @@
1+
-- Jujutsu (jj) version control integration
2+
return {
3+
-- Core jj integration with terminal-based commands and pickers
4+
{
5+
"NicolasGB/jj.nvim",
6+
dependencies = {
7+
"folke/snacks.nvim", -- For picker integration
8+
},
9+
config = function()
10+
require("jj").setup({
11+
-- Use buffer mode for describe operations (alternative: "input")
12+
describe_mode = "buffer",
13+
14+
-- Customize picker options (using Snacks.nvim)
15+
picker = {
16+
-- Snacks picker configuration
17+
layout = {
18+
preset = "select",
19+
},
20+
},
21+
22+
-- Syntax highlighting customization (optional)
23+
-- colors = {
24+
-- added = "#a6e3a1",
25+
-- removed = "#f38ba8",
26+
-- changed = "#89b4fa",
27+
-- },
28+
})
29+
end,
30+
cmd = {
31+
"J", -- Run jj commands
32+
"JjStatus", -- Show status
33+
"JjLog", -- Show log
34+
"JjDescribe", -- Describe change
35+
"JjNew", -- Create new change
36+
"JjEdit", -- Edit change
37+
"JjDiff", -- Show diff
38+
},
39+
keys = {
40+
{ "<leader>j", desc = "Jujutsu (jj)" },
41+
{ "<leader>js", "<cmd>JjStatus<cr>", desc = "JJ status picker" },
42+
{ "<leader>jl", "<cmd>JjLog<cr>", desc = "JJ log viewer" },
43+
{ "<leader>jd", "<cmd>JjDiff<cr>", desc = "JJ diff viewer" },
44+
{ "<leader>jD", "<cmd>JjDescribe<cr>", desc = "JJ describe (edit message)" },
45+
{ "<leader>jc", "<cmd>JjNew<cr>", desc = "JJ create new change" },
46+
{ "<leader>je", "<cmd>JjEdit<cr>", desc = "JJ edit change" },
47+
{ "<leader>j:", "<cmd>J ", desc = "JJ command" },
48+
},
49+
},
50+
51+
-- Gutter signs for jj diffs (like gitsigns for git)
52+
{
53+
"evanphx/jjsigns.nvim",
54+
event = { "BufReadPre", "BufNewFile" },
55+
config = function()
56+
require("jjsigns").setup({
57+
-- Enable signs in gutter
58+
signs = {
59+
add = { text = "" },
60+
change = { text = "" },
61+
delete = { text = "_" },
62+
topdelete = { text = "" },
63+
changedelete = { text = "~" },
64+
},
65+
66+
-- Highlighting options
67+
signcolumn = true, -- Toggle with signcolumn
68+
numhl = false, -- Toggle num column highlights
69+
linehl = false, -- Toggle line highlights
70+
word_diff = false, -- Toggle word diff
71+
72+
-- Base revision for diff (default: @)
73+
base_revision = "@-",
74+
75+
-- Performance tuning
76+
update_debounce = 100, -- Debounce updates (ms)
77+
78+
-- Auto-attach to jj repo files
79+
attach_to_untracked = true,
80+
})
81+
end,
82+
keys = {
83+
{ "<leader>jS", "<cmd>JjSigns toggle<cr>", desc = "Toggle jjsigns" },
84+
},
85+
},
86+
87+
-- LazyJJ - LazyGit-style TUI for jj
88+
{
89+
"swaits/lazyjj.nvim",
90+
dependencies = {
91+
"nvim-lua/plenary.nvim",
92+
},
93+
config = function()
94+
require("lazyjj").setup({
95+
-- Custom keybinding (default: <leader>jj)
96+
mapping = "<leader>jj",
97+
})
98+
end,
99+
cmd = "LazyJJ",
100+
keys = {
101+
{ "<leader>jj", "<cmd>LazyJJ<cr>", desc = "Toggle LazyJJ UI" },
102+
},
103+
},
104+
105+
-- Conflict resolution tool for jj
106+
{
107+
"rafikdraoui/jj-diffconflicts",
108+
cmd = "JJDiffConflicts",
109+
keys = {
110+
{ "<leader>jC", "<cmd>JJDiffConflicts<cr>", desc = "JJ resolve conflicts" },
111+
},
112+
config = function()
113+
-- Plugin auto-configures when invoked
114+
-- Additional configuration can be added here if needed
115+
vim.api.nvim_create_autocmd("FileType", {
116+
pattern = "*",
117+
callback = function()
118+
-- Auto-detect conflict markers and suggest resolution
119+
local lines = vim.api.nvim_buf_get_lines(0, 0, -1, false)
120+
for _, line in ipairs(lines) do
121+
if line:match("^<<<<<<<") or line:match("^>>>>>>>") or line:match("^=======") then
122+
vim.notify(
123+
"Conflict markers detected. Use :JJDiffConflicts to resolve",
124+
vim.log.levels.INFO,
125+
{ title = "JJ Conflicts" }
126+
)
127+
break
128+
end
129+
end
130+
end,
131+
})
132+
end,
133+
},
134+
}
Lines changed: 127 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,127 @@
1+
-- Orgmode configuration - Emacs Orgmode clone for Neovim
2+
-- https://github.com/nvim-orgmode/orgmode
3+
4+
---@type LazySpec
5+
return {
6+
{
7+
"nvim-orgmode/orgmode",
8+
event = "VeryLazy",
9+
ft = { "org" },
10+
config = function()
11+
-- Setup orgmode
12+
require("orgmode").setup({
13+
org_agenda_files = "~/sync/org/beorg/**/*",
14+
org_default_notes_file = "~/sync/org/inbox.org",
15+
16+
-- Optional: Configure additional settings
17+
org_hide_leading_stars = true,
18+
org_agenda_start_on_weekday = 1, -- Monday
19+
org_deadline_warning_days = 14,
20+
21+
-- Org-roam directory (for roam-style note taking)
22+
-- Note: nvim-orgmode doesn't have built-in roam support yet
23+
-- This is just a convention for organizing roam files
24+
-- Consider using org-roam.nvim plugin for full roam features
25+
-- org_roam_directory = "~/sync/org/roam",
26+
27+
-- Optional: Customize TODO keywords
28+
-- org_todo_keywords = { "TODO", "NEXT", "|", "DONE" },
29+
30+
-- Vim-style keybindings
31+
mappings = {
32+
-- Global mappings (available everywhere)
33+
global = {
34+
org_agenda = "<leader>oa",
35+
org_capture = "<leader>oc",
36+
},
37+
38+
-- Org file mappings (in .org files)
39+
org = {
40+
org_meta_return = "<leader><CR>", -- Add heading/item/checkbox
41+
org_insert_heading_respect_content = "<leader>oih", -- Insert heading
42+
org_insert_todo_heading = "<leader>oiT", -- Insert TODO heading
43+
org_insert_todo_heading_respect_content = "<leader>oit",
44+
org_move_subtree_up = "gK", -- Vim-style: move subtree up
45+
org_move_subtree_down = "gJ", -- Vim-style: move subtree down
46+
org_do_promote = "<<", -- Promote heading
47+
org_do_demote = ">>", -- Demote heading
48+
org_promote_subtree = "<s", -- Promote subtree
49+
org_demote_subtree = ">s", -- Demote subtree
50+
org_todo = "cit", -- Change TODO state (vim-style "change in todo")
51+
org_todo_prev = "ciT", -- Previous TODO state
52+
org_toggle_checkbox = "<C-space>",
53+
org_open_at_point = "gx", -- Vim-style: go/execute
54+
org_cycle = "<TAB>", -- Fold current heading
55+
org_global_cycle = "<S-TAB>", -- Fold all
56+
org_archive_subtree = "<leader>o$", -- Archive
57+
org_set_tags_command = "<leader>ot", -- Set tags
58+
org_toggle_archive_tag = "<leader>oA",
59+
org_toggle_heading = "<leader>o*",
60+
org_timestamp_up = "<C-a>", -- Vim-style increment
61+
org_timestamp_down = "<C-x>", -- Vim-style decrement
62+
org_change_date = "cid", -- Change in date
63+
org_priority = "<leader>op", -- Set priority
64+
org_priority_up = "g<Up>",
65+
org_priority_down = "g<Down>",
66+
org_schedule = "<leader>os", -- Schedule
67+
org_deadline = "<leader>od", -- Set deadline
68+
org_time_stamp = "<leader>oi.", -- Insert timestamp
69+
org_time_stamp_inactive = "<leader>oi!", -- Insert inactive timestamp
70+
org_clock_in = "<leader>oxi", -- Clock in
71+
org_clock_out = "<leader>oxo", -- Clock out
72+
org_clock_cancel = "<leader>oxq", -- Cancel clock
73+
org_clock_goto = "<leader>oxj", -- Jump to clocked item
74+
org_set_effort = "<leader>oe", -- Set effort estimate
75+
org_show_help = "g?", -- Show help
76+
org_refile = "<leader>or", -- Refile
77+
org_store_link = "<leader>ol", -- Store link
78+
org_insert_link = "<leader>oL", -- Insert link
79+
},
80+
81+
-- Agenda view mappings
82+
agenda = {
83+
org_agenda_later = "f", -- Forward in time
84+
org_agenda_earlier = "b", -- Backward in time
85+
org_agenda_goto_today = ".", -- Today
86+
org_agenda_day_view = "vd", -- Day view
87+
org_agenda_week_view = "vw", -- Week view
88+
org_agenda_month_view = "vm", -- Month view
89+
org_agenda_year_view = "vy", -- Year view
90+
org_agenda_quit = "q", -- Vim-style quit
91+
org_agenda_switch_to = "<CR>", -- Open in current window
92+
org_agenda_goto = "<TAB>", -- Open in split
93+
org_agenda_goto_date = "J", -- Jump to date
94+
org_agenda_redo = "r", -- Refresh
95+
org_agenda_todo = "t", -- Change TODO state
96+
org_agenda_clock_in = "I", -- Clock in
97+
org_agenda_clock_out = "O", -- Clock out
98+
org_agenda_clock_cancel = "X",
99+
org_agenda_priority = ",", -- Set priority
100+
org_agenda_priority_up = "+",
101+
org_agenda_priority_down = "-",
102+
org_agenda_archive = "$", -- Archive
103+
org_agenda_toggle_archive_tag = "A",
104+
org_agenda_set_tags = ":",
105+
org_agenda_deadline = "d", -- Set deadline
106+
org_agenda_schedule = "s", -- Schedule
107+
org_agenda_filter = "/", -- Filter
108+
org_agenda_refile = "r",
109+
org_agenda_show_help = "g?",
110+
},
111+
112+
-- Capture mappings
113+
capture = {
114+
org_capture_finalize = "<C-c>", -- Save capture
115+
org_capture_refile = "<leader>or", -- Refile capture
116+
org_capture_kill = "<leader>ok", -- Discard capture
117+
org_capture_show_help = "g?",
118+
},
119+
},
120+
})
121+
122+
-- Optional: Setup completion with nvim-cmp if needed
123+
-- Since you're using blink.cmp, you may need to configure completion separately
124+
-- or use the built-in orgmode completion
125+
end,
126+
},
127+
}

0 commit comments

Comments
 (0)