Skip to content

Commit

Permalink
macOS: change default keybinds for equalize splits, jump to prompt -1/+1
Browse files Browse the repository at this point in the history
From: #2363 (comment)

The justification there makes sense to me and I think it would be a good
change to make. Copied here:

> There are a few bindings that feel a little weird on macOS. My suggestions:
>
> (1) Equalize Splits
> ```
> keybind = shift+opt+equal=unbind
> keybind = ctrl+cmd+equal=equalize_splits
> ```
> The default hijacks the `±` character on US keyboards. Believe it or not, I do use ± in the terminal. Ctrl+cmd+equal matches the arrow key bindings in the Window > Resize Split menu and thus looks more elegant and is easier to memorize.
>
> (2) Jump to Prompt
> ```
> keybind = cmd+up=jump_to_prompt:-1
> keybind = cmd+down=jump_to_prompt:1
> ```
> These are the bindings in Terminal.app. The default shift-cmd-up/down is usually associated with extending a selection. Cmd-up/down are available (they currently act as simple up/down). I bind them additionally to the defaults.
  • Loading branch information
mitchellh committed Dec 23, 2024
1 parent dc9a19b commit 8c2233f
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion src/config/Config.zig
Original file line number Diff line number Diff line change
Expand Up @@ -2503,10 +2503,22 @@ pub fn default(alloc_gpa: Allocator) Allocator.Error!Config {
);
try result.keybind.set.put(
alloc,
.{ .key = .{ .translated = .equal }, .mods = .{ .shift = true, .alt = true } },
.{ .key = .{ .translated = .equal }, .mods = .{ .super = true, .ctrl = true } },
.{ .equalize_splits = {} },
);

// Jump to prompt, matches Terminal.app
try result.keybind.set.put(
alloc,
.{ .key = .{ .translated = .up }, .mods = .{ .super = true } },
.{ .jump_to_prompt = -1 },
);
try result.keybind.set.put(
alloc,
.{ .key = .{ .translated = .down }, .mods = .{ .super = true } },
.{ .jump_to_prompt = 1 },
);

// Inspector, matching Chromium
try result.keybind.set.put(
alloc,
Expand Down

0 comments on commit 8c2233f

Please sign in to comment.