From bcabdec9c7c4921ec62c80d05626eb6def4a3c3b Mon Sep 17 00:00:00 2001 From: Lap Tran Date: Sat, 18 Jul 2026 22:54:23 -0400 Subject: [PATCH] Fix ls aliases and add herdr config --- .DS_Store | Bin 0 -> 6148 bytes configuration.nix | 2 + home.nix | 39 ++++++++++++++++++- home/.config/herdr/config.toml | 17 ++++++++ home/.config/nvim/init.lua | 3 ++ home/.config/nvim/lazy-lock.json | 10 +++++ home/.config/nvim/lua/keys.lua | 7 ++++ home/.config/nvim/lua/plugin.lua | 8 ++++ home/.config/nvim/lua/plugins/git.lua | 13 +++++++ home/.config/nvim/lua/plugins/navigation.lua | 24 ++++++++++++ home/.config/nvim/lua/plugins/ui.lua | 8 ++++ home/.config/nvim/lua/vim_config.lua | 13 +++++++ home/.config/wezterm/wezterm.lua | 13 +++++++ 13 files changed, 156 insertions(+), 1 deletion(-) create mode 100644 .DS_Store create mode 100644 home/.config/herdr/config.toml create mode 100644 home/.config/nvim/init.lua create mode 100644 home/.config/nvim/lazy-lock.json create mode 100644 home/.config/nvim/lua/keys.lua create mode 100644 home/.config/nvim/lua/plugin.lua create mode 100644 home/.config/nvim/lua/plugins/git.lua create mode 100644 home/.config/nvim/lua/plugins/navigation.lua create mode 100644 home/.config/nvim/lua/plugins/ui.lua create mode 100644 home/.config/nvim/lua/vim_config.lua create mode 100644 home/.config/wezterm/wezterm.lua diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..f09fd66ab7dcfd17f90a05a33abf69bc94415dab GIT binary patch literal 6148 zcmeHKK~BRk5S$H_Xy8(A93vhOi62B&IdJ9!kS5TmEs+Y9IOYvJfJg8_n6*t6r{#(& zv@5O0+3c+2u@xr(WV)@cfeC;yT`@`795B7FzGq2@oD#*=Xz+wBHh946UbY2}Q2|}M z3(V2t8IS0%U*lpq;|<P2J&G^s&KS?MLo5Pz9vPw8hk%p88dKm;75E0o$!viD literal 0 HcmV?d00001 diff --git a/configuration.nix b/configuration.nix index fc03adb..55fc53e 100644 --- a/configuration.nix +++ b/configuration.nix @@ -3,6 +3,7 @@ { # Determinate already manages the Nix daemon, so nix-darwin shouldn't. nix.enable = false; + programs.zsh.enable = true; nixpkgs.config.allowUnfree = true; nixpkgs.hostPlatform = "aarch64-darwin"; # use x86_64-darwin for Intel CPU @@ -43,6 +44,7 @@ ]; casks = [ "wezterm" + "grok-build" ]; }; } diff --git a/home.nix b/home.nix index 4ae61df..7da2e0d 100644 --- a/home.nix +++ b/home.nix @@ -19,7 +19,44 @@ in ]; fonts.fontconfig.enable = true; home.sessionVariables.EDITOR = "nvim"; + + programs.zsh = { + enable = true; + autosuggestion.enable = true; # ghost text from history + syntaxHighlighting.enable = true; # commands turn green when valid + initContent = '' + bindkey '^f' autosuggest-accept + ''; + shellAliases = { + ".." = "cd .."; + ll = "ls -plart"; + add = "git add ."; + push = "git push"; + pull = "git pull"; + m = "git switch main"; + cc = "claude --dangerously-skip-permissions"; + co = "codex --full-auto"; + }; + }; - home.file.".config/wezterm".source = + programs.starship = { + enable = true; + settings = { + add_newline = false; + format = "$directory$git_branch$git_status$cmd_duration$line_break$character"; + character = { + success_symbol = "[❯](purple)"; + error_symbol = "[❯](red)"; + }; + cmd_duration.format = "[$duration]($style) "; + }; + }; + + # Edit-in-place: the real file stays in my repo, ~/.config just points at it. + home.file.".config/wezterm".source = config.lib.file.mkOutOfStoreSymlink "${dotfiles}/home/.config/wezterm"; + home.file.".config/nvim".source = + config.lib.file.mkOutOfStoreSymlink "${dotfiles}/home/.config/nvim"; + home.file.".config/herdr".source = + config.lib.file.mkOutOfStoreSymlink "${dotfiles}/home/.config/herdr"; } diff --git a/home/.config/herdr/config.toml b/home/.config/herdr/config.toml new file mode 100644 index 0000000..8fa93ac --- /dev/null +++ b/home/.config/herdr/config.toml @@ -0,0 +1,17 @@ +[keys] +prefix = "ctrl+b" +focus_pane_left = "prefix+h" +focus_pane_down = "prefix+j" +focus_pane_up = "prefix+k" +focus_pane_right = "prefix+l" +split_horizontal = "prefix+double_quote" +split_vertical = "prefix+percent" +new_tab = "prefix+c" +close_tab = "prefix+ampersand" +workspace_picker = "prefix+w" +goto = "prefix+g" +copy_mode = "prefix+y" # herdr's copy-mode entry key; copy-mode's own internal keys (v/space select, y/Enter copy, q/Esc cancel) aren't configurable + +[ui] +# Agents panel order: explicit choice of "spaces" (grouped by space, the default) over "priority". +agent_panel_sort = "spaces" diff --git a/home/.config/nvim/init.lua b/home/.config/nvim/init.lua new file mode 100644 index 0000000..88b3d8b --- /dev/null +++ b/home/.config/nvim/init.lua @@ -0,0 +1,3 @@ +require('vim_config') +require('plugin') +require('keys') diff --git a/home/.config/nvim/lazy-lock.json b/home/.config/nvim/lazy-lock.json new file mode 100644 index 0000000..8a799a7 --- /dev/null +++ b/home/.config/nvim/lazy-lock.json @@ -0,0 +1,10 @@ +{ + "diffview.nvim": { "branch": "main", "commit": "4516612fe98ff56ae0415a259ff6361a89419b0a" }, + "gitsigns.nvim": { "branch": "main", "commit": "31d6fb2d618bca1482b9f274751ead5f03461408" }, + "lazy.nvim": { "branch": "main", "commit": "306a05526ada86a7b30af95c5cc81ffba93fef97" }, + "neogit": { "branch": "master", "commit": "f8674ec894315c02449b61c9de9a116c5aafeb90" }, + "oil.nvim": { "branch": "master", "commit": "b73018b75affd13fa38e2fc94ef753b465f770d7" }, + "plenary.nvim": { "branch": "master", "commit": "74b06c6c75e4eeb3108ec01852001636d85a932b" }, + "snacks.nvim": { "branch": "main", "commit": "882c996cf28183f4d63640de0b4c02ec886d01f2" }, + "which-key.nvim": { "branch": "main", "commit": "3aab2147e74890957785941f0c1ad87d0a44c15a" } +} diff --git a/home/.config/nvim/lua/keys.lua b/home/.config/nvim/lua/keys.lua new file mode 100644 index 0000000..cfbe1c3 --- /dev/null +++ b/home/.config/nvim/lua/keys.lua @@ -0,0 +1,7 @@ +-- save by pressing Escape +vim.keymap.set('n', '', ':w', { desc = 'Save' }) +-- select all +vim.keymap.set('n', '', 'ggVG', { desc = 'Select All' }) +-- pasting over a selection no longer clobbers your clipboard +vim.cmd([[ xnoremap p 'pgv"'.v:register.'y' ]]) + diff --git a/home/.config/nvim/lua/plugin.lua b/home/.config/nvim/lua/plugin.lua new file mode 100644 index 0000000..e528a1c --- /dev/null +++ b/home/.config/nvim/lua/plugin.lua @@ -0,0 +1,8 @@ +local lazypath = vim.fn.stdpath('data') .. '/lazy/lazy.nvim' +if not vim.uv.fs_stat(lazypath) then + vim.fn.system({ 'git', 'clone', '--filter=blob:none', + 'https://github.com/folke/lazy.nvim.git', '--branch=stable', lazypath }) +end +vim.opt.rtp:prepend(lazypath) +require('lazy').setup('plugins') -- load every file in lua/plugins/ + diff --git a/home/.config/nvim/lua/plugins/git.lua b/home/.config/nvim/lua/plugins/git.lua new file mode 100644 index 0000000..3811e93 --- /dev/null +++ b/home/.config/nvim/lua/plugins/git.lua @@ -0,0 +1,13 @@ +return { + { + 'NeogitOrg/neogit', + dependencies = { 'nvim-lua/plenary.nvim', 'sindrets/diffview.nvim' }, + keys = { { 'g', function() require('neogit').open() end, desc = 'Neogit' } }, + }, + { + 'lewis6991/gitsigns.nvim', + event = 'BufWinEnter', + opts = { current_line_blame = true }, -- who last touched this line + }, +} + diff --git a/home/.config/nvim/lua/plugins/navigation.lua b/home/.config/nvim/lua/plugins/navigation.lua new file mode 100644 index 0000000..df163f3 --- /dev/null +++ b/home/.config/nvim/lua/plugins/navigation.lua @@ -0,0 +1,24 @@ +return { + { + 'stevearc/oil.nvim', + opts = { view_options = { show_hidden = true } }, + keys = { { 'e', 'Oil', desc = 'File Browser' } }, + }, + { + 'folke/snacks.nvim', + priority = 1000, + lazy = false, + opts = { + picker = { enabled = true }, + notifier = { enabled = true }, + input = { enabled = true }, + }, + keys = { + { 'f', function() Snacks.picker.files() end, desc = 'Find Files' }, + { 's', function() Snacks.picker.grep() end, desc = 'Search Text' }, + { 'b', function() Snacks.picker.buffers() end, desc = 'Buffers' }, + { 'gd', function() Snacks.picker.lsp_definitions() end, desc = 'Goto Definition' }, + }, + }, +} + diff --git a/home/.config/nvim/lua/plugins/ui.lua b/home/.config/nvim/lua/plugins/ui.lua new file mode 100644 index 0000000..754ccac --- /dev/null +++ b/home/.config/nvim/lua/plugins/ui.lua @@ -0,0 +1,8 @@ +return { + { + 'folke/which-key.nvim', + lazy = false, + config = true, -- popup that shows what my leader keys do + }, +} + diff --git a/home/.config/nvim/lua/vim_config.lua b/home/.config/nvim/lua/vim_config.lua new file mode 100644 index 0000000..f574d1c --- /dev/null +++ b/home/.config/nvim/lua/vim_config.lua @@ -0,0 +1,13 @@ +local o = vim.opt +vim.g.mapleader = ' ' -- space is the leader key +o.expandtab = true -- spaces, not tabs +o.shiftwidth = 2 -- 2 spaces per indent level +o.number = true -- absolute number on the cursor line, relative elsewhere +o.relativenumber = true -- relative line numbers for fast jumps +o.ignorecase = true -- search is case-insensitive by default +o.smartcase = true -- case-sensitive only if i type a capital +o.clipboard = 'unnamedplus' -- share the system clipboard +o.scrolloff = 16 -- keep cursor away from the screen edge +o.undofile = true -- persistent undo across sessions +o.mouse = '' -- no mouse in nvim; also lets Herdr keep host mouse capture off so Escape isn't swallowed + diff --git a/home/.config/wezterm/wezterm.lua b/home/.config/wezterm/wezterm.lua new file mode 100644 index 0000000..8bb9ce8 --- /dev/null +++ b/home/.config/wezterm/wezterm.lua @@ -0,0 +1,13 @@ +local wezterm = require("wezterm") + +local config = wezterm.config_builder() + +config.color_scheme = "rose-pine-moon" +config.font = wezterm.font("Hack Nerd Font") +config.font_size = 15.0 +config.window_background_opacity = 0.8 +config.macos_window_background_blur = 50 +config.hide_tab_bar_if_only_one_tab = true +config.window_decorations = "RESIZE" + +return config