mirror of
https://github.com/ryan4yin/nix-config.git
synced 2026-07-09 22:22:40 +02:00
feat: replace vscode with zed-editor (#263)
* feat: replace vscode with zed-editor * docs: helix
This commit is contained in:
@@ -51,8 +51,7 @@ In Helix, `|` / `!` and variants pipe or insert shell output on selections (see
|
|||||||
|
|
||||||
This flake’s Helix Home Manager module keeps **almost all default keys**; the only remap is
|
This flake’s 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
|
**`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**
|
`home/base/core/editors/helix/default.nix`).
|
||||||
(`Ctrl+g`), **`:`** commands, or the built-in **`Space`** menu.
|
|
||||||
|
|
||||||
### Command mode (`:`)
|
### Command mode (`:`)
|
||||||
|
|
||||||
@@ -64,6 +63,7 @@ This flake’s Helix Home Manager module keeps **almost all default keys**; the
|
|||||||
| Quit view / quit all | `:q` / `:qa` — add `!` to discard changes |
|
| Quit view / quit all | `:q` / `:qa` — add `!` to discard changes |
|
||||||
| Write and quit | `:wq`, `:x` |
|
| Write and quit | `:wq`, `:x` |
|
||||||
| Write all and quit all | `:wqa`, `:xa` |
|
| Write all and quit all | `:wqa`, `:xa` |
|
||||||
|
| Save to path | `:w path` |
|
||||||
| Open file | `:open path`, `:e path` |
|
| Open file | `:open path`, `:e path` |
|
||||||
| Next / previous buffer | `:bn` / `:bp` (also `gn` / `gp` in normal) |
|
| Next / previous buffer | `:bn` / `:bp` (also `gn` / `gp` in normal) |
|
||||||
| Close buffer | `:bc` (add `!` to force) |
|
| Close buffer | `:bc` (add `!` to force) |
|
||||||
@@ -73,37 +73,51 @@ This flake’s Helix Home Manager module keeps **almost all default keys**; the
|
|||||||
|
|
||||||
### Movement (normal mode)
|
### Movement (normal mode)
|
||||||
|
|
||||||
| Action | Keys / notes |
|
| Action | Keys / notes |
|
||||||
| --------------------- | --------------------------------------------------- |
|
| --------------------- | -------------------------------------------------------------------- |
|
||||||
| Arrow keys | `h` `j` `k` `l` |
|
| Arrow keys | `h` `j` `k` `l` |
|
||||||
| Words | `w` `b` `e` — `W` `B` `E` for WORD-style |
|
| Words | `w` `b` `e` — `W` `B` `E` for WORD-style |
|
||||||
| Find char / till char | `f` `F` `t` `T` (not limited to current line) |
|
| Counts | Prefix motions with a count: `2w`, `3e`, `2b`, `2x` |
|
||||||
| Line / file | `Home` / `End`; `gg` start or goto line; `G` line |
|
| Find char / till char | `f` `F` `t` `T` (not limited to current line) |
|
||||||
| Half / full page | `Ctrl-u` / `Ctrl-d`; `Ctrl-b` / `Ctrl-f` |
|
| Repeat find / till | `Alt-.` repeats the last `f` / `t` selection |
|
||||||
| Jumplist | `Ctrl-o` back, `Ctrl-i` forward; `Ctrl-s` save spot |
|
| 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
|
### Selection & changes
|
||||||
|
|
||||||
| Action | Keys / notes |
|
| Action | Keys / notes |
|
||||||
| ---------------------- | ----------------------------------------------------------------- |
|
| ---------------------- | --------------------------------------------------------------------------- |
|
||||||
| Extend selections | `v` select mode; motions extend instead of moving |
|
| Extend selections | `v` select mode; motions extend instead of moving; `v` or `Esc` leaves mode |
|
||||||
| Line selection | `x` extend line; `X` line bounds |
|
| Line selection | `x` extend line; `X` line bounds; repeat or use a count for more lines |
|
||||||
| Select all / regex | `%`; `s` regex in selections; `S` split on regex |
|
| Collapse selections | `;` collapse selections back to cursors |
|
||||||
| Undo / redo | `u` / `U` |
|
| Select all / regex | `%`; `s` regex in selections; `S` split on regex |
|
||||||
| Delete / change / yank | `d` / `c` / `y` — acts on selection |
|
| Multiple cursors | `C` duplicate to next suitable line; `Alt-C` above; `,` remove one cursor |
|
||||||
| Paste | `p` / `P`; registers `"` … |
|
| Align selections | `&` align selection contents |
|
||||||
| Insert | `i` `a` `I` `A` `o` `O` |
|
| Undo / redo | `u` / `U` |
|
||||||
| Indent / format | `>` / `<`; `=` format (LSP) |
|
| Delete / change / yank | `d` / `c` / `y` — acts on selection |
|
||||||
| Case | `~` toggle; lower/upper case via grave / `Alt-grave` (see keymap) |
|
| Replace with yank | `R` replace selection with yanked text |
|
||||||
| Join lines | `J`; `Alt-J` join keeping space |
|
| 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
|
### Search
|
||||||
|
|
||||||
| Action | Keys |
|
| Action | Keys |
|
||||||
| -------------------- | ---------------------------------------- |
|
| -------------------- | --------------------------------------------------------------- |
|
||||||
| Search / reverse | `/` / `?` |
|
| Search / reverse | `/` / `?` |
|
||||||
| Next / prev match | `n` / `N` |
|
| Next / prev match | `n` / `N` |
|
||||||
| Selection as pattern | `*` (word bounds); `Alt-*` raw selection |
|
| 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
|
Use **extend mode** (`v`) with `n` / `N` to add matches to multi-cursors
|
||||||
([keymap](https://docs.helix-editor.com/keymap.html#select--extend-mode)).
|
([keymap](https://docs.helix-editor.com/keymap.html#select--extend-mode)).
|
||||||
|
|||||||
@@ -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"
|
||||||
|
];
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -280,10 +280,6 @@ run = ['layout floating', 'move-node-to-workspace 9File']
|
|||||||
if.app-id = 'com.apple.Preview'
|
if.app-id = 'com.apple.Preview'
|
||||||
run = ['layout floating', 'move-node-to-workspace 9File']
|
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]]
|
[[on-window-detected]]
|
||||||
if.app-id = 'com.todesktop.230313mzl4w4u92' # Cursor AI Editor
|
if.app-id = 'com.todesktop.230313mzl4w4u92' # Cursor AI Editor
|
||||||
run = ['layout floating', 'move-node-to-workspace 9File']
|
run = ['layout floating', 'move-node-to-workspace 9File']
|
||||||
|
|||||||
@@ -11,6 +11,13 @@ in
|
|||||||
modules.desktop.niri.enable = true;
|
modules.desktop.niri.enable = true;
|
||||||
modules.desktop.nvidia.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 =
|
xdg.configFile."niri/niri-hardware.kdl".source =
|
||||||
mkSymlink "${config.home.homeDirectory}/nix-config/hosts/idols-ai/niri-hardware.kdl";
|
mkSymlink "${config.home.homeDirectory}/nix-config/hosts/idols-ai/niri-hardware.kdl";
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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"
|
|
||||||
];
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
||||||
@@ -18,10 +18,9 @@
|
|||||||
"firefox.desktop"
|
"firefox.desktop"
|
||||||
];
|
];
|
||||||
editor = [
|
editor = [
|
||||||
|
"dev.zed.Zed.desktop"
|
||||||
"nvim.desktop"
|
"nvim.desktop"
|
||||||
"Helix.desktop"
|
"Helix.desktop"
|
||||||
"code.desktop"
|
|
||||||
"code-insiders.desktop"
|
|
||||||
];
|
];
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
@@ -48,9 +47,6 @@
|
|||||||
"x-scheme-handler/ftp" = browser; # open `ftp:` url with `browser`
|
"x-scheme-handler/ftp" = browser; # open `ftp:` url with `browser`
|
||||||
"x-scheme-handler/http" = browser;
|
"x-scheme-handler/http" = browser;
|
||||||
"x-scheme-handler/https" = 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" ];
|
"x-scheme-handler/zoommtg" = [ "Zoom.desktop" ];
|
||||||
|
|
||||||
# all other unknown schemes will be opened by this default application.
|
# all other unknown schemes will be opened by this default application.
|
||||||
|
|||||||
@@ -82,7 +82,6 @@ nvme0n1 259:0 0 1.8T 0 disk
|
|||||||
/home/ryan/.zoom
|
/home/ryan/.zoom
|
||||||
/home/ryan/Documents
|
/home/ryan/Documents
|
||||||
/home/ryan/.wakatime
|
/home/ryan/.wakatime
|
||||||
/home/ryan/.vscode
|
|
||||||
/home/ryan/.var
|
/home/ryan/.var
|
||||||
/home/ryan/.terraform.d/plugin-cache
|
/home/ryan/.terraform.d/plugin-cache
|
||||||
/home/ryan/.steam
|
/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/password-store
|
||||||
/home/ryan/.local/share/opencode
|
/home/ryan/.local/share/opencode
|
||||||
/home/ryan/.local/share/nvim
|
/home/ryan/.local/share/nvim
|
||||||
|
/home/ryan/.local/share/zed
|
||||||
/home/ryan/.local/share/nix
|
/home/ryan/.local/share/nix
|
||||||
/home/ryan/.local/share/krita
|
/home/ryan/.local/share/krita
|
||||||
/home/ryan/.local/share/lutris
|
/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/obs-studio
|
||||||
/home/ryan/.config/mozc
|
/home/ryan/.config/mozc
|
||||||
/home/ryan/.config/nushell
|
/home/ryan/.config/nushell
|
||||||
|
/home/ryan/.config/zed
|
||||||
/home/ryan/.config/lutris
|
/home/ryan/.config/lutris
|
||||||
/home/ryan/.config/joplin
|
/home/ryan/.config/joplin
|
||||||
/home/ryan/.config/heroic
|
/home/ryan/.config/heroic
|
||||||
@@ -151,7 +152,6 @@ nvme0n1 259:0 0 1.8T 0 disk
|
|||||||
/home/ryan/.config/LDtk
|
/home/ryan/.config/LDtk
|
||||||
/home/ryan/.config/Joplin
|
/home/ryan/.config/Joplin
|
||||||
/home/ryan/.config/Cursor
|
/home/ryan/.config/Cursor
|
||||||
/home/ryan/.config/Code
|
|
||||||
/home/ryan/.conda
|
/home/ryan/.conda
|
||||||
/home/ryan/.cargo
|
/home/ryan/.cargo
|
||||||
/home/ryan/.codex
|
/home/ryan/.codex
|
||||||
|
|||||||
@@ -133,9 +133,9 @@ in
|
|||||||
# neovim plugins
|
# neovim plugins
|
||||||
".wakatime"
|
".wakatime"
|
||||||
|
|
||||||
# vscode
|
# zed
|
||||||
".vscode"
|
".config/zed"
|
||||||
".config/Code"
|
".local/share/zed"
|
||||||
|
|
||||||
# cursor ai editor / cli
|
# cursor ai editor / cli
|
||||||
".cursor"
|
".cursor"
|
||||||
|
|||||||
@@ -157,9 +157,6 @@ in
|
|||||||
"firefox"
|
"firefox"
|
||||||
"google-chrome"
|
"google-chrome"
|
||||||
|
|
||||||
# code editor
|
|
||||||
"visual-studio-code"
|
|
||||||
|
|
||||||
"nikitabobko/tap/aerospace" # an i3-like tiling window manager for macOS
|
"nikitabobko/tap/aerospace" # an i3-like tiling window manager for macOS
|
||||||
"ghostty" # terminal emulator
|
"ghostty" # terminal emulator
|
||||||
|
|
||||||
|
|||||||
@@ -48,7 +48,6 @@
|
|||||||
# which resolves bugs involving programs opening inside FHS envs or with unexpected env vars set from wrappers.
|
# 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
|
# 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
|
# 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;
|
xdgOpenUsePortal = true;
|
||||||
|
|
||||||
# ls /run/current-system/sw/share/xdg-desktop-portal/portals/
|
# ls /run/current-system/sw/share/xdg-desktop-portal/portals/
|
||||||
|
|||||||
Reference in New Issue
Block a user