Commit graph

21 commits

Author SHA1 Message Date
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
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
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
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
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
Ignat S.
e1bc48c554
Workspace move editor actions (#21760)
Closes #20205

Release Notes:

- Added `MoveItemToPane` and `MoveItemToPaneInDirection` actions

---------

Co-authored-by: Kirill Bulatov <kirill@zed.dev>
2024-12-17 13:39:36 +02:00
Peter Tripp
735849e201
Improve Editor::DuplicateSelection (#21976)
Improves the new `Editor::DuplicateSelection` @CharlesChen0823 added in
https://github.com/zed-industries/zed/pull/21154.

- Merge `duplicate_selection` and `duplicate_line` into single function.
- Add keyboard shortcuts to JetBrains and SublimeText keymaps.
- If the selection is empty (e.g. just a cursor) make
`Editor::DuplicateSelection` fallback to being the same as
`Editor::DuplicateLineDown`.
- Tested with multiple cursors and for multiple selections.

| Editor      | Action              | macOS       | Linux        |
| ----------- | ------------------- | ----------- | ------------ |
| VSCode      | Duplicate Selection |             |              |
| JetBrains   | Duplicate Selection | cmd-d       | ctrl-d       |
| XCode       | Duplicate           | cmd-d       | N/A          |
| SublimeText | duplicate_line      | cmd-shift-d | ctrl-shift-d |

This matches behavior of the `duplicate` functionality in all other
major editors, with one exception: other editors change the selection so
that the newly duplicated object, current Zed behavior leaves the
original selection unchanged (TODO?)
2024-12-13 16:32:33 -05:00
Peter Tripp
5d0e75dd73
Improve emacs keybind with better home/end behavior (#21923)
Improve behavior of ctrl-a/ctrl-e home/end in emacs keybind.
Follow up to #21921 to add those to Linux emacs keymap too.

Release Notes:

- emacs: Improved `ctrl-a` / `ctrl-e` / `home` / `end` behavior
- emacs: Added for `ctrl-s` / `ctrl-r` / `ctrl-g` for navigating buffer
search results
2024-12-12 10:37:15 -05:00
Peter Tripp
1c2b3ad782
Add editor::SelectAllMatches to SublimeText base keymap (#20866)
`alt-f3` on Linux
`ctrl-cmd-g` on MacOS

Co-authored-by: Roman Seidelsohn <rseidelsohn@gmail.com>
2024-11-19 14:33:35 -05:00
Shiny
2544fad8a4
Fix tab switch behavior for the Sublime Text keymap (#20547)
Don't override tab switching behavior, default has correct behavior.
2024-11-14 09:50:29 -05:00
Elias Müller
72125949d9
Add shortcuts for 'open settings' and 'revert selected hunks' to Jetbrains keymap (#20414) 2024-11-08 19:34:52 -05:00
Douglas Ronne
999853fee0
Add emacs keymap (#19605)
Release Notes:

- Added Emacs (beta) base keymap
2024-11-07 15:22:53 -05:00
Elias Müller
2c7e71028d
Fix selection extend/shrink on JetBrains keymap (#20199)
JetBrains IDE's use `ctrl-w` and `ctrl-shift-w` on Win/Linux and
`cmd-up` and `cmd-down` on mac to extend/shrink selections.

https://www.jetbrains.com/guide/java/tips/extend-selection/

Release Notes:

- Fixed extend/shrink selection on JetBrains keymap
2024-11-04 16:35:52 -05:00
Junwoo
37c7c99383
Add pane activation bindings for Sublime Text keymap (#16930)
- Improved Sublime keymap: Support for switching to individual tabs with `cmd-1` thru `cmd-9` (MacOS) and `alt-1` thru `alt-9` (Linux) matching Sublime behavior.
2024-08-27 15:22:38 -04:00
Peter Tripp
f7d6818c97
Sublime swap lines (#15089)
Improved SublimeText keymap (Mac & Linux).

- Add bind for MoveLineUp/Down (`ctrl-shift-up` on linux and `cmd-ctrl-up` on MacOS).

Co-authored-by: unixtensor <brandon@rhpidfyre.io>
2024-07-24 10:35:53 -04: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
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
Peter Tripp
1d7b28c658
Add Upper/LowerCase binds to Linux Sublime Text keybinds (#14155) 2024-07-11 11:15:49 -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