From abe1fd5e16c9a9c3db84648f56336c7f25df3ddb Mon Sep 17 00:00:00 2001 From: Ben Kunkle Date: Sat, 11 Oct 2025 23:19:57 -0500 Subject: [PATCH] docs: Validate JSON snippets (settings, keymap, tasks, etc) (#40043) Closes #ISSUE Release Notes: - N/A *or* Added/Fixed/Improved ... --- Cargo.lock | 2 + crates/docs_preprocessor/Cargo.toml | 2 + crates/docs_preprocessor/src/main.rs | 201 +++++++- crates/settings/src/keymap_file.rs | 52 +- docs/src/ai/agent-settings.md | 28 +- docs/src/ai/ai-improvement.md | 4 +- docs/src/ai/configuration.md | 2 +- docs/src/ai/edit-prediction.md | 36 +- docs/src/ai/external-agents.md | 8 +- docs/src/ai/inline-assistant.md | 2 +- docs/src/ai/llm-providers.md | 30 +- docs/src/ai/mcp.md | 4 +- docs/src/completions.md | 2 +- docs/src/configuring-languages.md | 34 +- docs/src/configuring-zed.md | 544 ++++++++++---------- docs/src/debugger.md | 30 +- docs/src/development/local-collaboration.md | 4 +- docs/src/development/windows.md | 4 +- docs/src/diagnostics.md | 10 +- docs/src/extensions/icon-themes.md | 6 +- docs/src/git.md | 2 +- docs/src/globs.md | 2 +- docs/src/icon-themes.md | 2 +- docs/src/key-bindings.md | 14 +- docs/src/languages/ansible.md | 8 +- docs/src/languages/biome.md | 2 +- docs/src/languages/c.md | 6 +- docs/src/languages/cpp.md | 12 +- docs/src/languages/csharp.md | 2 +- docs/src/languages/dart.md | 4 +- docs/src/languages/deno.md | 8 +- docs/src/languages/diff.md | 2 +- docs/src/languages/elixir.md | 13 +- docs/src/languages/elm.md | 2 +- docs/src/languages/erlang.md | 2 +- docs/src/languages/fish.md | 2 +- docs/src/languages/go.md | 16 +- docs/src/languages/haskell.md | 4 +- docs/src/languages/helm.md | 2 +- docs/src/languages/html.md | 8 +- docs/src/languages/java.md | 6 +- docs/src/languages/javascript.md | 24 +- docs/src/languages/json.md | 6 +- docs/src/languages/jsonnet.md | 2 +- docs/src/languages/kotlin.md | 4 +- docs/src/languages/lua.md | 12 +- docs/src/languages/luau.md | 2 +- docs/src/languages/markdown.md | 4 +- docs/src/languages/nim.md | 2 +- docs/src/languages/php.md | 4 +- docs/src/languages/powershell.md | 2 +- docs/src/languages/proto.md | 4 +- docs/src/languages/python.md | 16 +- docs/src/languages/r.md | 2 +- docs/src/languages/ruby.md | 42 +- docs/src/languages/rust.md | 24 +- docs/src/languages/sh.md | 4 +- docs/src/languages/sql.md | 6 +- docs/src/languages/svelte.md | 10 +- docs/src/languages/swift.md | 2 +- docs/src/languages/tailwindcss.md | 14 +- docs/src/languages/terraform.md | 2 +- docs/src/languages/typescript.md | 12 +- docs/src/languages/xml.md | 2 +- docs/src/languages/yaml.md | 10 +- docs/src/remote-development.md | 12 +- docs/src/repl.md | 2 +- docs/src/snippets.md | 4 +- docs/src/tasks.md | 24 +- docs/src/telemetry.md | 2 +- docs/src/themes.md | 4 +- docs/src/vim.md | 32 +- docs/src/visual-customization.md | 71 ++- docs/src/workspace-persistence.md | 2 +- 74 files changed, 849 insertions(+), 640 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index c9fc6b8cff408e5c62287571883f59d273ad8c98..14c4ab1fd13d0bcaa877eea987ce9f73a5edfd2d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -5028,6 +5028,8 @@ dependencies = [ "serde", "serde_json", "settings", + "task", + "theme", "workspace-hack", "zed", "zed-util", diff --git a/crates/docs_preprocessor/Cargo.toml b/crates/docs_preprocessor/Cargo.toml index e46ceb18db7e75f0f946da1d112509a18a68d4aa..6de7b3c6a5ee5c38a3055ddb82114f06e244d125 100644 --- a/crates/docs_preprocessor/Cargo.toml +++ b/crates/docs_preprocessor/Cargo.toml @@ -20,6 +20,8 @@ util.workspace = true workspace-hack.workspace = true zed.workspace = true zlog.workspace = true +task.workspace = true +theme.workspace = true [lints] workspace = true diff --git a/crates/docs_preprocessor/src/main.rs b/crates/docs_preprocessor/src/main.rs index e8f81812ccdf2e8ad10e18f06c10509a1ed5b65d..2e0d9b21fb35d1a5e95ed2251d783dc22ab62aca 100644 --- a/crates/docs_preprocessor/src/main.rs +++ b/crates/docs_preprocessor/src/main.rs @@ -53,9 +53,20 @@ fn main() -> Result<()> { #[derive(Debug, Clone, PartialEq, Eq, Hash)] enum PreprocessorError { - ActionNotFound { action_name: String }, - DeprecatedActionUsed { used: String, should_be: String }, + ActionNotFound { + action_name: String, + }, + DeprecatedActionUsed { + used: String, + should_be: String, + }, InvalidFrontmatterLine(String), + InvalidSettingsJson { + file: std::path::PathBuf, + line: usize, + snippet: String, + error: String, + }, } impl PreprocessorError { @@ -72,6 +83,20 @@ impl PreprocessorError { } PreprocessorError::ActionNotFound { action_name } } + + fn new_for_invalid_settings_json( + chapter: &Chapter, + location: usize, + snippet: String, + error: String, + ) -> Self { + PreprocessorError::InvalidSettingsJson { + file: chapter.path.clone().expect("chapter has path"), + line: chapter.content[..location].lines().count() + 1, + snippet, + error, + } + } } impl std::fmt::Display for PreprocessorError { @@ -88,6 +113,21 @@ impl std::fmt::Display for PreprocessorError { "Deprecated action used: {} should be {}", used, should_be ), + PreprocessorError::InvalidSettingsJson { + file, + line, + snippet, + error, + } => { + write!( + f, + "Invalid settings JSON at {}:{}\nError: {}\n\n{}", + file.display(), + line, + error, + snippet + ) + } } } } @@ -100,11 +140,11 @@ fn handle_preprocessing() -> Result<()> { let (_ctx, mut book) = CmdPreprocessor::parse_input(input.as_bytes())?; let mut errors = HashSet::::new(); - handle_frontmatter(&mut book, &mut errors); template_big_table_of_actions(&mut book); template_and_validate_keybindings(&mut book, &mut errors); template_and_validate_actions(&mut book, &mut errors); + template_and_validate_json_snippets(&mut book, &mut errors); if !errors.is_empty() { const ANSI_RED: &str = "\x1b[31m"; @@ -235,6 +275,161 @@ fn find_binding(os: &str, action: &str) -> Option { }) } +fn template_and_validate_json_snippets(book: &mut Book, errors: &mut HashSet) { + fn for_each_labeled_code_block_mut( + book: &mut Book, + errors: &mut HashSet, + f: impl Fn(&str, &str) -> anyhow::Result<()>, + ) { + const TAGGED_JSON_BLOCK_START: &'static str = "```json ["; + const JSON_BLOCK_END: &'static str = "```"; + + for_each_chapter_mut(book, |chapter| { + let mut offset = 0; + while let Some(loc) = chapter.content[offset..].find(TAGGED_JSON_BLOCK_START) { + let loc = loc + offset; + let tag_start = loc + TAGGED_JSON_BLOCK_START.len(); + offset = tag_start; + let Some(tag_end) = chapter.content[tag_start..].find(']') else { + errors.insert(PreprocessorError::new_for_invalid_settings_json( + chapter, + loc, + chapter.content[loc..tag_start].to_string(), + "Unclosed JSON block tag".to_string(), + )); + continue; + }; + let tag_end = tag_end + tag_start; + + let tag = &chapter.content[tag_start..tag_end]; + + if tag.contains('\n') { + errors.insert(PreprocessorError::new_for_invalid_settings_json( + chapter, + loc, + chapter.content[loc..tag_start].to_string(), + "Unclosed JSON block tag".to_string(), + )); + continue; + } + + let snippet_start = tag_end + 1; + offset = snippet_start; + + let Some(snippet_end) = chapter.content[snippet_start..].find(JSON_BLOCK_END) + else { + errors.insert(PreprocessorError::new_for_invalid_settings_json( + chapter, + loc, + chapter.content[loc..tag_end + 1].to_string(), + "Missing closing code block".to_string(), + )); + continue; + }; + let snippet_end = snippet_start + snippet_end; + let snippet_json = &chapter.content[snippet_start..snippet_end]; + offset = snippet_end + 3; + + if let Err(err) = f(tag, snippet_json) { + errors.insert(PreprocessorError::new_for_invalid_settings_json( + chapter, + loc, + chapter.content[loc..snippet_end + 3].to_string(), + err.to_string(), + )); + continue; + }; + let tag_range_complete = tag_start - 1..tag_end + 1; + offset -= tag_range_complete.len(); + chapter.content.replace_range(tag_range_complete, ""); + } + }); + } + + for_each_labeled_code_block_mut(book, errors, |label, snippet_json| { + let mut snippet_json_fixed = snippet_json + .to_string() + .replace("\n>", "\n") + .trim() + .to_string(); + while snippet_json_fixed.starts_with("//") { + if let Some(line_end) = snippet_json_fixed.find('\n') { + snippet_json_fixed.replace_range(0..line_end, ""); + snippet_json_fixed = snippet_json_fixed.trim().to_string(); + } + } + match label { + "settings" => { + if !snippet_json_fixed.starts_with('{') || !snippet_json_fixed.ends_with('}') { + snippet_json_fixed.insert(0, '{'); + snippet_json_fixed.push_str("\n}"); + } + settings::parse_json_with_comments::( + &snippet_json_fixed, + )?; + } + "keymap" => { + if !snippet_json_fixed.starts_with('[') || !snippet_json_fixed.ends_with(']') { + snippet_json_fixed.insert(0, '['); + snippet_json_fixed.push_str("\n]"); + } + + let keymap = settings::KeymapFile::parse(&snippet_json_fixed) + .context("Failed to parse keymap JSON")?; + for section in keymap.sections() { + for (keystrokes, action) in section.bindings() { + keystrokes + .split_whitespace() + .map(|source| gpui::Keystroke::parse(source)) + .collect::, _>>() + .context("Failed to parse keystroke")?; + if let Some((action_name, _)) = settings::KeymapFile::parse_action(action) + .map_err(|err| anyhow::format_err!(err)) + .context("Failed to parse action")? + { + anyhow::ensure!( + find_action_by_name(action_name).is_some(), + "Action not found: {}", + action_name + ); + } + } + } + } + "debug" => { + if !snippet_json_fixed.starts_with('[') || !snippet_json_fixed.ends_with(']') { + snippet_json_fixed.insert(0, '['); + snippet_json_fixed.push_str("\n]"); + } + + settings::parse_json_with_comments::(&snippet_json_fixed)?; + } + "tasks" => { + if !snippet_json_fixed.starts_with('[') || !snippet_json_fixed.ends_with(']') { + snippet_json_fixed.insert(0, '['); + snippet_json_fixed.push_str("\n]"); + } + + settings::parse_json_with_comments::(&snippet_json_fixed)?; + } + "icon-theme" => { + if !snippet_json_fixed.starts_with('{') || !snippet_json_fixed.ends_with('}') { + snippet_json_fixed.insert(0, '{'); + snippet_json_fixed.push_str("\n}"); + } + + settings::parse_json_with_comments::( + &snippet_json_fixed, + )?; + } + label => { + anyhow::bail!("Unexpected JSON code block tag: {}", label) + } + }; + Ok(()) + }); +} + /// Removes any configurable options from the stringified action if existing, /// ensuring that only the actual action name is returned. If the action consists /// only of a string and nothing else, the string is returned as-is. diff --git a/crates/settings/src/keymap_file.rs b/crates/settings/src/keymap_file.rs index cab35c1ad2a69fabf95ac1772d84c108ad1b93b5..b69b498a6c5596d8bbc78799e8edbe0befc9c35e 100644 --- a/crates/settings/src/keymap_file.rs +++ b/crates/settings/src/keymap_file.rs @@ -360,11 +360,10 @@ impl KeymapFile { } } - fn build_keymap_action( + pub fn parse_action( action: &KeymapAction, - cx: &App, - ) -> std::result::Result<(Box, Option), String> { - let (build_result, action_input_string) = match &action.0 { + ) -> Result)>, String> { + let name_and_input = match &action.0 { Value::Array(items) => { if items.len() != 2 { return Err(format!( @@ -380,22 +379,10 @@ impl KeymapFile { MarkdownInlineCode(&action.0.to_string()) )); }; - let action_input = items[1].clone(); - if name.as_str() == ActionSequence::name_for_type() { - (ActionSequence::build_sequence(action_input, cx), None) - } else { - let action_input_string = action_input.to_string(); - ( - cx.build_action(name, Some(action_input)), - Some(action_input_string), - ) - } + Some((name, Some(&items[1]))) } - Value::String(name) if name.as_str() == ActionSequence::name_for_type() => { - (Err(ActionSequence::expected_array_error()), None) - } - Value::String(name) => (cx.build_action(name, None), None), - Value::Null => (Ok(NoAction.boxed_clone()), None), + Value::String(name) => Some((name, None)), + Value::Null => None, _ => { return Err(format!( "expected two-element array of `[name, input]`. \ @@ -404,6 +391,33 @@ impl KeymapFile { )); } }; + Ok(name_and_input) + } + + fn build_keymap_action( + action: &KeymapAction, + cx: &App, + ) -> std::result::Result<(Box, Option), String> { + let (build_result, action_input_string) = match Self::parse_action(action)? { + Some((name, action_input)) if name.as_str() == ActionSequence::name_for_type() => { + match action_input { + Some(action_input) => ( + ActionSequence::build_sequence(action_input.clone(), cx), + None, + ), + None => (Err(ActionSequence::expected_array_error()), None), + } + } + Some((name, Some(action_input))) => { + let action_input_string = action_input.to_string(); + ( + cx.build_action(name, Some(action_input.clone())), + Some(action_input_string), + ) + } + Some((name, None)) => (cx.build_action(name, None), None), + None => (Ok(NoAction.boxed_clone()), None), + }; let action = match build_result { Ok(action) => action, diff --git a/docs/src/ai/agent-settings.md b/docs/src/ai/agent-settings.md index 17f4a620ee6a8df8e319fdf7377a7e064e0a4de3..e2aba0fe4134d038b9aed3a2dd19a7359618c139 100644 --- a/docs/src/ai/agent-settings.md +++ b/docs/src/ai/agent-settings.md @@ -8,7 +8,7 @@ Learn about all the settings you can customize in Zed's Agent Panel. If you're using [Zed's hosted LLM service](./subscription.md), it sets `claude-sonnet-4` as the default model for agentic work (agent panel, inline assistant) and `gpt-5-nano` as the default "fast" model (thread summarization, git commit messages). If you're not subscribed or want to change these defaults, you can manually edit the `default_model` object in your settings: -```json +```json [settings] { "agent": { "default_model": { @@ -27,7 +27,7 @@ You can assign distinct and specific models for the following AI-powered feature - Inline assistant model: Used for the inline assistant feature - Commit message model: Used for generating Git commit messages -```json +```json [settings] { "agent": { "default_model": { @@ -64,7 +64,7 @@ The models you specify here are always used in _addition_ to your [default model For example, the following configuration will generate two outputs for every assist. One with Claude Sonnet 4 (the default model), and one with GPT-5-mini. -```json +```json [settings] { "agent": { "default_model": { @@ -85,7 +85,7 @@ One with Claude Sonnet 4 (the default model), and one with GPT-5-mini. Specify a custom temperature for a provider and/or model: -```json +```json [settings] "model_parameters": [ // To set parameters for all requests to OpenAI models: { @@ -114,7 +114,7 @@ Note that some of these settings are also surfaced in the Agent Panel's settings Use the `default_view` setting to change the default view of the Agent Panel. You can choose between `thread` (the default) and `text_thread`: -```json +```json [settings] { "agent": { "default_view": "text_thread" @@ -126,7 +126,7 @@ You can choose between `thread` (the default) and `text_thread`: Use the `agent_font_size` setting to change the font size of rendered agent responses in the panel. -```json +```json [settings] { "agent": { "agent_font_size": 18 @@ -141,7 +141,7 @@ Use the `agent_font_size` setting to change the font size of rendered agent resp Control whether to allow the agent to run commands without asking you for permission. The default value is `false`. -```json +```json [settings] { "agent": { "always_allow_tool_actions": true @@ -154,7 +154,7 @@ The default value is `false`. Control whether to display review actions (accept & reject) in single buffers after the agent is done performing edits. The default value is `false`. -```json +```json [settings] { "agent": { "single_file_review": true @@ -169,7 +169,7 @@ When set to false, these controls are only available in the multibuffer review t Control whether to hear a notification sound when the agent is done generating changes or needs your input. The default value is `false`. -```json +```json [settings] { "agent": { "play_sound_when_agent_done": true @@ -182,7 +182,7 @@ The default value is `false`. Use the `message_editor_min_lines` setting to control minimum number of lines of height the agent message editor should have. It is set to `4` by default, and the max number of lines is always double of the minimum. -```json +```json [settings] { "agent": { "message_editor_min_lines": 4 @@ -196,7 +196,7 @@ Make a modifier (`cmd` on macOS, `ctrl` on Linux) required to send messages. This is encouraged for more thoughtful prompt crafting. The default value is `false`. -```json +```json [settings] { "agent": { "use_modifier_to_send": true @@ -209,7 +209,7 @@ The default value is `false`. Use the `expand_edit_card` setting to control whether edit cards show the full diff in the Agent Panel. It is set to `true` by default, but if set to false, the card's height is capped to a certain number of lines, requiring a click to be expanded. -```json +```json [settings] { "agent": { "expand_edit_card": false @@ -222,7 +222,7 @@ It is set to `true` by default, but if set to false, the card's height is capped Use the `expand_terminal_card` setting to control whether terminal cards show the command output in the Agent Panel. It is set to `true` by default, but if set to false, the card will be fully collapsed even while the command is running, requiring a click to be expanded. -```json +```json [settings] { "agent": { "expand_terminal_card": false @@ -235,7 +235,7 @@ It is set to `true` by default, but if set to false, the card will be fully coll Control whether to display the thumbs up/down buttons at the bottom of each agent response, allowing to give Zed feedback about the agent's performance. The default value is `true`. -```json +```json [settings] { "agent": { "enable_feedback": false diff --git a/docs/src/ai/ai-improvement.md b/docs/src/ai/ai-improvement.md index 972b5908c08c6a7549553b0ae237714283c4b937..6d7fe8fdb172afa17f494723bb16b1cc69c9336c 100644 --- a/docs/src/ai/ai-improvement.md +++ b/docs/src/ai/ai-improvement.md @@ -63,7 +63,7 @@ Zed will intentionally exclude certain files from Predictive Edits entirely, eve You can inspect this exclusion list by opening `zed: open default settings` from the command palette: -```json +```json [settings] { "edit_predictions": { // A list of globs representing files that edit predictions should be disabled for. @@ -83,7 +83,7 @@ You can inspect this exclusion list by opening `zed: open default settings` from Users may explicitly exclude additional paths and/or file extensions by adding them to [`edit_predictions.disabled_globs`](https://zed.dev/docs/configuring-zed#edit-predictions) in their Zed settings.json: -```json +```json [settings] { "edit_predictions": { "disabled_globs": ["secret_dir/*", "**/*.log"] diff --git a/docs/src/ai/configuration.md b/docs/src/ai/configuration.md index c11a0fd65c45ce46598596182fbf8fb0c147380a..e2cd9ad0201933a7ba4f1239615cf44ccdb7f3f6 100644 --- a/docs/src/ai/configuration.md +++ b/docs/src/ai/configuration.md @@ -14,7 +14,7 @@ When using AI in Zed, you can configure multiple dimensions: We want to respect users who want to use Zed without interacting with AI whatsoever. To do that, add the following key to your `settings.json`: -```json +```json [settings] { "disable_ai": true } diff --git a/docs/src/ai/edit-prediction.md b/docs/src/ai/edit-prediction.md index 7843b08ff7d552c0c05366e60feb31dbd31a8ae2..4508e304b9c12959082a8cbe3590197a722fe1a8 100644 --- a/docs/src/ai/edit-prediction.md +++ b/docs/src/ai/edit-prediction.md @@ -21,9 +21,9 @@ Zed's Edit Prediction comes with two different display modes: Toggle between them via the `mode` key: -```json +```json [settings] "edit_predictions": { - "mode": "eager" | "subtle" + "mode": "eager" // or "subtle" }, ``` @@ -50,7 +50,7 @@ See the [Configuring GitHub Copilot](#github-copilot) and [Configuring Supermave By default, `tab` is used to accept edit predictions. You can use another keybinding by inserting this in your keymap: -```json +```json [settings] { "context": "Editor && edit_prediction", "bindings": { @@ -62,7 +62,7 @@ By default, `tab` is used to accept edit predictions. You can use another keybin When there's a [conflict with the `tab` key](#edit-predictions-conflict), Zed uses a different context to accept keybindings (`edit_prediction_conflict`). If you want to use a different one, you can insert this in your keymap: -```json +```json [settings] { "context": "Editor && edit_prediction_conflict", "bindings": { @@ -75,7 +75,7 @@ If your keybinding contains a modifier (`ctrl` in the example above), it will al You can also bind this action to keybind without a modifier. In that case, Zed will use the default modifier (`alt`) to preview the edit prediction. -```json +```json [settings] { "context": "Editor && edit_prediction_conflict", "bindings": { @@ -88,7 +88,7 @@ You can also bind this action to keybind without a modifier. In that case, Zed w To maintain the use of the modifier key for accepting predictions when there is a language server completions menu, but allow `tab` to accept predictions regardless of cursor position, you can specify the context further with `showing_completions`: -```json +```json [settings] { "context": "Editor && edit_prediction_conflict && !showing_completions", "bindings": { @@ -102,7 +102,7 @@ To maintain the use of the modifier key for accepting predictions when there is The keybinding example below causes `alt-tab` to always be used instead of sometimes using `tab`. You might want this in order to have just one keybinding to use for accepting edit predictions, since the behavior of `tab` varies based on context. -```json +```json [keymap] { "context": "Editor && edit_prediction", "bindings": { @@ -126,7 +126,7 @@ The keybinding example below causes `alt-tab` to always be used instead of somet If `"vim_mode": true` is set within `settings.json`, then additional bindings are needed after the above to return `tab` to its original behavior: -```json +```json [keymap] { "context": "(VimControl && !menu) || vim_mode == replace || vim_mode == waiting", "bindings": { @@ -145,7 +145,7 @@ If `"vim_mode": true` is set within `settings.json`, then additional bindings ar While `tab` and `alt-tab` are supported on Linux, `alt-l` is displayed instead. If your window manager does not reserve `alt-tab`, and you would prefer to use `tab` and `alt-tab`, include these bindings in `keymap.json`: -```json +```json [keymap] { "context": "Editor && edit_prediction", "bindings": { @@ -170,7 +170,7 @@ Zed requires at least one keybinding for the {#action editor::AcceptEditPredicti If you have previously bound the default keybindings to different actions in the global context, you will not be able to preview or accept edit predictions. For example: -```json +```json [keymap] [ // Your keymap { @@ -184,7 +184,7 @@ If you have previously bound the default keybindings to different actions in the To fix this, you can specify your own keybinding for accepting edit predictions: -```json +```json [keymap] [ // ... { @@ -208,7 +208,7 @@ Alternatively, if you have Zed set as your provider, consider [using Subtle Mode To not have predictions appear automatically as you type, set this within `settings.json`: -```json +```json [settings] { "show_edit_predictions": false } @@ -221,7 +221,7 @@ Still, you can trigger edit predictions manually by executing {#action editor::S To not have predictions appear automatically as you type when working with a specific language, set this within `settings.json`: -```json +```json [settings] { "language": { "python": { @@ -235,7 +235,7 @@ To not have predictions appear automatically as you type when working with a spe To disable edit predictions for specific directories or files, set this within `settings.json`: -```json +```json [settings] { "edit_predictions": { "disabled_globs": ["~/.config/zed/settings.json"] @@ -247,7 +247,7 @@ To disable edit predictions for specific directories or files, set this within ` To completely turn off edit prediction across all providers, explicitly set the settings to `none`, like so: -```json +```json [settings] "features": { "edit_prediction_provider": "none" }, @@ -257,7 +257,7 @@ To completely turn off edit prediction across all providers, explicitly set the To use GitHub Copilot as your provider, set this within `settings.json`: -```json +```json [settings] { "features": { "edit_prediction_provider": "copilot" @@ -271,7 +271,7 @@ You should be able to sign-in to GitHub Copilot by clicking on the Copilot icon If your organization uses GitHub Copilot Enterprise, you can configure Zed to use your enterprise instance by specifying the enterprise URI in your `settings.json`: -```json +```json [settings] { "edit_predictions": { "copilot": { @@ -294,7 +294,7 @@ Copilot can provide multiple completion alternatives, and these can be navigated To use Supermaven as your provider, set this within `settings.json`: -```json +```json [settings] { "features": { "edit_prediction_provider": "supermaven" diff --git a/docs/src/ai/external-agents.md b/docs/src/ai/external-agents.md index abe14865902ee261b157cf653b0d556cf83d7c71..9235c921d58757cc026fda852a76f9bbc2106d54 100644 --- a/docs/src/ai/external-agents.md +++ b/docs/src/ai/external-agents.md @@ -20,7 +20,7 @@ As of [Zed Stable v0.201.5](https://zed.dev/releases/stable/0.201.5) you should If you'd like to bind this to a keyboard shortcut, you can do so by editing your `keymap.json` file via the `zed: open keymap` command to include: -```json +```json [keymap] [ { "bindings": { @@ -36,7 +36,7 @@ The first time you create a Gemini CLI thread, Zed will install [@google/gemini- By default, Zed will use this managed version of Gemini CLI even if you have it installed globally. However, you can configure it to use a version in your `PATH` by adding this to your settings: -```json +```json [settings] { "agent_servers": { "gemini": { @@ -77,7 +77,7 @@ Open the agent panel with {#kb agent::ToggleFocus}, and then use the `+` button If you'd like to bind this to a keyboard shortcut, you can do so by editing your `keymap.json` file via the `zed: open keymap` command to include: -```json +```json [keymap] [ { "bindings": { @@ -124,7 +124,7 @@ If you don't have a `CLAUDE.md` file, you can ask Claude Code to create one for You can run any agent speaking ACP in Zed by changing your settings as follows: -```json +```json [settings] { "agent_servers": { "Custom Agent": { diff --git a/docs/src/ai/inline-assistant.md b/docs/src/ai/inline-assistant.md index 41923e85da09c2eed067d40518c89088d653b7b7..d3caff6f45903c549073b97105a3310236d64478 100644 --- a/docs/src/ai/inline-assistant.md +++ b/docs/src/ai/inline-assistant.md @@ -18,7 +18,7 @@ A useful pattern here is to create a thread in the Agent Panel, and then mention To create a custom keybinding that prefills a prompt, you can add the following format in your keymap: -```json +```json [keymap] [ { "context": "Editor && mode == full", diff --git a/docs/src/ai/llm-providers.md b/docs/src/ai/llm-providers.md index aeed1be17370c28ad67d8ffb7d49fadc5a77cdce..d78078f83e950d63449e4932a97c288f9fbee6a8 100644 --- a/docs/src/ai/llm-providers.md +++ b/docs/src/ai/llm-providers.md @@ -43,7 +43,7 @@ Ensure your credentials have the following permissions set up: Your IAM policy should look similar to: -```json +```json [settings] { "Version": "2012-10-17", "Statement": [ @@ -65,7 +65,7 @@ With that done, choose one of the two authentication methods: 1. Ensure you have the AWS CLI installed and configured with a named profile 2. Open your `settings.json` (`zed: open settings`) and include the `bedrock` key under `language_models` with the following settings: - ```json + ```json [settings] { "language_models": { "bedrock": { @@ -120,7 +120,7 @@ Zed will also use the `ANTHROPIC_API_KEY` environment variable if it's defined. You can add custom models to the Anthropic provider by adding the following to your Zed `settings.json`: -```json +```json [settings] { "language_models": { "anthropic": { @@ -147,14 +147,14 @@ Custom models will be listed in the model dropdown in the Agent Panel. You can configure a model to use [extended thinking](https://docs.anthropic.com/en/docs/about-claude/models/extended-thinking-models) (if it supports it) by changing the mode in your model's configuration to `thinking`, for example: -```json +```json [settings] { "name": "claude-sonnet-4-latest", "display_name": "claude-sonnet-4-thinking", "max_tokens": 200000, "mode": { "type": "thinking", - "budget_tokens": 4_096 + "budget_tokens": 4096 } } ``` @@ -174,7 +174,7 @@ Zed will also use the `DEEPSEEK_API_KEY` environment variable if it's defined. The Zed agent comes pre-configured to use the latest version for common models (DeepSeek Chat, DeepSeek Reasoner). If you wish to use alternate models or customize the API endpoint, you can do so by adding the following to your Zed `settings.json`: -```json +```json [settings] { "language_models": { "deepseek": { @@ -231,7 +231,7 @@ By default, Zed will use `stable` versions of models, but you can use specific v Here is an example of a custom Google AI model you could add to your Zed `settings.json`: -```json +```json [settings] { "language_models": { "google": { @@ -286,7 +286,7 @@ The Zed agent comes pre-configured with several Mistral models (codestral-latest All the default models support tool use. If you wish to use alternate models or customize their parameters, you can do so by adding the following to your Zed `settings.json`: -```json +```json [settings] { "language_models": { "mistral": { @@ -338,7 +338,7 @@ See [get_max_tokens in ollama.rs](https://github.com/zed-industries/zed/blob/mai Depending on your hardware or use-case you may wish to limit or increase the context length for a specific model via settings.json: -```json +```json [settings] { "language_models": { "ollama": { @@ -406,7 +406,7 @@ Zed will also use the `OPENAI_API_KEY` environment variable if it's defined. The Zed agent comes pre-configured to use the latest version for common models (GPT-5, GPT-5 mini, o4-mini, GPT-4.1, and others). To use alternate models, perhaps a preview release, or if you wish to control the request parameters, you can do so by adding the following to your Zed `settings.json`: -```json +```json [settings] { "language_models": { "openai": { @@ -446,7 +446,7 @@ Then, fill up the input fields available in the modal. To do it via your `settings.json`, add the following snippet under `language_models`: -```json +```json [settings] { "language_models": { "openai_compatible": { @@ -499,7 +499,7 @@ Zed will also use the `OPENROUTER_API_KEY` environment variable if it's defined. You can add custom models to the OpenRouter provider by adding the following to your Zed `settings.json`: -```json +```json [settings] { "language_models": { "open_router": { @@ -555,7 +555,7 @@ Supported fields (all optional): Example adding routing preferences to a model: -```json +```json [settings] { "language_models": { "open_router": { @@ -613,7 +613,7 @@ The xAI API key will be saved in your keychain. Zed will also use the `XAI_API_K The Zed agent comes pre-configured with common Grok models. If you wish to use alternate models or customize their parameters, you can do so by adding the following to your Zed `settings.json`: -```json +```json [settings] { "language_models": { "x_ai": { @@ -643,7 +643,7 @@ The Zed agent comes pre-configured with common Grok models. If you wish to use a You can use a custom API endpoint for different providers, as long as it's compatible with the provider's API structure. To do so, add the following to your `settings.json`: -```json +```json [settings] { "language_models": { "some-provider": { diff --git a/docs/src/ai/mcp.md b/docs/src/ai/mcp.md index 9f79bbb9ca66a5babf0a1990a513fa7016466fbd..d11b666993aaf8d445e9a1ef3f83156217b3b2db 100644 --- a/docs/src/ai/mcp.md +++ b/docs/src/ai/mcp.md @@ -37,7 +37,7 @@ In any case, here are some of the ones available: Creating an extension is not the only way to use MCP servers in Zed. You can connect them by adding their commands directly to your `settings.json`, like so: -```json +```json [settings] { "context_servers": { "your-mcp-server": { @@ -79,7 +79,7 @@ However, if you want to ensure a given MCP server will be used, you can create [ As an example, [the Dagger team suggests](https://container-use.com/agent-integrations#zed) doing that with their [Container Use MCP server](https://zed.dev/extensions/mcp-server-container-use): -```json +```json [settings] "agent": { "profiles": { "container-use": { diff --git a/docs/src/completions.md b/docs/src/completions.md index d14cf61d829595ac622a1f007cbb44c8135c4cbd..ff96ede7503cd461bbd3d7b4afdedcaa2f36a2e5 100644 --- a/docs/src/completions.md +++ b/docs/src/completions.md @@ -9,7 +9,7 @@ Zed supports two sources for completions: When there is an appropriate language server available, Zed will provide completions of variable names, functions, and other symbols in the current file. You can disable these by adding the following to your Zed `settings.json` file: -```json +```json [settings] "show_completions_on_input": false ``` diff --git a/docs/src/configuring-languages.md b/docs/src/configuring-languages.md index afb5729ff711a3855d986a77532670eac84232d0..9a7157ceaecbcc956e1e98688dfee01316225a3a 100644 --- a/docs/src/configuring-languages.md +++ b/docs/src/configuring-languages.md @@ -28,7 +28,7 @@ Zed allows you to override global settings for individual languages. These custo Here's an example of language-specific settings: -```json +```json [settings] "languages": { "Python": { "tab_size": 4, @@ -67,7 +67,7 @@ Zed automatically detects file types based on their extensions, but you can cust To set up custom file associations, use the [`file_types`](./configuring-zed.md#file-types) setting in your `settings.json`: -```json +```json [settings] "file_types": { "C++": ["c"], "TOML": ["MyLockFile"], @@ -119,7 +119,7 @@ Some languages in Zed offer multiple language server options. You might have mul You can specify your preference using the `language_servers` setting: -```json +```json [settings] "languages": { "PHP": { "language_servers": ["intelephense", "!phpactor", "..."] @@ -145,7 +145,7 @@ Not all languages in Zed support toolchain discovery and selection, but for thos Many language servers accept custom configuration options. You can set these in the `lsp` section of your `settings.json`: -```json +```json [settings] "lsp": { "rust-analyzer": { "initialization_options": { @@ -170,7 +170,7 @@ Suppose you want to configure the following settings for TypeScript: Here's how you would structure these settings in Zed's `settings.json`: -```json +```json [settings] "lsp": { "typescript-language-server": { "initialization_options": { @@ -198,7 +198,7 @@ Sent once during language server startup, requires server's restart to reapply c For example, rust-analyzer and clangd rely on this way of configuring only. -```json +```json [settings] "lsp": { "rust-analyzer": { "initialization_options": { @@ -213,7 +213,7 @@ For example, rust-analyzer and clangd rely on this way of configuring only. May be queried by the server multiple times. Most of the servers would rely on this way of configuring only. -```json +```json [settings] "lsp": { "tailwindcss-language-server": { "settings": { @@ -229,7 +229,7 @@ Apart of the LSP-related server configuration options, certain servers in Zed al Language servers are automatically downloaded or launched if found in your path, if you wish to specify an explicit alternate binary you can specify that in settings: -```json +```json [settings] "lsp": { "rust-analyzer": { "binary": { @@ -249,7 +249,7 @@ Language servers are automatically downloaded or launched if found in your path, You can toggle language server support globally or per-language: -```json +```json [settings] "languages": { "Markdown": { "enable_language_server": false @@ -267,7 +267,7 @@ Zed provides support for code formatting and linting to maintain consistent code Zed supports both built-in and external formatters. See [`formatter`](./configuring-zed.md#formatter) docs for more. You can configure formatters globally or per-language in your `settings.json`: -```json +```json [settings] "languages": { "JavaScript": { "formatter": { @@ -289,7 +289,7 @@ This example uses Prettier for JavaScript and the language server's formatter fo To disable formatting for a specific language: -```json +```json [settings] "languages": { "Markdown": { "format_on_save": "off" @@ -301,7 +301,7 @@ To disable formatting for a specific language: Linting in Zed is typically handled by language servers. Many language servers allow you to configure linting rules: -```json +```json [settings] "lsp": { "eslint": { "settings": { @@ -317,7 +317,7 @@ This configuration sets up ESLint to organize imports on save for JavaScript fil To run linter fixes automatically on save: -```json +```json [settings] "languages": { "JavaScript": { "formatter": { @@ -331,7 +331,7 @@ To run linter fixes automatically on save: Zed allows you to run both formatting and linting on save. Here's an example that uses Prettier for formatting and ESLint for linting JavaScript files: -```json +```json [settings] "languages": { "JavaScript": { "formatter": [ @@ -368,7 +368,7 @@ Zed uses Tree-sitter grammars for syntax highlighting. Override the default high This example makes comments italic and changes the color of strings: -```json +```json [settings] "experimental.theme_overrides": { "syntax": { "comment": { @@ -388,7 +388,7 @@ Change your theme: 1. Use the theme selector ({#kb theme_selector::Toggle}) 2. Or set it in your `settings.json`: -```json +```json [settings] "theme": { "mode": "dark", "dark": "One Dark", @@ -410,7 +410,7 @@ To create your own theme extension, refer to the [Developing Theme Extensions](. Inlay hints provide additional information inline in your code, such as parameter names or inferred types. Configure inlay hints in your `settings.json`: -```json +```json [settings] "inlay_hints": { "enabled": true, "show_type_hints": true, diff --git a/docs/src/configuring-zed.md b/docs/src/configuring-zed.md index 6f2e1319ee6805c6a7651c7c53571bb972c46457..e4653ecc09a8bdb29a5bf8179d5027288825ded1 100644 --- a/docs/src/configuring-zed.md +++ b/docs/src/configuring-zed.md @@ -35,7 +35,7 @@ Extensions that provide language servers may also provide default settings for t - Setting: `active_pane_modifiers` - Default: -```json +```json [settings] { "active_pane_modifiers": { "border_size": 0.0, @@ -74,7 +74,7 @@ Non-negative `float` values 1. Contain the bottom dock, giving the full height of the window to the left and right docks. -```json +```json [settings] { "bottom_dock_layout": "contained" } @@ -82,7 +82,7 @@ Non-negative `float` values 2. Give the bottom dock the full width of the window, truncating the left and right docks. -```json +```json [settings] { "bottom_dock_layout": "full" } @@ -90,7 +90,7 @@ Non-negative `float` values 3. Left align the bottom dock, truncating the left dock and giving the right dock the full height of the window. -```json +```json [settings] { "bottom_dock_layout": "left_aligned" } @@ -98,7 +98,7 @@ Non-negative `float` values 4. Right align the bottom dock, giving the left dock the full height of the window and truncating the right dock. -```json +```json [settings] { "bottom_dock_layout": "right_aligned" } @@ -124,25 +124,25 @@ Non-negative `float` values 1. Allow rewrap in comments only: -```json +```json [settings] { "allow_rewrap": "in_comments" } ``` -2. Allow rewrap everywhere: +2. Allow rewrap in selections only: -```json +```json [settings] { - "allow_rewrap": "everywhere" + "allow_rewrap": "in_selections" } ``` -3. Never allow rewrap: +3. Allow rewrap anywhere: -```json +```json [settings] { - "allow_rewrap": "never" + "allow_rewrap": "anywhere" } ``` @@ -192,7 +192,7 @@ ls ~/.local/share/zed/extensions/installed Define extensions which should be installed (`true`) or never installed (`false`). -```json +```json [settings] { "auto_install_extensions": { "html": true, @@ -212,7 +212,7 @@ Define extensions which should be installed (`true`) or never installed (`false` 1. To disable autosave, set it to `off`: -```json +```json [settings] { "autosave": "off" } @@ -220,7 +220,7 @@ Define extensions which should be installed (`true`) or never installed (`false` 2. To autosave when focus changes, use `on_focus_change`: -```json +```json [settings] { "autosave": "on_focus_change" } @@ -228,7 +228,7 @@ Define extensions which should be installed (`true`) or never installed (`false` 3. To autosave when the active window changes, use `on_window_change`: -```json +```json [settings] { "autosave": "on_window_change" } @@ -236,7 +236,7 @@ Define extensions which should be installed (`true`) or never installed (`false` 4. To autosave after an inactivity period, use `after_delay`: -```json +```json [settings] { "autosave": { "after_delay": { @@ -298,7 +298,7 @@ Note that a save will be triggered when an unsaved tab is closed, even if this i 1. VS Code -```json +```json [settings] { "base_keymap": "VSCode" } @@ -306,7 +306,7 @@ Note that a save will be triggered when an unsaved tab is closed, even if this i 2. Atom -```json +```json [settings] { "base_keymap": "Atom" } @@ -314,7 +314,7 @@ Note that a save will be triggered when an unsaved tab is closed, even if this i 3. JetBrains -```json +```json [settings] { "base_keymap": "JetBrains" } @@ -322,7 +322,7 @@ Note that a save will be triggered when an unsaved tab is closed, even if this i 4. None -```json +```json [settings] { "base_keymap": "None" } @@ -330,7 +330,7 @@ Note that a save will be triggered when an unsaved tab is closed, even if this i 5. Sublime Text -```json +```json [settings] { "base_keymap": "SublimeText" } @@ -338,7 +338,7 @@ Note that a save will be triggered when an unsaved tab is closed, even if this i 6. TextMate -```json +```json [settings] { "base_keymap": "TextMate" } @@ -367,7 +367,7 @@ Zed supports all OpenType features that can be enabled or disabled for a given b For example, to disable font ligatures, add the following to your settings: -```json +```json [settings] { "buffer_font_features": { "calt": false @@ -377,7 +377,7 @@ For example, to disable font ligatures, add the following to your settings: You can also set other OpenType features, like setting `cv01` to `7`: -```json +```json [settings] { "buffer_font_features": { "cv01": 7 @@ -396,7 +396,7 @@ You can also set other OpenType features, like setting `cv01` to `7`: For example, to use `Nerd Font` as a fallback, add the following to your settings: -```json +```json [settings] { "buffer_font_fallbacks": ["Nerd Font"] } @@ -438,7 +438,7 @@ A font size from `6` to `100` pixels (inclusive) - Setting: `centered_layout` - Default: -```json +```json [settings] "centered_layout": { "left_padding": 0.2, "right_padding": 0.2, @@ -484,15 +484,15 @@ Note: Dirty files (files with unsaved changes) will not be automatically closed 1. Allow all diagnostics (default): -```json +```json [settings] { - "diagnostics_max_severity": null + "diagnostics_max_severity": "all" } ``` 2. Show only errors: -```json +```json [settings] { "diagnostics_max_severity": "error" } @@ -500,7 +500,7 @@ Note: Dirty files (files with unsaved changes) will not be automatically closed 3. Show errors and warnings: -```json +```json [settings] { "diagnostics_max_severity": "warning" } @@ -508,15 +508,15 @@ Note: Dirty files (files with unsaved changes) will not be automatically closed 4. Show errors, warnings, and information: -```json +```json [settings] { - "diagnostics_max_severity": "information" + "diagnostics_max_severity": "info" } ``` 5. Show all including hints: -```json +```json [settings] { "diagnostics_max_severity": "hint" } @@ -557,7 +557,7 @@ There are two options to choose from: 1. Behave as a regular buffer and select the whole word (default): -```json +```json [settings] { "double_click_in_multibuffer": "select" } @@ -565,7 +565,7 @@ There are two options to choose from: 2. Open the excerpt clicked as a new buffer in the new tab: -```json +```json [settings] { "double_click_in_multibuffer": "open" } @@ -589,7 +589,7 @@ For the case of "open", regular selection behavior can be achieved by holding `a - Setting: `edit_predictions` - Default: -```json +```json [settings] "edit_predictions": { "disabled_globs": [ "**/.env*", @@ -627,19 +627,19 @@ List of `string` values 1. Don't show edit predictions in comments: -```json +```json [settings] "disabled_in": ["comment"] ``` 2. Don't show edit predictions in strings and comments: -```json +```json [settings] "disabled_in": ["comment", "string"] ``` 3. Only in Go, don't show edit predictions in strings and comments: -```json +```json [settings] { "languages": { "Go": { @@ -659,25 +659,25 @@ List of `string` values 1. Don't highlight the current line: -```json +```json [settings] "current_line_highlight": "none" ``` 2. Highlight the gutter area: -```json +```json [settings] "current_line_highlight": "gutter" ``` 3. Highlight the editor area: -```json +```json [settings] "current_line_highlight": "line" ``` 4. Highlight the full line: -```json +```json [settings] "current_line_highlight": "all" ``` @@ -713,25 +713,25 @@ List of `string` values 1. A vertical bar: -```json +```json [settings] "cursor_shape": "bar" ``` 2. A block that surrounds the following character: -```json +```json [settings] "cursor_shape": "block" ``` 3. An underline / underscore that runs along the following character: -```json +```json [settings] "cursor_shape": "underline" ``` 4. An box drawn around the following character: -```json +```json [settings] "cursor_shape": "hollow" ``` @@ -741,7 +741,7 @@ List of `string` values - Setting: `gutter` - Default: -```json +```json [settings] { "gutter": { "line_numbers": true, @@ -771,19 +771,19 @@ List of `string` values 1. Never hide the mouse cursor: -```json +```json [settings] "hide_mouse": "never" ``` 2. Hide only when typing: -```json +```json [settings] "hide_mouse": "on_typing" ``` 3. Hide on both typing and cursor movement: -```json +```json [settings] "hide_mouse": "on_typing_and_movement" ``` @@ -797,25 +797,25 @@ List of `string` values 1. Place snippets at the top of the completion list: -```json +```json [settings] "snippet_sort_order": "top" ``` 2. Place snippets normally without any preference: -```json +```json [settings] "snippet_sort_order": "inline" ``` 3. Place snippets at the bottom of the completion list: -```json +```json [settings] "snippet_sort_order": "bottom" ``` 4. Do not show snippets in the completion list at all: -```json +```json [settings] "snippet_sort_order": "none" ``` @@ -825,7 +825,7 @@ List of `string` values - Setting: `scrollbar` - Default: -```json +```json [settings] "scrollbar": { "show": "auto", "cursors": true, @@ -851,7 +851,7 @@ List of `string` values 1. Show the scrollbar if there's important information or follow the system's configured behavior: -```json +```json [settings] "scrollbar": { "show": "auto" } @@ -859,7 +859,7 @@ List of `string` values 2. Match the system's configured behavior: -```json +```json [settings] "scrollbar": { "show": "system" } @@ -867,7 +867,7 @@ List of `string` values 3. Always show the scrollbar: -```json +```json [settings] "scrollbar": { "show": "always" } @@ -875,7 +875,7 @@ List of `string` values 4. Never show the scrollbar: -```json +```json [settings] "scrollbar": { "show": "never" } @@ -941,41 +941,41 @@ List of `string` values 1. Show all diagnostics: -```json +```json [settings] { - "diagnostics": "all" + "show_diagnostics": "all" } ``` 2. Do not show any diagnostics: -```json +```json [settings] { - "diagnostics": "none" + "show_diagnostics": "off" } ``` 3. Show only errors: -```json +```json [settings] { - "diagnostics": "error" + "show_diagnostics": "error" } ``` 4. Show only errors and warnings: -```json +```json [settings] { - "diagnostics": "warning" + "show_diagnostics": "warning" } ``` 5. Show only errors, warnings, and information: -```json +```json [settings] { - "diagnostics": "information" + "show_diagnostics": "info" } ``` @@ -985,7 +985,7 @@ List of `string` values - Setting: `axes` - Default: -```json +```json [settings] "scrollbar": { "axes": { "horizontal": true, @@ -1020,7 +1020,7 @@ List of `string` values - Setting: `minimap` - Default: -```json +```json [settings] { "minimap": { "show": "never", @@ -1041,7 +1041,7 @@ List of `string` values 1. Always show the minimap: -```json +```json [settings] { "show": "always" } @@ -1049,7 +1049,7 @@ List of `string` values 2. Show the minimap if the editor's scrollbars are visible: -```json +```json [settings] { "show": "auto" } @@ -1057,7 +1057,7 @@ List of `string` values 3. Never show the minimap: -```json +```json [settings] { "show": "never" } @@ -1073,7 +1073,7 @@ List of `string` values 1. Show the minimap thumb when hovering over the minimap: -```json +```json [settings] { "thumb": "hover" } @@ -1081,7 +1081,7 @@ List of `string` values 2. Always show the minimap thumb: -```json +```json [settings] { "thumb": "always" } @@ -1097,7 +1097,7 @@ List of `string` values 1. Display a border on all sides of the thumb: -```json +```json [settings] { "thumb_border": "full" } @@ -1105,7 +1105,7 @@ List of `string` values 2. Display a border on all sides except the left side: -```json +```json [settings] { "thumb_border": "left_open" } @@ -1113,7 +1113,7 @@ List of `string` values 3. Display a border on all sides except the right side: -```json +```json [settings] { "thumb_border": "right_open" } @@ -1121,7 +1121,7 @@ List of `string` values 4. Display a border only on the left side: -```json +```json [settings] { "thumb_border": "left_only" } @@ -1129,7 +1129,7 @@ List of `string` values 5. Display the thumb without any border: -```json +```json [settings] { "thumb_border": "none" } @@ -1145,7 +1145,7 @@ List of `string` values 1. Inherit the editor's current line highlight setting: -```json +```json [settings] { "minimap": { "current_line_highlight": null @@ -1155,7 +1155,7 @@ List of `string` values 2. Highlight the current line in the minimap: -```json +```json [settings] { "minimap": { "current_line_highlight": "line" @@ -1165,7 +1165,7 @@ List of `string` values or -```json +```json [settings] { "minimap": { "current_line_highlight": "all" @@ -1175,7 +1175,7 @@ or 3. Do not highlight the current line in the minimap: -```json +```json [settings] { "minimap": { "current_line_highlight": "gutter" @@ -1185,7 +1185,7 @@ or or -```json +```json [settings] { "minimap": { "current_line_highlight": "none" @@ -1199,7 +1199,7 @@ or - Settings: `tab_bar` - Default: -```json +```json [settings] "tab_bar": { "show": true, "show_nav_history_buttons": true, @@ -1243,7 +1243,7 @@ or - Setting: `tabs` - Default: -```json +```json [settings] "tabs": { "close_position": "right", "file_icons": false, @@ -1264,7 +1264,7 @@ or 1. Display the close button on the right: -```json +```json [settings] { "close_position": "right" } @@ -1272,7 +1272,7 @@ or 2. Display the close button on the left: -```json +```json [settings] { "close_position": "left" } @@ -1300,7 +1300,7 @@ or 1. Activate the tab that was open previously: -```json +```json [settings] { "activate_on_close": "history" } @@ -1308,7 +1308,7 @@ or 2. Activate the right neighbour tab if present: -```json +```json [settings] { "activate_on_close": "neighbour" } @@ -1316,7 +1316,7 @@ or 3. Activate the left neighbour tab if present: -```json +```json [settings] { "activate_on_close": "left_neighbour" } @@ -1332,7 +1332,7 @@ or 1. Show it just upon hovering the tab: -```json +```json [settings] { "show_close_button": "hover" } @@ -1340,7 +1340,7 @@ or 2. Show it persistently: -```json +```json [settings] { "show_close_button": "always" } @@ -1348,7 +1348,7 @@ or 3. Never show it, even if hovering it: -```json +```json [settings] { "show_close_button": "hidden" } @@ -1364,7 +1364,7 @@ or 1. Do not mark any files: -```json +```json [settings] { "show_diagnostics": "off" } @@ -1372,7 +1372,7 @@ or 2. Only mark files with errors: -```json +```json [settings] { "show_diagnostics": "errors" } @@ -1380,7 +1380,7 @@ or 3. Mark files with errors and warnings: -```json +```json [settings] { "show_diagnostics": "all" } @@ -1402,7 +1402,7 @@ or - Setting: `drag_and_drop_selection` - Default: -```json +```json [settings] "drag_and_drop_selection": { "enabled": true, "delay": 300 @@ -1415,7 +1415,7 @@ or - Setting: `toolbar` - Default: -```json +```json [settings] "toolbar": { "breadcrumbs": true, "quick_actions": true, @@ -1495,7 +1495,7 @@ Positive `integer` value between 1 and 32. Values outside of this range will be - Setting: `status_bar` - Default: -```json +```json [settings] "status_bar": { "active_language_button": true, "cursor_position_button": true @@ -1529,7 +1529,7 @@ Some options are passed via `initialization_options` to the language server. The For example to pass the `check` option to `rust-analyzer`, use the following configuration: -```json +```json [settings] "lsp": { "rust-analyzer": { "initialization_options": { @@ -1543,7 +1543,7 @@ For example to pass the `check` option to `rust-analyzer`, use the following con While other options may be changed at a runtime and should be placed under `settings`: -```json +```json [settings] "lsp": { "yaml-language-server": { "settings": { @@ -1561,7 +1561,7 @@ While other options may be changed at a runtime and should be placed under `sett - Setting: `global_lsp_settings` - Default: -```json +```json [settings] { "global_lsp_settings": { "button": true @@ -1589,7 +1589,7 @@ While other options may be changed at a runtime and should be placed under `sett - Setting: `features` - Default: -```json +```json [settings] { "features": { "edit_prediction_provider": "zed" @@ -1607,7 +1607,7 @@ While other options may be changed at a runtime and should be placed under `sett 1. Use Zeta as the edit prediction provider: -```json +```json [settings] { "features": { "edit_prediction_provider": "zed" @@ -1617,7 +1617,7 @@ While other options may be changed at a runtime and should be placed under `sett 2. Use Copilot as the edit prediction provider: -```json +```json [settings] { "features": { "edit_prediction_provider": "copilot" @@ -1627,7 +1627,7 @@ While other options may be changed at a runtime and should be placed under `sett 3. Use Supermaven as the edit prediction provider: -```json +```json [settings] { "features": { "edit_prediction_provider": "supermaven" @@ -1637,7 +1637,7 @@ While other options may be changed at a runtime and should be placed under `sett 4. Turn off edit predictions across all providers -```json +```json [settings] { "features": { "edit_prediction_provider": "none" @@ -1655,7 +1655,7 @@ While other options may be changed at a runtime and should be placed under `sett 1. `on`, enables format on save obeying `formatter` setting: -```json +```json [settings] { "format_on_save": "on" } @@ -1663,7 +1663,7 @@ While other options may be changed at a runtime and should be placed under `sett 2. `off`, disables format on save: -```json +```json [settings] { "format_on_save": "off" } @@ -1679,7 +1679,7 @@ While other options may be changed at a runtime and should be placed under `sett 1. To use the current language server, use `"language_server"`: -```json +```json [settings] { "formatter": "language_server" } @@ -1687,7 +1687,7 @@ While other options may be changed at a runtime and should be placed under `sett 2. Or to use an external command, use `"external"`. Specify the name of the formatting program to run, and an array of arguments to pass to the program. The buffer's text will be passed to the program on stdin, and the formatted output should be written to stdout. For example, the following command would strip trailing spaces using [`sed(1)`](https://linux.die.net/man/1/sed): -```json +```json [settings] { "formatter": { "external": { @@ -1702,7 +1702,7 @@ While other options may be changed at a runtime and should be placed under `sett WARNING: `{buffer_path}` should not be used to direct your formatter to read from a filename. Your formatter should only read from standard input and should not read or write files directly. -```json +```json [settings] "formatter": { "external": { "command": "prettier", @@ -1713,22 +1713,20 @@ WARNING: `{buffer_path}` should not be used to direct your formatter to read fro 4. Or to use code actions provided by the connected language servers, use `"code_actions"`: -```json +```json [settings] { - "formatter": { - "code_actions": { - // Use ESLint's --fix: - "source.fixAll.eslint": true, - // Organize imports on save: - "source.organizeImports": true - } - } + "formatter": [ + // Use ESLint's --fix: + { "code_action": "source.fixAll.eslint" }, + // Organize imports on save: + { "code_action": "source.organizeImports" } + ] } ``` 5. Or to use multiple formatters consecutively, use an array of formatters: -```json +```json [settings] { "formatter": [ { "language_server": { "name": "rust-analyzer" } }, @@ -1781,7 +1779,7 @@ The result is still `)))` and not `))))))`, which is what it would be by default - Description: Files or globs of files that will be excluded by Zed entirely. They will be skipped during file scans, file searches, and not be displayed in the project file tree. Overrides `file_scan_inclusions`. - Default: -```json +```json [settings] "file_scan_exclusions": [ "**/.git", "**/.svn", @@ -1803,7 +1801,7 @@ Note, specifying `file_scan_exclusions` in settings.json will override the defau - Description: Files or globs of files that will be included by Zed, even when ignored by git. This is useful for files that are not tracked by git, but are still important to your project. Note that globs that are overly broad can slow down Zed's file scanning. `file_scan_exclusions` takes precedence over these inclusions. - Default: -```json +```json [settings] "file_scan_inclusions": [".env*"], ``` @@ -1813,7 +1811,7 @@ Note, specifying `file_scan_exclusions` in settings.json will override the defau - Description: Configure how Zed selects a language for a file based on its filename or extension. Supports glob entries. - Default: -```json +```json [settings] "file_types": { "JSONC": ["**/.zed/**/*.json", "**/zed/**/*.json", "**/Zed/**/*.json", "**/.vscode/**/*.json"], "Shell Script": [".env.*"] @@ -1824,7 +1822,7 @@ Note, specifying `file_scan_exclusions` in settings.json will override the defau To interpret all `.c` files as C++, files called `MyLockFile` as TOML and files starting with `Dockerfile` as Dockerfile: -```json +```json [settings] { "file_types": { "C++": ["c"], @@ -1840,7 +1838,7 @@ To interpret all `.c` files as C++, files called `MyLockFile` as TOML and files - Setting: `diagnostics` - Default: -```json +```json [settings] { "diagnostics": { "include_warnings": true, @@ -1860,7 +1858,7 @@ To interpret all `.c` files as C++, files called `MyLockFile` as TOML and files - Setting: `inline` - Default: -```json +```json [settings] { "diagnostics": { "inline": { @@ -1878,7 +1876,7 @@ To interpret all `.c` files as C++, files called `MyLockFile` as TOML and files 1. Enable inline diagnostics. -```json +```json [settings] { "diagnostics": { "inline": { @@ -1890,7 +1888,7 @@ To interpret all `.c` files as C++, files called `MyLockFile` as TOML and files 2. Delay diagnostic updates until some time after the last diagnostic update. -```json +```json [settings] { "diagnostics": { "inline": { @@ -1903,7 +1901,7 @@ To interpret all `.c` files as C++, files called `MyLockFile` as TOML and files 3. Set padding between the end of the source line and the start of the diagnostic. -```json +```json [settings] { "diagnostics": { "inline": { @@ -1916,7 +1914,7 @@ To interpret all `.c` files as C++, files called `MyLockFile` as TOML and files 4. Horizontally align inline diagnostics at the given column. -```json +```json [settings] { "diagnostics": { "inline": { @@ -1929,7 +1927,7 @@ To interpret all `.c` files as C++, files called `MyLockFile` as TOML and files 5. Show only warning and error diagnostics. -```json +```json [settings] { "diagnostics": { "inline": { @@ -1946,7 +1944,7 @@ To interpret all `.c` files as C++, files called `MyLockFile` as TOML and files - Setting: `git` - Default: -```json +```json [settings] { "git": { "git_gutter": "tracked_files", @@ -1971,7 +1969,7 @@ To interpret all `.c` files as C++, files called `MyLockFile` as TOML and files 1. Show git gutter in tracked files -```json +```json [settings] { "git": { "git_gutter": "tracked_files" @@ -1981,7 +1979,7 @@ To interpret all `.c` files as C++, files called `MyLockFile` as TOML and files 2. Hide git gutter -```json +```json [settings] { "git": { "git_gutter": "hide" @@ -2001,7 +1999,7 @@ To interpret all `.c` files as C++, files called `MyLockFile` as TOML and files Example: -```json +```json [settings] { "git": { "gutter_debounce": 100 @@ -2015,7 +2013,7 @@ Example: - Setting: `inline_blame` - Default: -```json +```json [settings] { "git": { "inline_blame": { @@ -2029,7 +2027,7 @@ Example: 1. Disable inline git blame: -```json +```json [settings] { "git": { "inline_blame": { @@ -2041,7 +2039,7 @@ Example: 2. Only show inline git blame after a delay (that starts after cursor stops moving): -```json +```json [settings] { "git": { "inline_blame": { @@ -2053,7 +2051,7 @@ Example: 3. Show a commit summary next to the commit date and author: -```json +```json [settings] { "git": { "inline_blame": { @@ -2065,7 +2063,7 @@ Example: 4. Use this as the minimum column at which to display inline blame information: -```json +```json [settings] { "git": { "inline_blame": { @@ -2077,7 +2075,7 @@ Example: 5. Set the padding between the end of the line and the inline blame hint, in ems: -```json +```json [settings] { "git": { "inline_blame": { @@ -2093,7 +2091,7 @@ Example: - Setting: `branch_picker` - Default: -```json +```json [settings] { "git": { "branch_picker": { @@ -2107,7 +2105,7 @@ Example: 1. Show the author name in the branch picker: -```json +```json [settings] { "git": { "branch_picker": { @@ -2123,7 +2121,7 @@ Example: - Setting: `hunk_style` - Default: -```json +```json [settings] { "git": { "hunk_style": "staged_hollow" @@ -2135,7 +2133,7 @@ Example: 1. Show the staged hunks faded out and with a border: -```json +```json [settings] { "git": { "hunk_style": "staged_hollow" @@ -2145,7 +2143,7 @@ Example: 2. Show unstaged hunks faded out and with a border: -```json +```json [settings] { "git": { "hunk_style": "unstaged_hollow" @@ -2163,7 +2161,7 @@ Example: 1. Do nothing: -```json +```json [settings] { "go_to_definition_fallback": "none" } @@ -2171,7 +2169,7 @@ Example: 2. Find references for the same symbol (default): -```json +```json [settings] { "go_to_definition_fallback": "find_all_references" } @@ -2203,7 +2201,7 @@ Example: - Setting: `indent_guides` - Default: -```json +```json [settings] { "indent_guides": { "enabled": true, @@ -2219,7 +2217,7 @@ Example: 1. Disable indent guides -```json +```json [settings] { "indent_guides": { "enabled": false @@ -2229,7 +2227,7 @@ Example: 2. Enable indent guides for a specific language. -```json +```json [settings] { "languages": { "Python": { @@ -2244,7 +2242,7 @@ Example: 3. Enable indent aware coloring ("rainbow indentation"). The colors that are used for different indentation levels are defined in the theme (theme key: `accents`). They can be customized by using theme overrides. -```json +```json [settings] { "indent_guides": { "enabled": true, @@ -2256,7 +2254,7 @@ Example: 4. Enable indent aware background coloring ("rainbow indentation"). The colors that are used for different indentation levels are defined in the theme (theme key: `accents`). They can be customized by using theme overrides. -```json +```json [settings] { "indent_guides": { "enabled": true, @@ -2298,7 +2296,7 @@ Example: - Setting: `icon_theme` - Default: -```json +```json [settings] "icon_theme": { "mode": "system", "dark": "Zed (Default)", @@ -2316,7 +2314,7 @@ Example: 1. Set the icon theme to dark mode -```json +```json [settings] { "mode": "dark" } @@ -2324,7 +2322,7 @@ Example: 2. Set the icon theme to light mode -```json +```json [settings] { "mode": "light" } @@ -2332,7 +2330,7 @@ Example: 3. Set the icon theme to system mode -```json +```json [settings] { "mode": "system" } @@ -2364,7 +2362,7 @@ Run the {#action icon_theme_selector::Toggle} action in the command palette to s - Setting: `image_viewer` - Default: -```json +```json [settings] { "image_viewer": { "unit": "binary" @@ -2384,7 +2382,7 @@ Run the {#action icon_theme_selector::Toggle} action in the command palette to s 1. Use binary units (KiB, MiB): -```json +```json [settings] { "image_viewer": { "unit": "binary" @@ -2394,7 +2392,7 @@ Run the {#action icon_theme_selector::Toggle} action in the command palette to s 2. Use decimal units (KB, MB): -```json +```json [settings] { "image_viewer": { "unit": "decimal" @@ -2408,7 +2406,7 @@ Run the {#action icon_theme_selector::Toggle} action in the command palette to s - Setting: `inlay_hints` - Default: -```json +```json [settings] "inlay_hints": { "enabled": false, "show_type_hints": true, @@ -2441,7 +2439,7 @@ Settings-related hint updates are not debounced. All possible config values for `toggle_on_modifiers_press` are: -```json +```json [settings] "inlay_hints": { "toggle_on_modifiers_press": { "control": true, @@ -2461,7 +2459,7 @@ Unspecified values have a `false` value, hints won't be toggled if all the modif - Setting: `journal` - Default: -```json +```json [settings] "journal": { "path": "~", "hour_format": "hour12" @@ -2488,7 +2486,7 @@ Unspecified values have a `false` value, hints won't be toggled if all the modif 1. 12-hour format: -```json +```json [settings] { "hour_format": "hour12" } @@ -2496,7 +2494,7 @@ Unspecified values have a `false` value, hints won't be toggled if all the modif 2. 24-hour format: -```json +```json [settings] { "hour_format": "hour24" } @@ -2508,7 +2506,7 @@ Unspecified values have a `false` value, hints won't be toggled if all the modif - Setting: `jsx_tag_auto_close` - Default: -```json +```json [settings] { "jsx_tag_auto_close": { "enabled": true @@ -2530,7 +2528,7 @@ Unspecified values have a `false` value, hints won't be toggled if all the modif To override settings for a language, add an entry for that languages name to the `languages` value. Example: -```json +```json [settings] "languages": { "C": { "format_on_save": "off", @@ -2568,7 +2566,7 @@ These values take in the same options as the root-level settings with the same n - Setting: `language_models` - Default: -```json +```json [settings] { "language_models": { "anthropic": { @@ -2601,7 +2599,7 @@ Configuration for various AI model providers including API URLs and authenticati 1. Short format: -```json +```json [settings] { "line_indicator_format": "short" } @@ -2609,7 +2607,7 @@ Configuration for various AI model providers including API URLs and authenticati 2. Long format: -```json +```json [settings] { "line_indicator_format": "long" } @@ -2665,7 +2663,7 @@ Positive `integer` values or `null` for unlimited tabs 1. Maps to `Alt` on Linux and Windows and to `Option` on macOS: -```json +```json [settings] { "multi_cursor_modifier": "alt" } @@ -2673,7 +2671,7 @@ Positive `integer` values or `null` for unlimited tabs 2. Maps `Control` on Linux and Windows and to `Command` on macOS: -```json +```json [settings] { "multi_cursor_modifier": "cmd_or_ctrl" // alias: "cmd", "ctrl" } @@ -2685,7 +2683,7 @@ Positive `integer` values or `null` for unlimited tabs - Setting: `node` - Default: -```json +```json [settings] { "node": { "ignore_system_version": false, @@ -2726,7 +2724,7 @@ By default no proxy will be used, or Zed will attempt to retrieve proxy settings For example, to set an `http` proxy, add the following to your settings: -```json +```json [settings] { "proxy": "http://127.0.0.1:10809" } @@ -2734,7 +2732,7 @@ For example, to set an `http` proxy, add the following to your settings: Or to set a `socks5` proxy: -```json +```json [settings] { "proxy": "socks5h://localhost:10808" } @@ -2752,7 +2750,7 @@ If you wish to exclude certain hosts from using the proxy, set the `NO_PROXY` en 1. Use platform default behavior: -```json +```json [settings] { "on_last_window_closed": "platform_default" } @@ -2760,7 +2758,7 @@ If you wish to exclude certain hosts from using the proxy, set the `NO_PROXY` en 2. Always quit the application: -```json +```json [settings] { "on_last_window_closed": "quit_app" } @@ -2776,7 +2774,7 @@ If you wish to exclude certain hosts from using the proxy, set the `NO_PROXY` en Configuration object for defining settings profiles. Example: -```json +```json [settings] { "profiles": { "presentation": { @@ -2803,7 +2801,7 @@ Configuration object for defining settings profiles. Example: - Setting: `preview_tabs` - Default: -```json +```json [settings] "preview_tabs": { "enabled": true, "enable_preview_from_file_finder": false, @@ -2861,7 +2859,7 @@ Configuration object for defining settings profiles. Example: 1. Split upward: -```json +```json [settings] { "pane_split_direction_horizontal": "up" } @@ -2869,7 +2867,7 @@ Configuration object for defining settings profiles. Example: 2. Split downward: -```json +```json [settings] { "pane_split_direction_horizontal": "down" } @@ -2885,7 +2883,7 @@ Configuration object for defining settings profiles. Example: 1. Split to the left: -```json +```json [settings] { "pane_split_direction_vertical": "left" } @@ -2893,7 +2891,7 @@ Configuration object for defining settings profiles. Example: 2. Split to the right: -```json +```json [settings] { "pane_split_direction_vertical": "right" } @@ -3003,7 +3001,7 @@ List of strings containing any combination of: 1. Restore all workspaces that were open when quitting Zed: -```json +```json [settings] { "restore_on_startup": "last_session" } @@ -3011,7 +3009,7 @@ List of strings containing any combination of: 2. Restore the workspace that was closed last: -```json +```json [settings] { "restore_on_startup": "last_workspace" } @@ -3019,7 +3017,7 @@ List of strings containing any combination of: 3. Always start with an empty editor: -```json +```json [settings] { "restore_on_startup": "none" } @@ -3035,7 +3033,7 @@ List of strings containing any combination of: 1. Scroll one page beyond the last line by one page: -```json +```json [settings] { "scroll_beyond_last_line": "one_page" } @@ -3043,7 +3041,7 @@ List of strings containing any combination of: 2. The editor will scroll beyond the last line by the same amount of lines as `vertical_scroll_margin`: -```json +```json [settings] { "scroll_beyond_last_line": "vertical_scroll_margin" } @@ -3051,7 +3049,7 @@ List of strings containing any combination of: 3. The editor will not scroll beyond the last line: -```json +```json [settings] { "scroll_beyond_last_line": "off" } @@ -3107,7 +3105,7 @@ Non-negative `integer` values - Setting: `search` - Default: -```json +```json [settings] "search": { "whole_word": false, "case_sensitive": false, @@ -3166,7 +3164,7 @@ Examples: - Setting: `completions` - Default: -```json +```json [settings] { "completions": { "words": "fallback", @@ -3283,12 +3281,13 @@ Positive integer values - Setting: `whitespace_map` - Default: -```json +```json [settings] { "whitespace_map": { "space": "•", "tab": "→" - }, + } +} ``` ## Soft Wrap @@ -3381,7 +3380,7 @@ List of `integer` column numbers - Setting: `tasks` - Default: -```json +```json [settings] { "tasks": { "variables": {}, @@ -3403,7 +3402,7 @@ List of `integer` column numbers - Setting: `telemetry` - Default: -```json +```json [settings] "telemetry": { "diagnostics": true, "metrics": true @@ -3438,7 +3437,7 @@ List of `integer` column numbers - Setting: `terminal` - Default: -```json +```json [settings] { "terminal": { "alternate_scroll": "off", @@ -3494,7 +3493,7 @@ List of `integer` column numbers 1. Default alternate scroll mode to off -```json +```json [settings] { "terminal": { "alternate_scroll": "off" @@ -3504,7 +3503,7 @@ List of `integer` column numbers 2. Default alternate scroll mode to on -```json +```json [settings] { "terminal": { "alternate_scroll": "on" @@ -3522,7 +3521,7 @@ List of `integer` column numbers 1. Never blink the cursor, ignore the terminal mode -```json +```json [settings] { "terminal": { "blinking": "off" @@ -3532,7 +3531,7 @@ List of `integer` column numbers 2. Default the cursor blink to off, but allow the terminal to turn blinking on -```json +```json [settings] { "terminal": { "blinking": "terminal_controlled" @@ -3542,7 +3541,7 @@ List of `integer` column numbers 3. Always blink the cursor, ignore the terminal mode -```json +```json [settings] { "terminal": { "blinking": "on" @@ -3562,7 +3561,7 @@ List of `integer` column numbers **Example** -```json +```json [settings] { "terminal": { "copy_on_select": true @@ -3580,7 +3579,7 @@ List of `integer` column numbers 1. A block that surrounds the following character -```json +```json [settings] { "terminal": { "cursor_shape": "block" @@ -3590,7 +3589,7 @@ List of `integer` column numbers 2. A vertical bar -```json +```json [settings] { "terminal": { "cursor_shape": "bar" @@ -3600,7 +3599,7 @@ List of `integer` column numbers 3. An underline / underscore that runs along the following character -```json +```json [settings] { "terminal": { "cursor_shape": "underline" @@ -3610,7 +3609,7 @@ List of `integer` column numbers 4. A box drawn around the following character -```json +```json [settings] { "terminal": { "cursor_shape": "hollow" @@ -3630,7 +3629,7 @@ List of `integer` column numbers **Example** -```json +```json [settings] { "terminal": { "keep_selection_on_copy": false @@ -3646,7 +3645,7 @@ List of `integer` column numbers **Example** -```json +```json [settings] { "terminal": { "env": { @@ -3667,7 +3666,7 @@ List of `integer` column numbers `integer` values -```json +```json [settings] { "terminal": { "font_size": 15 @@ -3685,7 +3684,7 @@ List of `integer` column numbers The name of any font family installed on the user's system -```json +```json [settings] { "terminal": { "font_family": "Berkeley Mono" @@ -3704,7 +3703,7 @@ The name of any font family installed on the user's system See Buffer Font Features -```json +```json [settings] { "terminal": { "font_features": { @@ -3725,7 +3724,7 @@ See Buffer Font Features 1. Use a line height that's `comfortable` for reading, 1.618. -```json +```json [settings] { "terminal": { "line_height": "comfortable" @@ -3735,7 +3734,7 @@ See Buffer Font Features 2. Use a `standard` line height, 1.3. This option is useful for TUIs, particularly if they use box characters. (default) -```json +```json [settings] { "terminal": { "line_height": "standard" @@ -3745,7 +3744,7 @@ See Buffer Font Features 3. Use a custom line height. -```json +```json [settings] { "terminal": { "line_height": { @@ -3771,7 +3770,7 @@ See Buffer Font Features - `75`: Minimum for body text - `90`: Preferred for body text -```json +```json [settings] { "terminal": { "minimum_contrast": 45 @@ -3789,7 +3788,7 @@ See Buffer Font Features `boolean` values -```json +```json [settings] { "terminal": { "option_as_meta": true @@ -3807,7 +3806,7 @@ See Buffer Font Features 1. Use the system's default terminal configuration (usually the `/etc/passwd` file). -```json +```json [settings] { "terminal": { "shell": "system" @@ -3817,7 +3816,7 @@ See Buffer Font Features 2. A program to launch: -```json +```json [settings] { "terminal": { "shell": { @@ -3829,7 +3828,7 @@ See Buffer Font Features 3. A program with arguments: -```json +```json [settings] { "terminal": { "shell": { @@ -3848,7 +3847,7 @@ See Buffer Font Features - Setting: `detect_venv` - Default: -```json +```json [settings] { "terminal": { "detect_venv": { @@ -3867,7 +3866,7 @@ See Buffer Font Features Disable with: -```json +```json [settings] { "terminal": { "detect_venv": "off" @@ -3881,7 +3880,7 @@ Disable with: - Setting: `toolbar` - Default: -```json +```json [settings] { "terminal": { "toolbar": { @@ -3911,7 +3910,7 @@ Example command to set the title: `echo -e "\e]2;New Title\007";` `boolean` values -```json +```json [settings] { "terminal": { "button": false @@ -3929,7 +3928,7 @@ Example command to set the title: `echo -e "\e]2;New Title\007";` 1. Use the current file's project directory. Will Fallback to the first project directory strategy if unsuccessful -```json +```json [settings] { "terminal": { "working_directory": "current_project_directory" @@ -3939,7 +3938,7 @@ Example command to set the title: `echo -e "\e]2;New Title\007";` 2. Use the first project in this workspace's directory. Will fallback to using this platform's home directory. -```json +```json [settings] { "terminal": { "working_directory": "first_project_directory" @@ -3949,7 +3948,7 @@ Example command to set the title: `echo -e "\e]2;New Title\007";` 3. Always use this platform's home directory (if we can find it) -```json +```json [settings] { "terminal": { "working_directory": "always_home" @@ -3959,7 +3958,7 @@ Example command to set the title: `echo -e "\e]2;New Title\007";` 4. Always use a specific directory. This value will be shell expanded. If this path is not a valid directory the terminal will default to this platform's home directory. -```json +```json [settings] { "terminal": { "working_directory": { @@ -3977,7 +3976,7 @@ Example command to set the title: `echo -e "\e]2;New Title\007";` - Setting: `repl` - Default: -```json +```json [settings] "repl": { // Maximum number of columns to keep in REPL's scrollback buffer. // Clamped with [20, 512] range. @@ -4000,7 +3999,7 @@ Example command to set the title: `echo -e "\e]2;New Title\007";` - Setting: `theme` - Default: -```json +```json [settings] "theme": { "mode": "system", "dark": "One Dark", @@ -4018,7 +4017,7 @@ Example command to set the title: `echo -e "\e]2;New Title\007";` 1. Set the theme to dark mode -```json +```json [settings] { "mode": "dark" } @@ -4026,7 +4025,7 @@ Example command to set the title: `echo -e "\e]2;New Title\007";` 2. Set the theme to light mode -```json +```json [settings] { "mode": "light" } @@ -4034,7 +4033,7 @@ Example command to set the title: `echo -e "\e]2;New Title\007";` 3. Set the theme to system mode -```json +```json [settings] { "mode": "system" } @@ -4066,7 +4065,7 @@ Run the {#action theme_selector::Toggle} action in the command palette to see a - Setting: `title_bar` - Default: -```json +```json [settings] "title_bar": { "show_branch_icon": false, "show_branch_name": true, @@ -4104,7 +4103,7 @@ Run the {#action theme_selector::Toggle} action in the command palette to see a 1. Use platform default behavior: -```json +```json [settings] { "when_closing_with_no_tabs": "platform_default" } @@ -4112,7 +4111,7 @@ Run the {#action theme_selector::Toggle} action in the command palette to see a 2. Always close the window: -```json +```json [settings] { "when_closing_with_no_tabs": "close_window" } @@ -4120,7 +4119,7 @@ Run the {#action theme_selector::Toggle} action in the command palette to see a 3. Never close the window: -```json +```json [settings] { "when_closing_with_no_tabs": "keep_window_open" } @@ -4132,7 +4131,7 @@ Run the {#action theme_selector::Toggle} action in the command palette to see a - Setting: `project_panel` - Default: -```json +```json [settings] { "project_panel": { "button": true, @@ -4170,7 +4169,7 @@ Run the {#action theme_selector::Toggle} action in the command palette to see a 1. Default dock position to left -```json +```json [settings] { "dock": "left" } @@ -4178,7 +4177,7 @@ Run the {#action theme_selector::Toggle} action in the command palette to see a 2. Default dock position to right -```json +```json [settings] { "dock": "right" } @@ -4194,7 +4193,7 @@ Run the {#action theme_selector::Toggle} action in the command palette to see a 1. Comfortable entry spacing -```json +```json [settings] { "entry_spacing": "comfortable" } @@ -4202,7 +4201,7 @@ Run the {#action theme_selector::Toggle} action in the command palette to see a 2. Standard entry spacing -```json +```json [settings] { "entry_spacing": "standard" } @@ -4218,7 +4217,7 @@ Run the {#action theme_selector::Toggle} action in the command palette to see a 1. Default enable git status -```json +```json [settings] { "git_status": true } @@ -4226,7 +4225,7 @@ Run the {#action theme_selector::Toggle} action in the command palette to see a 2. Default disable git status -```json +```json [settings] { "git_status": false } @@ -4252,7 +4251,7 @@ Run the {#action theme_selector::Toggle} action in the command palette to see a 1. Enable auto reveal entries -```json +```json [settings] { "auto_reveal_entries": true } @@ -4260,7 +4259,7 @@ Run the {#action theme_selector::Toggle} action in the command palette to see a 2. Disable auto reveal entries -```json +```json [settings] { "auto_reveal_entries": false } @@ -4276,7 +4275,7 @@ Run the {#action theme_selector::Toggle} action in the command palette to see a 1. Enable auto fold dirs -```json +```json [settings] { "auto_fold_dirs": true } @@ -4284,7 +4283,7 @@ Run the {#action theme_selector::Toggle} action in the command palette to see a 2. Disable auto fold dirs -```json +```json [settings] { "auto_fold_dirs": false } @@ -4302,7 +4301,7 @@ Run the {#action theme_selector::Toggle} action in the command palette to see a - Setting: `indent_guides` - Default: -```json +```json [settings] "indent_guides": { "show": "always" } @@ -4312,7 +4311,7 @@ Run the {#action theme_selector::Toggle} action in the command palette to see a 1. Show indent guides in the project panel -```json +```json [settings] { "indent_guides": { "show": "always" @@ -4322,7 +4321,7 @@ Run the {#action theme_selector::Toggle} action in the command palette to see a 2. Hide indent guides in the project panel -```json +```json [settings] { "indent_guides": { "show": "never" @@ -4336,7 +4335,7 @@ Run the {#action theme_selector::Toggle} action in the command palette to see a - Setting: `scrollbar` - Default: -```json +```json [settings] "scrollbar": { "show": null } @@ -4346,7 +4345,7 @@ Run the {#action theme_selector::Toggle} action in the command palette to see a 1. Show scrollbar in the project panel -```json +```json [settings] { "scrollbar": { "show": "always" @@ -4356,7 +4355,7 @@ Run the {#action theme_selector::Toggle} action in the command palette to see a 2. Hide scrollbar in the project panel -```json +```json [settings] { "scrollbar": { "show": "never" @@ -4374,7 +4373,7 @@ Visit [the Configuration page](./ai/configuration.md) under the AI section to le - Setting: `collaboration_panel` - Default: -```json +```json [settings] { "collaboration_panel": { "button": true, @@ -4396,7 +4395,7 @@ Visit [the Configuration page](./ai/configuration.md) under the AI section to le - Setting: `debugger` - Default: -```json +```json [settings] { "debugger": { "stepping_granularity": "line", @@ -4415,7 +4414,7 @@ See the [debugger page](./debugger.md) for more information about debugging supp - Setting: `git_panel` - Default: -```json +```json [settings] { "git_panel": { "button": true, @@ -4449,7 +4448,7 @@ See the [debugger page](./debugger.md) for more information about debugging supp - Setting: `outline_panel` - Default: -```json +```json [settings] "outline_panel": { "button": true, "default_width": 300, @@ -4475,7 +4474,7 @@ See the [debugger page](./debugger.md) for more information about debugging supp - Setting: `calls` - Default: -```json +```json [settings] "calls": { // Join calls with the microphone live by default "mute_on_join": false, @@ -4499,7 +4498,7 @@ Float values between `0.0` and `0.9`, where: **Example** -```json +```json [settings] { "unnecessary_code_fade": 0.5 } @@ -4521,7 +4520,7 @@ The name of any font family installed on the system, `".ZedSans"` to use the Zed - Setting: `ui_font_features` - Default: -```json +```json [settings] "ui_font_features": { "calt": false } @@ -4535,7 +4534,7 @@ Zed supports all OpenType features that can be enabled or disabled for a given U For example, to disable font ligatures, add the following to your settings: -```json +```json [settings] { "ui_font_features": { "calt": false @@ -4545,7 +4544,7 @@ For example, to disable font ligatures, add the following to your settings: You can also set other OpenType features, like setting `cv01` to `7`: -```json +```json [settings] { "ui_font_features": { "cv01": 7 @@ -4564,7 +4563,7 @@ You can also set other OpenType features, like setting `cv01` to `7`: For example, to use `Nerd Font` as a fallback, add the following to your settings: -```json +```json [settings] { "ui_font_fallbacks": ["Nerd Font"] } @@ -4592,7 +4591,7 @@ For example, to use `Nerd Font` as a fallback, add the following to your setting ## An example configuration: -```json +```json [settings] // ~/.config/zed/settings.json { "theme": "cave-light", @@ -4613,7 +4612,8 @@ For example, to use `Nerd Font` as a fallback, add the following to your setting }, "languages": { "C": { - "format_on_save": "language_server", + "format_on_save": "on", + "formatter": "language_server", "preferred_line_length": 64, "soft_wrap": "preferred_line_length" } diff --git a/docs/src/debugger.md b/docs/src/debugger.md index eef828123345a19d0fdec07ae4dcf656212317cc..88d5dc78f165bd7f631b0ca69c46418979df15d7 100644 --- a/docs/src/debugger.md +++ b/docs/src/debugger.md @@ -37,7 +37,7 @@ You can open the same modal by clicking the "plus" button at the top right of th For languages that don't provide preconfigured debug tasks (this includes C, C++, and some extension-supported languages), you can define debug configurations in the `.zed/debug.json` file in your project root. This file should be an array of configuration objects: -```json +```json [debug] [ { "adapter": "CodeLLDB", @@ -70,7 +70,7 @@ Compared to launching, attaching to an existing process might seem inferior, but While configuration fields are debug adapter-dependent, most adapters support the following fields: -```json +```json [debug] [ { // The label for the debug configuration and used to identify the debug session inside the debug panel & new process modal @@ -95,7 +95,7 @@ All configuration fields support [task variables](./tasks.md#variables). Zed also allows embedding a Zed task in a `build` field that is run before the debugger starts. This is useful for setting up the environment or running any necessary setup steps before the debugger starts. -```json +```json [debug] [ { "label": "Build Binary", @@ -112,7 +112,7 @@ Zed also allows embedding a Zed task in a `build` field that is run before the d Build tasks can also refer to the existing tasks by unsubstituted label: -```json +```json [debug] [ { "label": "Build Binary", @@ -169,7 +169,7 @@ The settings for the debugger are grouped under the `debugger` key in `settings. 2. `right` - The debug panel will be docked to the right side of the UI. 3. `bottom` - The debug panel will be docked to the bottom of the UI. -```json +```json [settings] "debugger": { "dock": "bottom" }, @@ -187,7 +187,7 @@ The settings for the debugger are grouped under the `debugger` key in `settings. The meaning of a statement is determined by the adapter and it may be considered equivalent to a line. For example 'for(int i = 0; i < 10; i++)' could be considered to have 3 statements 'int i = 0', 'i < 10', and 'i++'. -```json +```json [settings] { "debugger": { "stepping_granularity": "statement" @@ -197,7 +197,7 @@ The settings for the debugger are grouped under the `debugger` key in `settings. 2. Line - The step should allow the program to run until the current source line has executed. -```json +```json [settings] { "debugger": { "stepping_granularity": "line" @@ -207,7 +207,7 @@ The settings for the debugger are grouped under the `debugger` key in `settings. 3. Instruction - The step should allow one instruction to execute (e.g. one x86 instruction). -```json +```json [settings] { "debugger": { "stepping_granularity": "instruction" @@ -225,7 +225,7 @@ The settings for the debugger are grouped under the `debugger` key in `settings. `boolean` values -```json +```json [settings] { "debugger": { "save_breakpoints": true @@ -243,7 +243,7 @@ The settings for the debugger are grouped under the `debugger` key in `settings. `boolean` values -```json +```json [settings] { "debugger": { "show_button": true @@ -261,7 +261,7 @@ The settings for the debugger are grouped under the `debugger` key in `settings. `integer` values -```json +```json [settings] { "debugger": { "timeout": 3000 @@ -277,7 +277,7 @@ The settings for the debugger are grouped under the `debugger` key in `settings. **Options** -```json +```json [settings] { "inlay_hints": { "show_value_hints": false @@ -297,7 +297,7 @@ Inline value hints can also be toggled from the Editor Controls menu in the edit `boolean` values -```json +```json [settings] { "debugger": { "log_dap_communications": true @@ -315,7 +315,7 @@ Inline value hints can also be toggled from the Editor Controls menu in the edit `boolean` values -```json +```json [settings] { "debugger": { "format_dap_log_messages": true @@ -331,7 +331,7 @@ Inline value hints can also be toggled from the Editor Controls menu in the edit You can pass `binary`, `args`, or both. `binary` should be a path to a _debug adapter_ (like `lldb-dap`) not a _debugger_ (like `lldb` itself). The `args` setting overrides any arguments that Zed would otherwise pass to the adapter. -```json +```json [settings] { "dap": { "CodeLLDB": { diff --git a/docs/src/development/local-collaboration.md b/docs/src/development/local-collaboration.md index 87363a4269ac32ac39598efef640b80384d1f44a..393c6f0bbf797cf9aa86d297633734444bdfb328 100644 --- a/docs/src/development/local-collaboration.md +++ b/docs/src/development/local-collaboration.md @@ -106,7 +106,7 @@ cat crates/collab/seed.default.json To use a different set of admin users, you can create your own version of that json file and export the `SEED_PATH` environment variable. Note that the usernames listed in the admins list currently must correspond to valid GitHub users. -```json +```json [settings] { "admins": ["admin1", "admin2"], "channels": ["zed"] @@ -196,7 +196,7 @@ By default Zed assumes that the DATABASE_URL is a Postgres database, but you can To authenticate you must first configure the server by creating a seed.json file that contains at a minimum your github handle. This will be used to create the user on demand. -```json +```json [settings] { "admins": ["nathansobo"] } diff --git a/docs/src/development/windows.md b/docs/src/development/windows.md index ccbc17b708b0d4691d69eea56279cc295d2c48da..17382e0bee5b97c2ffc2d74794cf3881a3cb98a1 100644 --- a/docs/src/development/windows.md +++ b/docs/src/development/windows.md @@ -18,7 +18,7 @@ Clone down the [Zed repository](https://github.com/zed-industries/zed). If you can't compile Zed, make sure that you have at least the following components installed in case of a Visual Studio installation: -```json +```json [settings] { "version": "1.0", "components": [ @@ -36,7 +36,7 @@ If you can't compile Zed, make sure that you have at least the following compone Or if in case of just Build Tools, the following components: -```json +```json [settings] { "version": "1.0", "components": [ diff --git a/docs/src/diagnostics.md b/docs/src/diagnostics.md index 9603c8197cf7ef473da027a51fa0db64d0b9b8e9..47cc586008deba55b9fd9fdab8fffd829a519a0e 100644 --- a/docs/src/diagnostics.md +++ b/docs/src/diagnostics.md @@ -8,7 +8,7 @@ By default, Zed displays all diagnostics as underlined text in the editor and th Editor diagnostics could be filtered with the -```json5 +```json [settings] "diagnostics_max_severity": null ``` @@ -16,7 +16,7 @@ editor setting (possible values: `"off"`, `"error"`, `"warning"`, `"info"`, `"hi The scrollbar ones are configured with the -```json5 +```json [settings] "scrollbar": { "diagnostics": "all", } @@ -32,7 +32,7 @@ Or, `editor::GoToDiagnostic` and `editor::GoToPreviousDiagnostic` could be used Zed supports showing diagnostic as lens to the right of the code. This is disabled by default, but can either be temporarily turned on (or off) using the editor menu, or permanently, using the -```json5 +```json [settings] "diagnostics": { "inline": { "enabled": true, @@ -49,7 +49,7 @@ Project panel can have its entries coloured based on the severity of the diagnos To configure, use -```json5 +```json [settings] "project_panel": { "show_diagnostics": "all", } @@ -61,7 +61,7 @@ configuration (possible values: `"off"`, `"errors"`, `"all"` (default)) Similar to the project panel, editor tabs can be colorized with the -```json5 +```json [settings] "tabs": { "show_diagnostics": "off", } diff --git a/docs/src/extensions/icon-themes.md b/docs/src/extensions/icon-themes.md index a76f03d068bb04fb0262d3f9309871a3a1c352d5..697723a59677c25dd14982a1c7f7cf92d1950a70 100644 --- a/docs/src/extensions/icon-themes.md +++ b/docs/src/extensions/icon-themes.md @@ -17,7 +17,7 @@ Each icon theme file should adhere to the JSON schema specified at [`https://zed Here is an example of the structure of an icon theme: -```json +```json [icon-theme] { "$schema": "https://zed.dev/schema/icon_themes/v0.3.0.json", "name": "My Icon Theme", @@ -34,8 +34,8 @@ Here is an example of the structure of an icon theme: "stylesheets": { "collapsed": "./icons/folder-stylesheets.svg", "expanded": "./icons/folder-stylesheets-open.svg" - }, - } + } + }, "chevron_icons": { "collapsed": "./icons/chevron-right.svg", "expanded": "./icons/chevron-down.svg" diff --git a/docs/src/git.md b/docs/src/git.md index f40040bec83226b19c17d9efdaf9241032dca7a5..c18ce1d2bbf958f0f5988c9179fd7ff4276615cc 100644 --- a/docs/src/git.md +++ b/docs/src/git.md @@ -83,7 +83,7 @@ You can ask AI to generate a commit message by focusing on the message editor wi You can specify your preferred model to use by providing a `commit_message_model` agent setting. See [Feature-specific models](./ai/agent-settings.md#feature-specific-models) for more information. -```json +```json [settings] { "agent": { "version": "2", diff --git a/docs/src/globs.md b/docs/src/globs.md index 4039d7c4556e24d0fb3ca30eafe8be05d13875bc..60873e6965493c0c089a329e89fdb6462999739f 100644 --- a/docs/src/globs.md +++ b/docs/src/globs.md @@ -57,7 +57,7 @@ When using the "Include" / "Exclude" filters on a Project Search each glob is wr Alternatively, if in your Zed settings you wanted a [`file_types`](./configuring-zed.md#file-types) override which only applied to a certain directory you must explicitly include the wildcard globs. For example, if you had a directory of template files with the `html` extension that you wanted to recognize as Jinja2 template you could use the following: -```json +```json [settings] { "file_types": { "C++": ["[cC]"], diff --git a/docs/src/icon-themes.md b/docs/src/icon-themes.md index 70dd1267aca0630050292dbea61baeabd13b0cf4..b3c449889cbbc53da216ea668cd309e9ae1bfe5b 100644 --- a/docs/src/icon-themes.md +++ b/docs/src/icon-themes.md @@ -18,7 +18,7 @@ Your selected icon theme is stored in your settings file. You can open your sett Just like with themes, Zed allows for configuring different icon themes for light and dark mode. You can set the mode to `"light"` or `"dark"` to ignore the current system mode. -```json +```json [settings] { "icon_theme": { "mode": "system", diff --git a/docs/src/key-bindings.md b/docs/src/key-bindings.md index 306396c73cfc2fab555ce85b223c56a56dd10fa0..cf3acf82b8e665fac5e499c8a9c57f5fb24b9cde 100644 --- a/docs/src/key-bindings.md +++ b/docs/src/key-bindings.md @@ -34,7 +34,7 @@ If you are using a non-QWERTY, Latin-character keyboard, you may want to set `us For example: -```json +```json [keymap] [ { "bindings": { @@ -72,7 +72,7 @@ The keys can be any single Unicode codepoint that your keyboard generates (for e A few examples: -```json +```json [settings] "bindings": { "cmd-k cmd-s": "zed::OpenKeymap", // matches ⌘-k then ⌘-s "space e": "editor::Complete", // type space then e @@ -161,7 +161,7 @@ On keyboards that support extended Latin alphabets (French AZERTY, German QWERTZ If you are defining shortcuts in your personal keymap, you can opt into the key equivalent mapping by setting `use_key_equivalents` to `true` in your keymap: -```json +```json [keymap] [ { "use_key_equivalents": true, @@ -187,7 +187,7 @@ If you'd like a given binding to do nothing in a given context, you can use want to disable it, or if you want to type the character that would be typed by the sequence, or if you want to disable multikey bindings starting with that key. -```json +```json [keymap] [ { "context": "Workspace", @@ -202,7 +202,7 @@ A `null` binding follows the same precedence rules as normal actions, so it disa This is useful for preventing Zed from falling back to a default key binding when the action you specified is conditional and propagates. For example, `buffer_search::DeployReplace` only triggers when the search bar is not in view. If the search bar is in view, it would propagate and trigger the default action set for that key binding, such as opening the right dock. To prevent this from happening: -```json +```json [keymap] [ { "context": "Workspace", @@ -223,7 +223,7 @@ This is useful for preventing Zed from falling back to a default key binding whe A common request is to be able to map from a single keystroke to a sequence. You can do this with the `workspace::SendKeystrokes` action. -```json +```json [keymap] [ { "bindings": { @@ -262,7 +262,7 @@ If you're on Linux or Windows, you might find yourself wanting to forward key co For example, `ctrl-n` creates a new tab in Zed on Linux. If you want to send `ctrl-n` to the built-in terminal when it's focused, add the following to your keymap: -```json +```json [settings] { "context": "Terminal", "bindings": { diff --git a/docs/src/languages/ansible.md b/docs/src/languages/ansible.md index 16b6cef5abffd59072140c0be19c317160f8c582..bce25ddc6c35f83517bbe26d27dc3d6b1bfa524e 100644 --- a/docs/src/languages/ansible.md +++ b/docs/src/languages/ansible.md @@ -11,7 +11,7 @@ Support for Ansible in Zed is provided via a community-maintained [Ansible exten To avoid mishandling non-Ansible YAML files, the Ansible Language is not associated with any file extensions by default. To change this behavior you can add a `"file_types"` section to Zed settings inside your project (`.zed/settings.json`) or your Zed user settings (`~/.config/zed/settings.json`) to match your folder/naming conventions. For example: -```json +```json [settings] "file_types": { "Ansible": [ "**.ansible.yml", @@ -50,7 +50,7 @@ If your inventory file is in the YAML format, you can either: - Or configure the yaml language server settings to set this schema for all your inventory files, that match your inventory pattern, under your Zed settings ([ref](https://zed.dev/docs/languages/yaml)): -```json +```json [settings] "lsp": { "yaml-language-server": { "settings": { @@ -71,7 +71,7 @@ If your inventory file is in the YAML format, you can either: By default, the following default config is passed to the Ansible language server. It conveniently mirrors the defaults set by [nvim-lspconfig](https://github.com/neovim/nvim-lspconfig/blob/03bc581e05e81d33808b42b2d7e76d70adb3b595/lua/lspconfig/configs/ansiblels.lua) for the Ansible language server: -```json +```json [settings] { "ansible": { "ansible": { @@ -99,7 +99,7 @@ By default, the following default config is passed to the Ansible language serve When desired, any of the above default settings can be overridden under the `"lsp"` section of your Zed settings file. For example: -```json +```json [settings] "lsp": { // Note, the Zed Ansible extension prefixes all settings with `ansible` // so instead of using `ansible.ansible.path` use `ansible.path`. diff --git a/docs/src/languages/biome.md b/docs/src/languages/biome.md index 4632d56d82aa3416e1bbe124b7e7900dc3035533..f0756fe5badd6080a2437dcdf8311427d6b8f0bb 100644 --- a/docs/src/languages/biome.md +++ b/docs/src/languages/biome.md @@ -24,7 +24,7 @@ The Biome extension includes support for the following languages: By default, the `biome.json` file is required to be in the root of the workspace. -```json +```json [settings] { "$schema": "https://biomejs.dev/schemas/1.8.3/schema.json" } diff --git a/docs/src/languages/c.md b/docs/src/languages/c.md index 849ce6a662e291659d27d05deea3aa95f51b0161..ca84cd54de02c86721c7ca92022b53fffb8ce97f 100644 --- a/docs/src/languages/c.md +++ b/docs/src/languages/c.md @@ -17,7 +17,7 @@ CompileFlags: By default clang and gcc will recognize `*.C` and `*.H` (uppercase extensions) as C++ and not C and so Zed too follows this convention. If you are working with a C-only project (perhaps one with legacy uppercase pathing like `FILENAME.C`) you can override this behavior by adding this to your settings: -```json +```json [settings] { "file_types": { "C": ["C", "H"] @@ -40,7 +40,7 @@ See [Clang-Format Style Options](https://clang.llvm.org/docs/ClangFormatStyleOpt You can trigger formatting via {#kb editor::Format} or the `editor: format` action from the command palette or by adding `format_on_save` to your Zed settings: -```json +```json [settings] "languages": { "C": { "format_on_save": "on", @@ -69,7 +69,7 @@ You can use CodeLLDB or GDB to debug native binaries. (Make sure that your build ### Build and Debug Binary -```json +```json [debug] [ { "label": "Debug native binary", diff --git a/docs/src/languages/cpp.md b/docs/src/languages/cpp.md index fe2eb9c1f911bc2457862d2d94d6d489cb1b3d49..ce4c163cf9d310e114c30c63e228b39aefe3e82c 100644 --- a/docs/src/languages/cpp.md +++ b/docs/src/languages/cpp.md @@ -13,7 +13,7 @@ By default, Zed will try to find a `clangd` in your `$PATH` and try to use that. If you want to install a pre-release `clangd` version instead you can instruct Zed to do so by setting `pre_release` to `true` in your `settings.json`: -```json +```json [settings] { "lsp": { "clangd": { @@ -27,7 +27,7 @@ If you want to install a pre-release `clangd` version instead you can instruct Z If you want to disable Zed looking for a `clangd` binary, you can set `ignore_system_version` to `true` in your `settings.json`: -```json +```json [settings] { "lsp": { "clangd": { @@ -41,7 +41,7 @@ If you want to disable Zed looking for a `clangd` binary, you can set `ignore_sy If you want to use a binary in a custom location, you can specify a `path` and optional `arguments`: -```json +```json [settings] { "lsp": { "clangd": { @@ -60,7 +60,7 @@ This `"path"` has to be an absolute path. You can pass any number of arguments to clangd. To see a full set of available options, run `clangd --help` from the command line. For example with `--function-arg-placeholders=0` completions contain only parentheses for function calls, while the default (`--function-arg-placeholders=1`) completions also contain placeholders for method parameters. -```json +```json [settings] { "lsp": { "clangd": { @@ -93,7 +93,7 @@ See [Clang-Format Style Options](https://clang.llvm.org/docs/ClangFormatStyleOpt You can trigger formatting via {#kb editor::Format} or the `editor: format` action from the command palette or by adding `format_on_save` to your Zed settings: -```json +```json [settings] "languages": { "C++": { "format_on_save": "on", @@ -137,7 +137,7 @@ You can use CodeLLDB or GDB to debug native binaries. (Make sure that your build ### Build and Debug Binary -```json +```json [debug] [ { "label": "Debug native binary", diff --git a/docs/src/languages/csharp.md b/docs/src/languages/csharp.md index b422e0941b5dc8cd67028c96eaad0d6249ab45c3..e7a702c19053219c37c56887954c393396e7abca 100644 --- a/docs/src/languages/csharp.md +++ b/docs/src/languages/csharp.md @@ -11,7 +11,7 @@ C# support is available through the [C# extension](https://github.com/zed-extens The `OmniSharp` binary can be configured in a Zed settings file with: -```json +```json [settings] { "lsp": { "omnisharp": { diff --git a/docs/src/languages/dart.md b/docs/src/languages/dart.md index 14760a46ad9e7cadeb3649050c5c953871782baa..20f8a1d23018ada2e0b4779447eebbed119299b8 100644 --- a/docs/src/languages/dart.md +++ b/docs/src/languages/dart.md @@ -22,7 +22,7 @@ dart --version If you would like to use a specific dart binary or use dart via FVM you can specify the `dart` binary in your Zed settings.jsons file: -```json +```json [settings] { "lsp": { "dart": { @@ -39,7 +39,7 @@ If you would like to use a specific dart binary or use dart via FVM you can spec Dart by-default uses a very conservative maximum line length (80). If you would like the dart LSP to permit a longer line length when auto-formatting, add the following to your Zed settings.json: -```json +```json [settings] { "lsp": { "dart": { diff --git a/docs/src/languages/deno.md b/docs/src/languages/deno.md index b2ef5a3565002047819110a253be292b5c592a93..a5aea4c07c047fde40d9537899bf3e35aeecd87c 100644 --- a/docs/src/languages/deno.md +++ b/docs/src/languages/deno.md @@ -8,7 +8,7 @@ Deno support is available through the [Deno extension](https://github.com/zed-ex To use the Deno Language Server with TypeScript and TSX files, you will likely wish to disable the default language servers and enable deno by adding the following to your `settings.json`: -```json +```json [settings] { "lsp": { "deno": { @@ -61,7 +61,7 @@ TBD: Deno TypeScript REPL instructions [docs/repl#typescript-deno](../repl.md#ty To get completions for `deno.json` or `package.json` you can add the following to your `settings.json`: (More info here https://zed.dev/docs/languages/json) -```json +```json [settings] "lsp": { "json-language-server": { "settings": { @@ -90,7 +90,7 @@ To get completions for `deno.json` or `package.json` you can add the following t To debug deno programs, add this to `.zed/debug.json` -```json +```json [debug] [ { "adapter": "JavaScript", @@ -110,7 +110,7 @@ To debug deno programs, add this to `.zed/debug.json` To run deno tasks like tests from the ui, add this to `.zed/tasks.json` -```json +```json [tasks] [ { "label": "deno test", diff --git a/docs/src/languages/diff.md b/docs/src/languages/diff.md index 3f8162962260a6c061e5d900d92e8b4b7cee1608..a089b975e7b420cf195a66dc114d267b6dd07a04 100644 --- a/docs/src/languages/diff.md +++ b/docs/src/languages/diff.md @@ -10,7 +10,7 @@ Zed will not attempt to format diff files and has [`remove_trailing_whitespace_o Zed will automatically recognize files with `patch` and `diff` extensions as Diff files. To recognize other extensions, add them to `file_types` in your Zed settings.json: -```json +```json [settings] "file_types": { "Diff": ["dif"] }, diff --git a/docs/src/languages/elixir.md b/docs/src/languages/elixir.md index b09653b7ff6972a0c9a92d496648302efa7db593..3df116492ae097f30e7da041a2643e085570f61c 100644 --- a/docs/src/languages/elixir.md +++ b/docs/src/languages/elixir.md @@ -21,7 +21,7 @@ The Elixir extension offers language server support for `expert`, `elixir-ls`, ` To switch to `expert`, add the following to your `settings.json`: -```json +```json [settings] "languages": { "Elixir": { "language_servers": ["expert", "!elixir-ls", "!next-ls", "!lexical", "..."] @@ -36,7 +36,7 @@ To switch to `expert`, add the following to your `settings.json`: To switch to `next-ls`, add the following to your `settings.json`: -```json +```json [settings] "languages": { "Elixir": { "language_servers": ["next-ls", "!expert", "!elixir-ls", "!lexical", "..."] @@ -51,7 +51,7 @@ To switch to `next-ls`, add the following to your `settings.json`: To switch to `lexical`, add the following to your `settings.json`: -```json +```json [settings] "languages": { "Elixir": { "language_servers": ["lexical", "!expert", "!elixir-ls", "!next-ls", "..."] @@ -84,11 +84,12 @@ brew install elixir-ls If you prefer to format your code with [Mix](https://hexdocs.pm/mix/Mix.html), use the following snippet in your `settings.json` file to configure it as an external formatter. Formatting will occur on file save. -```json +```json [settings] { "languages": { "Elixir": { - "format_on_save": { + "format_on_save": "on", + "formatter": { "external": { "command": "mix", "arguments": ["format", "--stdin-filename", "{buffer_path}", "-"] @@ -105,7 +106,7 @@ You can pass additional elixir-ls workspace configuration options via lsp settin The following example disables dialyzer: -```json +```json [settings] "lsp": { "elixir-ls": { "settings": { diff --git a/docs/src/languages/elm.md b/docs/src/languages/elm.md index ae9a4c1ffc53a4bd203c5f7dacb8e0bdce754606..3a18af05bb4c4008057d3fd813808c1cc3b61b70 100644 --- a/docs/src/languages/elm.md +++ b/docs/src/languages/elm.md @@ -23,7 +23,7 @@ Zed support for Elm requires installation of `elm`, `elm-format`, and `elm-revie Elm language server can be configured in your `settings.json`, e.g.: -```json +```json [settings] { "lsp": { "elm-language-server": { diff --git a/docs/src/languages/erlang.md b/docs/src/languages/erlang.md index e82e6d48c36ed627cda9031272754802380e967f..b3850fc55ee522d3bd2b8f5dda1af13b83135eb2 100644 --- a/docs/src/languages/erlang.md +++ b/docs/src/languages/erlang.md @@ -15,7 +15,7 @@ The Erlang extension offers language server support for `erlang_ls` and `erlang- To switch to `erlang-language-platform`, add the following to your `settings.json`: -```json +```json [settings] { "languages": { "Erlang": { diff --git a/docs/src/languages/fish.md b/docs/src/languages/fish.md index ad2148d807baeb73241206ab5538ddaffdc789ce..6c07d444b849ec92d73bf702e64e6f6323754e95 100644 --- a/docs/src/languages/fish.md +++ b/docs/src/languages/fish.md @@ -18,7 +18,7 @@ fish_indent --version 2. Configure Zed to automatically format fish code with `fish_indent`: -```json +```json [settings] "languages": { "Fish": { "formatter": { diff --git a/docs/src/languages/go.md b/docs/src/languages/go.md index 0a12616b1c7dda9eb416717aa16bfeb5f50748d4..d8125953f42b96bfcff69998bb6ce60cbb655a0f 100644 --- a/docs/src/languages/go.md +++ b/docs/src/languages/go.md @@ -41,7 +41,7 @@ If `gopls` is not found you will likely need to add `export PATH="$PATH:$HOME/go Zed sets the following initialization options for inlay hints: -```json +```json [settings] "hints": { "assignVariableTypes": true, "compositeLiteralFields": true, @@ -57,12 +57,12 @@ to make the language server send back inlay hints when Zed has them enabled in t Use -```json +```json [settings] "lsp": { "gopls": { "initialization_options": { "hints": { - .... + // .... } } } @@ -83,7 +83,7 @@ For more control, you can add debug configurations to `.zed/debug.json`. See bel To debug a specific package, you can do so by setting the Delve mode to "debug". In this case "program" should be set to the package name. -```json +```json [debug] [ { "label": "Go (Delve)", @@ -110,7 +110,7 @@ To debug a specific package, you can do so by setting the Delve mode to "debug". To debug the tests for a package, set the Delve mode to "test". The "program" is still the package name, and you can use the "buildFlags" to do things like set tags, and the "args" to set args on the test binary. (See `go help testflags` for more information on doing that). -```json +```json [debug] [ { "label": "Run integration tests", @@ -130,7 +130,7 @@ The "program" is still the package name, and you can use the "buildFlags" to do If you need to build your application with a specific command, you can use the "exec" mode of Delve. In this case "program" should point to an executable, and the "build" command should build that. -```json +```json [debug] [ { "label": "Debug Prebuilt Unit Tests", @@ -160,7 +160,7 @@ and the "build" command should build that. You might find yourself needing to connect to an existing instance of Delve that's not necessarily running on your machine; in such case, you can use `tcp_arguments` to instrument Zed's connection to Delve. -```json +```json [debug] [ { "adapter": "Delve", @@ -172,7 +172,7 @@ You might find yourself needing to connect to an existing instance of Delve that "request": "launch", "mode": "exec", "stopOnEntry": false, - "tcp_connection": { "host": "123.456.789.012", "port": 53412 } + "tcp_connection": { "host": "127.0.0.1", "port": 53412 } } ] ``` diff --git a/docs/src/languages/haskell.md b/docs/src/languages/haskell.md index fec9142a5f8e8a4414452b4109ae22c003169646..901bd9ded1954931df37ea3f912573bc849317db 100644 --- a/docs/src/languages/haskell.md +++ b/docs/src/languages/haskell.md @@ -19,7 +19,7 @@ which haskell-language-server-wrapper If you need to configure haskell-language-server (hls) you can add configuration options to your Zed settings.json: -```json +```json [settings] { "lsp": { "hls": { @@ -37,7 +37,7 @@ See the official [configuring haskell-language-server](https://haskell-language- If you would like to use a specific hls binary, or perhaps use [static-ls](https://github.com/josephsumabat/static-ls) as a drop-in replacement instead, you can specify the binary path and arguments: -```json +```json [settings] { "lsp": { "hls": { diff --git a/docs/src/languages/helm.md b/docs/src/languages/helm.md index a6e3c8fa49b9056fb9d053790a3f3f656087d366..f8a6f5c5fa736e0e4de3d4d9bfc33f28bec95dbc 100644 --- a/docs/src/languages/helm.md +++ b/docs/src/languages/helm.md @@ -9,7 +9,7 @@ Support for Helm in Zed is provided by the community-maintained [Helm extension] Enable Helm language for Helm files by editing your `.zed/settings.json` and adding: -```json +```json [settings] "file_types": { "Helm": [ "**/templates/**/*.tpl", diff --git a/docs/src/languages/html.md b/docs/src/languages/html.md index 3afa34068d9f9902595e6835951d07fe31de11ca..274083adee504f68852895b3e66c4f7b78ecdfff 100644 --- a/docs/src/languages/html.md +++ b/docs/src/languages/html.md @@ -7,7 +7,7 @@ HTML support is available through the [HTML extension](https://github.com/zed-in This extension is automatically installed, but if you do not want to use it, you can add the following to your settings: -```json +```json [settings] { "auto_install_extensions": { "html": false @@ -21,7 +21,7 @@ By default Zed uses [Prettier](https://prettier.io/) for formatting HTML. You can disable `format_on_save` by adding the following to your Zed `settings.json`: -```json +```json [settings] "languages": { "HTML": { "format_on_save": "off", @@ -35,7 +35,7 @@ You can still trigger formatting manually with {#kb editor::Format} or by openin To use the `vscode-html-language-server` language server auto-formatting instead of Prettier, add the following to your Zed settings: -```json +```json [settings] "languages": { "HTML": { "formatter": "language_server", @@ -45,7 +45,7 @@ To use the `vscode-html-language-server` language server auto-formatting instead You can customize various [formatting options](https://code.visualstudio.com/docs/languages/html#_formatting) for `vscode-html-language-server` via your Zed `settings.json`: -```json +```json [settings] "lsp": { "vscode-html-language-server": { "settings": { diff --git a/docs/src/languages/java.md b/docs/src/languages/java.md index 31177676854884be804838ddf72f937fc9376f71..966f2352b3955e9ed2574eab34a717dc14832d3d 100644 --- a/docs/src/languages/java.md +++ b/docs/src/languages/java.md @@ -31,7 +31,7 @@ You can add these customizations to your Zed Settings by launching {#action zed: ### Zed Java Settings -```json +```json [settings] { "lsp": { "jdtls": { @@ -47,7 +47,7 @@ You can add these customizations to your Zed Settings by launching {#action zed: By default, zed will look in your `PATH` for a `jdtls` binary, if you wish to specify an explicit binary you can do so via settings: -```json +```json [settings] "lsp": { "jdtls": { "binary": { @@ -64,7 +64,7 @@ By default, zed will look in your `PATH` for a `jdtls` binary, if you wish to sp There are also many more options you can pass directly to the language server, for example: -```json +```json [settings] { "lsp": { "jdtls": { diff --git a/docs/src/languages/javascript.md b/docs/src/languages/javascript.md index 9901708f333bdce8b65e338873f0e611b4e28f87..8926e5c3736f0c8fa5b3ed6bc5b1b7d34ce15cd6 100644 --- a/docs/src/languages/javascript.md +++ b/docs/src/languages/javascript.md @@ -15,7 +15,7 @@ See [the configuration docs](../configuring-zed.md) for more information. For example, if you have Prettier installed and on your `PATH`, you can use it to format JavaScript files by adding the following to your `settings.json`: -```json +```json [settings] { "languages": { "JavaScript": { @@ -45,7 +45,7 @@ Zed uses [tree-sitter/tree-sitter-jsdoc](https://github.com/tree-sitter/tree-sit You can configure Zed to format code using `eslint --fix` by running the ESLint code action when formatting: -```json +```json [settings] { "languages": { "JavaScript": { @@ -59,7 +59,7 @@ You can configure Zed to format code using `eslint --fix` by running the ESLint You can also only execute a single ESLint rule when using `fixAll`: -```json +```json [settings] { "languages": { "JavaScript": { @@ -88,14 +88,12 @@ You can also only execute a single ESLint rule when using `fixAll`: If you **only** want to run ESLint on save, you can configure code actions as the formatter: -```json +```json [settings] { "languages": { "JavaScript": { "formatter": { - "code_actions": { - "source.fixAll.eslint": true - } + "code_action": "source.fixAll.eslint" } } } @@ -106,7 +104,7 @@ the formatter: You can configure ESLint's `nodePath` setting: -```json +```json [settings] { "lsp": { "eslint": { @@ -124,7 +122,7 @@ You can configure ESLint's `problems` setting. For example, here's how to set `problems.shortenToSingleLine`: -```json +```json [settings] { "lsp": { "eslint": { @@ -142,7 +140,7 @@ For example, here's how to set `problems.shortenToSingleLine`: You can configure ESLint's `rulesCustomizations` setting: -```json +```json [settings] { "lsp": { "eslint": { @@ -161,7 +159,7 @@ You can configure ESLint's `rulesCustomizations` setting: You can configure ESLint's `workingDirectory` setting: -```json +```json [settings] { "lsp": { "eslint": { @@ -191,7 +189,7 @@ If your use-case isn't covered by any of these, you can take full control by add ### Debug the current file -```json +```json [debug] [ { "adapter": "JavaScript", @@ -208,7 +206,7 @@ This implicitly runs the current file using `node`. ### Launch a web app in Chrome -```json +```json [debug] [ { "adapter": "JavaScript", diff --git a/docs/src/languages/json.md b/docs/src/languages/json.md index 94f56999d51a3e2395f481be67d267172ba07075..33acdb172e40f0d94a3517dadb70efb37a50e635 100644 --- a/docs/src/languages/json.md +++ b/docs/src/languages/json.md @@ -16,7 +16,7 @@ If you use files with the `*.jsonc` extension when using `Format Document` or ha To workaround this behavior you can add the following to your `.prettierrc` configuration file: -```json +```json [settings] { "overrides": [ { @@ -40,7 +40,7 @@ To specify a schema inline with your JSON files, add a `$schema` top level key l For example to for a `.luarc.json` for use with [lua-language-server](https://github.com/LuaLS/lua-language-server/): -```json +```json [settings] { "$schema": "https://raw.githubusercontent.com/sumneko/vscode-lua/master/setting/schema.json", "runtime.version": "Lua 5.4" @@ -53,7 +53,7 @@ You can alternatively associate JSON Schemas with file paths by via Zed LSP sett To -```json +```json [settings] "lsp": { "json-language-server": { "settings": { diff --git a/docs/src/languages/jsonnet.md b/docs/src/languages/jsonnet.md index df4e39b98dc87deff5c56c0a51bf120c81055aa4..405087766b33d3cfe126bfd98c04cff9989cb857 100644 --- a/docs/src/languages/jsonnet.md +++ b/docs/src/languages/jsonnet.md @@ -11,7 +11,7 @@ Workspace configuration options can be passed to the language server via the `ls The following example enables support for resolving [tanka](https://tanka.dev) import paths in `jsonnet-language-server`: -```json +```json [settings] { "lsp": { "jsonnet-language-server": { diff --git a/docs/src/languages/kotlin.md b/docs/src/languages/kotlin.md index 60d66f277eb62c2bdf9905687045abbca4db20b9..a81643ab7d5a20b8985a6bfb3e23d214077c5d6b 100644 --- a/docs/src/languages/kotlin.md +++ b/docs/src/languages/kotlin.md @@ -20,7 +20,7 @@ under `class Configuration` and initialization_options under `class Initializati The following example changes the JVM target from `default` (which is 1.8) to `17`: -```json +```json [settings] { "lsp": { "kotlin-language-server": { @@ -40,7 +40,7 @@ The following example changes the JVM target from `default` (which is 1.8) to To use a specific java installation, just specify the `JAVA_HOME` environment variable with: -```json +```json [settings] { "lsp": { "kotlin-language-server": { diff --git a/docs/src/languages/lua.md b/docs/src/languages/lua.md index 7e92b12b919ef2537b0fa6785a6438ef0039deda..65b709b39188753a29a50119f04b6141ad12d849 100644 --- a/docs/src/languages/lua.md +++ b/docs/src/languages/lua.md @@ -9,7 +9,7 @@ Lua support is available through the [Lua extension](https://github.com/zed-exte To configure LuaLS you can create a `.luarc.json` file in the root of your workspace. -```json +```json [settings] { "$schema": "https://raw.githubusercontent.com/LuaLS/vscode-lua/master/setting/schema.json", "runtime.version": "Lua 5.4", @@ -55,7 +55,7 @@ cd .. && git clone https://github.com/notpeter/playdate-luacats Then in your `.luarc.json`: -```json +```json [settings] { "$schema": "https://raw.githubusercontent.com/LuaLS/vscode-lua/master/setting/schema.json", "runtime.version": "Lua 5.4", @@ -90,7 +90,7 @@ To enable [Inlay Hints](../configuring-languages.md#inlay-hints) for LuaLS in Ze 1. Add the following to your Zed settings.json: -```json +```json [settings] "languages": { "Lua": { "inlay_hints": { @@ -111,7 +111,7 @@ To enable [Inlay Hints](../configuring-languages.md#inlay-hints) for LuaLS in Ze To enable auto-formatting with your LuaLS (provided by [CppCXY/EmmyLuaCodeStyle](https://github.com/CppCXY/EmmyLuaCodeStyle)) make sure you have `"format.enable": true,` in your .luarc.json: -```json +```json [settings] { "$schema": "https://raw.githubusercontent.com/sumneko/vscode-lua/master/setting/schema.json", "format.enable": true @@ -120,7 +120,7 @@ To enable auto-formatting with your LuaLS (provided by [CppCXY/EmmyLuaCodeStyle] Then add the following to your Zed `settings.json`: -```json +```json [settings] { "languages": { "Lua": { @@ -140,7 +140,7 @@ Alternatively to use [StyLua](https://github.com/JohnnyMorganz/StyLua) for auto- 1. Install [StyLua](https://github.com/JohnnyMorganz/StyLua): `brew install stylua` or `cargo install stylua --features lua52,lua53,lua54,luau,luajit` (feel free to remove any Lua versions you don't need). 2. Add the following to your `settings.json`: -```json +```json [settings] { "languages": { "Lua": { diff --git a/docs/src/languages/luau.md b/docs/src/languages/luau.md index 58d78855a1afdb4ab782aff888ba0bbfb637a364..b99cfc86ac1ea7eb0e0f85a3091e2fc76725fed4 100644 --- a/docs/src/languages/luau.md +++ b/docs/src/languages/luau.md @@ -27,7 +27,7 @@ cargo install stylua --features lua52,lua53,lua54,luau Then add the following to your Zed `settings.json`: -```json +```json [settings] "languages": { "Luau": { "formatter": { diff --git a/docs/src/languages/markdown.md b/docs/src/languages/markdown.md index 38a2b1c43f94b91097bcd0b1dc3301427e1b9685..36ce734f7cfbcc066bb8026568209738655a6be9 100644 --- a/docs/src/languages/markdown.md +++ b/docs/src/languages/markdown.md @@ -25,7 +25,7 @@ def fib(n): Zed supports using Prettier to automatically re-format Markdown documents. You can trigger this manually via the {#action editor::Format} action or via the {#kb editor::Format} keyboard shortcut. Alternately, you can automatically format by enabling [`format_on_save`](../configuring-zed.md#format-on-save) in your settings.json: -```json +```json [settings] "languages": { "Markdown": { "format_on_save": "on" @@ -37,7 +37,7 @@ Zed supports using Prettier to automatically re-format Markdown documents. You c By default Zed will remove trailing whitespace on save. If you rely on invisible trailing whitespace being converted to `
` in Markdown files you can disable this behavior with: -```json +```json [settings] "languages": { "Markdown": { "remove_trailing_whitespace_on_save": false diff --git a/docs/src/languages/nim.md b/docs/src/languages/nim.md index 514810183cf63d5e478bacaf4b61a85fc168cb80..03c2bc0609698eee620ba80a8c82e13f53d6764d 100644 --- a/docs/src/languages/nim.md +++ b/docs/src/languages/nim.md @@ -10,7 +10,7 @@ Report issues to: [https://github.com/foxoman/zed-nim/issues](https://github.com To use [arnetheduck/nph](https://github.com/arnetheduck/nph) as a formatter, follow the [nph installation instructions](https://github.com/arnetheduck/nph?tab=readme-ov-file#installation) and add this to your Zed `settings.json`: -```json +```json [settings] "languages": { "Nim": { "formatter": { diff --git a/docs/src/languages/php.md b/docs/src/languages/php.md index 4e94c134467c5a3484ede7a2146f2f09c172e859..40c7f9a838e0435b952b25bb0072153ac2fcf4ec 100644 --- a/docs/src/languages/php.md +++ b/docs/src/languages/php.md @@ -31,7 +31,7 @@ which php To switch to `intelephense`, add the following to your `settings.json`: -```json +```json [settings] { "languages": { "PHP": { @@ -43,7 +43,7 @@ To switch to `intelephense`, add the following to your `settings.json`: To use the premium features, you can place your [licence.txt file](https://intelephense.com/faq.html) at `~/intelephense/licence.txt` inside your home directory. Alternatively, you can pass the licence key or a path to a file containing the licence key as an initialization option for the `intelephense` language server. To do this, add the following to your `settings.json`: -```json +```json [settings] { "lsp": { "intelephense": { diff --git a/docs/src/languages/powershell.md b/docs/src/languages/powershell.md index d4d706425663c494e66ce0c18d8bf801d94cf910..195ce4ad36ddfb9ddea2e3a759bb7c4ae695d7f1 100644 --- a/docs/src/languages/powershell.md +++ b/docs/src/languages/powershell.md @@ -24,7 +24,7 @@ The Zed PowerShell extensions will attempt to download [PowerShell Editor Servic If want to use a specific binary, you can specify in your that in your Zed settings.json: -```json +```json [settings] "lsp": { "powershell-es": { "binary": { diff --git a/docs/src/languages/proto.md b/docs/src/languages/proto.md index d8feaf4c42f49d17af0135f8876a90ee01bf8679..8d9b8350faa366f3981ab945ff3ffca344fa8c70 100644 --- a/docs/src/languages/proto.md +++ b/docs/src/languages/proto.md @@ -30,7 +30,7 @@ which protols ## Configuration -```json +```json [settings] "lsp": { "protobuf-language-server": { "binary": { @@ -62,7 +62,7 @@ ColumnLimit: 120 Or you can have zed directly invoke `clang-format` by specifying it as a [formatter](https://zed.dev/docs/configuring-zed#formatter) in your settings: -```json +```json [settings] "languages": { "Proto": { "format_on_save": "on", diff --git a/docs/src/languages/python.md b/docs/src/languages/python.md index 98eca1fcc9d43747aaf45085db5ed831f8d0b25f..c9e9cbcdbe1c35ab1d415bf1fd00151c1548a4dc 100644 --- a/docs/src/languages/python.md +++ b/docs/src/languages/python.md @@ -77,7 +77,7 @@ Other built-in language servers are: These are disabled by default, but can be enabled in your settings. For example: -```json +```json [settings] { "languages": { "Python": { @@ -123,7 +123,7 @@ For example, in order to: You can use the following configuration: -```json +```json [settings] { "lsp": { "basedpyright": { @@ -144,7 +144,7 @@ basedpyright reads project-specific configuration from the `pyrightconfig.json` Here's an example `pyrightconfig.json` file that configures basedpyright to use the `strict` type-checking mode and not to issue diagnostics for any files in `__pycache__` directories: -```json +```json [settings] { "typeCheckingMode": "strict", "ignore": ["**/__pycache__"] @@ -194,7 +194,7 @@ Zed provides the [Ruff](https://docs.astral.sh/ruff/) formatter and linter for P You can disable format-on-save for Python files in your `settings.json`: -```json +```json [settings] { "languages": { "Python": { @@ -206,7 +206,7 @@ You can disable format-on-save for Python files in your `settings.json`: Alternatively, you can use the `black` command-line tool for Python formatting, while keeping Ruff enabled for linting: -```json +```json [settings] { "languages": { "Python": { @@ -228,7 +228,7 @@ Like basedpyright, Ruff reads options from both Zed's language server settings a Here's an example of using language server settings in Zed's `settings.json` to disable all Ruff lints in Zed (while still using Ruff as a formatter): -```json +```json [settings] { "lsp": { "ruff": { @@ -277,7 +277,7 @@ For reusable setups, create a `.zed/debug.json` file in your project root. This #### Debug Active File -```json +```json [debug] [ { "label": "Python Active File", @@ -309,7 +309,7 @@ requirements.txt …the following configuration can be used: -```json +```json [debug] [ { "label": "Python: Flask", diff --git a/docs/src/languages/r.md b/docs/src/languages/r.md index 226a6f866846da43a3f32668dd19e1efb3f657ce..4907d09c5e5daaa32d081ff0da618f5b26cd577b 100644 --- a/docs/src/languages/r.md +++ b/docs/src/languages/r.md @@ -72,7 +72,7 @@ You can configure the [R languageserver settings](https://github.com/REditorSupp For example to disable Lintr linting and suppress code snippet suggestions (both enabled by default): -```json +```json [settings] { "lsp": { "r_language_server": { diff --git a/docs/src/languages/ruby.md b/docs/src/languages/ruby.md index 87210def30ca967da9cdd1a7314961520278adf3..1bed46fe4f2521b02ecd1a15d852253e85f0ef54 100644 --- a/docs/src/languages/ruby.md +++ b/docs/src/languages/ruby.md @@ -46,7 +46,7 @@ For all supported Ruby language servers (`solargraph`, `ruby-lsp`, `rubocop`, `s You can skip step 1 and force using the system executable by setting `use_bundler` to `false` in your settings: -```json +```json [settings] { "lsp": { "": { @@ -66,7 +66,7 @@ You can skip step 1 and force using the system executable by setting `use_bundle To switch to `ruby-lsp`, add the following to your `settings.json`: -```json +```json [settings] { "languages": { "Ruby": { @@ -84,7 +84,7 @@ The Ruby extension also provides support for `rubocop` language server for offen To enable it, add the following to your `settings.json`: -```json +```json [settings] { "languages": { "Ruby": { @@ -96,7 +96,7 @@ To enable it, add the following to your `settings.json`: Or, conversely, you can disable `ruby-lsp` and enable `solargraph` and `rubocop` by adding the following to your `settings.json`: -```json +```json [settings] { "languages": { "Ruby": { @@ -110,7 +110,7 @@ Or, conversely, you can disable `ruby-lsp` and enable `solargraph` and `rubocop` Solargraph has formatting and diagnostics disabled by default. We can tell Zed to enable them by adding the following to your `settings.json`: -```json +```json [settings] { "lsp": { "solargraph": { @@ -131,7 +131,7 @@ Solargraph reads its configuration from a file called `.solargraph.yml` in the r You can pass Ruby LSP configuration to `initialization_options`, e.g. -```json +```json [settings] { "languages": { "Ruby": { @@ -152,7 +152,7 @@ You can pass Ruby LSP configuration to `initialization_options`, e.g. LSP `settings` and `initialization_options` can also be project-specific. For example to use [standardrb/standard](https://github.com/standardrb/standard) as a formatter and linter for a particular project, add this to a `.zed/settings.json` inside your project repo: -```json +```json [settings] { "lsp": { "ruby-lsp": { @@ -169,7 +169,7 @@ LSP `settings` and `initialization_options` can also be project-specific. For ex Rubocop has unsafe autocorrection disabled by default. We can tell Zed to enable it by adding the following to your `settings.json`: -```json +```json [settings] { "languages": { "Ruby": { @@ -200,7 +200,7 @@ Rubocop has unsafe autocorrection disabled by default. We can tell Zed to enable To enable Sorbet, add `\"sorbet\"` to the `language_servers` list for Ruby in your `settings.json`. You may want to disable other language servers if Sorbet is intended to be your primary LSP, or if you plan to use it alongside another LSP for specific features like type checking. -```json +```json [settings] { "languages": { "Ruby": { @@ -224,7 +224,7 @@ For all aspects of installing Sorbet, setting it up in your project, and configu To enable Steep, add `\"steep\"` to the `language_servers` list for Ruby in your `settings.json`. You may need to adjust the order or disable other LSPs depending on your desired setup. -```json +```json [settings] { "languages": { "Ruby": { @@ -250,7 +250,7 @@ It's possible to use the [Tailwind CSS Language Server](https://github.com/tailw In order to do that, you need to configure the language server so that it knows about where to look for CSS classes in Ruby/ERB files by adding the following to your `settings.json`: -```json +```json [settings] { "languages": { "Ruby": { @@ -294,7 +294,7 @@ To run tests in your Ruby project, you can set up custom tasks in your local `.z ### Minitest with Rails -```json +```json [tasks] [ { "label": "test $ZED_RELATIVE_FILE -n /$ZED_CUSTOM_RUBY_TEST_NAME/", @@ -315,7 +315,7 @@ To run tests in your Ruby project, you can set up custom tasks in your local `.z Plain minitest does not support running tests by line number, only by name, so we need to use `$ZED_CUSTOM_RUBY_TEST_NAME` instead: -```json +```json [tasks] [ { "label": "-Itest $ZED_RELATIVE_FILE -n /$ZED_CUSTOM_RUBY_TEST_NAME/", @@ -336,7 +336,7 @@ Plain minitest does not support running tests by line number, only by name, so w ### RSpec -```json +```json [tasks] [ { "label": "test $ZED_RELATIVE_FILE:$ZED_ROW", @@ -358,7 +358,7 @@ The Ruby extension provides a debug adapter for debugging Ruby code. Zed's name #### Debug a Ruby script -```json +```json [debug] [ { "label": "Debug current file", @@ -372,7 +372,7 @@ The Ruby extension provides a debug adapter for debugging Ruby code. Zed's name #### Debug Rails server -```json +```json [debug] [ { "label": "Debug Rails server", @@ -394,15 +394,15 @@ The Ruby extension provides a debug adapter for debugging Ruby code. Zed's name To format ERB templates, you can use the `erb-formatter` formatter. This formatter uses the [`erb-formatter`](https://rubygems.org/gems/erb-formatter) gem to format ERB templates. -```jsonc +```json [settings] { "HTML+ERB": { "formatter": { "external": { "command": "erb-formatter", - "arguments": ["--stdin-filename", "{buffer_path}"], - }, - }, - }, + "arguments": ["--stdin-filename", "{buffer_path}"] + } + } + } } ``` diff --git a/docs/src/languages/rust.md b/docs/src/languages/rust.md index 359af7737161a8dff388b0ef849183504fe29207..3d4fe3f8eeb3801a3b87b5c5d0c0c5028f30786b 100644 --- a/docs/src/languages/rust.md +++ b/docs/src/languages/rust.md @@ -16,7 +16,7 @@ TBD: Provide explicit examples not just `....` The following configuration can be used to change the inlay hint settings for `rust-analyzer` in Rust: -```json +```json [settings] { "lsp": { "rust-analyzer": { @@ -43,7 +43,7 @@ See [Inlay Hints](https://rust-analyzer.github.io/book/features.html#inlay-hints The `rust-analyzer` target directory can be set in `initialization_options`: -```json +```json [settings] { "lsp": { "rust-analyzer": { @@ -67,7 +67,7 @@ By default, Zed will try to find a `rust-analyzer` in your `$PATH` and try to us If you want to install pre-release `rust-analyzer` version instead you can instruct Zed to do so by setting `pre_release` to `true` in your `settings.json`: -```json +```json [settings] { "lsp": { "rust-analyzer": { @@ -81,7 +81,7 @@ If you want to install pre-release `rust-analyzer` version instead you can instr If you want to disable Zed looking for a `rust-analyzer` binary, you can set `ignore_system_version` to `true` in your `settings.json`: -```json +```json [settings] { "lsp": { "rust-analyzer": { @@ -95,7 +95,7 @@ If you want to disable Zed looking for a `rust-analyzer` binary, you can set `ig If you want to use a binary in a custom location, you can specify a `path` and optional `arguments`: -```json +```json [settings] { "lsp": { "rust-analyzer": { @@ -114,7 +114,7 @@ This `"path"` has to be an absolute path. If you want rust-analyzer to provide diagnostics for a target other than your current platform (e.g. for windows when running on macOS) you can use the following Zed lsp settings: -```json +```json [settings] { "lsp": { "rust-analyzer": { @@ -139,7 +139,7 @@ rustup target list --installed Zed provides tasks using tree-sitter, but rust-analyzer has an LSP extension method for querying file-related tasks via LSP. This is enabled by default and can be configured as -```json +```json [settings] "lsp": { "rust-analyzer": { "enable_lsp_tasks": true, @@ -191,7 +191,7 @@ Check on save feature is responsible for returning part of the diagnostics based Consider more `rust-analyzer.cargo.` and `rust-analyzer.check.` and `rust-analyzer.diagnostics.` settings from the manual for more fine-grained configuration. Here's a snippet for Zed settings.json (the language server will restart automatically after the `lsp.rust-analyzer` section is edited and saved): -```json +```json [settings] { "lsp": { "rust-analyzer": { @@ -225,7 +225,7 @@ Here's a snippet for Zed settings.json (the language server will restart automat If you want rust-analyzer to analyze multiple Rust projects in the same folder that are not listed in `[members]` in the Cargo workspace, you can list them in `linkedProjects` in the local project settings: -```json +```json [settings] { "lsp": { "rust-analyzer": { @@ -241,7 +241,7 @@ you can list them in `linkedProjects` in the local project settings: There's a way to get custom completion items from rust-analyzer, that will transform the code according to the snippet body: -```json +```json [settings] { "lsp": { "rust-analyzer": { @@ -300,7 +300,7 @@ For more control, you can add debug configurations to `.zed/debug.json`. See the ### Build binary then debug -```json +```json [debug] [ { "label": "Build & Debug native binary", @@ -321,7 +321,7 @@ For more control, you can add debug configurations to `.zed/debug.json`. See the When you use `cargo build` or `cargo test` as the build command, Zed can infer the path to the output binary. -```json +```json [debug] [ { "label": "Build & Debug native binary", diff --git a/docs/src/languages/sh.md b/docs/src/languages/sh.md index abc8f03a6c051d9484052aad3ea0e453d9fb4fdc..cf88c89bfa29fd12390640a64cb4826678cfa9f5 100644 --- a/docs/src/languages/sh.md +++ b/docs/src/languages/sh.md @@ -8,7 +8,7 @@ Shell Scripts (bash, zsh, dash, sh) are supported natively by Zed. You can configure various settings for Shell Scripts in your Zed User Settings (`~/.config/zed/settings.json`) or Zed Project Settings (`.zed/settings.json`): -```json +```json [settings] "languages": { "Shell Script": { "tab_size": 2, @@ -41,7 +41,7 @@ shfmt --version 3. Configure Zed to automatically format Shell Scripts with `shfmt` on save: -```json +```json [settings] "languages": { "Shell Script": { "format_on_save": "on", diff --git a/docs/src/languages/sql.md b/docs/src/languages/sql.md index 7993450a04c788494116bbd259af84c12d9b0dfc..fd257c9ab0924db9bbc3ffc596a5992ead0dc211 100644 --- a/docs/src/languages/sql.md +++ b/docs/src/languages/sql.md @@ -23,7 +23,7 @@ sql-formatter --version 3. Configure Zed to automatically format SQL with `sql-formatter`: -```json +```json [settings] "languages": { "SQL": { "formatter": { @@ -44,7 +44,7 @@ You can add this to Zed project settings (`.zed/settings.json`) or via your Zed Sql-formatter also allows more precise control by providing [sql-formatter configuration options](https://github.com/sql-formatter-org/sql-formatter#configuration-options). To provide these, create a `.sql-formatter.json` file in your project: -```json +```json [settings] { "language": "postgresql", "tabWidth": 2, @@ -55,7 +55,7 @@ Sql-formatter also allows more precise control by providing [sql-formatter confi When using a `.sql-formatter.json` file you can use a more simplified set of Zed settings since the language need not be specified inline: -```json +```json [settings] "languages": { "SQL": { "formatter": { diff --git a/docs/src/languages/svelte.md b/docs/src/languages/svelte.md index 66d0d0cb50611c765a751552ece6620251daf28c..139195987b1ebb4b78cc19e988c0bbbcf927fb27 100644 --- a/docs/src/languages/svelte.md +++ b/docs/src/languages/svelte.md @@ -9,7 +9,7 @@ Svelte support is available through the [Svelte extension](https://github.com/ze You can modify how certain styles, such as directives and modifiers, appear in attributes: -```json +```json [settings] "syntax": { // Styling for directives (e.g., `class:foo` or `on:click`) (the `on` or `class` part of the attribute). "attribute.function": { @@ -26,7 +26,7 @@ You can modify how certain styles, such as directives and modifiers, appear in a When inlay hints is enabled in Zed, to make the language server send them back, Zed sets the following initialization options: -```json +```json [settings] "inlayHints": { "parameterNames": { "enabled": "all", @@ -53,16 +53,16 @@ When inlay hints is enabled in Zed, to make the language server send them back, To override these settings, use the following: -```json +```json [settings] "lsp": { "svelte-language-server": { "initialization_options": { "configuration": { "typescript": { - ...... + // ...... }, "javascript": { - ...... + // ...... } } } diff --git a/docs/src/languages/swift.md b/docs/src/languages/swift.md index 9b056be5bc8869b18b78e9a2e64ea43db3d8ea90..3462083a3135930d78dec0b2b72e5942c0103b1e 100644 --- a/docs/src/languages/swift.md +++ b/docs/src/languages/swift.md @@ -22,7 +22,7 @@ The extension doesn't attempt to download `lldb-dap` if it's not found. #### Build and debug a Swift binary -```json +```json [debug] [ { "label": "Debug Swift", diff --git a/docs/src/languages/tailwindcss.md b/docs/src/languages/tailwindcss.md index 4409a12bf0dde643f60bb46ae2887c3aa48ca002..ff20d097e45eb311d49f3c118ed642c11d73e19f 100644 --- a/docs/src/languages/tailwindcss.md +++ b/docs/src/languages/tailwindcss.md @@ -8,18 +8,18 @@ Zed has built-in support for Tailwind CSS autocomplete, linting, and hover previ To configure the Tailwind CSS language server, refer [to the extension settings](https://github.com/tailwindlabs/tailwindcss-intellisense?tab=readme-ov-file#extension-settings) and add them to the `lsp` section of your `settings.json`: -```jsonc +```json [settings] { "lsp": { "tailwindcss-language-server": { "settings": { "classFunctions": ["cva", "cx"], "experimental": { - "classRegex": ["[cls|className]\\s\\:\\=\\s\"([^\"]*)"], - }, - }, - }, - }, + "classRegex": ["[cls|className]\\s\\:\\=\\s\"([^\"]*)"] + } + } + } + } } ``` @@ -40,7 +40,7 @@ Languages which can be used with Tailwind CSS in Zed: Zed supports Prettier out of the box, which means that if you have the [Tailwind CSS Prettier plugin](https://github.com/tailwindlabs/prettier-plugin-tailwindcss) installed, adding it to your Prettier configuration will make it work automatically: -```json +```json [settings] // .prettierrc { "plugins": ["prettier-plugin-tailwindcss"] diff --git a/docs/src/languages/terraform.md b/docs/src/languages/terraform.md index 401526f16952ab209c41ab9f09bb9e22785c4e40..c1ff03a83a4da8d08639bc64dc354671fd66f5cc 100644 --- a/docs/src/languages/terraform.md +++ b/docs/src/languages/terraform.md @@ -13,7 +13,7 @@ TBD: Add example using `rootModulePaths` to match upstream example https://githu The Terraform language server can be configured in your `settings.json`, e.g.: -```json +```json [settings] { "lsp": { "terraform-ls": { diff --git a/docs/src/languages/typescript.md b/docs/src/languages/typescript.md index 02d2672cb64fce1671ae487bffffd6d84523f7fc..e6ed5a83d204ae6ae14911be7c7e830b4a4ae1aa 100644 --- a/docs/src/languages/typescript.md +++ b/docs/src/languages/typescript.md @@ -16,7 +16,7 @@ TBD: Document the difference between Language servers By default Zed uses [vtsls](https://github.com/yioneko/vtsls) for TypeScript, TSX, and JavaScript files. You can configure the use of [typescript-language-server](https://github.com/typescript-language-server/typescript-language-server) per language in your settings file: -```json +```json [settings] { "languages": { "TypeScript": { @@ -34,7 +34,7 @@ You can configure the use of [typescript-language-server](https://github.com/typ Prettier will also be used for TypeScript files by default. To disable this: -```json +```json [settings] { "languages": { "TypeScript": { @@ -49,7 +49,7 @@ Prettier will also be used for TypeScript files by default. To disable this: `vtsls` may run out of memory on very large projects. We default the limit to 8092 (8 GiB) vs. the default of 3072 but this may not be sufficient for you: -```json +```json [settings] { "lsp": { "vtsls": { @@ -70,7 +70,7 @@ Zed sets the following initialization options to make the language server send b You can override these settings in your Zed `settings.json` when using `typescript-language-server`: -```json +```json [settings] { "lsp": { "typescript-language-server": { @@ -95,7 +95,7 @@ See [typescript-language-server inlayhints documentation](https://github.com/typ When using `vtsls`: -```json +```json [settings] { "lsp": { "vtsls": { @@ -174,7 +174,7 @@ If your use-case isn't covered by any of these, you can take full control by add Given an externally-ran web server (e.g., with `npx serve` or `npx live-server`) one can attach to it and open it with a browser. -```json +```json [debug] [ { "label": "Launch Chrome (TypeScript)", diff --git a/docs/src/languages/xml.md b/docs/src/languages/xml.md index 4318756a101ddd1787d825b06df9425e9b2ac5b9..df3d845d6d258caa5f16432c84fb78da3586fc19 100644 --- a/docs/src/languages/xml.md +++ b/docs/src/languages/xml.md @@ -8,7 +8,7 @@ XML support is available through the [XML extension](https://github.com/sweetppr If you have additional file extensions that are not being automatically recognized as XML just add them to [file_types](../configuring-zed.md#file-types) in your Zed settings: -```json +```json [settings] "file_types": { "XML": ["rdf", "gpx", "kml"] } diff --git a/docs/src/languages/yaml.md b/docs/src/languages/yaml.md index 68167e873430970f2a871065da740659965e2df1..e4845e363671597281cf6cd2d26721cdc1e856fb 100644 --- a/docs/src/languages/yaml.md +++ b/docs/src/languages/yaml.md @@ -9,7 +9,7 @@ YAML support is available natively in Zed. You can configure various [yaml-language-server settings](https://github.com/redhat-developer/yaml-language-server?tab=readme-ov-file#language-server-settings) by adding them to your Zed settings.json in a `yaml-language-server` block under the `lsp` key. For example: -```json +```json [settings] "lsp": { "yaml-language-server": { "settings": { @@ -38,7 +38,7 @@ By default, Zed uses Prettier for formatting YAML files. You can customize the formatting behavior of Prettier. For example to use single-quotes in yaml files add the following to your `.prettierrc` configuration file: -```json +```json [settings] { "overrides": [ { @@ -55,7 +55,7 @@ You can customize the formatting behavior of Prettier. For example to use single To use `yaml-language-server` instead of Prettier for YAML formatting, add the following to your Zed `settings.json`: -```json +```json [settings] "languages": { "YAML": { "formatter": "language_server" @@ -79,7 +79,7 @@ on: You can disable the automatic detection and retrieval of schemas from the JSON Schema if desired: -```json +```json [settings] "lsp": { "yaml-language-server": { "settings": { @@ -99,7 +99,7 @@ Yaml-language-server supports [custom tags](https://github.com/redhat-developer/ For example Amazon CloudFormation YAML uses a number of custom tags, to support these you can add the following to your settings.json: -```json +```json [settings] "lsp": { "yaml-language-server": { "settings": { diff --git a/docs/src/remote-development.md b/docs/src/remote-development.md index e597e7a6c5743f47947bba1b3a068e497ee51faa..b4d7033a3b1d2201fbf35afa096551a2e5232272 100644 --- a/docs/src/remote-development.md +++ b/docs/src/remote-development.md @@ -35,7 +35,7 @@ The remote machine must be able to run Zed's server. The following platforms sho The list of remote servers is stored in your settings file {#kb zed::OpenSettings}. You can edit this list using the Remote Projects dialog {#kb projects::OpenRemote}, which provides some robustness - for example it checks that the connection can be established before writing it to the settings file. -```json +```json [settings] { "ssh_connections": [ { @@ -48,7 +48,7 @@ The list of remote servers is stored in your settings file {#kb zed::OpenSetting Zed shells out to the `ssh` on your path, and so it will inherit any configuration you have in `~/.ssh/config` for the given host. That said, if you need to override anything you can configure the following additional options on each connection: -```json +```json [settings] { "ssh_connections": [ { @@ -66,7 +66,7 @@ Zed shells out to the `ssh` on your path, and so it will inherit any configurati There are two additional Zed-specific options per connection, `upload_binary_over_ssh` and `nickname`: -```json +```json [settings] { "ssh_connections": [ { @@ -91,7 +91,7 @@ Additionally it's worth noting that while you can pass a password on the command If you'd like to be able to connect to ports on your remote server from your local machine, you can configure port forwarding in your settings file. This is particularly useful for developing websites so you can load the site in your browser while working. -```json +```json [settings] { "ssh_connections": [ { @@ -106,7 +106,7 @@ This will cause requests from your local machine to `localhost:8080` to be forwa By default these ports are bound to localhost, so other computers in the same network as your development machine cannot access them. You can set the local_host to bind to a different interface, for example, 0.0.0.0 will bind to all local interfaces. -```json +```json [settings] { "ssh_connections": [ { @@ -125,7 +125,7 @@ By default these ports are bound to localhost, so other computers in the same ne These ports also default to the `localhost` interface on the remote host. If you need to change this, you can also set the remote host: -```json +```json [settings] { "ssh_connections": [ { diff --git a/docs/src/repl.md b/docs/src/repl.md index 92b3d81f24fd7c8c238b56f8681b0b62d0ff93c1..692093007cb066e08d52c4694444eb3e55bf2144 100644 --- a/docs/src/repl.md +++ b/docs/src/repl.md @@ -149,7 +149,7 @@ TBD: Improve Julia REPL instructions Zed automatically detects the available kernels on your system. If you need to configure a different default kernel for a language, you can assign a kernel for any supported language in your `settings.json`. -```json +```json [settings] { "jupyter": { "kernel_selections": { diff --git a/docs/src/snippets.md b/docs/src/snippets.md index 6dc5355907bec47c4bd4f86353c226201bb49586..21aed43452318863b735a9b46cd5399a8bfca1c6 100644 --- a/docs/src/snippets.md +++ b/docs/src/snippets.md @@ -6,7 +6,7 @@ The snippets are located in `~/.config/zed/snippets` directory to which you can ## Example configuration -```json +```json [settings] { // Each snippet must have a name and body, but the prefix and description are optional. // The prefix is used to trigger the snippet, but when omitted then the name is used. @@ -44,7 +44,7 @@ The `feature_paths` option in `simple-completion-language-server` is disabled by If you want to enable it you can add the following to your `settings.json`: -```json +```json [settings] { "lsp": { "snippet-completion-server": { diff --git a/docs/src/tasks.md b/docs/src/tasks.md index f2986c9951fe660efdc54e2bb984403cdb6da1cd..a11988d9a030036ccd3e2602a161771f8288b549 100644 --- a/docs/src/tasks.md +++ b/docs/src/tasks.md @@ -2,7 +2,7 @@ Zed supports ways to spawn (and rerun) commands using its integrated terminal to output the results. These commands can read a limited subset of Zed state (such as a path to the file currently being edited or selected text). -```json +```json [tasks] [ { "label": "Example task", @@ -89,7 +89,7 @@ These variables allow you to pull information from the current editor and use it To use a variable in a task, prefix it with a dollar sign (`$`): -```json +```json [settings] { "label": "echo current file's path", "command": "echo $ZED_FILE" @@ -106,7 +106,7 @@ When working with paths containing spaces or other special characters, please en For example, instead of this (which will fail if the path has a space): -```json +```json [settings] { "label": "stat current file", "command": "stat $ZED_FILE" @@ -115,7 +115,7 @@ For example, instead of this (which will fail if the path has a space): Provide the following: -```json +```json [settings] { "label": "stat current file", "command": "stat", @@ -125,7 +125,7 @@ Provide the following: Or explicitly include escaped quotes like so: -```json +```json [settings] { "label": "stat current file", "command": "stat \"$ZED_FILE\"" @@ -137,7 +137,7 @@ Or explicitly include escaped quotes like so: Task definitions with variables which are not present at the moment the task list is determined are filtered out. For example, the following task will appear in the spawn modal only if there is a text selection: -```json +```json [settings] { "label": "selected text", "command": "echo \"$ZED_SELECTED_TEXT\"" @@ -146,7 +146,7 @@ For example, the following task will appear in the spawn modal only if there is Set default values to such variables to have such tasks always displayed: -```json +```json [settings] { "label": "selected text with default", "command": "echo \"${ZED_SELECTED_TEXT:no text selected}\"" @@ -172,7 +172,7 @@ By default, tasks capture their variables into a context once, and this "resolve This can be controlled with the `"reevaluate_context"` argument to the task: setting it to `true` will force the task to be reevaluated before each run. -```json +```json [keymap] { "context": "Workspace", "bindings": { @@ -185,7 +185,7 @@ This can be controlled with the `"reevaluate_context"` argument to the task: set You can define your own keybindings for your tasks via an additional argument to `task::Spawn`. If you wanted to bind the aforementioned `echo current file's path` task to `alt-g`, you would add the following snippet in your [`keymap.json`](./key-bindings.md) file: -```json +```json [keymap] { "context": "Workspace", "bindings": { @@ -197,7 +197,7 @@ You can define your own keybindings for your tasks via an additional argument to Note that these tasks can also have a 'target' specified to control where the spawned task should show up. This could be useful for launching a terminal application that you want to use in the center area: -```json +```json [tasks] // In tasks.json { "label": "start lazygit", @@ -205,7 +205,7 @@ This could be useful for launching a terminal application that you want to use i } ``` -```json +```json [keymap] // In keymap.json { "context": "Workspace", @@ -228,7 +228,7 @@ Zed supports overriding the default action for inline runnable indicators via wo To tag a task, add the runnable tag name to the `tags` field on the task template: -```json +```json [settings] { "label": "echo current file's path", "command": "echo $ZED_FILE", diff --git a/docs/src/telemetry.md b/docs/src/telemetry.md index 46c39a88aeecfb5e8172001af67bcf30b339d984..8dca8c1ee6fc9168dd384796292ffb3063027e71 100644 --- a/docs/src/telemetry.md +++ b/docs/src/telemetry.md @@ -9,7 +9,7 @@ To enable or disable some or all telemetry types, open your `settings.json` file Insert and tweak the following: -```json +```json [settings] "telemetry": { "diagnostics": false, "metrics": false diff --git a/docs/src/themes.md b/docs/src/themes.md index 363c99f065a711634e78e3b6093b9069fa7d2c7d..c0706cbf31e39f057c47dec55365113d8ce6009c 100644 --- a/docs/src/themes.md +++ b/docs/src/themes.md @@ -20,7 +20,7 @@ Your selected theme is stored in your settings file. You can open your settings By default, Zed maintains two themes: one for light mode and one for dark mode. You can set the mode to `"dark"` or `"light"` to ignore the current system mode. -```json +```json [settings] { "theme": { "mode": "system", @@ -36,7 +36,7 @@ To override specific attributes of a theme, use the `experimental.theme_override For example, add the following to your `settings.json` if you wish to override the background color of the editor and display comments and doc comments as italics: -```json +```json [settings] { "experimental.theme_overrides": { "editor.background": "#333", diff --git a/docs/src/vim.md b/docs/src/vim.md index b62ded09896d9ec7cc1f40da262b3a57bdc5d870..4eba076b70decdd59a7b771f933a3a50bc9189e7 100644 --- a/docs/src/vim.md +++ b/docs/src/vim.md @@ -39,7 +39,7 @@ If you missed this, you can toggle vim mode on or off anytime by opening the com > **Note**: This command toggles the following property in your user settings: > -> ```json +> ```json [settings] > { > "vim_mode": true > } @@ -219,7 +219,7 @@ These text objects implement the behavior of the [mini.ai](https://github.com/ec To use these text objects, you need to add bindings to your keymap. Here's an example configuration that makes them available when using text object operators (`i` and `a`) or change-surrounds (`cs`): -```json +```json [settings] { "context": "vim_operator == a || vim_operator == i || vim_operator == cs", "bindings": { @@ -377,7 +377,7 @@ In this section, we'll learn how to customize the key bindings of Zed's vim mode Zed's key bindings are evaluated only when the `"context"` property matches your location in the editor. For example, if you add key bindings to the `"Editor"` context, they will only work when you're editing a file. If you add key bindings to the `"Workspace"` context, they will work everywhere in Zed. Here's an example of a key binding that saves when you're editing a file: -```json +```json [settings] { "context": "Editor", "bindings": { @@ -388,12 +388,12 @@ Zed's key bindings are evaluated only when the `"context"` property matches your Contexts are nested, so when you're editing a file, the context is the `"Editor"` context, which is inside the `"Pane"` context, which is inside the `"Workspace"` context. That's why any key bindings you add to the `"Workspace"` context will work when you're editing a file. Here's an example: -```json +```json [keymap] // This key binding will work when you're editing a file. It comes built into Zed by default as the workspace: save command. { "context": "Workspace", "bindings": { - "ctrl-s": "file::Save" + "ctrl-s": "workspace::Save" } } ``` @@ -419,7 +419,7 @@ Vim mode adds several contexts to the `"Editor"` context: Here's a template with useful vim mode contexts to help you customize your vim mode key bindings. You can copy it and integrate it into your user keymap. -```json +```json [keymap] [ { "context": "VimControl && !menu", @@ -458,7 +458,7 @@ By default, you can navigate between the different files open in the editor with But you cannot use the same shortcuts to move between all the editor docks (the terminal, project panel, assistant panel, ...). If you want to use the same shortcuts to navigate to the docks, you can add the following key bindings to your user keymap. -```json +```json [settings] { "context": "Dock", "bindings": { @@ -473,7 +473,7 @@ But you cannot use the same shortcuts to move between all the editor docks (the Subword motion, which allows you to navigate and select individual words in camelCase or snake_case, is not enabled by default. To enable it, add these bindings to your keymap. -```json +```json [settings] { "context": "VimControl && !menu && vim_mode != operator", "bindings": { @@ -487,7 +487,7 @@ Subword motion, which allows you to navigate and select individual words in came Vim mode comes with shortcuts to surround the selection in normal mode (`ys`), but it doesn't have a shortcut to add surrounds in visual mode. By default, `shift-s` substitutes the selection (erases the text and enters insert mode). To use `shift-s` to add surrounds in visual mode, you can add the following object to your keymap. -```json +```json [settings] { "context": "vim_mode == visual", "bindings": { @@ -498,7 +498,7 @@ Vim mode comes with shortcuts to surround the selection in normal mode (`ys`), b In non-modal text editors, cursor navigation typically wraps when moving past line ends. Zed, however, handles this behavior exactly like Vim by default: the cursor stops at line boundaries. If you prefer your cursor to wrap between lines, override these keybindings: -```json +```json [settings] // In VimScript, this would look like this: // set whichwrap+=<,>,[,],h,l { @@ -514,7 +514,7 @@ In non-modal text editors, cursor navigation typically wraps when moving past li The [Sneak motion](https://github.com/justinmk/vim-sneak) feature allows for quick navigation to any two-character sequence in your text. You can enable it by adding the following keybindings to your keymap. By default, the `s` key is mapped to `vim::Substitute`. Adding these bindings will override that behavior, so ensure this change aligns with your workflow preferences. -```json +```json [settings] { "context": "vim_mode == normal || vim_mode == visual", "bindings": { @@ -526,7 +526,7 @@ The [Sneak motion](https://github.com/justinmk/vim-sneak) feature allows for qui The [vim-exchange](https://github.com/tommcdo/vim-exchange) feature does not have a default binding for visual mode, as the `shift-x` binding conflicts with the default `shift-x` binding for visual mode (`vim::VisualDeleteLine`). To assign the default vim-exchange binding, add the following keybinding to your keymap: -```json +```json [settings] { "context": "vim_mode == visual", "bindings": { @@ -539,7 +539,7 @@ The [vim-exchange](https://github.com/tommcdo/vim-exchange) feature does not hav If you're using vim mode on Linux or Windows, you may find it overrides keybindings you can't live without: `ctrl+v` to paste, `ctrl+f` to search, etc. You can restore them by copying this data into your keymap: -```json +```json [keymap] { "context": "Editor && !menu", "bindings": { @@ -572,7 +572,7 @@ You can change the following settings to modify vim mode's behavior: Here's an example of adding a digraph for the zombie emoji. This allows you to type `ctrl-k f z` to insert a zombie emoji. You can add as many digraphs as you like. -```json +```json [settings] { "vim": { "custom_digraphs": { @@ -584,7 +584,7 @@ Here's an example of adding a digraph for the zombie emoji. This allows you to t Here's an example of these settings changed: -```json +```json [settings] { "vim": { "default_mode": "insert", @@ -615,7 +615,7 @@ Here are a few general Zed settings that can help you fine-tune your Vim experie Here's an example of these settings changed: -```json +```json [settings] { // Disable cursor blink "cursor_blink": false, diff --git a/docs/src/visual-customization.md b/docs/src/visual-customization.md index 002ebdd4a8c0ca420a5f4be9acb2254c37820664..0318105cf77a42e596a4b67d6aa5317d1421da49 100644 --- a/docs/src/visual-customization.md +++ b/docs/src/visual-customization.md @@ -10,7 +10,7 @@ Use may install zed extensions providing [Themes](./themes.md) and [Icon Themes] You can preview/choose amongst your installed themes and icon themes with {#action theme_selector::Toggle} ({#kb theme_selector::Toggle}) and ({#action icon_theme_selector::Toggle}) which will modify the following settings: -```json +```json [settings] { "theme": "One Dark", "icon_theme": "Zed (Default)" @@ -19,26 +19,26 @@ You can preview/choose amongst your installed themes and icon themes with {#acti If you would like to use distinct themes for light mode/dark mode that can be set with: -```json +```json [settings] { "theme": { - "dark": "One Dark" + "dark": "One Dark", "light": "One Light", // Mode to use (dark, light) or "system" to follow the OS's light/dark mode (default) - "mode": "system", + "mode": "system" }, "icon_theme": { - "dark": "Zed (Default)" + "dark": "Zed (Default)", "light": "Zed (Default)", // Mode to use (dark, light) or "system" to follow the OS's light/dark mode (default) - "mode": "system", + "mode": "system" } } ``` ## Fonts -```json +```json [settings] // UI Font. Use ".SystemUIFont" to use the default system font (SF Pro on macOS), // or ".ZedSans" for the bundled default (currently IBM Plex) "ui_font_family": ".SystemUIFont", @@ -73,7 +73,7 @@ For example `=>` will be displayed as `→` and `!=` will be `≠`. This is pure To disable this behavior use: -```json +```json [settings] { "buffer_font_features": { "calt": false // Disable ligatures @@ -83,7 +83,7 @@ To disable this behavior use: ### Status Bar -```json +```json [settings] { // Whether to show full labels in line indicator or short ones // - `short`: "2 s, 15 l, 32 c" @@ -105,7 +105,7 @@ To disable this behavior use: ### Titlebar -```json +```json [settings] // Control which items are shown/hidden in the title bar "title_bar": { "show_branch_icon": false, // Show/hide branch icon beside branch switcher @@ -120,7 +120,7 @@ To disable this behavior use: ## Workspace -```json +```json [settings] { // Force usage of Zed build in path prompts (file and directory pickers) // instead of OS native pickers (false). @@ -129,10 +129,6 @@ To disable this behavior use: // instead of OS native prompts (false). On linux this is ignored (always false). "use_system_prompts": true, - // Whether to use the system provided dialogs for Open and Save As (true) or - // Zed's built-in keyboard-first pickers (false) - "use_system_path_prompts": true, - // Active pane styling settings. "active_pane_modifiers": { // Inset border size of the active pane, in pixels. @@ -152,7 +148,7 @@ To disable this behavior use: