This is a follow up to #26809, introducing `git.hunk_style` setting to
control whether staged or unstaged hunks are shown as hollow.
Reused `GitHunkStyleSetting` which was left over from #26504.
Release Notes:
- Added `git.hunk_style` setting to control whether staged or unstaged
hunks are hollow.
Follow-up of https://github.com/zed-industries/zed/pull/26410
* Extract word completions into their own, `editor::ShowWordCompletions`
action so those could be triggered independently of completions
* Assign `ctrl-shift-space` binding to this new action
* Still keep words returned along the completions as in the original PR,
but:
* Tone down regular completions' fallback logic, skip words when the
language server responds with empty list of completions, but keep on
adding words if nothing or an error were returned instead
* Adjust the defaults to wait for LSP completions infinitely
* Skip "words" with digits such as `0_usize` or `2.f32` from completion
items, unless a completion query has digits in it
Release Notes:
- N/A
Closes https://github.com/zed-industries/zed/issues/4957https://github.com/user-attachments/assets/ff491378-376d-48ec-b552-6cc80f74200b
Adds `"completions"` language settings section, to configure LSP and
word completions per language.
Word-based completions may be turned on never, always (returned along
with the LSP ones), and as a fallback if no LSP completion items were
returned.
Future work:
* words are matched with the same fuzzy matching code that the rest of
the completions are
This might worsen the completion menu's usability even more, and will
require work on better completion sorting.
* completion entries currently have no icons or other ways to indicate
those are coming from LSP or from word search, or from something else
* we may work with language scopes more intelligently, group words by
them and distinguish during completions
Release Notes:
- Supported word-based completions
---------
Co-authored-by: Max Brunsfeld <max@zed.dev>
Exposes a new "edit files" tool that the model can use to apply
modifications to files in the project. The main model provides
instructions and the tool uses a separate "editor" model (Claude 3.5 by
default) to generate search/replace blocks like Aider does:
````markdown
mathweb/flask/app.py
```python
<<<<<<< SEARCH
from flask import Flask
=======
import math
from flask import Flask
>>>>>>> REPLACE
```
````
The search/replace blocks are parsed and applied as they stream in. If a
block fails to parse, the tool will apply the other edits and report an
error pointing to the part of the input where it occurred. This should
allow the model to fix it.
Release Notes:
- N/A
---------
Co-authored-by: Antonio Scandurra <me@as-cii.com>
Based on conversation with @maxbrunsfeld. Enabling Tag auto closing by
default so that it is discoverable for new and existing users
Release Notes:
- Made it so JSX tag auto-closing is automatically enabled in supported
languages
Closes#20291
This PR removes the plain text file association from the default
settings, as #21298 added a `LanguageMatcher` for Plain Text files,
which now associates "Plain Text" with `txt`-files (see
10053e2566/crates/language/src/language.rs (L127-L137)).
Thus, the association via the default settings is not required anymore,
which fixes#20291 as described in
https://github.com/zed-industries/zed/issues/20291#issuecomment-2500731743
Release Notes:
- Fixed default file type associations overriding associations provided
by extensions for `txt`-files.
Co-authored-by: Peter Tripp <peter@zed.dev>
Closes#4271
Implemented by kicking of a task on the main thread at the end of
`Editor::handle_input` which waits for the buffer to be re-parsed before
checking if JSX tag completion possible based on the recent edits, and
if it is then it spawns a task on the background thread to generate the
edits to be auto-applied to the buffer
Release Notes:
- Added support for auto-closing of JSX tags
---------
Co-authored-by: Cole Miller <cole@zed.dev>
Co-authored-by: Max Brunsfeld <max@zed.dev>
Co-authored-by: Marshall Bowers <git@maxdeviant.com>
Co-authored-by: Mikayla <mikayla@zed.dev>
Co-authored-by: Peter Tripp <peter@zed.dev>
The function ensure_final_newline in buffer.rs has this explanation:
Ensures that the buffer ends with a single newline character, no other
whitespace.
The documentation wasn't explaining well that we actually remove any
lines containing only whitespace and keep only 1 line at the end of a
buffer.
Release Notes:
- N/A
---------
Co-authored-by: Peter Tripp <peter@zed.dev>
Co-authored-by: Danilo Leal <danilo@zed.dev>
This PR adds the `git.hunk_style` setting, allowing setting an alternate
style for hunks – specifically the rendering of unstaged hunks.
It has 2 options:
- `transparent` (unstaged hunks are more transparent/less opaque than
staged hunks)
- `pattern (unstaged hunks are indicated by a visual pattern)
We'll possibly explore a VSCode-style "don't show staged hunks", but the
complexity it adds is a bit out of scope for now.
Transparent:

Pattern:

Release Notes:
- Git Beta: Added `git.hunk_style` setting to allow toggling between git
hunk visual styles.
Closes#23744
Release Notes:
- Changed the `always_show_close_button` key to `show_close_button` and
introduced a new `hidden` value, that allows never displaying the close
button.
---------
Co-authored-by: Peter Tripp <peter@zed.dev>
Co-authored-by: Danilo Leal <daniloleal09@gmail.com>
Co-authored-by: smit <0xtimsb@gmail.com>
https://github.com/zed-industries/zed/pull/25752 with fixes on top
* Ensures no flickering happens for all modifiers `: false` case
* Dismisses the toggled state on focus out
* Reworks cache state so that "enabled" and "toggled by modifiers" are
different states with their own lifecycle
Release Notes:
- N/A
This PR updates the comments in the `default.json` file consistently use
`//`.
Some comments were using `///`, which doesn't make sense in JSONC.
Release Notes:
- N/A
Closes: #25556
We were always comparing `disabled_globs` against the relative file
path, we'll now use the absolute path if the glob is also absolute.
Release Notes:
- Support absolute globs in `edit_predictions.disabled_globs`
Closes#13881, and technically resolves#14927.
Release Notes:
- Added the ability to set the default Vim mode.
---------
Co-authored-by: Marshall Bowers <git@maxdeviant.com>
While investigating #24896, I noticed two issues:
1. The default configuration for the `zed.dev` provider was using the
wrong string for Claude 3.5 Sonnet. This meant the provider would always
result as not configured until the user selected it from the model
picker, because we couldn't deserialize that string to a valid
`anthropic::Model` enum variant.
2. When clicking on `Open New Chat`/`Start New Thread` in the provider
configuration, we would select `Claude 3.5 Haiku` by default instead of
Claude 3.5 Sonnet.
Release Notes:
- Fixed some issues that caused AI providers to sometimes be
misconfigured.
This reverts commit a8610fbd13.
I've been seeing some reports of segmentation faults that appear to
point to this change as the culprit.
Closes#25366.
Release Notes:
- Community: Reverted #25040, so remove the corresponding entry from the
release notes.
Closes https://github.com/zed-industries/zed/issues/4461
This PR improves the coding experience by hiding the mouse while the
user is typing so it does not accidentally get in their way, making it
challenging to ready characters in the editor.
Release Notes:
- The following PR hides the cursor when the user is typing by adding a
new cursor style called `None`.
- Assuming the user does not move the mouse, it will stay hidden until
it is moved again.
https://github.com/user-attachments/assets/6ba9f2ee-b9f3-4595-81e4-e9d986da4a39
---------
Co-authored-by: Agus <agus@zed.dev>
Co-authored-by: Peter Tripp <peter@zed.dev>
Co-authored-by: Kirill Bulatov <kirill@zed.dev>
Release Notes:
- Added an `on_last_window_closed` setting, that allows users to quit
the app when the last window is closed
---------
Co-authored-by: Richard <richard@zed.dev>
This PR adds a new `allow_rewrap` setting to control how
`editor::Rewrap` behaves for a given language.
This is a language setting, so it can either be configured globally or
within the context of an individual language.
For example:
```json
{
"allow_rewrap": "in_selections",
"languages": {
"Typst": {
"allow_rewrap": "anywhere"
}
}
}
```
There are three different values:
- `in_comment`: Only perform rewrapping within comments.
- `in_selections`: Only perform rewrapping within the current
selection(s).
- `anywhere`: Allow rewrapping anywhere.
The global default is `in_comment`, as it is the most conservative
option and allows rewrapping comments without risking breaking other
syntax.
The `Markdown` and `Plain Text` languages default to `anywhere`, which
mirrors the previous behavior for those language that was hard-coded
into the rewrap implementation.
This setting does not have any effect in Vim mode, as Vim mode already
allowed rewrapping anywhere.
Closes https://github.com/zed-industries/zed/issues/24242.
Release Notes:
- Added an `allow_rewrap` setting to control the `editor::Rewrap`
behavior for a given language.
Closes#12635
- [x] Get it working
- [x] Disable for multi cursor
- [x] Disable for vim visual line selection
- [x] Add setting to disable it
- [x] Add scrollbar marker
- [x] Handle delete state capturing selection
Preview:
https://github.com/user-attachments/assets/a76cde64-4f6c-4575-91cc-3a03a954e7a9
Release Notes:
- Added support to highlight all matching occurrences of text within the
selection in editor.
---------
Co-authored-by: Agus Zubiaga <agus@zed.dev>
Co-authored-by: Danilo <danilo@zed.dev>
This PR adds `.dev.vars` files as a default exclusion for edit
prediction.
These files are used by Cloudflare Workers and are likely to contain
secrets.
Release Notes:
- Excluded Cloudflare Workers `.dev.vars` files from edit prediction.
This PR does some clean up for the edit predictions settings:
- Removed `editor.show_edit_predictions_in_menu`
- Renamed `edit_predictions.inline_preview` to `edit_predictions.mode`
Release Notes:
- N/A
---------
Co-authored-by: Agus Zubiaga <agus@zed.dev>
This PR clarifies how the `disabled_globs` work.
Release Notes:
- N/A
---------
Co-authored-by: Bennet Bo Fenner <53836821+bennetbo@users.noreply.github.com>
- [x] snake case keymap properties
- [x] flatten actions
- [x] keymap migration + notfication
- [x] settings migration + notification
- [x] inline completions -> edit predictions
### future:
- keymap notification doesn't show up on start up, only on keymap save.
this is existing bug in zed, will be addressed in seperate PR.
Release Notes:
- Added a notification for deprecated settings and keymaps, allowing you
to migrate them with a single click. A backup of your existing keymap
and settings will be created in your home directory.
- Modified some keymap actions and settings for consistency.
---------
Co-authored-by: Piotr Osiewicz <piotr@zed.dev>
Co-authored-by: Max Brunsfeld <maxbrunsfeld@gmail.com>
This PR adds a new `inline_completions.inline_preview` config which can
be set to `auto` (current behavior) or to `when_holding_modifier`.
When set to the latter, instead of showing edit prediction previews
inline in the buffer, we'll show it in a popover (even when there's no
LSP completion) so your isn't constantly moving as completions arrive.
https://github.com/user-attachments/assets/3615d151-3633-4ee4-98b9-66ee0aa735b8
Release Notes:
- N/A
---------
Co-authored-by: Danilo <danilo@zed.dev>
Note that this does *not* involve any breaking code changes.
cc @0xtimsb - I didn't change any settings or anything here. That can
happen separately!
Release Notes:
- N/A
This PR adds support for icon themes.
Closes https://github.com/zed-industries/zed/issues/8843.
Here is Zed with Material Icons:
<img width="1136" alt="Screenshot 2025-01-30 at 7 02 06 PM"
src="https://github.com/user-attachments/assets/57d8a0e0-ff38-44d9-8628-af58a60a7c9a"
/>
### Extensions
Extensions can provide icon themes as well as the icons used in those
themes.
Icon themes are defined as JSON files in the `icon_themes` directory,
and icons included in the `icons` directory will be packaged up with the
extension.
All icon paths within an icon theme are interpreted relative to the root
of the extension.
See the [Material Icon
Theme](https://github.com/zed-extensions/material-icon-theme) extension
for an example.
Release Notes:
- Added support for icon themes.
- Extensions can now provide icon themes.
- Use the `icon theme selector: toggle` action to switch between
installed icon themes.