Compare commits
2 commits
e43a5eb880
...
592e989b03
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
592e989b03 | ||
|
|
9283643e07 |
4 changed files with 135 additions and 3 deletions
53
assets/zed/settings.json
Normal file
53
assets/zed/settings.json
Normal file
|
|
@ -0,0 +1,53 @@
|
|||
// Zed settings — tracked in dotfiles, symlinked into ~/.config/zed/settings.json
|
||||
// by home-manager (xdg.configFile in nixos/home/danny/home.nix).
|
||||
//
|
||||
// Because this is a symlink to a nix-store file, editing it from inside Zed
|
||||
// will fail (read-only). Edit THIS file in dotfiles, commit, and rebuild
|
||||
// (`darwin-rebuild switch --flake .`). To see Zed's full default settings,
|
||||
// run `zed: open default settings` from the command palette.
|
||||
{
|
||||
"sticky_scroll": {
|
||||
"enabled": true
|
||||
},
|
||||
"edit_predictions": {
|
||||
"provider": "ollama"
|
||||
},
|
||||
"buffer_font_family": "JetBrains Mono",
|
||||
"cli_default_open_behavior": "existing_window",
|
||||
"project_panel": {
|
||||
"dock": "left"
|
||||
},
|
||||
"outline_panel": {
|
||||
"dock": "left"
|
||||
},
|
||||
"collaboration_panel": {
|
||||
"dock": "left"
|
||||
},
|
||||
"git_panel": {
|
||||
"dock": "left"
|
||||
},
|
||||
"agent": {
|
||||
"dock": "right",
|
||||
"default_model": {
|
||||
"provider": "ollama",
|
||||
"model": "llama3.2:latest"
|
||||
}
|
||||
},
|
||||
"disable_ai": false,
|
||||
"minimap": {
|
||||
"show": "auto"
|
||||
},
|
||||
"telemetry": {
|
||||
"diagnostics": false,
|
||||
"metrics": false
|
||||
},
|
||||
"base_keymap": "VSCode",
|
||||
"vim_mode": true,
|
||||
"ui_font_size": 16,
|
||||
"buffer_font_size": 15,
|
||||
"theme": {
|
||||
"mode": "system",
|
||||
"light": "One Light",
|
||||
"dark": "One Dark"
|
||||
}
|
||||
}
|
||||
|
|
@ -24,6 +24,38 @@
|
|||
|
||||
set fish_greeting 🐟: (set_color yellow; date +%T; set_color green; date --iso-8601 2>/dev/null; or date +%F; set_color normal)
|
||||
|
||||
# gco: smart `git checkout` — if the branch is checked out in another
|
||||
# worktree, cd there instead of failing with "already used by worktree at".
|
||||
function gco --description 'git checkout, but cd into worktree if the branch lives there'
|
||||
if test (count $argv) -eq 0
|
||||
git checkout
|
||||
return $status
|
||||
end
|
||||
|
||||
set -l branch $argv[1]
|
||||
set -l target_ref "refs/heads/$branch"
|
||||
set -l wt_path ""
|
||||
set -l current_wt ""
|
||||
for line in (git worktree list --porcelain 2>/dev/null)
|
||||
switch $line
|
||||
case 'worktree *'
|
||||
set current_wt (string replace -r '^worktree ' "" -- $line)
|
||||
case "branch $target_ref"
|
||||
set wt_path $current_wt
|
||||
break
|
||||
end
|
||||
end
|
||||
|
||||
set -l here (git rev-parse --show-toplevel 2>/dev/null)
|
||||
if test -n "$wt_path"; and test "$wt_path" != "$here"
|
||||
echo "→ cd $wt_path (branch '$branch' is checked out in another worktree)"
|
||||
cd $wt_path
|
||||
return $status
|
||||
end
|
||||
|
||||
git checkout $argv
|
||||
end
|
||||
|
||||
# Alacritty palette follows macOS appearance; refresh when opening a shell (LaunchAgent also polls).
|
||||
if test (uname -s) = Darwin
|
||||
bash ~/dotfiles/scripts/alacritty-sync-system-theme.sh >/dev/null 2>&1 &
|
||||
|
|
|
|||
|
|
@ -89,14 +89,21 @@
|
|||
tmux-fzf
|
||||
extrakto
|
||||
# tmux-resurrect: prefix + Ctrl-s saves, prefix + Ctrl-r restores.
|
||||
# Snapshot lives at ~/.local/share/tmux/resurrect/last (window
|
||||
# layout, working dirs, pane contents if enabled). Survives
|
||||
# force-quits / reboots / kernel panics.
|
||||
# Snapshot lives at ~/.tmux/resurrect/last (window layout, working
|
||||
# dirs, pane contents if enabled). Survives force-quits / reboots
|
||||
# / kernel panics.
|
||||
#
|
||||
# @resurrect-processes: programs to restart on restore. Default
|
||||
# list covers vim/emacs/less/top/etc. but NOT nvim, claude, or
|
||||
# ssh. The "~name->cmd" form re-runs the original argv; bare
|
||||
# names match argv-less invocations. Without this, restored panes
|
||||
# come back as plain fish prompts in the right directory.
|
||||
{
|
||||
plugin = resurrect;
|
||||
extraConfig = ''
|
||||
set -g @resurrect-capture-pane-contents 'on'
|
||||
set -g @resurrect-strategy-nvim 'session'
|
||||
set -g @resurrect-processes 'nvim "~nvim->nvim *" claude "~claude->claude --continue" ssh "~ssh->ssh *"'
|
||||
'';
|
||||
}
|
||||
# tmux-continuum: auto-saves every 15min and auto-restores on
|
||||
|
|
@ -164,6 +171,11 @@
|
|||
xdg.configFile."alacritty/catppuccin-mocha-colors.toml".source =
|
||||
../../../assets/alacritty/catppuccin-mocha-colors.toml;
|
||||
|
||||
# Zed: settings.json is a read-only symlink to assets/zed/settings.json.
|
||||
# To change a setting, edit the asset file and rebuild — editing via Zed's
|
||||
# UI will fail because the target is in the nix store.
|
||||
xdg.configFile."zed/settings.json".source = ../../../assets/zed/settings.json;
|
||||
|
||||
# Alacritty: base config + imported active-colors.toml (updated without rebuild)
|
||||
programs.alacritty = {
|
||||
enable = true;
|
||||
|
|
|
|||
|
|
@ -58,6 +58,39 @@
|
|||
end,
|
||||
})
|
||||
|
||||
-- Treesitter highlighting: parser-driven syntax highlighting (richer
|
||||
-- than the regex-based default). Leaving `indent` off — it's still
|
||||
-- buggy in several languages (python, yaml).
|
||||
require'nvim-treesitter.configs'.setup {
|
||||
highlight = { enable = true },
|
||||
}
|
||||
|
||||
-- Sticky scroll: pin enclosing scopes (functions, classes, YAML keys,
|
||||
-- etc.) to the top of the window as you scroll deeper. Same idea as
|
||||
-- Zed/VS Code's "Sticky Scroll". `mode = 'topline'` matches Zed's
|
||||
-- "scrolled past" feel; switch to 'cursor' if you'd rather it track
|
||||
-- the cursor instead of the viewport.
|
||||
require'treesitter-context'.setup {
|
||||
enable = true,
|
||||
max_lines = 5,
|
||||
mode = 'topline',
|
||||
trim_scope = 'outer',
|
||||
}
|
||||
|
||||
-- Fish: expand tabs to spaces. Fish renders raw \t in the commandline
|
||||
-- as the Unicode glyph ␉ (U+2409) and wrap-indents each line to the
|
||||
-- column of the opening quote, which mangles Alt-E multiline edits.
|
||||
-- Using spaces sidesteps the issue entirely.
|
||||
vim.api.nvim_create_autocmd("FileType", {
|
||||
pattern = "fish",
|
||||
callback = function()
|
||||
vim.opt_local.expandtab = true
|
||||
vim.opt_local.tabstop = 2
|
||||
vim.opt_local.shiftwidth = 2
|
||||
vim.opt_local.softtabstop = 2
|
||||
end,
|
||||
})
|
||||
|
||||
-- Keymaps
|
||||
vim.keymap.set("n", "S", ":%s//g<Left><Left>", { desc = "Replace all" })
|
||||
vim.keymap.set("n", "<leader>w", ":w<CR>", { desc = "Save file" })
|
||||
|
|
@ -73,6 +106,8 @@
|
|||
catppuccin-nvim # theme
|
||||
goyo-vim # write prose
|
||||
limelight-vim # prose paragraph highlighter
|
||||
nvim-treesitter.withAllGrammars # parsers (also makes vim.treesitter.foldexpr work for markdown)
|
||||
nvim-treesitter-context # sticky scroll: pin parent scopes at top of window
|
||||
];
|
||||
};
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue