Commit Graph

1123 Commits

Author SHA1 Message Date
Peter Tripp
2f05f5bc5c
Make initial settings valid JSON (#13785) 2024-07-03 12:25:25 -04: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
Peter Tripp
351a3c0815
docs: Improve default settings comments (#13749)
- Add the phrase "compact folders" to `auto_fold_dirs` to enhance
searchability.
- Fix `buffer_line_height` copy pasta

Release Notes:

- N/A
2024-07-03 08:05:40 -04:00
Nate Butler
7db68547fa
Update Platform Controls (#13751)
Continuing from #13597, this PR refactors platform controls to extract a
generic set of platform controls that can be used for any platform that
does not define it's own/we don't use the system ones.

In the future, these controls will likely be used as a fallback on
windows as well when the windows icon font isn't available.

Release Notes:

- Added updated window controls on Linux
2024-07-02 16:15:59 -04:00
Andrei N. Onea
8dd7c2cddf
Fix typo in show_whitespaces docs in default setting (#13735)
Release Notes:

- N/A
2024-07-02 15:37:32 +03: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
Piotr Osiewicz
bac6e2fee7
tasks: Add experimental support for user-defined task variables (#13699)
Context:
@bennetbo spotted a regression in handling of `cargo run` task in zed
repo following a merge of #13658. We've started invoking `cargo run`
from the folder of an active file whereas previously we did it from the
workspace root. We brainstormed few solutions that involved adding a
separate task that gets invoked at a workspace level, but I realized
that a cleaner solution may be to finally add user-configured task
variables. This way, we can choose which crate to run by default at a
workspace level.

This has been originally brought up in the context of javascript tasks
in
https://github.com/zed-industries/zed/pull/12118#issuecomment-2129232114

Note that this is intended for internal use only for the time being.
/cc @RemcoSmitsDev we should be unblocked on having runner-dependant
tasks now.

Release notes:

- N/A
2024-07-01 15:59:19 +02:00
Kirill Bulatov
e650c0166d
Fix Prettier parser values when formatting files with paths (#13666)
Closes https://github.com/zed-industries/zed/issues/13660

Now, as intended, the parser value is passed only if configured in the
language settings.

Also, allows to format JSONC by default with Prettier and reformats Zed
settings.

Release Notes:

- Fixed Zed Prettier integration always passing parser value for files
with paths ([13660](https://github.com/zed-industries/zed/issues/13660))
2024-06-29 11:37:22 +03: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
Peter Tripp
891f195f7b
Add support for .markdown extension (#13609)
Fixes #13608

Release Notes:

- Added recognizing *.markdown files as Markdown
([#13608](https://github.com/zed-industries/zed/issues/13608)).
2024-06-28 08:34:06 -04: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
c560a24e7d
Default theme to match system (#13621)
Release Notes:

- Default to a light theme during the day (#9627)
2024-06-27 22:06:22 -06: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
Conrad Irwin
7652a8ae23
Fix font selection on macOS (#13615)
Release Notes:

- N/A
2024-06-27 17:02:45 -06:00
Conrad Irwin
7d7fd7d25d
Move from Zed fonts to IBM Plex (#13596)
Release Notes:

- Changed the default fonts to IBM Plex Sans and IBM Plex Mono. If you'd
like to go back to using Zed Sans/Zed mono you need to
[download](https://github.com/zed-industries/zed-fonts/releases/tag/1.2.0)
them and install them.
2024-06-27 14:36:44 -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
Tim Havlicek
fb3ef0d140
Add separate JSONC language (#12655)
Resolves https://github.com/zed-industries/extensions/issues/860 and
https://github.com/zed-industries/zed/issues/10921, also
https://github.com/biomejs/biome-zed/issues/11.

### Problem:
When opening .json files, zed allows comments by default in the JSON
language, which can cause some problems.
For example, language-servers also get "json" as the language, which may
show errors for those comments.

<img width="935" alt="image"
src="https://github.com/zed-industries/zed/assets/10381895/fed3d83d-abc0-44b5-9982-eb249bb04c3b">

### Solution:

This PR adds a JSONC language. 

<img width="816" alt="image"
src="https://github.com/zed-industries/zed/assets/10381895/8b40e671-d4f0-4e8d-80cb-82ee7c0ec490">

This allows for more specific configuration for language servers. 
Also any json file can be set explicitly to be JSONC using the
file_types setting:

```jsonc
{
  "file_types": {
    // set all .json files to be seen as JSONC
    "JSONC": ["*.json"]
  }
}
```


Release Notes:

- N/A
2024-06-27 11:12:02 +02: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
Nate Butler
4d5441c09d
Add UI setting components (#13550)
Adds some of the UI components to allow us to visually render settings.

These are UI only and are not functional yet (@maxdeviant will be
working on these when he is back.)

You can see some examples by running `script/storybook setting`.

![CleanShot 2024-06-26 at 12 38
37@2x](https://github.com/zed-industries/zed/assets/1714999/b5e6434d-3bc5-4fcd-9c0a-d280950cbef2)

Release Notes:

- N/A
2024-06-26 13:02:58 -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
Nate Butler
890443241d
Prompt Library Refinements (#13470)
TODO:

- [x] Moving the cursor out of the title editor should unselect any
selected text

Release Notes:

- N/A

---------

Co-authored-by: Antonio Scandurra <me@as-cii.com>
Co-authored-by: Richard <richard@zed.dev>
2024-06-25 11:43:30 -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
Kirill Bulatov
d2a2faf7a2
Update soft_wrap config option documentation (#13457)
Closes https://github.com/zed-industries/zed/discussions/13440

Release Notes:

- N/A
2024-06-24 11:52:52 +03: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
Piotr Osiewicz
d272e402ea
project panel: Add vertical scrollbar (#13358)
Fixes #4865
Release Notes:

- Added vertical scrollbar to project panel
2024-06-23 14:04:19 +02:00
Stanislav Alekseev
44c479c50c
Add a setting to increase the thickness of the active indent guide (#13210)
Resolves #12312.

Release Notes:

- Added an option to configure the line width of the active indent guide
[#12312](https://github.com/zed-industries/zed/issues/12312)
2024-06-21 10:53:46 +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
Evan Liu
6eb537643a
editor: Add scroll_beyond_last_line setting (#11155)
Add `scroll_beyond_last_line` setting with 3 options: 

- `one_page`: The default (current) behaviour of scrolling one more page
beyond the last line.
<img width="568" alt="SCR-20240429-sxry"
src="https://github.com/zed-industries/zed/assets/126383/1effbee9-759f-4858-9022-83bbb208ef82">

- `off`: No scrolling beyond the last line. 
<img width="568" alt="SCR-20240429-syhv"
src="https://github.com/zed-industries/zed/assets/126383/5391b1d7-918d-43f3-8a6f-7642ef32d174">

- `vertical_scroll_margin`: Scroll beyond the last line by the same
number of lines as `vertical_scroll_margin`. Matches the behaviour of
keyboard scrolling.
<img width="568" alt="SCR-20240429-sypc"
src="https://github.com/zed-industries/zed/assets/126383/bb9cc928-e515-4503-88f7-e434c45d742f">

Release Notes:

- Added `scroll_beyond_last_line` setting
([#4962](https://github.com/zed-industries/zed/issues/4962)).
2024-06-20 14:22:37 -07:00
Piotr Osiewicz
58e9952d7b
tasks: Allow disabling runnables in the gutter (#13329)
Runnables can now be disabled with:
```
  "gutter": {
    "runnables": false
  }
```
Fixes #13280



Release Notes:

- Added `gutter.runnables` setting that controls whether runnable
indicators are displayed in the gutter.
2024-06-20 21:07:45 +02:00
ᴀᴍᴛᴏᴀᴇʀ
95b06097ee
Add support for auto surround (#13217)
![result](https://github.com/zed-industries/zed/assets/32017007/c400081f-be5d-48fa-994f-90a00e2be359)

In the past, Zed used a single switch called `autoclose` to control both
`autoclose` and `auto_surround` functionalities:
+ `autoclose`: when input '(', append ')' automatically.
+ `auto_surround`: when select text and input '(', surround text with
'(' and ')' automatically.

This PR separates `auto_surround` from `autoclose` to support `<`. 

Previously, if `autoclose` of `<` was set to `false`, `auto_surround`
couldn't be used. However, setting `autoclose` to `true` would affect
the default behavior of simple expression. For example, `a < b` would
become `a <> b`.

For more information, see #13187.

Fix #12898.

Release Notes:

- Added support for `auto_surround`
([#12898](https://github.com/zed-industries/zed/issues/12898)).
2024-06-20 12:48:46 +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
Mikayla Maki
6b9ddbfef2
Add more menus to Zed (#12940)
### TODO

- [x] Make sure keybinding shows up in pane + menu
- [x] Selection tool in the editor toolbar
- [x] Application Menu
- [x] Add more options to pane + menu
   - Go to File...
  - Go to Symbol in Project... 
- [x] Add go items to the selection tool in the editor:
   - Go to Symbol in Editor...
   - Go to Line/Column...
   - Next Problem
   - Previous Problem
- [x] Fix a bug where modals opened from a context menu aren't focused
correclty
- [x] Determine if or what needs to be done with project actions:
- Difficulty is that these are exposed in the UI via clicking the
project name in the titlebar or by right clicking the root entry in the
project panel. But they require reading and are two clicks away. Is that
sufficient?
    - Add Folder to Project
    - Open a new project
    - Open recent
 - [x] Get a style pass 
 - [x] Implement style pass
   - [x] Fix the wrong actions in the selection menu
   - [x] Show selection tool toggle in the 'editor settings' thing
- [x] Put preferences section from the app menu onto the right hand user
menu
- [x] Add Project menu into app menu to replace 'preferences' section,
and put the rest of the actions there
- [ ] ~~Adopt `...` convention for opening a surface~~ uncertain what
this convention is.
   - [x] Adopt link styling  for webview actions
   - [x] Set lucide hamburger for menu icon
   - [x] Gate application menu to only show on Linux and Windows




Release Notes:

- Added a 'selection and movement' tool to the Editor's toolbar, as well
as controls to toggle it and a setting to remove it (`"toolbar":
{"selections_menu": true/false }`)
- Changed the behavior of the `+` menu in the tab bar to use standard
actions and keybindings. Replaced 'New Center Terminal' with 'New
Terminal', and 'New Search', with the usual 'Deploy Search'. Also added
item-creating actions to this menu.
- Added an 'application' menu to the titlebar to Linux and Windows
builds of Zed
2024-06-18 12:16:54 -07:00
Piotr Osiewicz
8af8493da6
typescript: Make VTSLS the default language server for Typescript (#13140)
Additionally, limit # of returned completion items + use fuzzy filtering
on VTSLS side. Prime LSP handler for response handling.


Release Notes:

- VTSLS is now a default language server for TypeScript, TSX, and
JavaScript.
2024-06-18 20:16:03 +02:00
Conrad Irwin
05c4c7872c
Fix ctrl-r with no register (#13184)
Release Notes:

- N/A
2024-06-17 22:17:33 -06:00
Marshall Bowers
71cc95d315
Remove copilot and show_copilot_suggestions setting aliases (#13167)
This PR removes the Copilot-specific aliases for the
`inline_completions` and `show_inline_completions` settings.

While these aliases were added to maintain backward-compatibility, the
aliasing behavior here can lead to a confusing experience when both keys
end up in the `settings.json`.

Release Notes:

- Breaking Change: Removed the `copilot` alias for the
`inline_completions` setting. If you have settings under `copilot` they
should get moved to `inline_completions`.
- Breaking Change: Removed the `show_copilot_suggestions` alias for the
`show_inline_completions` setting.
2024-06-17 15:51:37 -04: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
Conrad Irwin
fc19cc0ddf
vim: ctrl-r while we're on a register kick (#13085)
Release Notes:

- vim: Support `ctrl-r X` to paste in insert mode (#4308)
2024-06-14 22:38:38 -06:00
Conrad Irwin
3b84b106e2
vim gigv (#13028)
Release Notes:

- vim: Fix `gi` when the insert ended at the end of a line (#12162)
- vim: Add `gv` to restore previous visual selection (#12888)
- vim: Fix `gl` when the first match is at the end of a line
2024-06-14 10:16:59 -06:00
Peter Tripp
0f59607100
docs: wrap_guides (#12992)
- Add 'wrap_guides' to website config docs.
- Add the word 'ruler' to improve searchability.
2024-06-14 09:48:25 -04:00
Inam Ul Haq
6c70a809ec
Update linux keybinds (#12822)
Release Notes:
- Add `ctrl-y` for Redo.
- Reorder bindings for copy/paste Fixes #11912
- Update `ctrl-b` to show hide left dock. This is the default behavior
in VSCode.


![image](https://github.com/zed-industries/zed/assets/22079654/e0cc6c0e-81df-443f-b77c-9a96370b6cb4)

### Or...

Release Notes:

- N/A
2024-06-13 08:38:27 -06:00
Kirill Bulatov
2f43d52e7e
A set of outline panel fixes (#12965)
Follow-up of https://github.com/zed-industries/zed/pull/12637

* Wrong font size for the outline items (fixes
https://github.com/zed-industries/zed/pull/12637#issuecomment-2164084021)
* Duplicate context menu item (fixes
https://github.com/zed-industries/zed/issues/12957)
* Missing `space` keybinding for item opening (fixes
https://github.com/zed-industries/zed/issues/12956)
* Adds 60px more to the default width (fixes
https://github.com/zed-industries/zed/issues/12955)
* Incorrect scroll for singleton buffers (fixes
https://github.com/zed-industries/zed/issues/12953)

Release Notes:

- N/A
2024-06-13 10:46:51 +03:00
Kirill Bulatov
8451dba6a7
Introduce an outline panel (#12637)
Adds a new panel: `OutlinePanel` which looks very close to project
panel:

<img width="256" alt="Screenshot 2024-06-10 at 23 19 05"
src="https://github.com/zed-industries/zed/assets/2690773/c66e6e78-44ec-4de8-8d60-43238bb09ae9">

has similar settings and keymap (actions work in the `OutlinePanel`
context and are under `outline_panel::` namespace), with two notable
differences:
* no "edit" actions such as cut/copy/paste/delete/etc.
* directory auto folding is enabled by default

Empty view: 
<img width="841" alt="Screenshot 2024-06-10 at 23 19 11"
src="https://github.com/zed-industries/zed/assets/2690773/dc8bf37c-5a70-4fd5-9b57-76271eb7a40c">


When editor gets active, the panel displays all related files in a tree
(similar to what the project panel does) and all related excerpts'
outlines under each file.
Same as in the project panel, directories can be expanded or collapsed,
unfolded or folded; clicking file entries or outlines scrolls the buffer
to the corresponding excerpt; changing editor's selection reveals the
corresponding outline in the panel.

The panel is applicable to any singleton buffer:
<img width="1215" alt="Screenshot 2024-06-10 at 23 19 35"
src="https://github.com/zed-industries/zed/assets/2690773/a087631f-5c2d-4d4d-ae25-30ab9731d528">

<img width="1728" alt="image"
src="https://github.com/zed-industries/zed/assets/2690773/e4f8082c-d12d-4473-8500-e8fd1051285b">

or any multi buffer:

(search multi buffer)

<img width="1728" alt="Screenshot 2024-06-10 at 23 19 41"
src="https://github.com/zed-industries/zed/assets/2690773/60f768a3-6716-4520-9b13-42da8fd15f50">

(diagnostics multi buffer)
<img width="1728" alt="image"
src="https://github.com/zed-industries/zed/assets/2690773/64e285bd-9530-4bf2-8f1f-10ee5596067c">

Release Notes:
- Added an outline panel to show a "map" of the active editor
2024-06-12 23:22:52 +03:00
Paul Eguisier
001f17c011
vim: Implement named registers (#12895)
Release Notes:

- vim: Add support for register selection `"a`-`"z`, `"0`-`"9`, `"-`.
`"_` and `"%`
([#11511](https://github.com/zed-industries/zed/issues/11511))

---------

Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com>
2024-06-12 10:40:27 -06:00