This PR also removes the `ThumbsUp` action that wasn't being triggered
correctly. We didn't have it's counterpart `ThumbsDown`, too, so I
mostly assumed it would be harmless to remove `ThumbsUp` as well.
<img width="800" alt="Screenshot 2025-01-10 at 6 18 44 PM"
src="https://github.com/user-attachments/assets/9fd5da9f-9dff-454d-9f31-c02f1370b937"
/>
Release Notes:
- N/A
---------
Co-authored-by: Marshall Bowers <elliott.codes@gmail.com>
We weren't showing the keybinding in none of the places where the model
selector was visible. Also, I took advantage of the opportunity to
change the keybinding for two reasons:
1. `cmd-shift-m` caused conflict if on an editor (inline assistant case)
2. `cmd-opt-/` is the one Cursor uses; so consistency with something
that might be already consolidated sounds like a low-hanging fruit
| Editor Inline Assist | Terminal Inline Assist | Assistant Panel |
|--------|--------|--------|
| <img width="1336" alt="Screenshot 2025-01-10 at 11 01 24 AM"
src="https://github.com/user-attachments/assets/0782f217-025f-4bc0-b2fa-64b3524c968b"
/> | <img width="1336" alt="Screenshot 2025-01-10 at 11 01 29 AM"
src="https://github.com/user-attachments/assets/d05a3b5c-33fd-4593-b1d8-aa9944de816a"
/> | <img width="1336" alt="Screenshot 2025-01-10 at 11 01 33 AM"
src="https://github.com/user-attachments/assets/8cb075e7-ccde-46f5-aa05-d20a9d42b286"
/> |
Release Notes:
- N/A
### Edit 1:
I tested it locally and it works!
### IMPORTANT:
**Feedback and suggestions for improvement are greatly appreciated!**
This commit introduces a new AnyQuotes text object to handle text
surrounded by single quotes ('), double quotes ("), or back quotes (`)
seamlessly. The following changes are included:
- Added AnyQuotes to the Object enum to represent the new feature.
- Registered AnyQuotes as an action in the actions! macro and register
function to ensure proper integration with Vim actions like ci, ca, di,
and da.
- Extended Object::range to check for surrounding single, double, or
back quotes sequentially.
- Updated methods like is_multiline and always_expands_both_ways to
ensure consistent behavior with other text objects.
- Added support in surrounding_markers to evaluate any of the quote
types when AnyQuotes is invoked.
- This enhancement provides users with a flexible and unified way to
interact with text objects enclosed by different types of quotes.
Release Notes:
- vim: Add `aq`/`iq` "any quote" text objects that are the smallest of
`a"`, `a'` or <code>a`</code>
Ensuring all of the assistant 2 actions have keybindings.
Release Notes:
- N/A
---------
Co-authored-by: Agus Zubiaga <hi@aguz.me>
Co-authored-by: Marshall Bowers <elliott.codes@gmail.com>
These are more closely like default Emacs bindings.
I hope such small and minor changes didn't warrant a discussion in
advance.
Release Notes:
- Added Emacs bindings for creating a new window, closing a window, and
quitting zed entirely.
- Closes: https://github.com/zed-industries/zed/issues/22699
- Refine the key binding for `cmd-shift-e` (macOS) / `ctrl-shift-e`
(linux)
- Now Works after closing the final buffer
- Now Works from other panels (Terminal/Assistant/Collab/Chat/etc)
Follow-up to:
- https://github.com/zed-industries/zed/pull/21228
Release Notes:
- Fixed Project Panel toggle (`cmd-shift-e` / `ctrl-shift-e`) so it
works in more contexts.
Closes#19837
This PR is a continuation of [linux: Implement
Menus](https://github.com/zed-industries/zed/pull/21873) and should only
be reviewed once the existing PR is merged.
I created this as a separate PR as the existing PR was already reviewed
but is yet to merge, and also it was my initial plan to do it in
separate parts because of the scope of it. This will also help reviewing
code faster.
This PR adds two new types of keyboard shortcuts to make menu navigation
easier:
1. `Alt + Z` for Zed, `Alt + F` for File, `Alt + S` for Selection, and
so on to open a specific menu with this combination. This mimics VSCode
and IntelliJ.
2. `Arrow Left/Right` when any menu is open. This will trigger the
current menu to close, and the previous/next to open respectively. First
and last element cycling is handled.
`Arrow Up/Down` to navigate menu entries is already there in existing
work.
https://github.com/user-attachments/assets/976aea48-4e20-4c19-850d-4d205a4bead2
Release Notes:
- Added keyboard navigation for menus on Linux (left/right). If you wish
to open menus with keyboard shortcuts add the following to your user
keymap:
```json
{
"context": "Workspace",
"bindings": {
"alt-z": ["app_menu::OpenApplicationMenu", "Zed"],
"alt-f": ["app_menu::OpenApplicationMenu", "File"],
"alt-e": ["app_menu::OpenApplicationMenu", "Edit"],
"alt-s": ["app_menu::OpenApplicationMenu", "Selection"],
"alt-v": ["app_menu::OpenApplicationMenu", "View"],
"alt-g": ["app_menu::OpenApplicationMenu", "Go"],
"alt-w": ["app_menu::OpenApplicationMenu", "Window"],
"alt-h": ["app_menu::OpenApplicationMenu", "Help"]
}
}
```
---------
Co-authored-by: Peter Tripp <peter@zed.dev>
This PR adds an action and associated keybinding
(<kbd>Cmd+Shift+A</kbd>) to toggle the context picker.
This allows for adding context via the keyboard.
Release Notes:
- N/A
Follow-up of https://github.com/zed-industries/zed/pull/22004
* Reuse center terminals for tasks, when requested
* Extend task templates with `RevealTarget`, moving it from
`TaskSpawnTarget` into the core library
* Use `reveal_target` instead of `target` to avoid misinterpretations in
the task template context
* Do not expose `SpawnInTerminal` to user interface, avoid it
implementing `Serialize` and `Deserialize`
* Remove `NewCenterTask` action, extending `task::Spawn` interface
instead
* Do not require any extra unrelated parameters during task resolution,
instead, use task overrides on the resolved tasks on the modal side
* Add keybindings for opening the task modal in the
`RevealTarget::Center` mode
Release Notes:
- N/A
This reverts part of #21858 by changing how `tab` works again:
- If both, completions and inline completions, are visible, then `tab`
accepts the completion and `shif-tab` the inline completion.
- If only one of them is shown, then `tab` accepts it.
I'm not a fan of this solution, but I think it's a short-term fix that
avoids breaking people's `tab` muscle memory.
Release Notes:
- (These release notes invalidate the release notes contained in:
https://github.com/zed-industries/zed/pull/21858)
- Changed how inline completions (Copilot, Supermaven, ...) and normal
completions (from language servers) interact. Zed will now also show
inline completions when the completion menu is visible. The user can
accept the inline completion with `<shift-tab>` and the active entry in
the completion menu with `<tab>`.
When using inline assist, after successfully generating a transformation
it's not possible to generate a new transformation. Currently, you have
to modify the prompt (i.e. add a `<SPACE>` and hit `<ENTER>`) to
regenerate.
So, I changed the restart button to be visible after a successful
transformation. And in that case I map it to a different keyboard
shortcut because `menu::Confirm` is mapped to accept the current
suggestion.
Now, I can invoke a series of transforms back to back until I get what I
want!
It might also be desired to keep the accept button visible after
modifying the prompt (before submitting it). In that case we'll need to
remap accept to an alternate key (perhaps the same alt-shift-enter I am
using for restart. That wouldn't be too insane to remember. But maybe
someone has a better idea.
I don't care what the shortcut is, I just want the ability to regenerate
without adding/deleting spaces.
## Before
**Two choices** after a suggestions is presented. Also, a great example
of why I would want to regenerate the suggestion, it left some tokens
`<rewrite_this>`!
![CleanShot 2024-12-13 at 00 34
09](https://github.com/user-attachments/assets/3c1786ca-8ec5-48e2-b3dd-64de36e61f6a)
## After
**Three choices** after a suggestion is presented, the circular icon is
for regenerate, just like you see if you modify the prompt text.
![CleanShot 2024-12-13 at 00 37
58](https://github.com/user-attachments/assets/ceda300f-0851-48bf-ad3a-be44308c734e)
## Release Notes:
- Added Restart Button to Inline Assistant When Prompt Is Unchanged
---------
Co-authored-by: Danilo Leal <daniloleal09@gmail.com>
Improves the new `Editor::DuplicateSelection` @CharlesChen0823 added in
https://github.com/zed-industries/zed/pull/21154.
- Merge `duplicate_selection` and `duplicate_line` into single function.
- Add keyboard shortcuts to JetBrains and SublimeText keymaps.
- If the selection is empty (e.g. just a cursor) make
`Editor::DuplicateSelection` fallback to being the same as
`Editor::DuplicateLineDown`.
- Tested with multiple cursors and for multiple selections.
| Editor | Action | macOS | Linux |
| ----------- | ------------------- | ----------- | ------------ |
| VSCode | Duplicate Selection | | |
| JetBrains | Duplicate Selection | cmd-d | ctrl-d |
| XCode | Duplicate | cmd-d | N/A |
| SublimeText | duplicate_line | cmd-shift-d | ctrl-shift-d |
This matches behavior of the `duplicate` functionality in all other
major editors, with one exception: other editors change the selection so
that the newly duplicated object, current Zed behavior leaves the
original selection unchanged (TODO?)
Improve behavior of ctrl-a/ctrl-e home/end in emacs keybind.
Follow up to #21921 to add those to Linux emacs keymap too.
Release Notes:
- emacs: Improved `ctrl-a` / `ctrl-e` / `home` / `end` behavior
- emacs: Added for `ctrl-s` / `ctrl-r` / `ctrl-g` for navigating buffer
search results
This changes the behavior of how we display inline completions and
non-inline completions (i.e. completion menu).
Previously we would never show inline completions if a completion menu
was visible, meaning that we'd never show Copilot/Supermaven/...
suggestions if the language server had a suggestion.
With this change, we now display the inline completions even if there is
a completion menu visible.
In that case `<tab>` then accepts the inline completion and `<enter>`
accepts the selected entry in the completion menu.
Release Notes:
- Changed how inline completions (Copilot, Supermaven, ...) and normal
completions (from language servers) interact. Zed will now also show
inline completions when the completion menu is visible. The user can
accept the inline completion with `<tab>` and the active entry in the
completion menu with `<enter>`. Previously, `<tab>` would also select
the active entry in the completion menu.
---------
Co-authored-by: Antonio <antonio@zed.dev>
This PR adds keyboard shortcuts to common interactions you might want to
do in the Zeta rating panel.
This PR also adds a way to fake inline completion requests, as well as
the test data used to create this PR, to make it easier to adjust the UI
in the future.
It also changes the status bar from the text "Zeta" to "ζ", because I
thought it looked cool.
Release Notes:
- N/A
Although I hoped we could keep the non-ascii alt characters, it turns
out this is not the case for all keyboards.
Fixes#21175
Release Notes:
- (breaking change) editor::ShowInlineCompetion is now `option-tab` on
macOS
(not `option-/`). editor::{Next,Previous}Completion are `option-tab` and
`option-shift-tab` (not `option-[` and `option-]`). This fixes typing
characters generated by option-{/,[,]} on keyboards like Croatian.
When revamping international keyboard shortcuts I wanted to make the
default to use key equivalents; in hindsight, this is not what people
expect.
Release Notes:
- (Breaking) In keymap.json `"use_layout_keys": true` is now the
default. If you want to opt-out of this behaviour, set
`"use_key_equivalents": true` to have keys mapped for your keyboard. See
[documentation](https://zed.dev/docs/key-bindings#non-qwerty-keyboards)
---------
Co-authored-by: Peter Tripp <peter@zed.dev>
This addresses the editor context menu portion of #17819.
Release Notes:
- Added `editor::OpenContextMenu` action to open context menu at current
cursor position.
Closes#4642
- Added the ability to switch to helix normal mode, with an additional
helix visual mode.
- <kbd>ctrl</kbd><kbd>h</kbd> from Insert mode goes to Helix Normal
mode. <kbd> i </kbd> and <kbd> a </kbd> to go back.
- Need to find a way to perform the helix normal mode selection with
<kbd> w </kbd>, <kbd>e </kbd>, <kbd> b </kbd> as a first step. Need to
figure out how the mode will interoperate with the VIM mode as the new
additions are in the same crate.
This reverts commit 614b3b979b.
This conflicts with the macOS `ctrl-fn-left/right` bindings for moving
windows around (new in Sequoia).
If you want these use:
```
{
"context": "Editor",
"bindings": {
"ctrl-home": "editor::MoveToBeginning",
"ctrl-end": "editor::MoveToEnd"
}
},
```
Release Notes:
- N/A
Co-Authored-By: Max <max@zed.dev>
Release Notes:
- vim: Added motions `[[`, `[]`, `]]`, `][` for navigating by section,
`[m`, `]m`, `[M`, `]M` for navigating by method, and `[*`, `]*`, `[/`,
`]/` for comments. These currently only work for languages built in to
Zed, as they are powered by new tree-sitter queries.
- vim: Added new text objects: `ic`, `ac` for inside/around classes,
`if`,`af` for functions/methods, and `g c` for comments. These currently
only work for languages built in to Zed, as they are powered by new
tree-sitter queries.
---------
Co-authored-by: Max <max@zed.dev>
Closes https://github.com/zed-industries/zed/issues/4351
![it_splits](https://github.com/user-attachments/assets/40de03c9-2173-4441-ba96-8e91537956e0)
Applies the same splitting mechanism, as Zed's central pane has, to the
terminal panel.
Similar navigation, splitting and (de)serialization capabilities are
supported.
Notable caveats:
* zooming keeps the terminal splits' ratio, rather expanding the
terminal pane
* on macOs, central panel is split with `cmd-k up/down/etc.` but `cmd-k`
is a "standard" terminal clearing keybinding on macOS, so terminal panel
splitting is done via `ctrl-k up/down/etc.`
* task terminals are "split" into regular terminals, and also not
persisted (same as currently in the terminal)
Seems ok for the initial version, we can revisit and polish things
later.
Release Notes:
- Added the ability to split the terminal panel
Closes#8628
Release Notes:
- Added support for resizing the current pane using vim keybinds with
the intention to follow the functionality of vim
- "ctrl-w +" to make a pane taller
- "ctrl-w -" to make the pane shorter
- "ctrl-w >" to make a pane wider
- "ctrl-w <" to make the pane narrower
- Changed vim pre_count and post_count to globals to allow for other
crates to use the vim count. In this case, it allows for resizing by
more than one unit. For example, "10 ctrl-w -" will decrease the height
of the pane 10 times more than "ctrl-w -"
- This pr does **not** add keybinds for making all panes in an axis
equal size and does **not** add support for resizing docks. This is
mentioned because these could be implied by the original issue
---------
Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com>