Commit Graph
684 Commits
Author SHA1 Message Date
Conrad Irwin c9da617730 Add SwapPaneInDirection
Add keybindings for vim (and non-vim)
2023-09-26 22:00:51 -06:00
Piotr Osiewicz 071fa7f832 project_replace: Fix up key bindings (#3034)
Release Notes:
- N/A
2023-09-26 18:40:41 +02:00
Conrad Irwin 8e4406b397 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 3b6bb008b6 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 0c042436d4 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 355f925d75 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
Conrad Irwin 2061d7e47a vim: Command (#2951)
Release Notes:

- vim: Add v1 of command mode
([#279](https://github.com/zed-industries/community/issues/279)). The
goal was to cover 90% of what most people actually do, but it is very
incomplete. Known omissions are that ranges cannot be specified (except
that `:%s//` must always specify the % range), commands cannot take
arguments (you can `:w` but not `:w [file]`), and there is no history.
Please file feature requests on
https://github.com/zed-industries/community as you notice things that
could be better.
- `:` triggers zed's command palette. If you type a known vim command it
will run it, otherwise you get zed's normal fuzzy search. For this
release supported commands are limited to:
- - `:w[rite][!]`, `:wq[!]`, `:q[uit][!]`, `:wa[ll][!]`, `:wqa[ll][!]`,
`:qa[ll][!]`, `:[e]x[it][!]`, `:up[date]` to save/close tab(s) and
pane(s).
- - `:cq` to quit completely.
- - `:vs[plit]`, `:sp[lit]` to split vertically/horizontally
- - `:new`, `:vne[w]` to create a new file in a new pane above or to the
left
- - `:tabedit`, `:tabnew` to create a new file in a new tab.
- - `:tabn[ext]`, `:tabp[rev]` to go to previous/next tabs
- - `:tabc[lose]` to close tabs
- - `:cn[ext]`, `:cp[rev]`, `:ln[ext]`, `:lp[rev]` to go to the
next/prev diagnostics.
- - `:cc`, `:ll` to open the errors page
- - `:<number>` to jump to a line number.
- - `:$` to jump to end of file
- - `:%s/foo/bar/` (note that /g is always implied, the range must
always be %, and zed uses different regex syntax to vim)
- - `:/foo` and `:?foo` to jump to next/prev line matching foo
- - `:j[oin]`, to join the current line (no range is yet supported)
- - `:d[elete][l][p]`, to delete the current line (no range is yet
supported)
- - `:s[ort] [i]` to sort the current selection (case-insensitively)
- vim: Add `ctrl-w o` (closes everything except the current item) and
`ctrl-w n` (creates a new file in the pane above).
([#1884](https://github.com/zed-industries/community/issues/1884))
- all: Add a "Discard" option to prompt when saving a file with
conflicts (previously this only appeared on close, not on save).

Internal changes:
- The Picker will now wait for pending queries before confirming (to
handle people typing `: w enter` rapidly.
- workspace::save_item and Pane::save_item are now merged together, and
the behavior controlled by `workspace::SaveIntent`.
- Many actions related to closing/saving items now take an optional
`SaveIntent`.
-
2023-09-25 14:07:22 -05:00
Mikayla e0373b0bc6 Fix space and copy/paste when editing a channel 2023-09-25 11:31:02 -07:00
Mikayla Maki 9c3518e8fc Add support for the experimental Next LS for Elixir (#3024)
This is a PR I built for a friend of a friend at StrangeLoop, who is
making a much better LSP for elixir that elixir folks want to experiment
with. This PR also improves the our debug log viewer to handle LSP
restarts.

TODO:
- [ ] Make sure NextLS binary loading works.

Release Notes:

- Added support for the experimental Next LS for Elxir, to enable it add
the following field to your settings to enable:

```json
"elixir": {
    "next": "on"
}
```
2023-09-25 12:52:56 -05:00
Conrad Irwin 1241fc6bc4 Add cmd-+ as an alias for cmd-=
For github.com/zed-industries/community#1021
2023-09-25 11:31:34 -06:00
Mikayla 2c6ef3a45d Improve lsp log viewer's behavior in the presence of LSP restarts
Improve settings interface to local LSP
2023-09-24 04:59:55 -07:00
Conrad Irwin 6e501de8e2 Code review changes 2023-09-20 21:29:45 -06:00
Conrad Irwin 376f80d966 Add NewFileInDirection 2023-09-20 20:44:26 -06:00
Conrad Irwin ee0a229996 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 043f998a97 fix default keybindings for select all matches 2023-09-20 17:14:19 -07:00
Conrad Irwin 66226ea84f 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
Nate Butler f78dd3960a Add an initial set of GPUI2 components to the storybook (#2990)
This PR adds an initial set of components to `crates/storybook/src/ui`.

All changes still are contained to inside storybook. Merging to keep up
to date with main.
2023-09-20 13:52:47 -04:00
Kyle Caverly 5d7ec08095 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
KCaverly 57f49a6530 remove conditional action registration for activate semantic search mode 2023-09-20 12:38:29 -04:00
Mikayla 71df613d1c Fix rebase 2023-09-20 08:34:18 -07:00
Mikayla 1d665148b3 Fix infinite loop in select all matches 2023-09-20 08:25:21 -07:00
Mikayla 38b05545a4 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 41f23e6adb add keymaps for activating text, regex and semantic modes 2023-09-20 10:04:43 -04:00
Mikayla 20a8d98b73 Get nextLS running 2023-09-20 06:55:24 -07:00
Conrad Irwin 76bba1b8c1 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 9376900ab1 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 2dc8da1006 Add hover styles to channels matching the current selection
Fix chat desync from moving / linking channels
2023-09-19 17:50:02 -07:00
Nate Butler ad9c0e70ca Merge branch 'main' into nate/gpui2-ui-components 2023-09-19 00:26:41 -04:00
Conrad Irwin 39e97afdc2 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
Nate Butler c7afbc6123 Add missing logo_96 icon, fix a few incorrect paths (#2977)
🙈 I missed a few

Thanks @maxbrunsfeld / @mikayla-maki
2023-09-15 14:57:40 -04:00
Nate Butler c2a1635d7c Add missing logo_96 icon, fix a few incorrect paths 2023-09-15 14:21:33 -04:00
Max Brunsfeld 973f156de2 Restore user_group_16 icon 2023-09-15 11:16:30 -07:00
Nate Butler 184229de82 WIP 2023-09-15 14:14:28 -04:00
Max Brunsfeld b21b2dd959 Merge branch 'main' into chat-again 2023-09-15 11:06:39 -07:00
Nate Butler f7076f9ae2 Unify icons using multiple variants, remove all unused icons (#2974)
There are around ~400 icons in the `assets/icons` folder, but in reality
including file icons we only use around 50. In a number of places we use
different variants of the same icon, even in different styles.

This PR unifies the icons we use, removes the duplicates, and cleans out
unused icons.

Release Notes:

- Made icons more consistent throughout the app.
2023-09-15 13:55:13 -04:00
Conrad Irwin a22d09c9d7 Fix Y on last line with no trailing new line
For zed-industries/community#2044
2023-09-15 11:14:04 -06:00
Nate Butler 0dc4475f7f Unify icons using multiple variants, remove all unused icons 2023-09-15 12:50:49 -04:00
Conrad Irwin f9b55c99e4 Add shift-d and shift-x as aliases for d and x in visual mode 2023-09-15 10:26:43 -06:00
Max Brunsfeld 3cb0e69878 Merge branch 'main' into chat-again 2023-09-14 14:50:45 -07:00
Conrad Irwin b6addac61c vim: g s/S for outline/project symbols 2023-09-14 13:49:02 -06:00
Conrad Irwin d5d2c2785a 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 OsiewiczandMax b21d8ecf19 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
Max Brunsfeld 27c098addd Merge branch 'main' into chat-again 2023-09-12 11:26:54 -07:00
Piotr Osiewicz c4e0bcb99e Z 1200/replace in buffer (#2922)
This is still WIP, mostly pending styling. I added a pretty rudimentary
text field and no buttons whatsoever other than that. I am targeting a
Preview of 09.13, as I am gonna be on PTO for the next week.

I dislike the current implementation slightly because of `regex`'s crate
syntax and lack of support of backreferences. What strikes me as odd wrt
to syntax is that it will just replace a capture name with empty string
if that capture is missing from the regex. While this is perfectly fine
behaviour for conditionally-matched capture groups (e.g. `(foo)?`), I
think it should still error out if there's no group with a given name
(conditional or not).
Release Notes:

- Added "Replace" functionality to buffer search.
2023-09-12 18:46:54 +02:00
Conrad Irwin b850e0b8a6 vim: ALlow counts on insert actions
This re-uses the existing repeat infrastructure.
2023-09-11 18:09:47 -06:00
Conrad Irwin 4aa2148f76 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 755586f439 Allow a count with CurrentLine
Add _ and g_ too while we're here.
2023-09-11 14:19:43 -06:00
Nathan Sobo 7695bbf44c Merge remote-tracking branch 'origin/main' into chat-again 2023-09-11 12:08:01 -06:00
Nathan Sobo 444d8662a5 Merge branch 'main' into storybook 2023-09-11 09:13:46 -06:00
Conrad Irwin 6c6b04ad71 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