feat: replace vscode with zed-editor (#263)

* feat: replace vscode with zed-editor
* docs: helix
This commit is contained in:
Ryan Yin
2026-06-04 23:20:59 +08:00
committed by GitHub
parent 008bc8857b
commit cfc192afc4
10 changed files with 113 additions and 64 deletions
+41 -27
View File
@@ -51,8 +51,7 @@ In Helix, `|` / `!` and variants pipe or insert shell output on selections (see
This flakes Helix Home Manager module keeps **almost all default keys**; the only remap is
**`Ctrl+Shift+o`** → jump backward, because Zellij uses **`Ctrl+o`** for Session (see
`home/base/core/editors/helix/default.nix`). For other Zellij clashes, use **locked mode**
(`Ctrl+g`), **`:`** commands, or the built-in **`Space`** menu.
`home/base/core/editors/helix/default.nix`).
### Command mode (`:`)
@@ -64,6 +63,7 @@ This flakes Helix Home Manager module keeps **almost all default keys**; the
| Quit view / quit all | `:q` / `:qa` — add `!` to discard changes |
| Write and quit | `:wq`, `:x` |
| Write all and quit all | `:wqa`, `:xa` |
| Save to path | `:w path` |
| Open file | `:open path`, `:e path` |
| Next / previous buffer | `:bn` / `:bp` (also `gn` / `gp` in normal) |
| Close buffer | `:bc` (add `!` to force) |
@@ -73,37 +73,51 @@ This flakes Helix Home Manager module keeps **almost all default keys**; the
### Movement (normal mode)
| Action | Keys / notes |
| --------------------- | --------------------------------------------------- |
| Arrow keys | `h` `j` `k` `l` |
| Words | `w` `b` `e``W` `B` `E` for WORD-style |
| Find char / till char | `f` `F` `t` `T` (not limited to current line) |
| Line / file | `Home` / `End`; `gg` start or goto line; `G` line |
| Half / full page | `Ctrl-u` / `Ctrl-d`; `Ctrl-b` / `Ctrl-f` |
| Jumplist | `Ctrl-o` back, `Ctrl-i` forward; `Ctrl-s` save spot |
| Action | Keys / notes |
| --------------------- | -------------------------------------------------------------------- |
| Arrow keys | `h` `j` `k` `l` |
| Words | `w` `b` `e``W` `B` `E` for WORD-style |
| Counts | Prefix motions with a count: `2w`, `3e`, `2b`, `2x` |
| Find char / till char | `f` `F` `t` `T` (not limited to current line) |
| Repeat find / till | `Alt-.` repeats the last `f` / `t` selection |
| Word-label jump | `gw` shows two-character labels; type a label to jump, `Esc` cancels |
| Line / file | `Home` / `End`; `gg` start or goto line; `G` line |
| Half / full page | `Ctrl-u` / `Ctrl-d`; `Ctrl-b` / `Ctrl-f` |
| Jumplist | `Ctrl-o` back, `Ctrl-i` forward; `Ctrl-s` save spot |
### Selection & changes
| Action | Keys / notes |
| ---------------------- | ----------------------------------------------------------------- |
| Extend selections | `v` select mode; motions extend instead of moving |
| Line selection | `x` extend line; `X` line bounds |
| Select all / regex | `%`; `s` regex in selections; `S` split on regex |
| Undo / redo | `u` / `U` |
| Delete / change / yank | `d` / `c` / `y` — acts on selection |
| Paste | `p` / `P`; registers `"` |
| Insert | `i` `a` `I` `A` `o` `O` |
| Indent / format | `>` / `<`; `=` format (LSP) |
| Case | `~` toggle; lower/upper case via grave / `Alt-grave` (see keymap) |
| Join lines | `J`; `Alt-J` join keeping space |
| Action | Keys / notes |
| ---------------------- | --------------------------------------------------------------------------- |
| Extend selections | `v` select mode; motions extend instead of moving; `v` or `Esc` leaves mode |
| Line selection | `x` extend line; `X` line bounds; repeat or use a count for more lines |
| Collapse selections | `;` collapse selections back to cursors |
| Select all / regex | `%`; `s` regex in selections; `S` split on regex |
| Multiple cursors | `C` duplicate to next suitable line; `Alt-C` above; `,` remove one cursor |
| Align selections | `&` align selection contents |
| Undo / redo | `u` / `U` |
| Delete / change / yank | `d` / `c` / `y` — acts on selection |
| Replace with yank | `R` replace selection with yanked text |
| Paste | `p` / `P`; registers `"` |
| Register prefix | `"<char>` selects a register for yank/paste/macro operations |
| Insert | `i` `a` `I` `A` `o` `O` |
| Repeat insert | `.` repeat the last insertion |
| Replace selected chars | `r<char>` |
| Indent / format | `>` / `<`; `=` format (LSP) |
| Increment / decrement | `Ctrl-a` / `Ctrl-x` on selected numbers |
| Case | `~` toggle; lower/upper case via grave / `Alt-grave` (see Alt caveat above) |
| Join lines | `J`; `Alt-J` join keeping space (see Alt caveat above) |
| Toggle line comment | `Ctrl-c` |
| Macro record / replay | `Q` start/stop recording; `q` replay from the default `@` register |
### Search
| Action | Keys |
| -------------------- | ---------------------------------------- |
| Search / reverse | `/` / `?` |
| Next / prev match | `n` / `N` |
| Selection as pattern | `*` (word bounds); `Alt-*` raw selection |
| Action | Keys |
| -------------------- | --------------------------------------------------------------- |
| Search / reverse | `/` / `?` |
| Next / prev match | `n` / `N` |
| Selection as pattern | `*` (word bounds); `Alt-*` raw selection (see Alt caveat above) |
| Split on newlines | `Alt-s` |
Use **extend mode** (`v`) with `n` / `N` to add matches to multi-cursors
([keymap](https://docs.helix-editor.com/keymap.html#select--extend-mode)).
+59
View File
@@ -0,0 +1,59 @@
{ lib, ... }:
{
catppuccin.zed.enable = true;
programs.zed-editor = {
enable = true;
mutableUserSettings = true;
userSettings = {
# Editor behavior
autosave = "on_focus_change";
inlay_hints.enabled = true;
soft_wrap = "editor_width";
which_key.enabled = true;
# Modal editing
helix_mode = true;
vim = {
use_smartcase_find = true;
toggle_relative_line_numbers = true;
};
# Font sizing
ui_font_size = lib.mkDefault 16.0;
buffer_font_size = lib.mkDefault 14.0;
agent_ui_font_size = lib.mkDefault 16.0;
agent_buffer_font_size = lib.mkDefault 15.0;
# App behavior
auto_update = false;
# AI/editor integrations
agent.play_sound_when_agent_done = "when_hidden";
agent_servers = {
opencode.type = "registry";
cursor.type = "registry";
codex-acp.type = "registry";
claude-acp.type = "registry";
};
# Privacy
edit_predictions.allow_data_collection = "no";
telemetry = {
diagnostics = false;
metrics = false;
};
};
extensions = [
"catppuccin"
"dockerfile"
"just"
"nix"
"nu"
"terraform"
"toml"
];
};
}
-4
View File
@@ -280,10 +280,6 @@ run = ['layout floating', 'move-node-to-workspace 9File']
if.app-id = 'com.apple.Preview'
run = ['layout floating', 'move-node-to-workspace 9File']
[[on-window-detected]]
if.app-id = 'com.microsoft.VSCode'
run = ['layout floating', 'move-node-to-workspace 9File']
[[on-window-detected]]
if.app-id = 'com.todesktop.230313mzl4w4u92' # Cursor AI Editor
run = ['layout floating', 'move-node-to-workspace 9File']
+7
View File
@@ -11,6 +11,13 @@ in
modules.desktop.niri.enable = true;
modules.desktop.nvidia.enable = true;
programs.zed-editor.userSettings = {
ui_font_size = 19.0;
buffer_font_size = 17.0;
agent_ui_font_size = 19.0;
agent_buffer_font_size = 18.0;
};
xdg.configFile."niri/niri-hardware.kdl".source =
mkSymlink "${config.home.homeDirectory}/nix-config/hosts/idols-ai/niri-hardware.kdl";
}
-19
View File
@@ -1,19 +0,0 @@
{
lib,
pkgs-master,
...
}:
{
programs.vscode = {
enable = true;
package = pkgs-master.vscode.override {
commandLineArgs = [
# https://code.visualstudio.com/docs/configure/settings-sync#_recommended-configure-the-keyring-to-use-with-vs-code
# For use with any package that implements the Secret Service API
# (for example gnome-keyring, kwallet5, KeepassXC)
"--password-store=gnome-libsecret"
];
};
};
}
+1 -5
View File
@@ -18,10 +18,9 @@
"firefox.desktop"
];
editor = [
"dev.zed.Zed.desktop"
"nvim.desktop"
"Helix.desktop"
"code.desktop"
"code-insiders.desktop"
];
in
{
@@ -48,9 +47,6 @@
"x-scheme-handler/ftp" = browser; # open `ftp:` url with `browser`
"x-scheme-handler/http" = browser;
"x-scheme-handler/https" = browser;
# https://github.com/microsoft/vscode/issues/146408
"x-scheme-handler/vscode" = [ "code-url-handler.desktop" ]; # open `vscode://` url with `code-url-handler.desktop`
"x-scheme-handler/vscode-insiders" = [ "code-insiders-url-handler.desktop" ]; # open `vscode-insiders://` url with `code-insiders-url-handler.desktop`
"x-scheme-handler/zoommtg" = [ "Zoom.desktop" ];
# all other unknown schemes will be opened by this default application.
+2 -2
View File
@@ -82,7 +82,6 @@ nvme0n1 259:0 0 1.8T 0 disk
/home/ryan/.zoom
/home/ryan/Documents
/home/ryan/.wakatime
/home/ryan/.vscode
/home/ryan/.var
/home/ryan/.terraform.d/plugin-cache
/home/ryan/.steam
@@ -106,6 +105,7 @@ nvme0n1 259:0 0 1.8T 0 disk
/home/ryan/.local/share/password-store
/home/ryan/.local/share/opencode
/home/ryan/.local/share/nvim
/home/ryan/.local/share/zed
/home/ryan/.local/share/nix
/home/ryan/.local/share/krita
/home/ryan/.local/share/lutris
@@ -140,6 +140,7 @@ nvme0n1 259:0 0 1.8T 0 disk
/home/ryan/.config/obs-studio
/home/ryan/.config/mozc
/home/ryan/.config/nushell
/home/ryan/.config/zed
/home/ryan/.config/lutris
/home/ryan/.config/joplin
/home/ryan/.config/heroic
@@ -151,7 +152,6 @@ nvme0n1 259:0 0 1.8T 0 disk
/home/ryan/.config/LDtk
/home/ryan/.config/Joplin
/home/ryan/.config/Cursor
/home/ryan/.config/Code
/home/ryan/.conda
/home/ryan/.cargo
/home/ryan/.codex
+3 -3
View File
@@ -133,9 +133,9 @@ in
# neovim plugins
".wakatime"
# vscode
".vscode"
".config/Code"
# zed
".config/zed"
".local/share/zed"
# cursor ai editor / cli
".cursor"
-3
View File
@@ -157,9 +157,6 @@ in
"firefox"
"google-chrome"
# code editor
"visual-studio-code"
"nikitabobko/tap/aerospace" # an i3-like tiling window manager for macOS
"ghostty" # terminal emulator
-1
View File
@@ -48,7 +48,6 @@
# which resolves bugs involving programs opening inside FHS envs or with unexpected env vars set from wrappers.
# xdg-open is used by almost all programs to open a unknown file/uri
# alacritty as an example, it use xdg-open as default, but you can also custom this behavior
# and vscode has open like `External Uri Openers`
xdgOpenUsePortal = true;
# ls /run/current-system/sw/share/xdg-desktop-portal/portals/