plugins.jujutsu: initialise#4372
Conversation
|
once difftastic-nvim is in unstable, i'll add difftastic-nvim as well |
| # 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 |
| type = lib.types.attrsOf (lib.types.either keys lib.types.bool); | ||
| description = "Keymaps for jujutsu-nvim"; | ||
| default = { }; | ||
|
|
| 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 = { }; | ||
|
|
||
| }; |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
does settingsExample prevent this?
| } | ||
|
|
||
| ); |
There was a problem hiding this comment.
| } | |
| ); | |
| }); |
You may need to run nix fmt or nix develop --run treefmt on this PR.
| 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"; | ||
| }; |
There was a problem hiding this comment.
This feels hard to maintain. Is it really worth it? Can't we link to upstream docs or refer to :h instead?
There was a problem hiding this comment.
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
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