Commit graph

986 commits

Author SHA1 Message Date
张小白
fff0ecead1
windows: Fix keystroke & keymap (#36572)
Closes #36300

This PR follows Windows conventions by introducing
`KeybindingKeystroke`, so shortcuts now show up as `ctrl-shift-4`
instead of `ctrl-$`.

It also fixes issues with keyboard layouts: when `use_key_equivalents`
is set to true, keys are remapped based on their virtual key codes. For
example, `ctrl-\` on a standard English layout will be mapped to
`ctrl-ё` on a Russian layout.


Release Notes:

- N/A

---------

Co-authored-by: Kate <kate@zed.dev>
2025-08-27 03:24:50 +08:00
Daniel Martín
2c64b05ea4
emacs: Add editor::FindAllReferences keybinding (#36840)
This commit maps `editor::FindAllReferences` to Alt+? in the Emacs
keymap.

Release Notes:

- N/A
2025-08-26 13:43:58 +00:00
Peter Tripp
aa0f7a2d09
Fix conflicts in Linux default keymap (#36519)
Closes https://github.com/zed-industries/zed/issues/29746

| Action | New Key | Old Key | Former Conflict |
| - | - | - | - |
| `edit_prediction::ToggleMenu` | `ctrl-alt-shift-i` | `ctrl-shift-i` |
`editor::Format` |
| `editor::ToggleEditPrediction` | `ctrl-alt-shift-e` | `ctrl-shift-e` |
`project_panel::ToggleFocus` |

These aren't great keys and I'm open to alternate suggestions, but the
will work out of the box without conflict.

Release Notes:

- N/A
2025-08-26 09:33:42 -04:00
Romans Malinovskis
bb5cfe118f
Add "shift-r" and "g ." support for helix mode (#35468)
Related #4642
Compatible with #34136

Release Notes:

- Helix: `Shift+R` works as Paste instead of taking you to ReplaceMode
- Helix: `g .` goes to last modification place (similar to `. in vim)
2025-08-25 21:37:29 -06:00
Kirill Bulatov
42ae3301d0
Show file open error view instead of the modal (#36764)
Closes https://github.com/zed-industries/zed/issues/36672

Before:
either 
<img width="966" height="642" alt="image"
src="https://github.com/user-attachments/assets/7263ea3c-3d48-4f4d-be9e-16b24ca6f60b"
/>
(when opening from the project panel)

or

<img width="959" height="1019" alt="image"
src="https://github.com/user-attachments/assets/834041d4-f4d6-46db-b333-803169ec4803"
/>

(for the rest of the cases)

After:

<img width="2032" height="1167" alt="Screenshot 2025-08-22 at 19 34 10"
src="https://github.com/user-attachments/assets/1aa4530b-69f6-4c3a-8ea1-d4035dbb28da"
/>

(the unified error view)

Release Notes:

- Improved unsupported file opening in Zed

---------

Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com>
2025-08-22 17:04:39 +00:00
Peter Tripp
ac9fdaa1da
onboarding: Improve Windows/Linux keyboard shortcuts; example ligature (#36712)
Small fixes to onboarding.
Correct ligature example.
Replace`ctrl-escape` and `alt-tab` since they are reserved on windows
(and often on linux) and so are caught by the OS.

Release Notes:

- N/A
2025-08-22 11:51:01 -04:00
Cole Miller
595cf1c6c3
acp: Rename assistant::QuoteSelection and support it in agent2 threads (#36628)
Release Notes:

- N/A
2025-08-20 21:31:25 +00:00
Danilo Leal
159b5e9fb5
agent2: Port user_modifier_to_send setting (#36550)
Release Notes:

- N/A
2025-08-20 05:30:43 +00:00
Conrad Irwin
b65e9af3e9
Add [f/]f to follow the next collaborator (#36191)
Release Notes:

- vim: Add `[f`/`]f` to go to the next collaborator
2025-08-14 13:08:35 -06:00
Mostafa Khaled
5a9546ff4b
Add alt-s to helix mode (#33918)
Closes #31562

Release Notes:

- Helix: bind alt-s to SplitSelectionIntoLines

---------

Co-authored-by: Ben Kunkle <ben@zed.dev>
2025-08-14 13:04:38 -04:00
Romans Malinovskis
20be133713
helix: Allow yank without a selection (#35612)
Related https://github.com/zed-industries/zed/issues/4642

Release Notes:
- Helix: without active selection, pressing `y` in helix mode will yank
a single character under cursor.

---------

Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com>
2025-08-14 17:04:01 +00:00
Conrad Irwin
e5402d5464
Allow editing Agent2 messages (#36155)
Release Notes:

- N/A

---------

Co-authored-by: Antonio Scandurra <me@as-cii.com>
Co-authored-by: Agus Zubiaga <agus@zed.dev>
2025-08-14 13:39:33 +00:00
Danilo Leal
cb0bc463f1
agent2: Add new "new thread" selector in the toolbar (#36133)
Release Notes:

- N/A
2025-08-13 14:45:37 -03:00
Conrad Irwin
52a9101970
vim: Add ctrl-y/e in insert mode (#36017)
Closes #17292

Release Notes:

- vim: Added ctrl-y/ctrl-e in insert mode to copy the next character
from the line above or below
2025-08-11 23:20:09 -06:00
Danilo Leal
024a5bbcd0
onboarding: Add some adjustments (#35887)
Release Notes:

- N/A
2025-08-08 16:40:41 -03:00
Danilo Leal
070f7dbe1a
onboarding: Add fast-follow adjustments (#35814)
Release Notes:

- N/A
2025-08-07 19:01:52 -03:00
mcwindy
e8db429d24
project_panel: Add file comparison function, supports selecting files for comparison (#35255)
Closes https://github.com/zed-industries/zed/discussions/35010
Closes https://github.com/zed-industries/zed/issues/17100
Closes https://github.com/zed-industries/zed/issues/4523

Release Notes:

- Added file comparison function in project panel

---------

Co-authored-by: Kirill Bulatov <kirill@zed.dev>
2025-08-07 21:34:12 +03:00
Danilo Leal
8e290b446e
thread view: Add UI refinements (#35754)
More notably around how we render tool calls. Nothing too drastic,
though.

Release Notes:

- N/A
2025-08-06 20:31:11 -03:00
Ben Kunkle
6b77654f66
onboarding: Wire up tab index (#35659)
Closes #ISSUE

Allows tabbing through everything in all three pages. Until #35075 is
merged it is not possible to actually "click" tab focused buttons with
the keyboard.

Additionally adds an action `onboarding::Finish` and displays the
keybind. The action corresponds to both the "Skip all" and "Start
Building" buttons, with the keybind displayed similar to how it is for
the page nav buttons

Release Notes:

- N/A *or* Added/Fixed/Improved ...

---------

Co-authored-by: MrSubidubi <finn@zed.dev>
2025-08-05 19:48:15 +00:00
Peter Tripp
bb5af6f76d
Fix escape in terminal with JetBrains keymap (#35585)
Closes https://github.com/zed-industries/zed/issues/35429
Closes https://github.com/zed-industries/zed/issues/35091
Follow-up to: https://github.com/zed-industries/zed/pull/35230

Release Notes:

- Fix `escape` in Terminal broken in JetBrains compatability keymaps
2025-08-04 15:37:34 +00:00
Ben Kunkle
ac75593198
onboarding: Actions for page navigation (#35484)
Closes #ISSUE

Release Notes:

- N/A *or* Added/Fixed/Improved ...
2025-08-01 19:30:25 +00:00
Joseph T. Lyons
106aa0d9cc
Add default binding to open settings profile selector (#35459)
Release Notes:

- N/A
2025-08-01 05:53:40 +00:00
Peter Tripp
4a82b6c5ee
jetbrains: Unmap cmd-k in Jetbrains keymap (#35443)
This only works after a delay in most situations because of the all
chorded `cmd-k` mappings in the so disable them for now.

Reported by @jer-k:
https://x.com/J_Kreutzbender/status/1951033355434336606

Release Notes:

- Undo mapping of `cmd-k` for Git Panel in default Jetbrains keymap
(thanks [@jer-k](https://github.com/jer-k))
2025-07-31 18:29:51 -04:00
Danilo Leal
00725273e4
agent: Rename "open configuration" action to "open settings" (#35329)
"Settings" is the terminology we use in the agent panel, thus having the
action use "configuration" makes it harder for folks to find this either
via the command palette or the keybinding editor UI in case they'd like
to change it.

Release Notes:

- agent: Renamed the "open configuration" action to "open settings" for
better discoverability and consistency
2025-07-30 09:55:13 -03:00
Peter Tripp
3fc84f8a62
Comment on source of ctrl-m in keymaps (#35273)
Closes https://github.com/zed-industries/zed/issues/23896

Release Notes:

- N/A
2025-07-29 15:29:12 +00:00
Peter Tripp
8207621a4a
Improve JetBrains keymap for dock toggling (#35234)
Follow-up to: 
- https://github.com/zed-industries/zed/pull/34641
- https://github.com/zed-industries/zed/pull/35230

This improves Zed's behavior with the Jetbrains keymap for toggling
specific docks/sidebars with cmd-0 thru cmd-9 (macos) and alt-0 thru
alt-9 (linux). Added in
https://github.com/zed-industries/zed/pull/34641. Additionally, this
also maps `ctrl-b` / `ctrl-alt-`b to their JetBrains equivalents
(`editor::GoToDefinition` and `editor::GoToDefinitionSplit`) instead of
the default vscode-compatable behavior (toggle left / right dock). This
is because we those specific toggles and a default Hide keyboard
shortcut (`shift-escape`) added in
https://github.com/zed-industries/zed/pull/35230.

Thanks to @thomaseizinger for raising this in:
-
https://github.com/zed-industries/zed/discussions/34643#discussioncomment-13856746

Release Notes:

- Improve support keyboard-based dock show/hide in Jetbrains keymap.
2025-07-28 21:00:01 +00:00
Peter Tripp
994d400ab8
Map shift-escape in the Jetbrains keymaps (#35230)
Release Notes:

- Added support for closing docks (sidebars) with `shift-escape` in the
Jetbrains keymaps.
2025-07-28 19:59:01 +00:00
Cole Miller
3dc36dc7c3
git: Touch up amend UX (#35114)
Follow-up to #26114

- Ensure that the previous commit message is filled in when toggling on
amend mode from the context menu
- Fix keybinding flicker in context menu

Release Notes:

- N/A
2025-07-28 12:21:07 -04:00
Pablo Ramón Guevara
a6956eebcb
Improve Helix insert (#34765)
Closes #34763 

Release Notes:

- Improved insert in `helix_mode` when a selection exists to better
match helix's behavior: collapse selection to avoid replacing it
- Improved append (`insert_after`) to better match helix's behavior:
move cursor to end of selection if it exists
2025-07-23 23:27:07 -06:00
Michael Sloan
3b428e2ecc
Remove !menu from j k binding in initial keymap examples (#34959)
See
https://github.com/zed-industries/zed/pull/34912#issuecomment-3108802582

Release Notes:

- N/A
2025-07-23 17:33:40 +00:00
Finn Evers
8713c556d6
keymap_ui: Dim keybinds that are overridden by other keybinds (#34952)
This change dims rows in the keymap editor for which the corresponding
keybind is overridden by other keybinds coming from higher priority
sources.

Release Notes:

- N/A
2025-07-23 16:03:04 +00:00
Peter Tripp
326ab5fa3f
Improve collab channel organization keybinds (#34821)
Change channel reorganization (move up/down) from `cmd-up/down` (mac) /
`ctrl-up/down` (linux) to `alt-up/down` (both) to match moving lines in
the editor.

Also fix an issue where if you selected channels using down/up in the
filter field, the movement shortcuts would not work (`editing` vs
`not_editing`).

Release Notes:

- N/A
2025-07-23 10:04:53 -04:00
Michael Sloan
d81a8178e9
Bind "j k" to NormalBefore in initial keymap examples (#34912)
It looks like typically vim configurations bind "j k" to be the same as
escape, which has the "NormalBefore" behavior positioning the block
cursor on the character before the insertion cursor. The [vim mode
docs](https://zed.dev/docs/vim#useful-contexts-for-vim-mode-key-bindings)
also use NormalBefore here.

Thanks to @omniwrench for mentioning this in
https://github.com/zed-industries/zed/discussions/6661#discussioncomment-13848043
. This was a mistake in #31163.

Release Notes:

- N/A
2025-07-22 11:35:58 -06:00
Peter Tripp
2eeab5b0bf
textmate: Correct context for 'Editor && mode == full' keybinds (#34895)
Closes https://github.com/zed-industries/zed/issues/34891

Release Notes:

- Fixed textmate keymap misbehaving in certain contexts
2025-07-22 14:52:04 +00:00
Daste
233e66d35f
Add editor::BlameHover action for triggering the blame popover via keyboard (#32096)
Make the git blame popover available via the keymap by making it an
action. The blame popover stays open after being shown via the action,
similar to the `editor::Hover` action.

I added a default vim-mode key binding for `g b`, which goes in hand
with `g h` for hover. I'm not sure what the keybind would be for regular
layouts, if any would be set by default.

I'm opening this as a draft because I coludn't figure out a way to
position the popover correctly above/under the cursor head. I saw some
uses of `content_origin` in other places for calculating absolute pixel
positions, but I'm not sure how to make use of it here without doing a
big refactor of the blame popover code 🤔. I would appreciate some
help/tips with positioning, because it seems like the last thing to
implement here.

Opening as a draft for now because I think without the correct
positioning this feature is not complete.

Closes https://github.com/zed-industries/zed/discussions/26447

Release Notes:

- Added `editor::BlameHover` action for showing the git blame popover
under the cursor. By default bound to `ctrl-k ctrl-b` and to `g h` in
vim mode.
2025-07-21 19:30:23 -06:00
Peter Tripp
8eca7f32e2
Fix for vim bindings in Pickers on Linux (#34840)
Closes: https://github.com/zed-industries/zed/issues/34780

Also relocated undo/redo selection in the keymap (no-op) as they are
from Sublime, not VSCode.

Release Notes:

- vim: Fixed an issue so `ctrl-w` / `ctrl-h` and `ctrl-u` work in
pickers on Linux when Vim mode is enabled.
2025-07-21 20:09:02 +00:00
Ben Kunkle
1a1715766f
Fix enter to select model in agent panel (#34846)
Broken by #34664

Release Notes:

- N/A *or* Added/Fixed/Improved ...
2025-07-21 19:16:47 +00:00
Ben Kunkle
7c1040bc93
keymap_ui: Auto complete action arguments (#34785)
Supersedes: #34242

Creates an `ActionArgumentsEditor` that implements the required logic to
have a JSON language server run when editing keybinds so that there is
auto-complete for action arguments.

This is the first time action argument schemas are required by
themselves rather than inlined in the keymap schema. Rather than add all
action schemas to the configuration options we send to the JSON LSP on
startup, this PR implements support for the
`vscode-json-language-server` extension to the LSP whereby the server
will request the client (Zed) to resolve URLs with URI schemes it does
not recognize, in our case `zed://`. This limits the impact on the size
of the configuration options to ~1KB as we send URLs for the language
server to resolve on demand rather than the schema itself. My
understanding is that this is how VSCode handles JSON schemas as well. I
plan to investigate converting the rest of our schema generation logic
to this method in a follow up PR.

Co-Authored-By: Cole <cole@zed.dev>

Release Notes:

- N/A *or* Added/Fixed/Improved ...
2025-07-20 16:24:17 -04:00
Conrad Irwin
43486c416c
Fix enter in branch view (#34731)
Broken by #34664

Release Notes:

- N/A
2025-07-18 19:04:05 +00:00
Danilo Leal
e1d28ff957
agent: Add use_modifier_to_send setting (#34709)
When `use_modifier_to_send` is turned on, holding `cmd`/`ctrl` is
necessary to send a message in the agent panel. Text threads already use
`cmd-enter` by default to submit a message, and it was done this way to
have the usual text editing bindings not taken over when writing a
prompt, sort of stimulating more thoughtful writing. While `enter` to
send is still somewhat a huge pattern in chat-like LLM UIs, it still
makes sense to allow this for the new agent panel... hence the existence
of this setting now!

Release Notes:

- agent: Added the `use_modifier_to_send` setting, which makes holding a
modifier (`cmd`/`ctrl`), together with `enter`, required to send a new
message.
2025-07-18 15:03:31 -03:00
Conrad Irwin
e421fc7a2d
Update keymap context binding behavior of > and ! (#34664)
Now ! means "no ancestors matches this", and > means "any descendent"
not "any child".

Updates #34570

Co-authored-by: Ben Kunkle <ben@zed.dev>

Release Notes:

- *Breaking change*. The context predicates in the keymap file now
handle ! and > differently. Before this change ! meant "this node does
not match", now it means "none of these nodes match". Before this change
> meant "child of", now it means "descendent of". We do not expect these
changes to break many keymaps, but they may cause subtle changes for
complex context queries.

---------

Co-authored-by: Ben Kunkle <ben@zed.dev>
2025-07-18 09:25:18 -06:00
Daniel Sauble
c1307cead4
Add ; key binding for Helix mode (#34315)
Closes #34111

In Helix mode, the `;` key should collapse the current selection without
moving the cursor. I've added a new action `vim::HelixCollapseSelection`
to support this behavior.


https://github.com/user-attachments/assets/1a40821a-f56f-456e-9d37-532500bef17b

Release Notes:

- Added `;` key binding to collapse the current text selection in Helix
mode
2025-07-17 22:30:01 -06:00
Danilo Leal
c287397a18
Rename "CloseInactiveItems" action to "CloseOtherItems" (#34676)
This is following feedback from folks that were searching the "close
others" action, available in the tab's context menu, and not finding it
because it was actually named "close inactive", which was confusing. So,
this PR makes sure the tab's menu item and the action have consistent
naming.

Release Notes:

- Rename "CloseInactiveItems" action to "CloseOtherItems" for naming
consistency.
2025-07-17 21:40:02 -03:00
Peter Tripp
0c88189aab
Refine JetBrains keymaps (#34658)
Follow-up to: https://github.com/zed-industries/zed/pull/34641

Release Notes:

- N/A
2025-07-17 19:23:00 +00:00
Peter Tripp
1ceda2babd
JetBrains keymap improvements (July 2025) (#34641)
Closes: https://github.com/zed-industries/zed/issues/14639
Closes: https://github.com/zed-industries/zed/issues/33020

If would have ideas for future enhancements, please see:
- https://github.com/zed-industries/zed/discussions/34643

Various Jetbrains keymaps improvements for macOS and Linux/Windows:

| Area | Action | macOS | Linux |
| ------------- | -------------------------- |
--------------------------------- | --------------------------------- |
| Workspace | Toggle Git Panel | `cmd-0` | `ctrl-0` |
| Workspace | Toggle Project Panel | `cmd-1` | `alt-0` |
| Workspace | Toggle Debug Panel | `cmd-5` | `alt-1` |
| Workspace | Toggle Diagnostics | `cmd-6` | `alt-6` |
| Workspace | Toggle Outline Panel | `cmd-7` | `alt-7` |
| Workspace | Toggle Terminal Panel | `alt-f12` | `alt-f12` |
| Workspace | File Finder | `cmd-e` | `ctrl-e` |
| Workspace | Task Spawn | `ctrl-alt-r` | `alt-shift-f10` |
| Workspace | Close All Docks | `ctrl-shift-f12` | `ctrl-shift-f12` |
| Project Panel | Search in Directory | `cmd-shift-f` | `ctrl-shift-f` |
| Search | Replace in Files | `cmd-shift-r` | `ctrl-shift-r` |
| Search | Replace in Buffer | `cmd-r` | `ctrl-r` |
| Search | Toggle Case Sensitive | `ctrl-alt-c` / `alt-c` | `ctrl-alt-c`
|
| Search | Toggle Search in Selection | `ctrl-alt-s` / `alt-s` |
`ctrl-alt-s` |
| Search | Toggle Regex | `ctrl-alt-x` / `alt-x` | `ctrl-alt-x` |
| Search | Toggle Whole Word | `ctrl-alt-w` / `alt-w` | `ctrl-alt-w` |
| Terminal | New Terminal Tab | `cmd-t` | `ctrl-shift-t` |
| Terminal | Scroll Line | `cmd-up` / `cmd-down` | `ctrl-up` /
`ctrl-down` |
| Terminal | Scroll Page | `shift-pageup` / `shift-pagedown` |
`shift-pageup` / `shift-pagedown` |
| Git | Git Panel | `cmd-k` | `ctrl-k` |
| Git | Git Push | `cmd-shift-k` | `ctrl-shift-k` |

In addition, with the help of the recently merged
https://github.com/zed-industries/zed/pull/34495, no matter where you
are mashing `escape` will refocus you back to your most recent editor
buffer similar to the behavior of JetBrains.

Release Notes:

- jetbrains: Added 25+ keybinds to the macOS and Linux/Windows JetBrains
compatibility keymaps
2025-07-17 17:14:24 +00:00
Ben Kunkle
948c1f22bb
keymap_ui: Improve keybind display in menus (#34587)
Closes #ISSUE

Defines keybindings for `keymap_editor::EditBinding` and
`keymap_editor::CreateBinding`, making sure those actions are used in
tooltips.

Release Notes:

- N/A *or* Added/Fixed/Improved ...

---------

Co-authored-by: Finn <dev@bahn.sh>
2025-07-17 11:10:07 -04:00
Agus Zubiaga
8e4555455c
Claude experiment (#34577)
Release Notes:

- N/A

---------

Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com>
Co-authored-by: Anthony Eid <hello@anthonyeid.me>
Co-authored-by: Ben Brandt <benjamin.j.brandt@gmail.com>
Co-authored-by: Nathan Sobo <nathan@zed.dev>
Co-authored-by: Oleksiy Syvokon <oleksiy.syvokon@gmail.com>
2025-07-17 14:25:55 +00:00
Ben Kunkle
a6a7a1cc28
keymap_ui: Remove feature flag (#34568)
Closes #ISSUE

Release Notes:

- Rebound the keystroke to open the keymap file, to open the new keymap
editor
2025-07-16 18:28:44 +00:00
Peter Tripp
2a9a82d757
macos: Add mappings for alt-delete and cmd-delete (#34493)
Closes https://github.com/zed-industries/zed/issues/34484

Release Notes:

- macos: Add default mappings for `alt-delete` and `cmd-delete` in
Terminal (delete word to right; delete to end of line)
2025-07-16 10:45:34 -04:00
Ben Kunkle
ebbf02e25b
keymap_ui: Keyboard navigation for keybind edit modal (#34482)
Adds keyboard navigation to the keybind edit modal. Using up/down arrows
to select the previous/next input editor, and `cmd-enter` to save +
`escape` to exit

Release Notes:

- N/A *or* Added/Fixed/Improved ...
2025-07-15 18:03:19 +00:00