Commit graph

1539 commits

Author SHA1 Message Date
Marshall Bowers
e59c910845
assistant2: Add prompt editor (#23436)
This PR adds the Assistant1 experience to Assistant2 as a "prompt
editor".

<img width="1309" alt="Screenshot 2025-01-21 at 7 17 26 PM"
src="https://github.com/user-attachments/assets/3ce2f32b-2b1a-48a8-8e56-4c44e3ac4ce5"
/>

Release Notes:

- N/A
2025-01-22 00:36:55 +00:00
Peter Tripp
3d47f32f0c
Add support for editor::SwapSelectionEnds everywhere (emacs exchange-point-and-mark) (#23428)
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.
2025-01-21 18:14:00 -05:00
Conrad Irwin
94189e1784
Add emacs mark mode (#23297)
Updates #21927
Replaces https://github.com/zed-industries/zed/pull/22904
Closes #8580

Adds actions (default keybinds with emacs keymap):
- editor::SetMark (`ctrl-space` and `ctrl-@`)
- editor::ExchangeMark (`ctrl-x ctrl-x`)

Co-Authored-By: Peter <peter@zed.dev>

Release Notes:

- Add Emacs mark mode (`ctrl-space` / `ctrl-@` to set mark; `ctrl-x
ctrl-x` to swap mark/cursor)
- Breaking change: `selection` keyboard context has been replaced with
`selection_mode`

---------

Co-authored-by: Peter <peter@zed.dev>
2025-01-21 10:18:25 -05:00
Michael Sloan
aacd80ee4a
Prefer later bindings in keymap section for display in UI (#23378)
Some checks are pending
CI / Check Postgres and Protobuf migrations, mergability (push) Waiting to run
CI / Check formatting and spelling (push) Waiting to run
CI / (macOS) Run Clippy and tests (push) Waiting to run
CI / (Linux) Run Clippy and tests (push) Waiting to run
CI / (Linux) Build Remote Server (push) Waiting to run
CI / (Windows) Run Clippy and tests (push) Waiting to run
CI / Create a macOS bundle (push) Blocked by required conditions
CI / Linux x86_x64 release bundle (push) Blocked by required conditions
CI / Linux arm64 release bundle (push) Blocked by required conditions
CI / Auto release preview (push) Blocked by required conditions
Deploy Docs / Deploy Docs (push) Waiting to run
Docs / Check formatting (push) Waiting to run
Script / ShellCheck Scripts (push) Waiting to run
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.
2025-01-20 23:20:15 +00:00
Agus Zubiaga
919703e6a8
Toggle inline completion menu from keyboard (#23380) 2025-01-20 19:11:13 -03:00
Jules Bertholet
a22d8ef78f
Add support for various action keys to Linux keymap (#22997)
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.
2025-01-20 12:28:34 -07:00
Agus Zubiaga
919803a4f4
Require accepting ToS when enabling zeta (#23255)
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>
2025-01-20 11:48:49 -03:00
Thorsten Ball
5bb696e6d7
keybindings: Fix AcceptPartialInlineCompletion on macOS (#23357)
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>
2025-01-20 14:11:46 +01:00
tims
8c92da45a9
terminal: Add scrollbar (#23256)
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
2025-01-18 17:36:41 +01:00
Agus Zubiaga
938e28f871
assistant2: Thread history keyboard navigation (#23145)
Open and delete threads via keyboard:


https://github.com/user-attachments/assets/79b402ad-a49d-4c52-9d46-28a7bf32ff1f



Note: this doesn't include navigation in the "recent threads" section of
the empty state

Release Notes:

- N/A
2025-01-17 18:41:17 -03:00
Danilo Leal
da1c3d8b40
Add hover_line_number color token (#23279)
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>
2025-01-17 09:24:42 -03:00
Conrad Irwin
f94efb5008
vim: ! support (#23169)
Closes #22885
Closes #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
2025-01-16 21:19:15 -07:00
Danilo Leal
8a0c22c3bf
assistant2: Add ChatMode action (#23243)
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>
2025-01-16 13:02:22 -03:00
Peter Tripp
ebb937d88c
Move 'pane::ReopenClosedItem' keybinds from Pane to Workspace context (#23242)
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).
2025-01-16 15:53:35 +00:00
Peter Tripp
fd40d173f3
macos: Document ctrl-space global shortcut conflict (#23239)
Some checks are pending
CI / Check Postgres and Protobuf migrations, mergability (push) Waiting to run
CI / Check formatting and spelling (push) Waiting to run
CI / (macOS) Run Clippy and tests (push) Waiting to run
CI / (Linux) Run Clippy and tests (push) Waiting to run
CI / (Linux) Build Remote Server (push) Waiting to run
CI / (Windows) Run Clippy and tests (push) Waiting to run
CI / Create a macOS bundle (push) Blocked by required conditions
CI / Linux x86_x64 release bundle (push) Blocked by required conditions
CI / Linux arm64 release bundle (push) Blocked by required conditions
CI / Auto release preview (push) Blocked by required conditions
Deploy Docs / Deploy Docs (push) Waiting to run
Docs / Check formatting (push) Waiting to run
Script / ShellCheck Scripts (push) Waiting to run
2025-01-16 14:51:59 +00:00
Peter Tripp
88cb9bbc04
Add fn-f keyboard shortcut for Fullscreen (mac-only) (#23184)
- See:
https://github.com/zed-industries/zed/issues/22674#issuecomment-2593133447

Release Notes:

- macos: Added `fn-f` keyboard shortcut for fullscreen toggle.
2025-01-15 12:40:56 -05:00
Marshall Bowers
88e42cc7aa
Refactor file icons to use IconTheme (#23153)
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
2025-01-14 22:49:36 +00:00
Danilo Leal
07d582401a
assistant2: Revise thread visual design (#23083)
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
2025-01-14 22:29:39 +00:00
Peter Tripp
b7fd5718a3
Revert "Add emacs keybindings for mark emulation" (#23146)
- 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)
2025-01-14 20:56:04 +00:00
Yagil Burowski
c038696aa8
Add LM Studio support to the Assistant (#23097)
#### Release Notes:

- Added support for [LM Studio](https://lmstudio.ai/) to the Assistant.

#### Quick demo:


https://github.com/user-attachments/assets/af58fc13-1abc-4898-9747-3511016da86a

#### Future enhancements:
- wire up tool calling (new in [LM Studio
0.3.6](https://lmstudio.ai/blog/lmstudio-v0.3.6))

---------

Co-authored-by: Marshall Bowers <elliott.codes@gmail.com>
2025-01-14 20:41:58 +00:00
Kirill Bulatov
4445679f3c
Fix a typo in the task example (#23148)
Release Notes:

- N/A
2025-01-14 20:33:28 +00:00
Agus Zubiaga
39ac6e4a75
assistant2: Navigate context strip with keyboard (#23128)
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
2025-01-14 16:45:11 +00:00
Nate Butler
78fd5b5f02
git_ui: Add Git Panel settings (#23132)
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
2025-01-14 15:40:45 +00:00
Kirill Bulatov
8e65ec1022
Disable Prettier for C projects by default (#23119)
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.
2025-01-14 11:47:22 +00:00
Thorsten Ball
fcadd3e1ff
cpp: Enable language server as formatter by default (#23112)
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.
2025-01-14 09:56:57 +00:00
0x2CA
26be440d99
vim: Add Subword Textobject (#22387)
Some checks are pending
CI / check_docs_only (push) Waiting to run
CI / Check Postgres and Protobuf migrations, mergability (push) Waiting to run
CI / Check formatting and spelling (push) Waiting to run
CI / (macOS) Run Clippy and tests (push) Blocked by required conditions
CI / (Linux) Run Clippy and tests (push) Blocked by required conditions
CI / (Linux) Build Remote Server (push) Blocked by required conditions
CI / (Windows) Run Clippy and tests (push) Blocked by required conditions
CI / Create a macOS bundle (push) Blocked by required conditions
CI / Create a Linux bundle (push) Blocked by required conditions
CI / Create arm64 Linux bundle (push) Blocked by required conditions
CI / Auto release preview (push) Blocked by required conditions
Deploy Docs / Deploy Docs (push) Waiting to run
Docs / Check formatting (push) Waiting to run
Script / ShellCheck Scripts (push) Waiting to run
Closes #22761

[Vim: subword text object?
#22280](https://github.com/zed-industries/zed/discussions/22280)

Release Notes:

- Added Vim SubWord TextObject

---------

Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com>
2025-01-14 03:34:49 +00:00
Nate Butler
102e70816c
git: Git Panel UI, continued (#22960)
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>
2025-01-13 16:47:09 +00:00
Ozan
13405ed4a3
Add emacs keybindings for mark emulation (#22904)
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>
2025-01-13 14:53:13 +00:00
Danilo Leal
1e0ded4feb
zeta: Show keybinding in completion rating buttons in review modal (#22985)
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>
2025-01-10 22:00:11 +00:00
Peter Tripp
c74ad61c0f
emacs: Add as Transpose Characters (editor::Transpose) (#22974)
Originally reported here:
-
https://github.com/zed-industries/zed/issues/4856#issuecomment-2578468329

macOS default vscode keymap already has this:

8d42456b8a/assets/keymaps/default-macos.json (L55)
But it's disabled on Linux default vscode keymap as VSCode has this bind
instead:

8d42456b8a/assets/keymaps/default-linux.json (L407)

Explicitly add it to both emacs keymaps so we can keep them identical
between macos/linux as long as possible.

Release Notes:

- emacs: Add support for `ctrl-t` transposing characters on Linux
2025-01-10 17:07:06 +00:00
Peter Tripp
3795963cf5
emacs: Fix emacs in embedded terminal on Linux too (#22969)
- Follow-up to #22779 (accidentially did macos only)
- Follow-up to: https://github.com/zed-industries/zed/pull/22590

Release Notes:

- N/A
2025-01-10 15:32:24 +00:00
Danilo Leal
9248458928
assistant2: Change model selector keybinding and make it visible (#22965)
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
2025-01-10 14:27:52 +00:00
Michael Sloan
d3eae024a2
assistant2: Add Linux keybindings following same pattern as macOS (#22874)
Release Notes:

- N/A

---------

Co-authored-by: Marshall Bowers <elliott.codes@gmail.com>
2025-01-09 20:54:11 +00:00
Mike Sun
9ea7ed8e0a
Allow configuring spacing of project panel entries (#16255)
Some checks are pending
CI / check_docs_only (push) Waiting to run
CI / Check Postgres and Protobuf migrations, mergability (push) Waiting to run
CI / Check formatting and spelling (push) Waiting to run
CI / (macOS) Run Clippy and tests (push) Blocked by required conditions
CI / (Linux) Run Clippy and tests (push) Blocked by required conditions
CI / (Linux) Build Remote Server (push) Blocked by required conditions
CI / (Windows) Run Clippy and tests (push) Blocked by required conditions
CI / Create a macOS bundle (push) Blocked by required conditions
CI / Create a Linux bundle (push) Blocked by required conditions
CI / Create arm64 Linux bundle (push) Blocked by required conditions
CI / Auto release preview (push) Blocked by required conditions
Deploy Docs / Deploy Docs (push) Waiting to run
Docs / Check formatting (push) Waiting to run
Script / ShellCheck Scripts (push) Waiting to run
Release Notes:

- Added `project_panel.entry_spacing` setting to configure spacing
between entries in the project panel.

### Comfortable (default)
```json
  "project_panel": {
    "entry_spacing": "comfortable",
```
<img width="1582" alt="Screenshot 2024-08-14 at 5 50 41 PM"
src="https://github.com/user-attachments/assets/3411a82e-7517-4095-bf4a-bbf40000a7cb">

### Standard
```json
  "project_panel": {
    "entry_spacing": "standard",
```
<img width="1582" alt="Screenshot 2024-08-14 at 5 50 54 PM"
src="https://github.com/user-attachments/assets/2c13d799-c405-4301-8214-1cb3cc641c92">

---------

Co-authored-by: Marshall Bowers <elliott.codes@gmail.com>
2025-01-09 17:57:52 +00:00
Matt Prodani
a9d2628c05
Update suggest_edits prompt to clarify usage of <old_text> when using update/create operations (#22341)
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)
2025-01-08 23:45:15 +00:00
Cole Miller
d855eb3acb
Update reference to editor::OpenFile in keymap (#22827)
Follow-up to #22494

Release Notes:

- N/A
2025-01-08 17:42:22 +00:00
Vladimir Varankin
9850bf8022
Fix extend selection shortcuts in JetBrains keymap on macOS (#22814)
Fixups https://github.com/zed-industries/zed/pull/20199

As mentioned in [the post-merge comment][1], the original change was
wrong. The JetBrains IDEs use <kbd>⌥</kbd> (option) key on macOS for the
shortcuts, which corresponds to the <kbd>alt</kbd> key in the keymap
config.

Release Notes:

- Fixed extend/shrink selection in JetBrains keymap on macOS

[1]:
https://github.com/zed-industries/zed/pull/20199#issuecomment-2468136572
2025-01-08 16:01:21 +00:00
Danilo Leal
b890a12030
Improve LSP notification design (#22828)
Mostly just fine-tuning the styles and modernizing some of the component
usage. Visually, it doesn't change that _much_, but it still polishes it
up a bit.

| Before | After |
|--------|--------|
| <img width="1426" alt="Screenshot 2025-01-08 at 11 25 01 AM"
src="https://github.com/user-attachments/assets/df074f88-08c0-47c2-bd98-1a8b6dbadc99"
/> | <img width="1426" alt="Screenshot 2025-01-08 at 11 23 24 AM"
src="https://github.com/user-attachments/assets/250e3aee-fd1b-4b32-b305-e58b4fede75a"
/> |

Release Notes:

- N/A
2025-01-08 14:46:40 +00:00
Osvaldo
222b04548d
vim: Add AnyQuotes support for unified quote handling similar to mini.ai nvim (#22263)
### 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>
2025-01-08 03:00:20 +00:00
Danilo Leal
9d5ae516fd
assistant2: Add keybinding for "Remove All Context" action (#22783)
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>
2025-01-07 20:56:10 +00:00
Peter Tripp
57dfaa63ca
emacs: Fix using emacs in embedded terminal (#22779)
Some checks are pending
CI / check_docs_only (push) Waiting to run
CI / Check Postgres and Protobuf migrations, mergability (push) Waiting to run
CI / Check formatting and spelling (push) Waiting to run
CI / (macOS) Run Clippy and tests (push) Blocked by required conditions
CI / (Linux) Run Clippy and tests (push) Blocked by required conditions
CI / (Linux) Build Remote Server (push) Blocked by required conditions
CI / (Windows) Run Clippy and tests (push) Blocked by required conditions
CI / Create a macOS bundle (push) Blocked by required conditions
CI / Create a Linux bundle (push) Blocked by required conditions
CI / Create arm64 Linux bundle (push) Blocked by required conditions
CI / Auto release preview (push) Blocked by required conditions
Deploy Docs / Deploy Docs (push) Waiting to run
Docs / Check formatting (push) Waiting to run
Script / ShellCheck Scripts (push) Waiting to run
- Follow-up to: https://github.com/zed-industries/zed/pull/22590

Release Notes:

- N/A
2025-01-07 17:04:54 +00:00
0x2CA
4deab8a0b9
vim: Add Separator and RemoveIndent in Join Lines, fix gJ use space join (#22496)
Closes #22492

Release Notes:

- Added Join Lines Separator And RemoveIndent

---------

Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com>
2025-01-07 17:04:49 +00:00
Danilo Leal
677868ba1a
Add toolbar spacing and alignment improvements (#22771)
Tackles some of the points here:
https://github.com/zed-industries/zed/issues/22673. However, this is not
doing anything yet to treat misalignment when with odd-number UI font
sizes. Here are some screenshots with a theme that makes easier to spot
them. It's subtle:

| Before | After |
|--------|--------|
| <img width="1313" alt="Screenshot 2025-01-07 at 10 23 31 AM"
src="https://github.com/user-attachments/assets/fdf125a7-ef1c-4368-aea8-579f916b9c34"
/> | <img width="1313" alt="Screenshot 2025-01-07 at 10 26 11 AM"
src="https://github.com/user-attachments/assets/9728fd47-3c17-4c42-9cf6-11083eb32980"
/> |
| <img width="1313" alt="Screenshot 2025-01-07 at 10 23 36 AM"
src="https://github.com/user-attachments/assets/dc2010e9-4ae4-451c-afd1-6bd13750dc66"
/> | <img width="1313" alt="Screenshot 2025-01-07 at 10 26 08 AM"
src="https://github.com/user-attachments/assets/a71ef2ef-3ac7-4b0a-8d50-1c3c4f17d5cb"
/> |

Release Notes:

- N/A
2025-01-07 16:07:25 +00:00
0x2CA
e7ca39dfe9
vim: Fix VisualYankLine (#22416)
Closes #22388

Release Notes:

- Fixed Visual Mode Use `Y` Yank Line

---------

Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com>
2025-01-07 00:15:19 +00:00
Ross Timson
c968225b61
Add Emacs keybindings to open new/close windows and quit Zed (#22629)
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.
2025-01-06 22:02:54 +00:00
Peter Tripp
1c223d8940
Ensure project search keyboard shortcut tooltip is displayed (#22717)
Part of: https://github.com/zed-industries/zed/issues/22673

Before/After:
<img width="212" alt="Screenshot 2025-01-06 at 12 17 52"
src="https://github.com/user-attachments/assets/8eef7c5e-ccc7-4946-be19-f10dcd5f957d"
/><img width="211" alt="Screenshot 2025-01-06 at 12 17 42"
src="https://github.com/user-attachments/assets/8612b1b5-139d-422f-9457-ce399814d641"
/>


Release Notes:

- N/A
2025-01-06 21:42:47 +00:00
Peter Tripp
0f548c6add
Make show project panel keyboard shortcut work in more places (#22713)
- 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.
2025-01-06 16:34:44 +00:00
tims
bb24c085be
linux: Add keyboard shortcuts for menus (#22074)
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>
2025-01-03 18:19:24 +00:00
Peter Tripp
e5c3d5d626
Emacs keybinding improvements (2025-01-02) (#22590)
Various improvements to the emacs compatibility keybindings.

- See also: https://github.com/zed-industries/zed/issues/4856

Release Notes:

- Improvements to emacs keybindings:
- Better support for running emacs inside Zed terminal (e.g. `ctrl-x
ctrl-c` will quit emacs in terminal not zed)
  - `alt-^` Join Lines
  - `ctrl-/` Undo
  - `alt-.` GotoDefinition and `alt-,` GoBack
  - `ctrl-x h` SelectAll
  - `alt-<` / `alt->` Goto End/Beginning of Buffer
  - `ctrl-g` as Menu::cancel
2025-01-03 16:48:41 +00:00
Justin Su
898064e6b4
Fix a typo in default.json (#22589)
Release Notes:

- N/A
2025-01-02 21:44:51 +00:00