Commit graph

903 commits

Author SHA1 Message Date
Conrad Irwin
2400fb4d9e
Set keybindings to non-vim mode when vim is disabled (#24971)
Closes #ISSUE

Release Notes:

- N/A
2025-02-16 10:19:03 -05:00
Dino
e0fc767c11
Display case-sensitive keybindings for vim commands (#24322)
This Pull Request tackles the issue outline in #14287 by changing the
way `KeyBinding`s for vim mode are displayed in the command palette.
It's worth pointing out that this whole thing was pretty much
implemented by Conrad Irwin during a pairing session, I just tried to
clean up some other changes introduced for a different issue, while
improving some comments.

Here's a quick list of the changes introduced:

- Update `KeyBinding` with a new `vim_mode` field to determine whether
the keybinding should be displayed in vim mode.
- Update the way `KeyBinding` is rendered, so as to detect if the
keybinding is for vim mode, if it is, only display keys in uppercase if
they require the shift key.
- Introduce a new global state – `VimStyle(bool)` - use to determine
whether `vim_mode` should be enabled or disabled when creating a new
`KeyBinding` struct. This global state is automatically set by the `vim`
crate whenever vim mode is enabled or disabled.
- Since the app's context is now required when building a `KeyBinding` ,
update a lot of callers to correctly pass this context.

And before and after screenshots, for comparison:

| before | after |
|--------|-------|
| <img width="1050" alt="SCR-20250205-tyeq"
src="https://github.com/user-attachments/assets/e577206d-2a3d-4e06-a96f-a98899cc15c0"
/> | <img width="1050" alt="SCR-20250205-tylh"
src="https://github.com/user-attachments/assets/ebbf70a9-e838-4d32-aee5-0ffde94d65fb"
/> |

Closes #14287 

Release Notes:

- Fix rendering of vim commands to preserve case sensitivity

---------

Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com>
2025-02-14 22:03:59 -07:00
xzbdmw
14289b5a6e
Fix ReplaceWithRegister with proper dot repeat (#24932)
Release Notes:

- Fixed ReplaceWithRegister with proper dot repeat
2025-02-14 21:32:21 -07:00
Marshall Bowers
e60123bbdc
Allow icon themes to provide their own file associations (#24926)
This PR adds the ability for icon themes to provide their own file
associations.

The old `file_types.json` that was previously used to make these
associations has been removed in favor of storing them on the default
theme.

Icon themes have two new fields on them:

- `file_stems`: A mapping of file stems to icon keys.
- `file_suffixes`: A mapping of file suffixes to icon keys.

These mappings produce icon keys which can then be used in `file_icons`
to associate them to a particular icon:

```json
{
  "file_stems": {
    "Makefile": "make"
  },
  "file_suffixes": {
    "idr": "idris"
  },
  "file_icons": {
    "idris": { "path": "./icons/idris.svg" },
    "make": { "path": "./icons/make.svg" }
  }
}
```

When loading an icon theme, the `file_stems` and `file_icons` fields
will be merged with the ones from the base icon theme, with the values
from the icon theme being loaded overriding ones in the base theme.

Release Notes:

- Added the ability for icon themes to provide their own file
associations.
2025-02-15 00:35:13 +00:00
Kirill Bulatov
3b91de8003
Adds a way to toggle font size without settings adjustments (#24857)
Closes https://github.com/zed-industries/zed/issues/23505

Now `zed::IncreaseBufferFontSize` (and all the same UI- and
Buffer-related settings) action is parameterized with `{ "persist": true
}` (default).
Using `"persist": false` brings back resizing behavior prior to
https://github.com/zed-industries/zed/pull/23265


Release Notes:

- Added a way to toggle font size without settings adjustments
2025-02-14 13:27:48 +02:00
Conrad Irwin
2f741c8686
vim: Fix :wq in multibuffer (#24603)
Supercedes #24561
Closes #21059

Before this change we would skip saving multibuffers regardless of the
save intent. Now we correctly save them.

Along the way:
* Prompt to save when closing the last singleton copy of an item (even
if it's still open in a multibuffer).
* Update our file name prompt to pull out dirty project items from
multibuffers instead of counting multibuffers as untitled files.
* Fix our prompt test helpers to require passing the button name instead
of the index. A few tests were passing invalid responses to save
prompts.
* Refactor the code a bit to hopefully clarify it for the next bug.

Release Notes:

- Fixed edge-cases when closing multiple items including multibuffers.
Previously no prompt was generated when closing an item that was open in
a multibuffer, now you will be prompted.
- vim: Fix :wq in a multibuffer
2025-02-13 17:13:43 +00:00
5brian
0a146793ea
vim: Prevent around word operations from selecting indentation (#24635)
Closes https://github.com/zed-industries/zed/issues/15323

Changes:
Added check for first word on line

Tested `v/c/d/y aw`. Matches standard neovim.

|initial|old|new|
|---|---|---|

|![image](https://github.com/user-attachments/assets/725b74e6-3aa0-40dc-9fd2-4d2b593e9926)|![image](https://github.com/user-attachments/assets/eeebd267-b4c6-4ea6-bb9a-fb913614754c)|![image](https://github.com/user-attachments/assets/fb695e54-b4c2-44a6-a588-909c1fd415e0)



Release Notes:

- vim: Prevent around word operations from selecting indentation
2025-02-11 11:35:59 -07:00
5brian
236f51cddd
vim: Update vi{ (#24601)
Small fix: Following up on
https://github.com/zed-industries/zed/pull/24518 where i missed `vi{`.

Matching neovim(tree-sitter), `vi{` should not have the newline selected
(Now `vi{d`/`vi{c` can match `di{`/`ci{`).

Also moved the cursor to the start.

|prev|new|neovim|
|---|---|---|

|![image](https://github.com/user-attachments/assets/0311fbe5-df2e-4feb-977d-de33a3af7fdc)|![image](https://github.com/user-attachments/assets/a940c6ba-268b-4401-8c43-38ca17848542)|![image](https://github.com/user-attachments/assets/dab2c47d-660c-4ae3-bf79-635265222cc1)|

Release Notes:

- N/A
2025-02-10 22:26:26 -07:00
Max Bucknell
37785a54d5
vim: :set support (#24209)
Closes #21147 

Release Notes:

- vim: First version of `:set` with support for `[no]wrap`,
`[no]number`, `[no]relativenumber`

---------

Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com>
2025-02-11 04:55:40 +00:00
Michael Sloan
4c881b6a12
Use editor::AcceptEditPrediction in vim keymap (#24596)
* Overrides the action handler to switch to insert mode after jumps.

* Returns `vim::Tab` to its behavior from before #24418

Release Notes:

- N/A

Co-authored-by: Conrad <conrad@zed.dev>
2025-02-10 19:20:13 -07:00
5brian
69d415c8d0
vim: Multiline operation improvements (#24518)
Closes #15711

Discussed changes to match neovim in
https://github.com/zed-industries/zed/pull/24481#issuecomment-2644504695
-- `vi{` matches neovim with treesitter instead of vanilla neovim.
Change and delete matches standard neovim.

Not sure if this is the best way to do it, implemented post processing
to change and delete objects.
I think another way would be adjust the range to trim the trailing
newline char on change and delete operations, instead of having to add
it back.

||Before|After|
|---|---|---|

|initial|![image](https://github.com/user-attachments/assets/0bab37b7-c0ac-4992-a365-b7ec304a6800)||
| `vi{` |
![image](https://github.com/user-attachments/assets/4c802fcd-fa7e-45ba-b7d4-3283ed538e10)
|
![image](https://github.com/user-attachments/assets/4394bb6e-418b-4463-9737-f9bdfc6d31c2)
|
| `ci{` |
![image](https://github.com/user-attachments/assets/b5eabb58-4a93-4c98-80b6-f34a6525b1fb)
|
![image](https://github.com/user-attachments/assets/79af57e4-260c-4432-af66-eba5285d97a0)
|
| `di{` |
![image](https://github.com/user-attachments/assets/190a70e7-71fd-47fe-9d6c-2082f2034d0f)
|
![image](https://github.com/user-attachments/assets/775b86a9-68c1-4397-a44b-c645a772de63)
|

Release Notes:

- vim: Improved multi-line operations
2025-02-10 08:45:06 -07:00
5brian
7bddb390ca
vim: Preserve trailing whitespace in inner text object selections (#24481)
Closes #24438

Changes: Adjusted loop to only trim whitespace between last newline and
closing marker, when using inner objects like `y/d/c i b`

| Start   | Fixed `vib`   | Previous `vib`   |
| ---------- | ---------- | ---------- |
|
![image](https://github.com/user-attachments/assets/3d64dd7d-ed3d-4a85-9f98-f2f83799a738)
|
![image](https://github.com/user-attachments/assets/841beb59-31b1-475e-93f0-f4deaf18939c)
|
![image](https://github.com/user-attachments/assets/736d4c6f-20e1-4563-9471-1e8195455df4)
|



Release Notes:

- vim: Preserve trailing whitespace in inner text object selections

---------

Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com>
2025-02-08 02:50:34 +00:00
smit
44c6a54f95
pane: Improve close active item to better handle pinned tabs (#23488)
Closes #22247

- [x] Do not close pinned tab on keyboard shortcuts like `ctrl+w` or
`alt+f4`
- [x] Close pinned tab on context menu action, menu bar action, or vim
bang
- [x] While closing pinned tab via shortcut (where it won't close),
instead activate any other non-pinned tab in same pane
- [x] Else, if any other pane contains non-pinned tab, activate that
- [x] Tests

Co-authored-by: uncenter <47499684+uncenter@users.noreply.github.com>

Release Notes:

- Pinned tab now stay open when using close shortcuts, auto focuses to
any other non-pinned tab instead.
2025-02-07 22:54:57 +05:30
smit
00c2a30059
Migrate keymap and settings + edit predictions rename (#23834)
- [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>
2025-02-07 21:17:07 +05:30
Michael Sloan
f700268029
Improve vim interactions with edit predictions (#24418)
* When an edit prediction is present in non-insertion modes, hide it but
show `tab Jump to edit`.
* Removes discarding of edit predictions when going from insert mode to
normal mode, instead just hide them in non-insertion modes.
* Removes zeta-specific showing of predictions in normal mode. This
behavior was only happening in special cases anyway - where the discard
of completions wasn't happening due to some other thing taking
precedence in `dismiss_menus_and_popups`.

Release Notes:

- N/A

---------

Co-authored-by: Conrad <conrad@zed.dev>
Co-authored-by: Mikayla <mikayla@zed.dev>
2025-02-07 03:53:38 -07:00
Conrad Irwin
8646d37c0c
vim: Replace with Register (#24326)
Closes #18813

Release Notes:

- vim: Add `gr` for [replace with
register](https://github.com/vim-scripts/ReplaceWithRegister)
2025-02-06 20:24:41 -07:00
Ben Kunkle
a1ed1a00b3
Fix issue with Vim test instead of cheating (#24411)
Appears this test was failing, and someone edited the expected test
output instead of fixing it. Well no longer!

Release Notes:

- N/A

Co-authored-by: Conrad <conrad@zed.dev>
2025-02-06 18:43:30 -06:00
Ben Kunkle
337b9e62d2
Fix vim full line operations failing when no trailing newline (#24409)
Closes #24270

Release Notes:

- Fixed an issue where doing line-wise operations in vim mode on the
last line of a file with no trailing newline would not work properly
2025-02-06 17:57:24 -06:00
0x2CA
c24f22cd14
vim: Fix Around Subword not including whitespace (#24356)
Closes #24271

Release Notes:

- Fixed Around Subword No Include Whitespace
2025-02-06 08:54:04 -07:00
Bennet Bo Fenner
e1a6d9a485
edit prediction: Improve UX around disabled_globs and show_inline_completions (#24207)
Release Notes:

- N/A

---------

Co-authored-by: Danilo <danilo@zed.dev>
Co-authored-by: Danilo Leal <daniloleal09@gmail.com>
2025-02-05 17:09:19 +00:00
张小白
74c4dbd237
windows: Fix tests on Windows (#22616)
Release Notes:

- N/A

---------

Co-authored-by: Mikayla <mikayla.c.maki@gmail.com>
2025-02-05 14:30:09 +00:00
Anthony Eid
8c7096f7a6
Rename model based variable names to entity (#24198)
## Context
While looking through the client crate, I noticed that some of the old
functions and variables were still using gpui::model name that was
deprecated during the gpui3 transition. This PR renames those instances
of model to entity to be more inline with gpui3.

In addition, I also renamed `model` to `entity` in cases found by the
below search terms given by @someone13574

- model = cx.
- model: Entity
- model: &Entity
- OpenedModelHandle
- model.update
- model.upgrade
- model = .*\.root (regex)
- parent_model
- model = cx.new
- cx.spawn(move |model

Release Notes:

- N/A
2025-02-04 10:24:35 -08:00
Ben Kunkle
daf09fa532
Fix issue where changing the case of a vim object would be clipped at the end of the line (#24163)
Co-authored-by: Conrad Irwin <conrad@zed.dev>

Closes #24124

Release Notes:

- Fixed an issue in vim mode where changing the case of an object at the
end of the line would not change the case of the last character in the
object

Co-authored-by: Conrad Irwin <conrad@zed.dev>
2025-02-04 03:40:45 +00:00
Agus Zubiaga
4c29e1ff07
zeta: Improve UX for simultaneous LSP and prediction completions (#24024)
Release Notes:

- N/A

---------

Co-authored-by: Michael Sloan <michael@zed.dev>
Co-authored-by: Danilo <danilo@zed.dev>
Co-authored-by: Richard <richard@zed.dev>
2025-02-03 21:47:11 -03:00
AidanV
d0152f9eb4
vim: Add keybindings for resizing docks (#23874)
Closes #23334

This does not follow the exact way that windows are resized in vim.
Normally the command is `ctrl-w >` however this PR uses just `ctrl->`.
This is because I could not find a good way to read in a count like `10
ctrl-w ctrl->`. This is not really a problem since `ctrl->` can be held
down, which, in my opinion, speeds up resizing. I think this is a good
compromise since it improves usability; however, I am concerned that
this is not intuitive. I am looking forward to feedback.

Release Notes:

- Added the following commands 
  - vim::ResizeLeftDock
  - vim::ResizeRightDock
  - vim::ResizeBottomDock
- Added keybinds
  - `ctrl->` for widening left dock
  - `ctrl-<` for narrowing left dock
2025-01-31 21:50:16 -07:00
Conrad Irwin
a3c7dc3321
vim: Add textobject e for entire file (#24039)
Co-Authored-By: Thomas Heartman <zed@thomasheartman.com>

Release Notes:

- vim: Add `e` for entire file object. `yae` to copy entire file

Co-authored-by: Thomas Heartman <zed@thomasheartman.com>
2025-01-31 21:38:19 -07:00
Conrad Irwin
cb15753694
Fix clipping at end of line in vim mode with inlay hints (#23975)
Closes #23877

Co-Authored-By: Ben <ben@zed.dev>
Co-Authored-By: Michael <michael@zed.dev>

Release Notes:

- vim: Fix navigating to end of line with inlay hints

---------

Co-authored-by: Ben <ben@zed.dev>
Co-authored-by: Michael <michael@zed.dev>
2025-01-31 00:00:47 -07:00
Michael Sloan
43f3491d50
Add comment explaining why AddSurrounds target is not deserializable (#23820)
See #23088

Release Notes:

- N/A
2025-01-29 06:18:56 +00:00
Osvaldo
9e31b1019e
vim: Add any brackets to support motions like ab and ib to work with any type of brackets (#23679)
# Add AnyBrackets text object for Vim mode

## Overview
This PR introduces a new text object `AnyBrackets` that allows
operations on the closest matching pair of brackets, regardless of the
bracket type. This enhances the editing experience by reducing the need
to identify specific bracket types before performing text operations.

By default, this feature is NOT mapped to any key in vim.json. However,
it can be enabled manually, and the recommended key for mapping is b:

If you want to add it to your zed keymap config you need to add the
following config:
```json
{
	"context": "vim_operator == a || vim_operator == i || vim_operator == cs",
	"bindings": {
		"b": "vim::AnyBrackets"
	}
}
```

## Features
- New text object that works with parentheses `()`, square brackets
`[]`, curly braces `{}`, they are also know as round brackets, square
brackets and curly brackets in english.
- Automatically finds the closest matching pair of any bracket type
- Works with all standard Vim operators (delete, change, yank)
- Supports both "inside" and "around" variants (`i` and `a`)

## Usage Examples
```vim
# Delete inside the closest brackets
di(  # Works on (), [] or {} depending on which is closest

# Change around the closest brackets
ca[  # Works on (), [] or {}  depending on which is closest

# Visual select inside the closest brackets
vi{  # Works on (), [] or {}  depending on which is closest
```

# References:
- Based on the popular plugin https://github.com/echasnovski/mini.ai

# Important Notes
This PR also fixes a bug with nested quotes on AnyQuotes, now it works
fine with any type of quotes or brackets.
Please take a look at the new tests to understand the expected behavior.

Release Notes:

- vim: Add `ab`/`ib` "AnyBrackets" text objects that are the smallest of
`a(`, `a[` or `a{` or `i(`, `i[` or `i{`
- vim: Fix aq/iq "AnyQuotes" text objects when they are nested
2025-01-28 20:23:17 -07:00
CharlesChen0823
02503cf3be
vim: Fix NextSubwordEnd crash (#23604)
Closes #23550 

Release Notes:

- N/A
2025-01-27 23:13:13 -07:00
Cole Miller
27d57ba3b6
git: First stab at adding Linux and Vim keybindings (#23738)
Release Notes:

- N/A
2025-01-27 16:58:09 -05:00
Mikayla Maki
9cae96f82f
Remove more references to 'model' in GPUI APIs (#23693)
Release Notes:

- N/A
2025-01-27 04:00:27 +00:00
Mikayla Maki
a6b1514246
Fix missed renames in #22632 (#23688)
Fix a bug where a GPUI macro still used `ModelContext`
Rename `AsyncAppContext` -> `AsyncApp`
Rename update_model, read_model, insert_model, and reserve_model to
update_entity, read_entity, insert_entity, and reserve_entity

Release Notes:

- N/A
2025-01-26 23:37:34 +00:00
Nathan Sobo
6fca1d2b0b
Eliminate GPUI View, ViewContext, and WindowContext types (#22632)
There's still a bit more work to do on this, but this PR is compiling
(with warnings) after eliminating the key types. When the tasks below
are complete, this will be the new narrative for GPUI:

- `Entity<T>` - This replaces `View<T>`/`Model<T>`. It represents a unit
of state, and if `T` implements `Render`, then `Entity<T>` implements
`Element`.
- `&mut App` This replaces `AppContext` and represents the app.
- `&mut Context<T>` This replaces `ModelContext` and derefs to `App`. It
is provided by the framework when updating an entity.
- `&mut Window` Broken out of `&mut WindowContext` which no longer
exists. Every method that once took `&mut WindowContext` now takes `&mut
Window, &mut App` and every method that took `&mut ViewContext<T>` now
takes `&mut Window, &mut Context<T>`

Not pictured here are the two other failed attempts. It's been quite a
month!

Tasks:

- [x] Remove `View`, `ViewContext`, `WindowContext` and thread through
`Window`
- [x] [@cole-miller @mikayla-maki] Redraw window when entities change
- [x] [@cole-miller @mikayla-maki] Get examples and Zed running
- [x] [@cole-miller @mikayla-maki] Fix Zed rendering
- [x] [@mikayla-maki] Fix todo! macros and comments
- [x] Fix a bug where the editor would not be redrawn because of view
caching
- [x] remove publicness window.notify() and replace with
`AppContext::notify`
- [x] remove `observe_new_window_models`, replace with
`observe_new_models` with an optional window
- [x] Fix a bug where the project panel would not be redrawn because of
the wrong refresh() call being used
- [x] Fix the tests
- [x] Fix warnings by eliminating `Window` params or using `_`
- [x] Fix conflicts
- [x] Simplify generic code where possible
- [x] Rename types
- [ ] Update docs

### issues post merge

- [x] Issues switching between normal and insert mode
- [x] Assistant re-rendering failure
- [x] Vim test failures
- [x] Mac build issue



Release Notes:

- N/A

---------

Co-authored-by: Antonio Scandurra <me@as-cii.com>
Co-authored-by: Cole Miller <cole@zed.dev>
Co-authored-by: Mikayla <mikayla@zed.dev>
Co-authored-by: Joseph <joseph@zed.dev>
Co-authored-by: max <max@zed.dev>
Co-authored-by: Michael Sloan <michael@zed.dev>
Co-authored-by: Mikayla Maki <mikaylamaki@Mikaylas-MacBook-Pro.local>
Co-authored-by: Mikayla <mikayla.c.maki@gmail.com>
Co-authored-by: joão <joao@zed.dev>
2025-01-26 03:02:45 +00:00
Max Brunsfeld
d2c55cbe3d
Rework diff rendering to allow putting the cursor into deleted text, soft-wrapping and scrolling deleted text correctly (#22994)
Closes #12553

* [x] Fix `diff_hunk_before`
* [x] Fix failure to show deleted text when expanding hunk w/ cursor on
second line of the hunk
* [x] Failure to expand diff hunk below the cursor.
* [x] Delete the whole file, and expand the diff. Backspace over the
deleted hunk, panic!
* [x] Go-to-line now counts the diff hunks, but it should not
* [x] backspace at the beginning of a deleted hunk deletes too much text
* [x] Indent guides are rendered incorrectly 
* [ ] Fix randomized multi buffer tests

Maybe:
* [ ] Buffer search should include deleted text (in vim mode it turns
out I use `/x` all the time to jump to the next x I can see).
* [ ] vim: should refuse to switch into insert mode if selection is
fully within a diff.
* [ ] vim `o` command when cursor is on last line of deleted hunk.
* [ ] vim `shift-o` on first line of deleted hunk moves cursor but
doesn't insert line
* [x] `enter` at end of diff hunk inserts a new line but doesn't move
cursor
* [x] (`shift-enter` at start of diff hunk does nothing)
* [ ] Inserting a line just before an expanded hunk collapses it

Release Notes:


- Improved diff rendering, allowing you to navigate with your cursor
inside of deleted text in diff hunks.

---------

Co-authored-by: Conrad <conrad@zed.dev>
Co-authored-by: Cole <cole@zed.dev>
Co-authored-by: Mikayla <mikayla@zed.dev>
Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com>
Co-authored-by: Michael <michael@zed.dev>
Co-authored-by: Agus <agus@zed.dev>
Co-authored-by: João <joao@zed.dev>
2025-01-24 14:18:22 -07:00
Conrad Irwin
0ef53bf476
vim: Add support for ctrl-g (#23562)
Co-Authored-By: Jon Walstedt <jon@walstedt.se>

Closes #22094

Release Notes:

- vim: Added support for ctrl-g

Co-authored-by: Jon Walstedt <jon@walstedt.se>
2025-01-23 12:10:08 -07:00
Thorsten Ball
706e46c3ff
vim: Fix % not working for multi-char bracket pairs (#23471)
Closes #23358

Demo/proof:


https://github.com/user-attachments/assets/2036d183-8830-415b-9155-0d3efe3d824c




Release Notes:

- Fixed `%` in Vim mode not working correctly for multi-char brackets,
such as `do/end` in Elixir or `\begin` and `\end` in LaTeX.

Co-authored-by: Conrad <conrad@zed.dev>
2025-01-22 17:39:11 +01:00
Michael Sloan
711dc21eb2
Load all key bindings that parse and use markdown in error notifications (#23113)
* Collects and reports all parse errors

* Shares parsed `KeyBindingContextPredicate` among the actions.

* Updates gpui keybinding and action parsing to return structured
errors.

* Renames "block" to "section" to match the docs, as types like
`KeymapSection` are shown in `json-language-server` hovers.

* Removes wrapping of `context` and `use_key_equivalents` fields so that
`json-language-server` auto-inserts `""` and `false` instead of `null`.

* Updates `add_to_cx` to take `&self`, so that the user keymap doesn't
get unnecessarily cloned.

In retrospect I wish I'd just switched to using TreeSitter to do the
parsing and provide proper diagnostics. This is tracked in #23333

Release Notes:

- Improved handling of errors within the user keymap file. Parse errors
within context, keystrokes, or actions no longer prevent loading the key
bindings that do parse.
2025-01-18 22:27:08 +00:00
Piotr Osiewicz
c9534e8025
chore: Use workspace fields for edition and publish (#23291)
This prepares us for an upcoming bump to Rust 2024 edition.

Release Notes:

- N/A
2025-01-17 17:39:22 +01: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
Piotr Osiewicz
795376cb07
ui: Track changes to UI font size made via actions with settings (#23265)
Fixes #5380

Closes #5380

Release Notes:

- Font size changes made with actions are now persisted in user settings
2025-01-16 23:28:18 +00:00
Thorsten Ball
bf75b33464
vim: Fix inline completions not disappearing in normal mode (#23176)
Closes #23042

Release Notes:

- Fixed inline completions (Copilot, Supermaven, ...) still being
visible sometimes after leaving Vim's insert mode.
2025-01-15 12:44:56 +00:00
0x2CA
26be440d99
vim: Add Subword Textobject (#22387)
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
0x2CA
03c99e39f9
vim: Fix vim delete to line (#23053)
Closes #23024

Release Notes:

- Fixed Vim `dxG` delete to line

---------

Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com>
2025-01-14 03:07:47 +00:00
Michael Sloan
6aba3950d2
Improve keymap json schema (#23044)
Also:

* Adds `impl_internal_actions!` for deriving the `Action` trait without
registering.

* Removes some deserializers that immediately fail in favor of
`#[serde(skip)]` on fields where they were used. This also omits them
from the schema.

Release Notes:

- Keymap settings file now has more JSON schema information to inform
`json-language-server` completions and info, particularly for actions
that take input.
2025-01-13 02:34:35 +00:00
Michael Sloan
1b44398967
Make SelectionsCollection::disjoint_anchor_ranges return an iterator (#22948)
This helps discourage unnecessary collection to Vec

Release Notes:

- N/A
2025-01-10 09:37:46 +00:00
Nico Lehmann
0b105ba8b7
vim: Add sneak motion (#22793)
A (re)continuation of https://github.com/zed-industries/zed/pull/21067. 

This takes the original implementation in
https://github.com/zed-industries/zed/pull/15572 and adds the test in
https://github.com/zed-industries/zed/pull/21067. Then, as requested in
https://github.com/zed-industries/zed/pull/21067#issuecomment-2515469185,
it documents how to map a keybinding instead of having a setting.

Closes #13858

Release Notes:

- Added support for the popular
[vim_sneak](https://github.com/justinmk/vim-sneak) plugin. This is
disabled by default and can be enabled by binding a key to the `Sneak`
and `SneakBackward` operators.

Reference:
https://github.com/justinmk/vim-sneak

---------

Co-authored-by: Kajetan Puchalski <kajetan.puchalski@tuta.io>
Co-authored-by: Aidan Grant <mraidangrant@gmail.com>
Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com>
2025-01-10 07:07:32 +00:00
Thorsten Ball
f9ee28db5e
vim: Fix clipping when navigating over inlay hints (#22813)
This fixes the issue described in this comment:
https://github.com/zed-industries/zed/pull/22439#issuecomment-2563896422

Essentially, we'd clip in the wrong direction when there were multi-line
inlay hints.

It also fixes inline completions for non-Zeta-providers showing up in
normal mode.

Release Notes:

- N/A
2025-01-08 09:41:43 +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
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