Commit Graph

530 Commits

Author SHA1 Message Date
Conrad Irwin
09b216cf5e
Make project search feel better (#14674)
Release Notes:

- Improved UX of project search

---------

Co-authored-by: Marshall <marshall@zed.dev>
2024-07-17 14:14:46 -06:00
Nemo
ff85f1d608
Fix default sublime tab navigation (#14427)
Co-authored-by: Peter Tripp <peter@zed.dev>
2024-07-17 10:07:46 -04:00
Peter Tripp
d1300b7a66
Linux Keybinding Improvements (#14600)
- Fixed ctrl-shift-d (duplicate line) conflict.
- Fixes #14458
- Remove some duplicated definitions
- Fix Expand/Shrink selection (was ctrl-shift-up/down, now alt-shift-left/right)
- Add `ctrl-f2` / `cmd-f2` as alias for `editor::SelectAllMatches` matching VSCode
- Moved multi-cursor (Insert cursor above / below) from ctrl-shift-up/down to alt-shift-up/down
2024-07-17 10:06:47 -04:00
Conrad Irwin
2cdfae9ce3
Show an initial empty keymap (#14609)
Release Notes:

- Added default content for the user keymap file.
2024-07-16 20:24:13 -06:00
Conrad Irwin
76594ae5cd
vim: fix escape while waiting (#14595)
Follow up from #14233

Release Notes:

- N/A
2024-07-16 14:08:05 -06:00
Peter Tripp
0bf0152b74
Fix GoForward shortcut on non-US keyboard layouts (#14570)
- Fixes #14418. Originally broken by #13946
2024-07-16 11:00:15 -04:00
Conrad Irwin
abc5abcd8b
open picker (#14524)
Release Notes:

- linux: Added a fallback Open picker for when XDG is not working
- Added a new setting `use_system_path_prompts` (default true) that can
be disabled to use Zed's builtin keyboard-driven prompts.

---------

Co-authored-by: Max <max@zed.dev>
2024-07-15 17:04:15 -06:00
Eric Skogen
2c6cb4ec16
Fix Cmd+\ for workspace::ToggleLeftDock for Atom base keymap (#14098)
Release Notes:

- Fixed Left Dock in Atom keymap on Mac/Linux (`cmd-\`, `ctrl-\`) 
 ([#14098](https://github.com/zed-industries/zed/pull/14098), thanks [@audionerd](https://github.com/audionerd)).

---------

Co-authored-by: Peter Tripp <peter@zed.dev>
2024-07-15 15:56:10 -04:00
Peter Tripp
3c38be59b5
Add keyboard shortcuts to center scrolling around current line (#14385)
- MacOS: Center the cursor in the visible area. `ctrl-l` (matches MacOS)
- Linux JetBrains: Scroll so cursor is at the Middle `ctrl-m`
- `editor::NextScreen` is not longer bound in any keymap by default (was
`ctrl-l` on MacOS)

Fixes #5247
2024-07-15 09:26:53 -04:00
sherwyn
e402d7e96a
vim: Add support for vim::PreviousLineStart motion (#14193)
Release Notes:

- vim: Added `-`/`+` to go to beginning of line above/below
([#14183](https://github.com/zed-industries/zed/issues/14183)).
- vim: (Breaking) Removed non-standard builtin binding from `-` to open
the project panel. You can re-add it to your keymap file with:
`{"context":"VimControl", "bindings":{ "-":
"pane::RevealInProjectPanel"}}`


Optionally, include screenshots / media showcasing your addition that
can be included in the release notes.


https://github.com/zed-industries/zed/assets/32429059/0e9e9348-265e-4a81-a45a-4739034dc5d9

---------

Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com>
2024-07-11 16:36:07 -06:00
Conrad Irwin
b0dbc80575
vim: (BREAKING) clean up keymap contexts (#14233)
Release Notes:

- vim: (BREAKING) Improved vim keymap contexts.

Previously `vim_mode == normal` was true even when operators were
pending, which led to bugs like #13789 and a requirement for custom
keymaps to exclude various conditions like (`!VimObject` and
`!VimWaiting`) to avoid bugs.

Now `vim_mode` will be set to `operator` or `waiting` in these cases as
described in [the docs](https://zed.dev/docs/vim#keybindings). For most
custom keymaps this change will be a no-op or an improvement, but if you
were deliberately relying on the old behaviour (if you were relying on
`VimObject` or `VimWaiting` becoming true) you will need to update your
keymap.

---------

Co-authored-by: Thorsten <thorsten@zed.dev>
2024-07-11 13:16:26 -06:00
Peter Tripp
1d7b28c658
Add Upper/LowerCase binds to Linux Sublime Text keybinds (#14155) 2024-07-11 11:15:49 -04:00
Peter Tripp
de78eb44b1
Keymap changes for editor::JoinLines (#14136)
- Linux (default) add ctrl-shift-j
- Linux (default) remove ctrl-j
  - Conflicted with: `"ctrl-j": "workspace::ToggleBottomDock",`
- MacOS (sublime) add cmd-shift-j
2024-07-11 11:14:25 -04:00
tomoikey
291d64c803
lsp: Implement textDocument/signatureHelp for ProjectClientState::Local environment (#12909)
Closes https://github.com/zed-industries/zed/issues/5155
Closes https://github.com/zed-industries/zed/issues/4879


# Purpose
There was no way to know what to put in function signatures or struct
fields other than hovering at the moment. Therefore, it was necessary to
implement LSP's `textDocument/signatureHelp`.

I tried my best to match the surrounding coding style, but since this is
my first contribution, I believe there are various aspects that may be
lacking. I would greatly appreciate your code review.

# Description
When the window is displayed, the current argument or field at the
cursor's position is automatically bolded. If the cursor moves and there
is nothing to display, the window closes automatically.
To minimize changes and reduce the burden of review and debugging, the
SignatureHelp feature is implemented only when `is_local` is `true`.
Some `unimplemented!()` macros are embedded, but rest assured that they
are not called in this implementation.

# How to try it out
Press `cmd + i` (MacOS), `ctrl + i` (Linux).

# Enable auto signature help (2 ways)
### Add `"auto_signature_help": true` to `settings.json`
<img width="426" alt="image"
src="https://github.com/zed-industries/zed/assets/55743826/61310c39-47f9-4586-94b0-ae519dc3b37c">

Or

### Press `Auto Signature Help`. (Default `false`)
<img width="226" alt="image"
src="https://github.com/zed-industries/zed/assets/55743826/34155215-1eb5-4621-b09b-55df2f1ab6a8">

# Disable to show signature help after completion
### Add `"show_signature_help_after_completion": false` to
`settings.json`
<img width="438" alt="image"
src="https://github.com/zed-industries/zed/assets/55743826/5e5bacac-62e0-4921-9243-17e1e72d5eb6">

# Movie

https://github.com/zed-industries/zed/assets/55743826/77c12d51-b0a5-415d-8901-f93ef92098e7

# Screen Shot
<img width="628" alt="image"
src="https://github.com/zed-industries/zed/assets/55743826/3ebcf4b6-2b94-4dea-97f9-ac4f33e0291e">

<img width="637" alt="image"
src="https://github.com/zed-industries/zed/assets/55743826/6dc3eb4d-beee-460b-8dbe-d6eec6379b76">

Release Notes:

- Show function signature popovers
([4879](https://github.com/zed-industries/zed/issues/4879),
[5155](https://github.com/zed-industries/zed/issues/5155))

---------

Co-authored-by: Kirill Bulatov <kirill@zed.dev>
2024-07-11 13:38:33 +03:00
Kyle Kelley
07dc4050bf
Do not bind cmd-enter for repl::Run when in AssistantContext (#14066)
Don't pollute cmd-enter in the Assistant's `ContextEditor`.

Release Notes:

- N/A
2024-07-10 09:25:07 -07:00
Thorsten Ball
7ef64fe6db
vim: Add ctrl-m binding (equivalent to <CR>) (#14057)
Now that we have macros I noticed how much I rely on this.

Release Notes:

- vim: `ctrl-m` now is equivalent to `enter` in editor.
2024-07-10 16:31:54 +02:00
Saurabh
ba7d5a3d4c
Fixed keymap for toggling right dock in linux (#14041)
Release Notes:

- N/A
2024-07-10 10:49:28 +02:00
Aleksei Gusev
5e1521eded
Change the default shortcut for git blame on Linux (#13637)
Zed already has a shortcut assigned to ctrl-alt-g and it's mapped to
`search::SelectNextMatch`. Having another multi shortcut with the same
prefix makes `ctrl-alt-g` to have a very noticeable delay when pressed.

This commit changes the default shortcut for git blame to `alt-g b`

Release Notes:

- N/A
2024-07-09 12:13:20 -07:00
francesco-gaglione
2dd486733b
Reveal in files instead of Finder (#13432)
fixes: #12776 

Release Notes:

- Renamed `editor::RevealInFinder` to `editor::RevealInFileManager`

---------

Co-authored-by: Mikayla Maki <mikayla@zed.dev>
2024-07-09 11:54:14 -07:00
Peter Tripp
9a523ef730
Fix keybind conflicts (atom mac/linux default) (#13988)
- atom(mac): Cmd+j conflicts with `workspace: ToggleBottomDock` in
default map. Revert.
- default(linux): `ctrl-shift-t` conflict. Move
`project_symbols::Toggle` to `ctrl-t` to match vscode linux. Leave
`pane::ReopenClosedItem` at `ctrl-shift-t` to match vscode/chrome on
linux.
- Fixes #13973
2024-07-09 10:02:21 -04:00
Kirill Bulatov
9b688655a8
Add a way to filter items in the outline panel (#13984)
https://github.com/zed-industries/zed/assets/2690773/145a7cf2-332c-46c9-ab2f-42a77504f54f

Adds a way to filter entries in the outline panel, by showing all
entries (even if their parents were collapsed) that fuzzy match a given
query.

Release Notes:

- Added a way to filter items in the outline panel
2024-07-09 16:44:24 +03:00
Aleksei Gusev
18d6be250f
Add keyboard shortcuts for the prompts on Linux (#13915)
This change adds ability to choose any action from prompts, not just the
default one and cancel as Zed has right now. For example, when a user
tries to close a file with edits in it the prompt offers "Don't save"
option that can be selected only with mouse. Now you can use arrows,
tab/shift-tab to pick action and enter/space to confirm it.

Fixes [#13906](https://github.com/zed-industries/zed/issues/13906)


Release Notes:

- Added keyboard navigation in the prompts on Linux
([#13906](https://github.com/zed-industries/zed/issues/13906)).


Co-authored-by: Thorsten Ball <mrnugget@gmail.com>
2024-07-09 10:50:13 +02:00
Matt Fellenz
034d905435
Allow vim counts with undo and redo (#13950)
These were previously passed directly to the editor module, which knows
nothing about vim counts. Instead, implement new actions in the vim
module which take the count and use it to invoke the corresponding
action in the editor module, properly repeated.

Release Notes:

- Fixed vim undo and redo commands not taking counts.
2024-07-08 23:16:52 -06:00
Conrad Irwin
0d7bd0c535
vim: Disable default ctrl-x/ctrl-w on linux (#13966)
Release Notes:

- N/A
2024-07-08 22:36:21 -06:00
Peter Tripp
af697d9cc2
Better tooltips for back/forward (#13946)
Fixes #8459
2024-07-08 16:33:41 -04:00
Mikayla Maki
032b203519
Separate out macOS and Linux keymaps (#13792)
Release Notes:

- Added Linux-Specific keymaps for JetBrains, Atom and Sublime Text
- Improved MacOS-specific keymaps for JetBrains and Atom
- Improved Linux default keymap (VSCode compatibility)
- Windows now uses same keymap as Linux

---------

Co-authored-by: Peter Tripp <peter@zed.dev>
2024-07-08 15:05:29 -04:00
Vince
79f3646325
Add missing clipboard shortcut to default-linux.json (#13900)
Bind shift-delete to editor::Cut (similar to #11799, which added copy
and paste, but not cut)


Release Notes:

- N/A
2024-07-07 14:40:23 +03:00
Peter Tripp
813cc3f5e5
Keymap oneliners (#13887)
This is should be a no-op, whitespace formatting only.
Removes 425 lines of excess whitespace in our default keymap json files.

Release Notes:

- Improved formatting of default keymaps (single line per bind)
2024-07-05 22:00:18 -04:00
Kyle Kelley
1c1fd6aaa1
Finely scope repl events for runs and output clearing (#13872)
Sets up the `cmd-enter` keybinding for the jupyter repl to only apply
when enabled.

Release Notes:

- N/A

---------

Co-authored-by: Kirill <kirill@zed.dev>
2024-07-05 13:38:44 -07:00
Xiaoguang Wang
48763d0663
vim: Add vim bindings for outline panel (#13763)
Release Notes:

- vim: Add vim bindings for outline panel #13763
2024-07-03 09:23:52 -06:00
Conrad Irwin
3348c3ab4c
vim: Support for q and @ (#13761)
Fixes: #1504

Release Notes:

- vim: Support for macros (`q` and `@`) to record and replay (#1506,
#4448)
2024-07-03 09:03:39 -06:00
Richard Feldman
3bbe574341
Introduce a New assistant: insert into editor Action (#13467)
This implements the functionality (paired with @as-cii), but we weren't
sure what the clearest name would be for the action. It's essentially
the inverse of "quote selection" - but what's the opposite of quoting
the selection?

One idea:
* Rename "quote selection" to "Insert **into** assistant"
* Name this "Insert **from** assistant"

Release Notes:

- Added action to insert from assistant into editor (default keybinding:
`cmd-<` on macOS, `ctrl-<` on Linux)

---------

Co-authored-by: Antonio Scandurra <me@as-cii.com>
Co-authored-by: Bennet <bennet@zed.dev>
2024-07-02 14:13:14 +02:00
Bennet Bo Fenner
e243856559
Add terminal inline assistant (#13638)
Release Notes:

- N/A

---------

Co-authored-by: Antonio <antonio@zed.dev>
2024-07-01 20:53:56 +02:00
Peter Tripp
b1a0188467
Fix: Atom keymap in ProjectPanel (#13655)
- Fix various keys [aAD] which did not function in Project Panel filename entry with Atom Keybind.
2024-06-28 15:29:45 -04:00
Johannes
5e465f2029
Add duplicate line shortcut to sublime_text.json (#13640)
Release Notes:

- Added duplicate line shortcut to Sublime Text shortcuts
2024-06-28 19:03:27 +03:00
Aleksei Gusev
d5fbf75ccf
Add keyboard shortcuts for scrolling in terminal (#13508)
Fixes #4917, #12231

Release Notes:
-  Added keyboard shortcuts for scrolling in terminal ([4917](https://github.com/zed-industries/zed/issues/4917), [12231](https://github.com/zed-industries/zed/issues/12231))
2024-06-28 10:26:14 +03:00
Conrad Irwin
363ac6bc96
vim: Empty pane improvements (#13624)
Release Notes:

- vim: Fixed `:` in empty diagnostics view
- vim: Fixed `g/` outside of an editor
2024-06-27 21:54:03 -06:00
Peter Tripp
20c1f8245a
Improve PageUp/PageDown keybinds for Linux/Mac (#13510)
This makes pageup/pagedown move the cursor too.  Fixes: #13389

Co-authored-by: llogick <16590917+llogick@users.noreply.github.com>
2024-06-27 09:26:53 -04:00
Joseph T. Lyons
89951f7e66
Add shift shift to open command palette (#13556)
I've add `shift shift` as a default keybinding to open command palette,
when using JetBrains keymap, along with the already existing
`cmd-shift-a`. This isn't quite right, as in JetBrains, `cmd-shift-a`
opens the actions modal, which would be our command palette, and `shift
shift` actually opens up a view for searching everything, commands,
actions, settings, etc - we do not have a unified modal for these
things, so I think this is the best thing we can do. Some users might
want to change this to be our file picker, but I think adding it as the
default at least puts it on their radar that they can use this type of
binding; they can change it if they want.

Release Notes:

- Added `shift shift` as a default binding to open the command palette
in the JetBrains keymap.
2024-06-26 16:44:40 -04:00
Mikayla Maki
41d2c52638
Adjust keybindings for deletion in the project panel (#13326)
- Improve compatibility keybindings (Atom, JetBrains, TextMate)
- Revert MacOS cmd+backspace regression. Should trash without prompting (like MacOS)

Co-authored-by: Peter Tripp <peter@zed.dev>
2024-06-25 14:21:44 -04:00
Tristan Hume
f96e4ba84f
Add "Select Enclosing Symbol" command (#13435)
I use this for a much faster workflow with inline assist when using fast
models.

Release Notes:

- Added "Select Enclosing Symbol" command based on tree-sitter outline.
Useful in combination with inline assist to rewrite a function.
2024-06-24 21:26:47 -06:00
Benjamin Davies
dea928b00c
vim: Allow count and repeat for "r" and "shift-r" action (#13287)
Fixing the "r" action just involved adapting `normal_replace` to replace
multiple characters.

Fixing the "shift-r" command was less straightforward. The bindings for
`vim::BeforeNormal` in replace mode were being overwritten and several
other steps required for action repetition were not performed. Finally,
the cursor adjustment after re-entering normal mode was duplicated
(`vim::BeforeNormal` was now triggered correctly) so I removed the
special case for replace mode.

Release Notes:

- Fixed vim "r" action to accept a count argument
- Fixed vim "shift-r" action to accept a count argument and allow
repetition

---------

Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com>
2024-06-24 09:41:33 -06:00
crwen
354427413a
vim: Switch to normal mode after toggling comments (#13412)
Release Notes:

- vim: Fixed switching to normal mode after `g c`(vim::ToggleComments)
in visual mode
([#4439](https://github.com/zed-industries/zed/issues/4439))
2024-06-24 10:23:40 +02:00
Adam Soutar
f78f6a6e1e
Add Markdown Preview shortcut to Atom keymap (#13313)
This patch maps `Ctrl+Shift+M` to "Open Markdown Preview to the side".

That's what it used to be in Atom:
https://github.com/atom/markdown-preview

Release Notes:

- Added Markdown Preview shortcut for the Atom keymap
2024-06-21 10:28:31 +03:00
Thorsten Ball
963b0c010a
linux: Cleanup comments in keymap (#13299)
Release Notes:

- N/A
2024-06-20 11:28:53 +02:00
Thorsten Ball
3d4f275c52
editor: Add SelectPageUp/SelectPageDown actions (#13272)
This adds two new actions to `editor`:

- `editor::SelectPageUp`
- `editor::SelectPageDown`

On Linux they're bound by default to `shift-pageup` and
`shift-pagedown`, which matches VS Code and JetBrains.

Release Notes:

- N/A
2024-06-19 17:37:17 +02:00
Thorsten Ball
cd2533de5a
linux: Scroll linewise up/down on ctrl-up/ctrl-down (#13269)
This matches the behavior of VS Code and JetBrains.

(Of course I implemented both actions myself before figuring out that we
already have actions to scroll a line up and down.)


Release Notes:

- N/A
2024-06-19 17:27:40 +02:00
Thorsten Ball
aff7a83815
linux: Forward ctrl-w/ctrl-e to terminal (#13263)
This fixes `ctrl-w` and `ctrl-e` not working in the terminal pane but
instead triggering Zed actions ("close pane" and "search project files"
respectively).

I've added both because I think they're pretty commonly used in
terminals, since they're default Emacs-style keybindings.

But I also didn't want to add more, since it's relatively easy for users
to define themselves which keybindings should be forwarded to the
terminal and which not.

All that's required is adding something like this to the keymap:

```json
{
  "context": "Terminal",
  "bindings": {
    "ctrl-n": ["terminal::SendKeystroke", "ctrl-n"],
    "ctrl-p": ["terminal::SendKeystroke", "ctrl-p"]
  }
}
```
cc @mikayla-maki 

Release Notes:

- N/A
2024-06-19 15:14:58 +02:00
Conrad Irwin
05c4c7872c
Fix ctrl-r with no register (#13184)
Release Notes:

- N/A
2024-06-17 22:17:33 -06:00
Conrad Irwin
7cc2538fe1
vim: Fix minor keybinding bugs (#13086)
Fixes: #13068
Fixes: #9383



Release Notes:

- vim: Fixed `home` and `end` in visual mode (#13068)
- vim: Fixed inserting a 0 in insert mode with a count (#9383)
2024-06-14 22:38:50 -06:00