From 8a75f0e7de8c65225f3c52ca8d943471e6e195f4 Mon Sep 17 00:00:00 2001 From: cy Date: Thu, 27 Feb 2025 12:46:39 -0500 Subject: [PATCH 1/5] make vscode nicer --- home/codium.nix | 76 +++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 70 insertions(+), 6 deletions(-) diff --git a/home/codium.nix b/home/codium.nix index f6c9a04..945087f 100644 --- a/home/codium.nix +++ b/home/codium.nix @@ -17,28 +17,92 @@ rust-lang.rust-analyzer shd101wyy.markdown-preview-enhanced fwcd.kotlin + alefragnani.bookmarks + tomrijndorp.find-it-faster ]; userSettings = { "workbench.colorTheme" = "GitHub Dark Default"; - "files.autoSave" = "afterDelay"; + "files.autoSave" = "onFocusChange"; "nix.enableLanguageServer" = true; "nix.serverPath" = "nil"; "editor.fontFamily" = "IBM Plex Mono"; - "editor.fontSize" = 16; - "editor.wordWrap" = "on"; + "editor.fontSize" = 15; + "window.zoomLevel" = 0.5; # vim mode settings - "vim.handleKeys" = { - "" = false; # file tree toggle - }; + "vim.leader" = ","; "vim.normalModeKeyBindings" = [ { "before" = [ ";" ]; "after" = [ ":" ]; "silent" = true; } + { + "before" = [ "" "m" ]; + "commands" = [ "bookmarks.toggle" ]; + } + { + "before" = [ "" "l" ]; + "commands" = [ "bookmarks.toggleLabeled" ]; + } + { + "before" = [ "" "b" ]; + "commands" = [ "bookmarks.list" ]; + } + { + "before" = [ "" "s" ]; + "commands" = [ "workbench.action.toggleSidebarVisibility" ]; + } + { + "before" = [ "" "f" "f" ]; + "commands" = [ "find-it-faster.findFiles" ]; + } + { + "before" = [ "" "f" "g"]; + "commands" = [ "find-it-faster.findWithinFiles"]; + } + { + "before" = [ "" "f" "t"]; + "commands" = [ "find-it-faster.findWithinFilesWithType"]; + } ]; + "vim.insertModeKeyBindings" = [ + { + "before" = [ "C-a" ]; + "commands" = [ "cursorHome" ]; + } + { + "before" = [ "C-e" ]; + "commands" = [ "cursorEnd" ]; + } + ]; + "vim.visualModeKeyBindings" = [ + { + "before" = [ ">" ]; + "commands" = [ "editor.action.indentLines" ]; + } + { + "before" = [ "<" ]; + "commands" = [ "editor.action.outdentLines" ]; + } + ]; + "extensions.experimental.affinity" = { + "vscodevim.vim" = 1; + }; "workbench.startupEditor" = "none"; + "git.openRepositoryInParentFolders" = "never"; + + # terminal stuff + "terminal.integrated.cursorBlinking" = true; + "terminal.integrated.cursorStyle" = "line"; + "terminal.integrated.customGlyphs" = false; + "terminal.integrated.env.linux" = { + # https://github.com/tomrijndorp/vscode-finditfaster/issues/112#issuecomment-2475227546 + FZF_DEFAULT_OPTS = "--bind ctrl-n:down,ctrl-p:up"; + }; + # don't let the workbench handle terminal keys like ctrl+n and friends + "terminal.integrated.sendKeybindingsToShell" = true; + "terminal.integrated.allowChords" = false; }; }; }; From 6519ab7f062b380b836f8b5d3d54c90cb5f5c114 Mon Sep 17 00:00:00 2001 From: cy Date: Thu, 27 Feb 2025 12:48:18 -0500 Subject: [PATCH 2/5] use rust nightly; disable man cache; some zsh nicieties --- home/yt/common.nix | 3 ++- home/yt/ytnix.nix | 2 +- home/zsh/default.nix | 2 ++ 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/home/yt/common.nix b/home/yt/common.nix index b7c586e..28f3457 100644 --- a/home/yt/common.nix +++ b/home/yt/common.nix @@ -66,6 +66,7 @@ }; }; programs.ripgrep.enable = true; - programs.man.generateCaches = true; + # programs.man.generateCaches = true; # slows down eval programs.fd.enable = true; + news.display = "silent"; } diff --git a/home/yt/ytnix.nix b/home/yt/ytnix.nix index d16cd5f..67625f6 100644 --- a/home/yt/ytnix.nix +++ b/home/yt/ytnix.nix @@ -54,7 +54,7 @@ yarn rclone go - rustup + (rust-bin.selectLatestNightlyWith (toolchain: toolchain.default)) pwgen lua-language-server gnumake diff --git a/home/zsh/default.nix b/home/zsh/default.nix index 0697fbc..311def5 100644 --- a/home/zsh/default.nix +++ b/home/zsh/default.nix @@ -51,6 +51,7 @@ bindkey -M viins "^E" end-of-line bindkey -M viins "^A" beginning-of-line bindkey -M viins "^B" backward-char + bindkey -M viins "^F" forward-char # accept one word completion bindkey -M viins "^S" forward-word @@ -111,6 +112,7 @@ "grv" = "git remote --verbose"; "gs" = "git status --short"; "gss" = "git status"; + "code" = "codium"; }; }; From bba29fa1ea28859a938df24dfe1c577217562ab5 Mon Sep 17 00:00:00 2001 From: cy Date: Fri, 28 Feb 2025 02:25:51 -0500 Subject: [PATCH 3/5] make vscode nicer; install rust-src; change btrbk stuff --- home/codium.nix | 19 ++++++++++++++++++- home/yt/ytnix.nix | 4 +++- hosts/ytnix/default.nix | 6 +++--- 3 files changed, 24 insertions(+), 5 deletions(-) diff --git a/home/codium.nix b/home/codium.nix index 945087f..9d9b479 100644 --- a/home/codium.nix +++ b/home/codium.nix @@ -29,7 +29,7 @@ "editor.fontSize" = 15; "window.zoomLevel" = 0.5; - # vim mode settings + # vim stuff "vim.leader" = ","; "vim.normalModeKeyBindings" = [ { @@ -65,6 +65,20 @@ "before" = [ "" "f" "t"]; "commands" = [ "find-it-faster.findWithinFilesWithType"]; } + # "gd" for definitions is by default + { + "before" = [ "g" "r" ]; + "commands" = [ "editor.action.goToReferences" ]; + } + # the default is weird when you need to go back within a file + { + "before" = [ "C-o" ]; + "commands" = [ "workbench.action.navigateBack" ]; + } + { + "before" = [ "C-i" ]; + "commands" = [ "workbench.action.navigateForward" ]; + } ]; "vim.insertModeKeyBindings" = [ { @@ -103,6 +117,9 @@ # don't let the workbench handle terminal keys like ctrl+n and friends "terminal.integrated.sendKeybindingsToShell" = true; "terminal.integrated.allowChords" = false; + + "security.promptForLocalFileProtocolHandling" = false; + "security.promptForRemoteFileProtocolHandling" = false; }; }; }; diff --git a/home/yt/ytnix.nix b/home/yt/ytnix.nix index 67625f6..e9b8738 100644 --- a/home/yt/ytnix.nix +++ b/home/yt/ytnix.nix @@ -54,7 +54,9 @@ yarn rclone go - (rust-bin.selectLatestNightlyWith (toolchain: toolchain.default)) + (rust-bin.selectLatestNightlyWith (toolchain: toolchain.default.override { + extensions = [ "rust-src" ]; + })) pwgen lua-language-server gnumake diff --git a/hosts/ytnix/default.nix b/hosts/ytnix/default.nix index 296335c..42d9217 100644 --- a/hosts/ytnix/default.nix +++ b/hosts/ytnix/default.nix @@ -232,9 +232,9 @@ snapshotOnly = true; settings = { snapshot_preserve_min = "latest"; - target_preserve = "*d"; - target_preserve_min = "no"; - target = "/mnt/external/btr_backup/ytnix"; + target_preserve = "30d"; + target_preserve_min = "2d"; + target = "/mnt/target/btr_backup/ytnix"; stream_compress = "zstd"; stream_compress_level = "8"; snapshot_dir = "/snapshots"; From a1dd96a68bab04bfc6b5af4e277372033cdf1c7c Mon Sep 17 00:00:00 2001 From: cy Date: Sat, 1 Mar 2025 10:11:34 -0500 Subject: [PATCH 4/5] vscode: add spell cheker and some settings --- home/codium.nix | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/home/codium.nix b/home/codium.nix index 9d9b479..792f880 100644 --- a/home/codium.nix +++ b/home/codium.nix @@ -19,6 +19,7 @@ fwcd.kotlin alefragnani.bookmarks tomrijndorp.find-it-faster + streetsidesoftware.code-spell-checker ]; userSettings = { "workbench.colorTheme" = "GitHub Dark Default"; @@ -120,6 +121,10 @@ "security.promptForLocalFileProtocolHandling" = false; "security.promptForRemoteFileProtocolHandling" = false; + "markdown-preview-enhanced.previewTheme" = "github-dark.css"; + "editor.minimap.enabled" = false; + "explorer.confirmDelete" = false; + "explorer.confirmDragAndDrop" = false; }; }; }; From 44bf0ca489ccde694a1352726a598698e9d42fd9 Mon Sep 17 00:00:00 2001 From: cy Date: Sat, 1 Mar 2025 10:16:38 -0500 Subject: [PATCH 5/5] flake update Signed-off-by: cy --- flake.lock | 50 +++++++++++++++++++++++++------------------------- 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/flake.lock b/flake.lock index 6aefae5..7fd9b1e 100644 --- a/flake.lock +++ b/flake.lock @@ -493,11 +493,11 @@ ] }, "locked": { - "lastModified": 1740624780, - "narHash": "sha256-8TP61AI3QBQsjzVUQFIV8NoB5nbYfJB3iHczhBikDkU=", + "lastModified": 1740840901, + "narHash": "sha256-nAHSkQJ2J5W8rGSReohh4xZ1b2edkG2UIj/4tF+ARAQ=", "owner": "nix-community", "repo": "home-manager", - "rev": "b8869e4ead721bbd4f0d6b927e8395705d4f16e6", + "rev": "30da4310935450ea38931abf775ffe1dfab15355", "type": "github" }, "original": { @@ -614,11 +614,11 @@ "pre-commit-hooks": "pre-commit-hooks" }, "locked": { - "lastModified": 1740647693, - "narHash": "sha256-pYxhtDAOmlbP4XqgjIvbpi7CFtX8USH6DlRybS2Jxu4=", + "lastModified": 1740781229, + "narHash": "sha256-H8i+LhDQr6PbAxFt37TXYoRkwHvGlSTuNJUrlE5bb0w=", "ref": "refs/heads/main", - "rev": "03ade5e6d75cb7705900cf696505b836fc831be0", - "revCount": 17515, + "rev": "99bc6867e8913ad8f5fa7d63fefd885743eac4c1", + "revCount": 17539, "type": "git", "url": "https://git.lix.systems/lix-project/lix" }, @@ -694,11 +694,11 @@ "xwayland-satellite-unstable": "xwayland-satellite-unstable" }, "locked": { - "lastModified": 1740655457, - "narHash": "sha256-brpdF7wEdGDZWuV8T5axwzHr5gnGfB7Dua2QVAjSSL4=", + "lastModified": 1740817768, + "narHash": "sha256-NFu4LhDHkc4xonmpknh2cI/0ozeXjFmoMxVz1HecqxI=", "owner": "sodiboo", "repo": "niri-flake", - "rev": "2a098dfa179b6d89c962908df0e4840308db04df", + "rev": "f3dde1ed6d76545ac637a80a356d50f6a7089a2a", "type": "github" }, "original": { @@ -727,11 +727,11 @@ "niri-unstable": { "flake": false, "locked": { - "lastModified": 1740641916, - "narHash": "sha256-aYAYvdKnmmlkN7t4VbPfPbAtWHHADKHL8bPlNYZ2bZY=", + "lastModified": 1740749946, + "narHash": "sha256-uA03y5H8XI00ZxOIAAj3RGGOBOQCFjLyjLc79NH01oI=", "owner": "YaLTeR", "repo": "niri", - "rev": "70dcd229cfaa54946163ccf0a1ea0ce595a35cc4", + "rev": "66113d7d76f6cf7d06e2ccde9281ff9bafab126c", "type": "github" }, "original": { @@ -937,11 +937,11 @@ }, "nixpkgs-stable_4": { "locked": { - "lastModified": 1740463929, - "narHash": "sha256-4Xhu/3aUdCKeLfdteEHMegx5ooKQvwPHNkOgNCXQrvc=", + "lastModified": 1740743217, + "narHash": "sha256-brsCRzLqimpyhORma84c3W2xPbIidZlIc3JGIuQVSNI=", "owner": "nixos", "repo": "nixpkgs", - "rev": "5d7db4668d7a0c6cc5fc8cf6ef33b008b2b1ed8b", + "rev": "b27ba4eb322d9d2bf2dc9ada9fd59442f50c8d7c", "type": "github" }, "original": { @@ -1001,11 +1001,11 @@ }, "nixpkgs_5": { "locked": { - "lastModified": 1740642522, - "narHash": "sha256-t6VfQs+u3CiVASTVkjQhBh5u8NcEo/VDWEYagCIwVCk=", + "lastModified": 1740804553, + "narHash": "sha256-1vP/NaV+Ps+kFqfVBJ5yxYahML9Vk6VwLndtU9bDvUE=", "owner": "nixos", "repo": "nixpkgs", - "rev": "d6fde23c7a50cf47485e28fa0c51b8ed4cfdf1d7", + "rev": "9114ab05304c83c930673fee79948b3fb14acd9a", "type": "github" }, "original": { @@ -1211,11 +1211,11 @@ ] }, "locked": { - "lastModified": 1740623427, - "narHash": "sha256-3SdPQrZoa4odlScFDUHd4CUPQ/R1gtH4Mq9u8CBiK8M=", + "lastModified": 1740796337, + "narHash": "sha256-FuoXrXZPoJEZQ3PF7t85tEpfBVID9JQIOnVKMNfTAb0=", "owner": "oxalica", "repo": "rust-overlay", - "rev": "d342e8b5fd88421ff982f383c853f0fc78a847ab", + "rev": "bbac9527bc6b28b6330b13043d0e76eac11720dc", "type": "github" }, "original": { @@ -1307,11 +1307,11 @@ ] }, "locked": { - "lastModified": 1740655383, - "narHash": "sha256-HHb6wtlHWy/CW3oCtOyOQrNnzgtsvwvwM6wAlDvfTec=", + "lastModified": 1740827838, + "narHash": "sha256-xHWVg/CgaJqID4BUxqqJ47ESXRzWOxRNhJ9+jBXKuLc=", "owner": "nix-community", "repo": "nix-vscode-extensions", - "rev": "bcf7577daac02aa1a7dfaddc79324b7c6ca4af81", + "rev": "02d071ae1fadb1a63c6122d307ca5eb7e6b4feb9", "type": "github" }, "original": {