Commit Graph

345 Commits

Author SHA1 Message Date
Conrad Irwin
91adefedfa
vim keybinding updates (#3057)
Release Notes:

- vim: Add ctrl-i to go forward
([#1732](https://github.com/zed-industries/community/issues/1732)).
ctrl-o was already supported.
- vim: Add `g <space>` to open the current snippet in its own file.
- vim: Escape will now return to normal mode even if completion menus
are open (use `ctrl-x ctrl-z` to hide menus, as in vim).
- vim: Add key bindings for Zed's various completion mechanisms:
- - `ctrl-x ctrl-o` to open the completion menu,
- -  `ctrl-x ctrl-l` to open the LSP action menu,
- - `ctrl-x ctrl-c` to trigger Copilot (requires configuring copilot),
- - `ctrl-x ctrl-a` to trigger the inline Assistant (requires
configuring openAI),

NOTE: we should add these to the docs before shipping 0.107 to stable.
2023-09-28 15:32:21 -06:00
Conrad Irwin
2f5eaa8475
vim increment (#3054)
- vim: add ctrl-a/ctrl-x for increment/decrement
2023-09-28 15:32:11 -06:00
Piotr Osiewicz
81a107f503
assets: Add keybinds to replace (#3055)
Release Notes:

- N/A
2023-09-28 13:04:14 +02:00
Conrad Irwin
51b24bbaf3 Add vim-style completion bindings: 2023-09-27 21:29:18 -06:00
Conrad Irwin
2cb320e246 Escape returns to normal mode even if completion is open
For zed-industries/community#1746
2023-09-27 21:28:30 -06:00
Conrad Irwin
73fc1c1c56 Add g space for option-enter
vimify all the things
2023-09-27 21:05:58 -06:00
Conrad Irwin
d1baff1743 Add ctrl-i to go forward
For zed-industries/community#1732
2023-09-27 21:04:13 -06:00
Conrad Irwin
dd1cf5c3cf vim: add ctrl-a/ctrl-x
For zed-industries/community#1411
For zed-industries/community#619
2023-09-27 19:49:31 -06:00
Conrad Irwin
25429f760c ctrl-a/x for vim 2023-09-27 12:32:01 -06:00
Conrad Irwin
37b6e1cbb7 Add SwapPaneInDirection
Add keybindings for vim (and non-vim)
2023-09-26 22:00:51 -06:00
Piotr Osiewicz
36f022bb58
project_replace: Fix up key bindings (#3034)
Release Notes:
- N/A
2023-09-26 18:40:41 +02:00
Conrad Irwin
42df5ef45e
vim: Add multicursor shortcuts (#3032)
Adding a few bindings to bring first class feeling multiselect to zed's
vim emulation.

gn and gN are similar to similar vim bindings, ga is similar to gA (and
I doubt we need vim's real ga), g> and g< are just made up.

Release Notes:

- vim: `g n` / `g N` to select next/previous
- vim: `g >` / `g <` to skip current selection and select next/previous
- vim: `g a` to select all
2023-09-25 17:18:12 -05:00
Conrad Irwin
b29e295e1b vim: Add multicursor shortcuts
- g n / g N to select next/previous
- g > / g < to select next/previous replacing current
- g a to select all matches
2023-09-25 15:32:03 -06:00
Mikayla Maki
8c90157990
Fix space and copy/paste when editing a channel (#3030)
This fixes several bugs with how spaces and keyboard commands interact
with channel creating / renaming.

fixes
https://github.com/zed-industries/community/discussions/2076#discussioncomment-7096959

Release Notes:

- N/A
2023-09-25 15:20:00 -05:00
Conrad Irwin
b454f43b6c
Add cmd-+ as an alias for cmd-= (#3028)
Release Notes:

- Allow cmd-+ in addition to cmd-= for zoom in
([#1021](https://github.com/zed-industries/community/issues/1021)).

Although I had initially thought this was something more to do with
option key handling, it turns out to be a straightforward and reasonable
feature request.
2023-09-25 14:45:46 -05:00
Mikayla
667fc25766
Fix space and copy/paste when editing a channel 2023-09-25 11:31:02 -07:00
Conrad Irwin
23767f734f Add cmd-+ as an alias for cmd-=
For github.com/zed-industries/community#1021
2023-09-25 11:31:34 -06:00
Conrad Irwin
32f8733313 Code review changes 2023-09-20 21:29:45 -06:00
Conrad Irwin
6ad1f19a21 Add NewFileInDirection 2023-09-20 20:44:26 -06:00
Conrad Irwin
ea3a1745f5 Add vim-specific interactions to command
This mostly adds the commonly requested set (:wq and friends) and
a few that I use frequently
:<line> to go to a line number
:vsp / :sp to create a split
:cn / :cp to go to diagnostics
2023-09-20 20:44:26 -06:00
Mikayla
58f4efb579
fix default keybindings for select all matches 2023-09-20 17:14:19 -07:00
Conrad Irwin
f4d4a2f41b
vim fixes for find&replace (#2995)
* allow replacing with the empty string to delete
* fix <enter> for ReplaceNext (in vim mode)

Release Notes:

- allow replacement to be empty
2023-09-20 16:42:39 -06:00
Kyle Caverly
5fe8aa064f
Keyboard navigation and setting persistence for project search (#2996)
Enable keyboard shortcuts for Project Search modes, and ensure project
search settings are persisted search to search.

Release Notes:

- Added alt-cmd-s to Toggle Semantic Search Mode
- Added alt-cmd-g to Toggle Regex Search Mode
- Added alt-cmd-x to Toggle Text Search Mode
- Defaulted new project searches to using last used search mode and
settings.
2023-09-20 12:44:30 -04:00
Mikayla
8cc7a02390
Fix rebase 2023-09-20 08:34:18 -07:00
Mikayla
03d4191685
Fix infinite loop in select all matches 2023-09-20 08:25:21 -07:00
Mikayla
c074bfd441
Add select all command to the editor, equivalent to hitting cmd-d as many times as possible 2023-09-20 08:25:20 -07:00
KCaverly
28ed406d54 add keymaps for activating text, regex and semantic modes 2023-09-20 10:04:43 -04:00
Conrad Irwin
2da664ed17 vim fixes for find&replace
* allow replacing with the empty string to delete
* fix <enter> for ReplaceNext
2023-09-19 20:48:01 -06:00
Mikayla Maki
e37373a636
Add UI/UX for moving channels (#2976)
TODO:

- [x] Add drag and drop
- [x] Polish up in-flight decisions.
- [x] Fix chat panel panic
- [x] Add nice hover effect highlighting the matching ones
- [x] Fix and test keyboard

Release Notes:

- N/A
2023-09-19 17:56:22 -07:00
Mikayla
ac65e7590c
Add hover styles to channels matching the current selection
Fix chat desync from moving / linking channels
2023-09-19 17:50:02 -07:00
Conrad Irwin
5c22e40e99
vim: Fix Y on last line (#2975)
For zed-industries/community#2044

Release Notes:

- vim: Fix y in VISUAL LINE mode when last line has no trailing newline
([#2044](https://github.com/zed-industries/community/issues/2044)).
2023-09-18 08:54:48 -06:00
Conrad Irwin
b02bd9bce1 Fix Y on last line with no trailing new line
For zed-industries/community#2044
2023-09-15 11:14:04 -06:00
Conrad Irwin
9ef7004383 Add shift-d and shift-x as aliases for d and x in visual mode 2023-09-15 10:26:43 -06:00
Conrad Irwin
06555a423b vim: g s/S for outline/project symbols 2023-09-14 13:49:02 -06:00
Conrad Irwin
329a0724e0
vim counts (#2958)
Release Notes:

- vim: Fix counts with operators (`2yy`, `d3d`, etc.)
([#1496](https://github.com/zed-industries/community/issues/1496))
([#970](https://github.com/zed-industries/community/issues/970)).
- vim: Add support for counts with insert actions (`2i`, `2o`, `2a`,
etc.)
- vim: add `_` and `g_`
2023-09-12 14:32:00 -06:00
Piotr Osiewicz
a63b78d5a0
Replace in buffer adjustments (#2960)
This PR addresses feedback from @maxbrunsfeld on new replace in buffer.
It fixes:
- missing padding surrounding replace input.
- missing padding around replace buttons.
- missing `.notify` call which made the replace fields not show up
immediately sometimes.

Release Notes:
- N/A

---------

Co-authored-by: Max <max@zed.dev>
2023-09-12 22:08:39 +02:00
Conrad Irwin
d868d00985 vim: ALlow counts on insert actions
This re-uses the existing repeat infrastructure.
2023-09-11 18:09:47 -06:00
Conrad Irwin
cee549e1ef vim: Fix count handling to allow pre/post counts
Fixes 2yy, d3d, etc.

For zed-industries/community#970
For zed-industries/community#1496
2023-09-11 14:35:47 -06:00
Conrad Irwin
e8a6ecd6ac Allow a count with CurrentLine
Add _ and g_ too while we're here.
2023-09-11 14:19:43 -06:00
Conrad Irwin
ba1c350dad vim: Add ZZ and ZQ
The major change here is a refactoring to allow controling the save
behaviour when closing items, which is pre-work needed for vim command
palette.

For zed-industries/community#1868
2023-09-08 16:25:20 -06:00
Conrad Irwin
8e2e00e003 add vim-specific J (with repeatability) 2023-09-07 11:08:07 -06:00
Conrad Irwin
48bb2a3321 TEMP 2023-09-07 10:51:18 -06:00
Conrad Irwin
1b1d7f22cc Add visual area repeating 2023-09-07 10:45:38 -06:00
Conrad Irwin
20f98e4d17 vim . to replay
Co-Authored-By: maxbrunsfeld@gmail.com
2023-09-06 13:49:55 -06:00
Conrad Irwin
c2c04616b4
vim S (#2929)
Release Notes:
- vim: Add `S` to substitute line ([#1897](https://github.com/zed-industries/community/issues/1897)).
2023-09-05 09:39:08 -06:00
Conrad Irwin
56db21d54b Split ContextMenu actions
This should have no user-visible impact.

For vim `.` to repeat it's important that actions are replayable.
Currently editor::MoveDown *sometimes* moves the cursor down, and
*sometimes* selects the next completion.

For replay we need to be able to separate the two.
2023-09-02 21:04:19 -06:00
Conrad Irwin
af12977d17 vim: Add S to substitute line
For zed-industries/community#1897
2023-09-01 13:13:59 -06:00
Kirill Bulatov
af665cc3d2 Use ctrl-: instead of ctrl-shift-: for inlay hints toggling
The latter is not posible to press in Zed, since `:` is typed as
`shift-;` with typical US keyboard layouts.

In the end, it's the same buttons you have to press to toggle the inlay
hints, but working this time.
2023-08-31 10:43:29 +03:00
Antonio Scandurra
ea17d1638e
Introduce code generation (#2901)
![CleanShot 2023-08-28 at 12 24
36@2x](https://github.com/zed-industries/zed/assets/482957/f97cb399-1ac2-4fa9-94a7-137d1eec711c)


Release Notes:

- Added a new "Inline Assist" feature that lets you transform a
selection or generate new code at the cursor location by hitting
`ctrl-enter`.
2023-08-30 14:58:22 +02:00
Conrad Irwin
dd577074f2
vim: Fix relative motions (#2888)
This changes vim motions to be relative to fold lines, not display
lines, to match the behaviour of vim.

This is necessary for relative line numbers to make sense (as the most
important thing is you can do `3j` to get th e line that is numbered 3).


Release Notes:

- vim: Fix handling of motions when `soft_wrap` is enabled in zed. Like
in vim `j,k,up,down,$,^,0,home,end` will all now navigate in file
coordinates not display coordinates.
- vim: Add `g {j,k,up,down,$,^,0,home,end}` to navigate in display
coordinates.
- vim: Add `z o` and `z c` to open and close folds.
- vim: Add `z f` in visual mode to fold selection.

Note: this may be a jarring change if you're grown used to the current
behaviour of `j` and `k`. You can make the issue less acute by setting
`"soft_wrap":"none"` in your settings; or you can manually copy the
bindings for `g j` to the binding for `j` (etc.) in your keymap.json to
preserve the existing behaviour.
2023-08-29 11:19:37 -07:00