Skip to content
/ zed Public
forked from zed-industries/zed

Contains personal changes to make Zed more awesome for me ... Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.

License

Unknown and 2 other licenses found

Licenses found

Unknown
LICENSE-AGPL
Unknown
LICENSE-APACHE
GPL-3.0
LICENSE-GPL
Notifications You must be signed in to change notification settings

Dima-369/zed

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

My workflow for macOS

To test modifications, I am only using cargo run (note that when webrtc-sys takes too long, use Warp for a faster download) to compile and start Zed in debug mode which is faster than building the release binaries.

Once, I am satisfied with a batch of changes, I install Zed into /Applications/Zed Dev.app with this:

./script/bundle-mac-without-licenses -l -o -i && \
rm -f "$HOME/.cargo/bin/zed" && \
ln -s "/Applications/Zed Dev.app/Contents/MacOS/cli" "$HOME/.cargo/bin/zed"

Development note

To have easier Zed's main branch merges, I am not really adding or modifying existing unit tests to my own functionality, so some are failing. I try to satisfy ./script/clippy, though.


AI is heavily used for pretty much every feature implemented. I use a mix of those models, all free:

For anything more complicated, I use the Architect + Editor pattern (see https://aider.chat/2024/09/26/architect.html) with Gemini 3 Pro being the Architect and the other models being the Editor.

Sync this fork's main branch with Zed's main branch and merge into my custom dima branch

git checkout main && git pull zed main && git push && git checkout dima && git merge main

If there are merge conflicts, I resolve them via IntelliJ IDEA.

Compare my changes with Zed's main branch

https://github.com/zed-industries/zed/compare/main...Dima-369:zed:dima

Fork changes

General/editor changes

  • add many defaults in project_settings.rs to not crash on startup (not sure if that is only from my code)
  • add bundle-mac-without-licenses which is faster than generating licenses, and skips the sentry-cli at end
  • try to fix panic in anchor_at_offset when buffer has Umlaute, seems to work, no idea if my fix has other consequences
  • changed fn do_copy(&self, strip_leading_indents: bool, cx: &mut Context<Self>) { to only strip trailing newlines instead of leading indents
  • lower MIN_NAVIGATION_HISTORY_ROW_DELTA to 3, from 10, as a test which seems fine
  • opening a workspace which has no tabs initially, will trigger workspace::NewFile for proper editor focus. Before, there seems to be a bug where the project panel does not have proper focus
  • improved the go to next/previous diagnostic action to always jump to errors first. Only if there are no errors, it jumps to warnings. Before, this was mixed
  • moving up/down in outline panel does not wrap around anymore
  • fixed that a large vertical_scroll_margin in settings.json to have a centered cursor jumps buffer scrolls around (zed-industries#42155)
  • fixed that on entering the project search, there can be instances where visual mode is entered (zed-industries#43878)
  • integrate file explorer modal from zed-industries#43961 file explorer modal, PR closed)
  • integrated live refreshing project search from zed-industries#42889, enable in settings.json via search > search_on_input
  • integrated smooth scroll from zed-industries#31671
  • modified compute_style_internal() in crates/gpui/src/elements/div.rs to not apply the mouse hover style, since it clashes when one only uses the keyboard
    • I also unset the mouse hover background change on enabled sticky_scroll
  • improved outline::Toggle to work in multi buffers, it shows the file headings only
  • improve editor::SelectLargerSyntaxNode for inline code blocks in Markdown files (foo bar), so that it first extends the selection to the word inside the quotes, then the text inside the quotes and only then to the inner text plus the outer quotes
  • add structured outline for Markdown, modifies crates/languages/src/markdown/outline.scm (from zed-industries#45643)
  • integrated 'Multibuffer breadcrumbs toolbar redesign' from zed-industries#45547
  • improve editor::AcceptNextWordEditPrediction to not insert a sole space when a space is before a word in the suggestion. Now, it inserts both the space and the word

Vim/Helix

  • add vim_visual context which can be set to normal, line or block for more fine-grained keybindings
  • modified vim/.../delete_motion.rs so vim::DeleteRight at end of line stays on the newline character
  • made clip_at_line_end() in crates/editor/src/display_map.rs a no-op, to have an always enabled virtualedit=onemore mode
    • this also allows mouse clicking beyond the end of the line where no characters are, to select the newline character in vim mode
  • fix bug that when in vim visual line mode and cursor is on right newline character, that the line below is incorrectly copied on editor::Copy. This mostly happens in my own Zed config because I mixing editor and vim actions to ensure that I can move cursor on the right newline character, and usually not in proper Zed keybindings.
  • integrate Helix jump list from zed-industries#44661 and implemented vim::HelixOpenJumpListInMultibuffer action

Network

  • add "proxy_no_verify": true support in settings.json

Git

  • add blame > git_blame_font_family setting to specify the font family for the git blame view because I am using a proportional font and the blame view misaligns otherwise
  • add git::DiffWithCommit from zed-industries#44467 and based on that code, git::DiffWithBranch is implemented
  • add ({file count}) in the git panel to every directory, inspired by zed-industries#45846 (Improve Git Panel with TreeView, VSCode-style grouping, commit history, and auto-fetch)

Project Diff Tab Changes

  • make the title dynamic: if there are no files, it shows No Changes, otherwise it shows Uncommitted Changes (1 file) or Uncommitted Changes (n files)
  • make the icon and text foreground dynamic when the tab is not selected with the same logic as the "Recent Branches" from crates/title_bar/src/title_bar.rs. See fn tab_content(&self, params: TabContentParams, _window: &Window, cx: &App) -> AnyElement

Git Commit Modal

  • move git commit modal to the right side instead of being centered, so it does not overlap the left git dock, which makes it impossible to see what files are staged on a small screen. One could lower the size of the git dock to make it fit, but then it is quite small
    • and use text_accent for its border color to be easier to see
  • preset git commit message with "Update {file count} files" on multiple files and add every file name to the commit description as a list with a - prefix

Zed CLI

Add --stdin-cursor-at-end flag to CLI to position cursor at end of buffer when reading from stdin instead of at start which I find more useful.

I developed and tested it like this:

timeout 15s bash -c 'cat README.md | target/debug/cli --zed target/debug/zed --stdin-cursor-at-end --foreground -' 2>&1 || echo "Timeout reached"

Terminal

  • remove abbreviated cwd display in terminal title
  • add terminal::OpenScrollbackBuffer action to open the scrollback buffer in a new buffer. It positions the cursor at the end

Vi Mode

  • add little indicator at top of terminal view to display if Vi Mode is enabled
  • modify Vi Mode keys to my custom Dvorak Programmer keyboard layout inspired by https://github.com/xahlee/xah-fly-keys
    • see diff in crates/terminal/src/terminal.rs compared to Zed's main branch for key changes
    • enter sets the cursor position for a selection
    • escape clears the selection if there is one, otherwise exits Vi Mode
  • fix bug that in Vi Mode on key press, the terminal does not rerender, so the cursor position is not updated

AI

  • allow AI edit predictions in the following places:
    • Zed's settings.json
    • Zed's keymap.json
    • buffers without files like ones from workspace: new file
    • AI agent text threads
  • add the Qwen provider with models qwen3-coder-plus and qwen3-coder-flash which can be used for Inline Assist and in Zed Agent
    • the implementation is based on how https://github.com/RooCodeInc/Roo-Code interacts with Qwen and requires the ~/.qwen/oauth_creds.json file to set which can be done by using the qwen binary and authenticating with OAuth
    • inside the Zed Agent, it performs weirdly, you often do not see the Color::Muted tool call rows, although the model does call them. And agent::OpenActiveThreadAsMarkdown then sometimes shows incorrect context. I did not investigate that further

Agent UI changes (mainly ACP, since I am not using the Zed Agent)

  • add concurrent agent tabs from wzulfikar#8 (which was based on zed-industries#42387)
    • remove the opacity animation for the tabs when waiting for a response and instead rotate a circle like Windsurf
    • add agent::CloseActiveThreadTabOrDock
  • Zed Agent, External Agents and text thread title summaries are now generated on every AI message received (WIP)
  • estimate tokens for ACP agents, or displays ACP token info when provided (although both Gemini and Qwen do not provide it)
  • add agent::ActivateNextTab and agent::ActivatePreviousTab
  • add agent::DismissErrorNotification and agent::CopyErrorNotification
  • change agent::OpenActiveThreadAsMarkdown to always open to end of buffer instead of start, and when there are more than 90k lines, open as Plain Text because Markdown lags hard for me, see crates/agent_ui/src/acp/thread_view.rs
  • add agent::TogglePlan which toggles the plan of the current thread
  • always allow all edits, otherwise it kepts asking for "Allow All Edits" every single time a new ACP thread is started which is just annoying. Note that it still asks for tool permissions
  • show command output for acp::ToolKind::Execute always below the Run Command view in a plain text view to preserve newlines
    • I added prepare_execute_tool_output_from_qwen() to strip trailing and leading information for cleaner output
  • integrate external agent history from zed-industries#45734
  • allow New From Summary for ACP agents, instead of only for Zed Agent
  • add agent::LaunchAgent action which takes an external agent name and can be bound like this:
    • "cmd-t": ["agent::LaunchAgent", { "agent_name": "qwen" }]

Command palette

  • the command palette sorting now sorts the same for close work and work close, and it does not search individual character matches anymore, like when you enter bsp, it would show editor: backspace before. I do not like that behavior, so I removed that
  • changed command palette: toggle to sort by recency instead of hit count
  • removed GlobalCommandPaletteInterceptor usage which contains Vim things like :delete, :edit, :help, :join, :quit, :sort, :write, :xit, :yank because I do not use them. Apparently, this also removed the ability to jump to a line via :144. I still removed this behavior because it is hard to sort those dynamic actions by recency in combination with the other real editor action commands.

New actions

workspace::OpenRecentFile for recent file functionality which tracks every opened buffer to quickly jump to a recent file or open a recent workspace

  • Markdown::ScrollPageLittleDown and Markdown::ScrollPageLittleUp which scroll a quarter of a page
  • projects::OpenRecentZoxide which displays recent directories from zoxide CLI binary. It displays no footer and abbreviates paths to ~. highlighted_label.rs was adjusted for its filtering. Here cmd+enter is flipped, so by default, it always opens in a new window
  • workspace::NewFileFromClipboard which pastes in the clipboard contents
    • the action supports setting an initial language like "space n j": [ "workspace::NewFileFromClipboard", { "language": "json" } ], in keymap.json
  • workspace::CopyFilePaths which opens a picker to copy the file path to clipboard
  • workspace::MakeSinglePane which closes all other panes except the active one
  • snippets::ReloadSnippets because auto-reloading snippets is not working for me
  • editor::CreateNavHistoryEntry
  • editor::CopyAll to copy entire buffer content to clipboard
  • editor::CountTokens which counts the tokens in the current buffer using o200k_base via the tiktoken crate
  • editor::StopAllLanguageServers which stops all language servers. It works like the bottom button in Language Servers > Stop All Servers
  • project_lsp_treesitter_symbol_search::Toggle based on search_everywhere::Toggle from zed-industries#45720. I ripped out everything else except the symbol search. The reason this is better than the built-in project_symbols::Toggle is that it uses both Tree-sitter and LSP with indexing which is faster and more reliable.
  • editor::MoveToStartOfLargerSyntaxNode from zed-industries#45331
  • buffer_search_modal::ToggleBufferSearch which shows a modal to search the current buffer content (code is in crates/search/src/buffer_search_modal.rs) based on zed-industries#44530 (Add quick search modal). This is a basic implementation of Swiper from Emacs or Snacks.picker.lines() from Neovim. I tried matching every line with nucleo, but it was kinda slow, so it just split on spaces and then every line which has all words from the query is matched.
    • ctrl-c and ctrl-t can be used to insert history items into the search field
    • ctrl-r is to toggle between line (case-insensitive) and exact match (case-sensitive) mode
    • it also works in multi buffers, although the preview editor mixes lines

Hint jumping functionality

jump::Toggle as a new action (this is for everything except multi buffers)

From https://github.com/tebben/zed/tree/feature/jump

With the following changes:

  • modify key jump hints to my custom Dvorak Programmer keyboard layout
  • implement multiple character jump hints
  • set the opacity of the dialog to 50% to see hints below
  • implement jump::JumpToUrl based on this code to jump to http... URLs
  • note that it does not work in multi buffers, but it works to jump across panes of regular text editors

vim::HelixJumpToWord as a new action (this is for multi buffers)

From zed-industries#43733

  • improved UI to look like the jump::Toggle action
  • removed the helix > "jump_label_accent" setting since the UI is now the same as jump::Toggle
  • modified key jump hints to my custom Dvorak Programmer keyboard layout
  • I am only using this is inside multi buffers, whereas jump::Toggle does not. And this also does not work to jump across editor panes
  • note that escape does not work to break out of this mode, apparently. I have no idea how to adjust the code for it

DeepL integration

There is this new actoin: zed::DeeplTranslate which translates the current selection or the current line. It needs the DEEPL_API_KEY environment variable to be set. Bind like this:

"space c g": [
  "zed::DeeplTranslate",
  {
    "source_lang": "EN",
    "target_lang": "DE",
  }
],

File Finder modal, the file_finder::Toggle action

  • file_finder > modal_max_width=full does not take full width anymore because it looks weird, but subtracts 128 pixels
  • show scrollbar
  • try to improve matching to use substring through nucleo crate. I dislike fuzzy matching which is annoying. Based on zed-industries#37123, but that had fuzzy matching
    • nucleo has its issues when you search in this repo for just README, it does not prioritize the root README.md, but other READMEs from other crates, but at least there is no weird fuzzy matching anymore

UI changes

  • on macOS, the unsaved changes model uses the native macOS dialog instead of Zed's custom one which has bad keyboard support, so unsaved_changes_model.rs was created which allows keyboard navigation (and just looks nicer)
  • use larger font size (LabelSize::Default) for the line/column and selection info in the bottom bar and use text_accent for it when a selection is active
  • lower status bar height, see impl Render for StatusBar
  • add scrollbar to outline::Toggle, file_finder::Toggle and command_palette::Toggle (why is it not shown in the first place?)
  • lower toolbar.rs height to save space, same in breadcrumbs.rs (here no padding is set). This applies for terminals, as well
  • lower DEFAULT_TOAST_DURATION from 10 to 5 seconds

Scrollbar

  • hide horizontal scrollbar when soft wrap is enabled
  • adjust scrollbar UI to look rounded and more native to macOS (idea is from this fork: https://github.com/notnotjake/zed)

Tabs

  • align the right slot of tabs (the directory) to the file name baseline, meaning in such cases: README.md db (see diff in crates/editor/src/items.rs)
    • as recommended in Refactoring UI > Baseline, not center
  • lower excessive tab height
  • switch system tab background color from title_bar_background to tab_bar_background, so I can style active tabs far nicer because the default just uses a slightly different foreground color which is hard to spot

Vertical stacking tabs

The vertical tabs stack to next rows without scrollbars. Enable in settings.json with:

"tab_bar": {
  "vertical_stacking": true
}

It places pinned tabs in an own row, separated to non-pinned tabs.

Note: Since it was too difficult to only render tab borders where exactly required, every tab now has a full border, so it looks a bit bold between tabs, but I don't mind. It looks better that way, instead of missing top borders in second row, for instance, when first row has pinned tabs.

Original README

Zed

Zed CI

Welcome to Zed, a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.


Installation

On macOS, Linux, and Windows you can download Zed directly or install Zed via your local package manager (macOS/Linux/Windows).

Other platforms are not yet available:

Developing Zed

Contributing

See CONTRIBUTING.md for ways you can contribute to Zed.

Also... we're hiring! Check out our jobs page for open roles.

Licensing

License information for third party dependencies must be correctly provided for CI to pass.

We use cargo-about to automatically comply with open source licenses. If CI is failing, check the following:

  • Is it showing a no license specified error for a crate you've created? If so, add publish = false under [package] in your crate's Cargo.toml.
  • Is the error failed to satisfy license requirements for a dependency? If so, first determine what license the project has and whether this system is sufficient to comply with this license's requirements. If you're unsure, ask a lawyer. Once you've verified that this system is acceptable add the license's SPDX identifier to the accepted array in script/licenses/zed-licenses.toml.
  • Is cargo-about unable to find the license for a dependency? If so, add a clarification field at the end of script/licenses/zed-licenses.toml, as specified in the cargo-about book.

About

Contains personal changes to make Zed more awesome for me ... Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.

Resources

License

Unknown and 2 other licenses found

Licenses found

Unknown
LICENSE-AGPL
Unknown
LICENSE-APACHE
GPL-3.0
LICENSE-GPL

Code of conduct

Contributing

Stars

Watchers

Forks

Languages

  • Rust 97.7%
  • Inno Setup 0.6%
  • Tree-sitter Query 0.5%
  • Shell 0.3%
  • WGSL 0.1%
  • Metal 0.1%
  • Other 0.7%