Skip to content

plugins.jujutsu: initialise#4372

Open
auscyber wants to merge 1 commit into
nix-community:mainfrom
auscyber:add-jujutsu-nvim
Open

plugins.jujutsu: initialise#4372
auscyber wants to merge 1 commit into
nix-community:mainfrom
auscyber:add-jujutsu-nvim

Conversation

@auscyber

@auscyber auscyber commented Jun 3, 2026

Copy link
Copy Markdown

add jujutsu-nvim as a plugin.

yes i know a lil weird to have the settings as such, but its worth having checking of keymaps as they are in a weird format, and also being able to enable diff viewer on demand as shown. the other option yes not needed necessarily, however it makes such if im defining the others

@auscyber

auscyber commented Jun 3, 2026

Copy link
Copy Markdown
Author

once difftastic-nvim is in unstable, i'll add difftastic-nvim as well

Comment on lines +112 to +113
# TODO provide an example for the `settings` option (or remove entirely if there is no useful example)
# NOTE you can use `lib.literalExpression` or `lib.literalMD` if needed

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This needs addressing.

type = lib.types.attrsOf (lib.types.either keys lib.types.bool);
description = "Keymaps for jujutsu-nvim";
default = { };

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change

Comment on lines +94 to +110
settingsOptions = {
diff_preset = lib.nixvim.defaultNullOpts.mkEnum [
"difftastic"
"diffview"
"codediff"
"none"
] "none" "diff view preset";
help_position = lib.nixvim.defaultNullOpts.mkEnum [
"center"
"bottom_right"
] "center" "The help window (opened with ?) can be positioned in different locations";
keymap = lib.mkOption {
type = lib.types.attrsOf (lib.types.either keys lib.types.bool);
description = "Keymaps for jujutsu-nvim";
default = { };

};

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The reason we've stopped declaring settings-options in new plugins is because they don't do anything, users can already define anything in settings as it is freeform.

They do add documentation, which also adds a maintenance burden for us (and you) to keep in sync with upstream. And they add more restrictive option types, which can sometimes accidentally prevent users defining valid configs.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does settingsExample prevent this?

Comment on lines +89 to +91
}

);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
}
);
});

You may need to run nix fmt or nix develop --run treefmt on this PR.

Comment on lines +5 to +35
actions = {
"show_help" = "Show keybindings help window";
"quit" = "Close the log window";
"jump_to_next_change" = "Navigate to next change";
"jump_to_prev_change" = "Navigate to previous change";
"jump_to_current_change" = "Navigate to the currently edited change";
"refresh" = "Refresh the log view";
"undo" = "Undo the last operation";
"set_revset" = "Open log with custom revset";
"switch_diff_viewer" = "Switch between diff viewer presets";
"show_global_flags" = "Show menu to toggle global jj flags";
"open_diff" = "Open diff viewer for change";
"describe" = "Edit change description";
"new_change" = "Create new change";
"new_change_menu" = "Show new change options menu";
"abandon_changes" = "Abandon change(s)";
"absorb_changes" = "Absorb change(s)";
"edit_change" = "Check out change";
"edit_change_menu" = "Show edit change options menu";
"rebase_change" = "Rebase change";
"squash_change" = "Squash change";
"squash_to_target" = "Squash to specific target";
"bookmark_change" = "Set/create bookmark";
"bookmark_menu" = "Show bookmark operations";
"push_bookmarks" = "Push bookmarks";
"push_bookmarks_and_create" = "Push bookmarks with --allow-new";
"git_fetch" = "Fetch from remote";
"pull_bookmark" = "Pull bookmark from remote";
"toggle_change" = "Toggle multi-selection";
"clear_selections" = "Clear all selections";
};

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This feels hard to maintain. Is it really worth it? Can't we link to upstream docs or refer to :h instead?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

illl remove this as a guarantee, but it is a nice fallback for the desc which makes the documentation work correctly, ill make it less stringent on checking

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants