Add `editor:: SwapSelectionEnds ` action which swaps the cursor location from the beginning/end of a given selection.
Renamed from `editor::ExchangeMark` to `editor::SwapSelectionEnds`.
Unbound by default, bound to `ctrl-x ctrl-x` in Emacs keymap.
Closes#23015
Release Notes:
- Improved which keybindings are selected for display. Now later entries
within `bindings` will take precedence. The default keymaps have been
updated accordingly.
Adds support for Cut, Copy, Paste, Undo, Redo, New, Open, Save, and Find
keys to the default keymap. These keys can be found on old keyboards,
but also custom layouts like
[Extend](https://dreymar.colemak.org/layers-extend.html).
Release Notes:
- Added support for the Cut, Copy, Paste, Undo, Redo, New, Open, Save,
and Find keys to the default keymap.
Note: Design hasn't been reviewed yet, but the logic is done
When the user switches the inline completion provider to `zed`, we'll
show a modal prompting them to accept terms if they haven't done so:
https://github.com/user-attachments/assets/3fc6d368-c00a-4dcb-9484-fbbbb5eb859e
If they dismiss the modal, they'll be able to get to it again from the
inline completion button:
https://github.com/user-attachments/assets/cf842778-5538-4e06-9ed8-21579981cc47
This also stops zeta sending requests that will fail immediately when
ToS are not accepted.
Release Notes:
- N/A
---------
Co-authored-by: Richard <richard@zed.dev>
Co-authored-by: Danilo Leal <daniloleal09@gmail.com>
Co-authored-by: Joao <joao@zed.dev>
Related issue: https://github.com/zed-industries/zed/issues/20167
Release Notes:
- Changed the default keybinding to accept partial inline completions
from `ctrl-right` to `ctrl-cmd-right` on macOS, because `ctrl-right` is
already bound to jump to the end of the line.
Co-authored-by: Antonio <antonio@zed.dev>
Co-authored-by: Kirill <kirill@zed.dev>
Co-authored-by: Bennet <bennet@zed.dev>
Closes#4798
This PR implements a scrollbar for the terminal by turning
`ScrollableHandle` into a trait, allowing us to implement a custom
scroll handle, `TerminalScrollHandle`. It works by converting terminal
lines into pixels that `ScrollableHandle` understands. When
`ScrollableHandle` provides a changed offset (e.g., when you drag the
scrollbar), we convert this pixel offset back into the number of lines
to scroll and update the terminal content accordingly.
While the current version works as expected, I believe the scrollbar's
offset updates could potentially be turned into an event. This event
could then be subscribed to in `TerminalView`, not needing to update the
terminal's offset in the `render` method as it might have performance
implications. Further ideas on this are welcome.
Preview:
https://github.com/user-attachments/assets/560f0aac-4544-4007-8f0b-8833386f608f
Todo:
- [x] Experiment with custom scrollbar responding to terminal mouse
scroll
- [x] Refactor existing scrollbar handle into a trait
- [x] Update terminal to use the scrollbar trait instead of a custom
scrollbar implementation
- [x] Figure out how scrollbar events like mouse drag should notify the
terminal to update its state
- [x] Code clean up
- [x] Scrollbar hide setting for terminal
Release Notes:
- Added scrollbar to the terminal
This enables having a dedicated color for the line number hover state.
That's relevant because line numbers can now be clicked to jump to
cursor location in multibuffers.
Release Notes:
- N/A
---------
Co-authored-by: João Marcos <marcospb19@hotmail.com>
Closes#22885Closes#12565
This doesn't yet add history in the command palette, which is painfully
missing.
Release Notes:
- vim: Added `:!`, `:<range>!` and `:r!` support
- vim: Added `!` operator in normal/visual mode
This PR makes the assistant 2 panel switch work with the keyboard via
the `cmd-e` keybinding.
Release Notes:
- N/A
---------
Co-authored-by: Agus Zubiaga <hi@aguz.me>
Makes pane::ReopenClosedItem (`cmd-shift-t` macos / `ctrl-shift-t`
linux) work in Project Panel and other non-`Pane` Dock contexts too
(Diagnostics, Outline, Git, Collab).
This PR adds the initial concept of an `IconTheme` and refactors
`FileIcons` to use it to resolve the icons.
The `IconTheme` will ultimately be used to allow users to select a
different set of icons to use. Currently, however, this is just laying
the foundation for that work.
The association between file types and icons is now handled by the icon
theme when we resolve file icons. This mapping has been moved out of
`file_types.json` and into `icon_theme.rs`.
Release Notes:
- N/A
This PR adjusts the design of the assistant 2 threads with the goal of
reducing visual busyness. My intention is to remove the amount of lines
and borders given it is a relatively tight space. It also refines the
"generating" floating container style, finally leveraging linear
gradients that were recently added to GPUI! Now, we only display headers
for "you" messages. Assistant responses will be rendered right in the
panel; not bounded by a card container.
<img width="800" alt="Screenshot 2025-01-14 at 7 08 39 PM"
src="https://github.com/user-attachments/assets/a8ffa780-0ef2-4d4b-ae19-3f02fd2d63a6"
/>
Release Notes:
- N/A
- Reverts zed-industries/zed#22904
- See also: https://github.com/zed-industries/zed/issues/8580
After using it full-time for a day I very much think an implicit "mark
mode" when the emacs base keymap is enabled is the wrong approach.
Release Notes:
- Reverted "Add emacs keybindings for mark emulation" #23146 (main only)
Context pills are now focusable and intractable via the keyboard.
- <kbd>←</kbd> and <kbd>→</kbd> move the focus to the previous or next
item (wrapping if necessary)
- <kbd>↓</kbd> and <kbd>↑</kbd> move the focus vertically
- If the cursor is in the first/last row of the assistant/inline editor,
they will move the focus to the strip
- Inside the strip, they will move the focus to the pill horizontally
overlapping the most
- If already in the first/last row of the strip, they will move to the
first/last pill (like in editors)
- If the first/last pill is focused, they will move the focus back to
the editor
- <kbd>⌫</kbd> removes the focused pill (unless it's the suggested one)
- <kbd>⏎</kbd> accepts the suggested pill if focused
https://github.com/user-attachments/assets/040bc71c-a3ae-4961-9886-2d5c3d290a73
Release Notes:
- N/A
This PR adds settings for the Git Panel.
The new settings include:
| Setting | Description | Default |
|---------|-------------|---------|
| `git_panel.button` | Toggle visibility of the Git Panel button in the
status bar | `true` |
| `git_panel.dock` | Choose where to dock the Git Panel | `"left"` |
| `git_panel.default_width` | Set the default width of the Git Panel in
pixels | `360` |
| `git_panel.status_style` | Select how Git status is displayed |
`"icon"` |
| `git_panel.scrollbar.show` | Configure scrollbar behavior | Inherits
from editor settings |
Example usage:
```json
"git_panel": {
"button": true,
"dock": "left",
"default_width": 360,
"status_style": "icon",
"scrollbar": {
"show": "auto"
}
}
```
Release Notes:
- N/A
Follow-up of https://github.com/zed-industries/zed/pull/23112
Same reasoning applies.
Release Notes:
- Changed default formatter for C to be the primary language server, not
Prettier. Format-on-save is still disabled by default for C, but if one
uses the editor: format command now, it will default to the language
server. clangd can format C files, whereas prettier cannot.
As @hferreiro points out in [this
comment](https://github.com/zed-industries/zed/pull/18752#issuecomment-2589340565):
C++ and prettier don't work well together, so let's make the default
formatter for C++ the primary language server. We get that by disabling
prettier.
Release Notes:
- Changed default formatter for C++ to be the primary language server,
not Prettier. Format-on-save is still disabled by default for C++, but
if one uses the `editor: format` command now, it will default to the
language server. `clangd` can format C++ files, whereas prettier cannot.
TODO:
- [ ] Investigate incorrect hit target for `stage all` button
- [ ] Add top level context menu
- [ ] Add entry context menus
- [x] Show paths in list view
- [ ] For now, `enter` can just open the file
- [ ] 🐞: Hover deadzone in list caused by scrollbar
- [x] 🐞: Incorrect status/nothing shown when multiple worktrees are
added
---
This PR continues work on the feature flagged git panel.
Changes:
- Defines and wires up git panel actions & keybindings
- Re-scopes some actions from `git_ui` -> `git`.
- General git actions (StageAll, CommitChanges, ...) are scoped to
`git`.
- Git panel specific actions (Close, FocusCommitEditor, ...) are scoped
to `git_panel.
- Staging actions & UI are now connected to git!
- Unify more reusable git status into the GitState global over being
tied to the panel directly.
- Uses the new git status codepaths instead of filtering all workspace
entries
Release Notes:
- N/A
---------
Co-authored-by: Cole Miller <53574922+cole-miller@users.noreply.github.com>
Co-authored-by: Cole Miller <cole@zed.dev>
These keybindings extend the already selected text. This allows closer
emacs emulation where subsequent movement commands extend / shrink the
current selection instead of dismissing it.
This is a follow up on
- #21927
Release Notes:
- Added emacs movement keybindings that extend/shrink the current
selection
---------
Co-authored-by: Peter Tripp <peter@zed.dev>
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
Update `suggest_edits` prompt to clarify usage of `<old_text>` when
using update/create operations using update/create operations.
- Add a mention that `old_text` is required for all but create.
- Change definition of `create` operation to also mean overwrite, as
some models heavily prefer rewrites.
- Remove mention of `If this tag is not specified, then the entire file
will be used as the range.` which is not current behavior.
Closes#22340
Release Notes:
- N/A (not sure if this requires a release note)
### 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>