feat(zsh): prospectively migrate back
This commit is contained in:
parent
ed8e5bf7fd
commit
1ca5e7d974
11 changed files with 208 additions and 152 deletions
|
|
@ -1,29 +0,0 @@
|
|||
_tf="${XDG_STATE_HOME:-$HOME/.local/state}/theme"
|
||||
THEME="$(cat "$_tf" 2>/dev/null)" || THEME="midnight"
|
||||
export THEME
|
||||
unset _tf
|
||||
|
||||
shopt -s autocd cdspell dirspell globstar histappend
|
||||
|
||||
HISTFILE="${XDG_STATE_HOME:-$HOME/.local/state}/bash_history"
|
||||
HISTSIZE=50000
|
||||
HISTFILESIZE=50000
|
||||
HISTCONTROL=ignoreboth:erasedups
|
||||
|
||||
export GPG_TTY=$(tty)
|
||||
export FZF_COMPLETION_TRIGGER=';'
|
||||
export FZF_TMUX=1
|
||||
|
||||
fzf-config-widget() {
|
||||
local selected
|
||||
selected="$(rg --files --hidden "$HOME"/.config | sed "s|$HOME|~|" | \
|
||||
FZF_DEFAULT_OPTS=$(__fzf_defaults "--reverse --scheme=path" "-m") \
|
||||
FZF_DEFAULT_OPTS_FILE='' $(__fzfcmd))" || return
|
||||
selected="${selected//$'\n'/ }"
|
||||
READLINE_LINE="${READLINE_LINE:0:READLINE_POINT}${selected}${READLINE_LINE:READLINE_POINT}"
|
||||
READLINE_POINT=$((READLINE_POINT + ${#selected}))
|
||||
}
|
||||
bind -m vi-insert -x '"\C-e": fzf-config-widget'
|
||||
bind -m vi-command -x '"\C-e": fzf-config-widget'
|
||||
|
||||
[ -r "$OPAMROOT/opam-init/init.sh" ] && . "$OPAMROOT/opam-init/init.sh" > /dev/null 2> /dev/null
|
||||
|
|
@ -1,26 +0,0 @@
|
|||
set editing-mode vi
|
||||
set show-mode-in-prompt on
|
||||
set vi-cmd-mode-string "\1\e[2 q\2"
|
||||
set vi-ins-mode-string "\1\e[6 q\2"
|
||||
|
||||
set completion-ignore-case on
|
||||
set colored-stats on
|
||||
set show-all-if-ambiguous on
|
||||
|
||||
$if mode=vi
|
||||
set keymap vi-command
|
||||
"\C-l": clear-screen
|
||||
"\C-p": previous-history
|
||||
"\C-n": next-history
|
||||
"\C-j": backward-char
|
||||
"\C-k": forward-char
|
||||
"\e[3~": delete-char
|
||||
|
||||
set keymap vi-insert
|
||||
"\C-l": clear-screen
|
||||
"\C-p": previous-history
|
||||
"\C-n": next-history
|
||||
"\C-j": backward-char
|
||||
"\C-k": forward-char
|
||||
"\e[3~": delete-char
|
||||
$endif
|
||||
67
config/claude/skills/canola/SKILL.md
Normal file
67
config/claude/skills/canola/SKILL.md
Normal file
|
|
@ -0,0 +1,67 @@
|
|||
---
|
||||
name: canola
|
||||
description: This skill should be used when starting a canola.nvim issue fix
|
||||
session, processing upstream oil.nvim issues, or when the user invokes /canola.
|
||||
version: 0.3.0
|
||||
---
|
||||
|
||||
# Canola Issue Fix Session
|
||||
|
||||
## Repo rules (non-negotiable)
|
||||
|
||||
- ALL PRs target `barrettruth/canola.nvim` (remote `origin`) — NEVER `stevearc/oil.nvim`
|
||||
- Upstream (`stevearc/oil.nvim`) is READ-ONLY: fetch, diff, view — never push or open PRs
|
||||
- Always pass `--repo barrettruth/canola.nvim` explicitly to every `gh pr` command
|
||||
|
||||
## Phase 1: Research (parallel, 2 issues at a time)
|
||||
|
||||
Process at most 2 issues per session. Spawn one Agent(subagent_type=general,
|
||||
worktree=true) per issue using EnterWorktree so each agent works in an
|
||||
isolated git worktree. Each agent receives: issue number, description, and
|
||||
instructions to find:
|
||||
- Root cause (which files, which functions, line numbers)
|
||||
- Whether a test already covers it
|
||||
- Whether the fix has side effects in other adapters or modes
|
||||
- What upstream's latest state is
|
||||
|
||||
## Phase 2: Plan mode — present BEFORE implementing
|
||||
|
||||
Call EnterPlanMode immediately after research completes.
|
||||
|
||||
For each issue, present the FULL picture:
|
||||
- Problem statement (2-3 sentences, not just the title)
|
||||
- Root cause (files + line numbers)
|
||||
- **Expected behavior** — what the correct outcome looks like, step by step,
|
||||
so the user knows exactly what to verify after the fix
|
||||
- Solution A: description, tradeoffs, risks
|
||||
- Solution B: description, tradeoffs, risks
|
||||
- Recommended solution and why
|
||||
- Config surface change? (yes/no) → vimdoc needed?
|
||||
|
||||
Do NOT write any code or edit any files during plan mode.
|
||||
Do NOT exit plan mode until the user has approved an approach for every issue.
|
||||
Call ExitPlanMode only after receiving explicit approval.
|
||||
|
||||
## Phase 3: Implement (one at a time, after plan mode exits)
|
||||
|
||||
For each approved issue:
|
||||
1. Write `/tmp/minimal_init.lua` — self-contained repro
|
||||
2. Give user step-by-step instructions to confirm bug reproduces
|
||||
3. Implement fix
|
||||
4. Give user the pre-laid-out expected behavior from Phase 2 as a checklist
|
||||
to verify the fix works (no surprises — user already knows what to expect)
|
||||
5. /gc — conventional commit on fix/<short> branch
|
||||
6. /pr — push, create PR targeting `barrettruth/canola.nvim` with Problem/Solution body
|
||||
7. Update doc/upstream.md — status → fixed, add PR + commit link
|
||||
8. /gc + push the upstream.md change on same branch
|
||||
|
||||
## Subagent Research Prompt Template
|
||||
|
||||
"Research upstream oil.nvim issue #NNN for the canola.nvim fork.
|
||||
Read: doc/upstream.md entry for this issue, then trace the relevant
|
||||
source files to find the root cause. Return:
|
||||
- Affected files and functions (with line numbers)
|
||||
- Root cause in 2-3 sentences
|
||||
- Expected correct behavior (step by step)
|
||||
- Risky areas (other code that touches the same path)
|
||||
- Whether existing tests cover this behavior"
|
||||
|
|
@ -102,12 +102,12 @@ return {
|
|||
end,
|
||||
},
|
||||
keymaps = {
|
||||
['<C-h>'] = false,
|
||||
['<C-t>'] = false,
|
||||
['<C-l>'] = false,
|
||||
['<C-r>'] = 'actions.refresh',
|
||||
['<C-s>'] = { 'actions.select', opts = { vertical = true } },
|
||||
['<C-x>'] = {
|
||||
['<c-h>'] = false,
|
||||
['<c-t>'] = false,
|
||||
['<c-l>'] = false,
|
||||
['<c-r>'] = 'actions.refresh',
|
||||
['<c-s>'] = { 'actions.select', opts = { vertical = true } },
|
||||
['<c-x>'] = {
|
||||
'actions.select',
|
||||
opts = { horizontal = true },
|
||||
},
|
||||
|
|
@ -121,7 +121,6 @@ return {
|
|||
end,
|
||||
},
|
||||
})
|
||||
-- TODO: better way to do this allowing vim.g.canola as that's it
|
||||
local refresh = require('canola.actions').refresh
|
||||
local orig_refresh = refresh.callback
|
||||
refresh.callback = function(...)
|
||||
|
|
@ -153,7 +152,11 @@ return {
|
|||
{
|
||||
'barrettruth/pending.nvim',
|
||||
before = function()
|
||||
vim.g.pending = { debug = false }
|
||||
vim.g.pending = {
|
||||
debug = true,
|
||||
-- TODO: use date formats/personal rice
|
||||
data_path = (os.getenv('XDG_STATE_HOME') or (os.getenv('HOME') .. '/.local/state')) .. '/nvim/pending/tasks.json',
|
||||
}
|
||||
end,
|
||||
cmd = 'Pending',
|
||||
keys = { { '<leader>P', '<cmd>Pending<cr>' } },
|
||||
|
|
@ -183,7 +186,7 @@ return {
|
|||
commands = {
|
||||
build = {
|
||||
'g++',
|
||||
'-std=c++23',
|
||||
'-std=c++20',
|
||||
'-O2',
|
||||
'-Wall',
|
||||
'-Wextra',
|
||||
|
|
@ -202,7 +205,7 @@ return {
|
|||
run = { '{binary}' },
|
||||
debug = {
|
||||
'g++',
|
||||
'-std=c++23',
|
||||
'-std=c++20',
|
||||
'-g3',
|
||||
'-fsanitize=address,undefined',
|
||||
'-fno-omit-frame-pointer',
|
||||
|
|
|
|||
|
|
@ -28,6 +28,10 @@
|
|||
"rev": "f2634758455cfa52a8acea6f142dcd6271a1bf57",
|
||||
"src": "https://github.com/monaqa/dial.nvim"
|
||||
},
|
||||
"fzf-lua": {
|
||||
"rev": "1eba927866251bae1b61dffc5b673b8dbd0f3f48",
|
||||
"src": "https://github.com/ibhagwan/fzf-lua"
|
||||
},
|
||||
"guard-collection": {
|
||||
"rev": "edf6c86c06badc972964dadb7fd469022690cbf0",
|
||||
"src": "https://github.com/nvimdev/guard-collection"
|
||||
|
|
@ -109,4 +113,4 @@
|
|||
"src": "https://github.com/tpope/vim-sleuth"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -54,9 +54,9 @@ unbind C-u; bind C-u if -F '#{pane_in_mode}' { send-keys -X halfpage-up } { copy
|
|||
unbind /; bind / if -F '#{pane_in_mode}' { send-keys -X cancel } { copy-mode ; command-prompt -p '/' { send -X search-forward -- '%%' } }
|
||||
unbind ?; bind ? if -F '#{pane_in_mode}' { send-keys -X cancel } { copy-mode ; command-prompt -p '?' { send -X search-backward -- '%%' } }
|
||||
|
||||
bind -T copy-mode-vi WheelDownPane select-pane \; send-keys -X scroll-down
|
||||
bind -T copy-mode-vi v send-keys -X begin-selection
|
||||
bind -T copy-mode-vi y send-keys -X copy-pipe 'test -n "$WAYLAND_DISPLAY" && wl-copy || xclip -in -sel c'
|
||||
# TODO: breaks all the time
|
||||
bind -n DoubleClick1Pane select-pane \; copy-mode -M \; send-keys -X select-word \; run-shell -d 0.3 \; send-keys -X copy-pipe-and-cancel 'test -n "$WAYLAND_DISPLAY" && wl-copy || xclip -in -sel c'
|
||||
bind -n TripleClick1Pane select-pane \; copy-mode -M \; send-keys -X select-line \; run-shell -d 0.3 \; send-keys -X copy-pipe-and-cancel 'test -n "$WAYLAND_DISPLAY" && wl-copy || xclip -in -sel c'
|
||||
bind -T copy-mode-vi DoubleClick1Pane select-pane \; send-keys -X select-word \; run-shell -d 0.3 \; send-keys -X copy-pipe 'test -n "$WAYLAND_DISPLAY" && wl-copy || xclip -in -sel c' \; send-keys -X clear-selection
|
||||
|
|
|
|||
57
config/zsh/zshrc
Normal file
57
config/zsh/zshrc
Normal file
|
|
@ -0,0 +1,57 @@
|
|||
autoload -U compinit && compinit -d "$XDG_STATE_HOME/zcompdump" -u
|
||||
zmodload zsh/complist
|
||||
zstyle ':completion:*' list-colors ${(s.:.)LS_COLORS}
|
||||
zstyle ':completion:*' matcher-list 'm:{a-zA-Z}={A-za-z}'
|
||||
|
||||
export GPG_TTY=$(tty)
|
||||
export THEME="${THEME:-midnight}"
|
||||
|
||||
setopt auto_cd
|
||||
unsetopt beep notify
|
||||
unset completealiases
|
||||
|
||||
bindkey -v
|
||||
bindkey '^[[3~' delete-char
|
||||
bindkey '^P' up-line-or-history
|
||||
bindkey '^N' down-line-or-history
|
||||
bindkey '^J' backward-char
|
||||
bindkey '^K' forward-char
|
||||
|
||||
export PURE_PROMPT_SYMBOL=">"
|
||||
export PURE_PROMPT_VICMD_SYMBOL="<"
|
||||
export PURE_GIT_UP_ARROW="^"
|
||||
export PURE_GIT_DOWN_ARROW="v"
|
||||
export PURE_GIT_STASH_SYMBOL="="
|
||||
export PURE_CMD_MAX_EXEC_TIME=5
|
||||
export PURE_GIT_PULL=0
|
||||
export PURE_GIT_UNTRACKED_DIRTY=1
|
||||
zstyle ':prompt:pure:git:stash' show yes
|
||||
|
||||
autoload -Uz promptinit && promptinit
|
||||
prompt pure
|
||||
|
||||
autoload -Uz add-zle-hook-widget
|
||||
function _cursor_shape() {
|
||||
case $KEYMAP in
|
||||
vicmd) echo -ne '\e[2 q' ;;
|
||||
viins|main) echo -ne '\e[6 q' ;;
|
||||
esac
|
||||
}
|
||||
function _cursor_init() { echo -ne '\e[6 q'; }
|
||||
add-zle-hook-widget zle-keymap-select _cursor_shape
|
||||
add-zle-hook-widget zle-line-init _cursor_init
|
||||
|
||||
export FZF_COMPLETION_TRIGGER=\;
|
||||
export FZF_TMUX=1
|
||||
|
||||
fzf-config-widget() {
|
||||
local file="$(FZF_CTRL_T_COMMAND="fd --type file --hidden . \"$XDG_CONFIG_HOME\"/nix | sed \"s|$HOME|~|g\"" __fzf_select)"
|
||||
[ -n "$file" ] || { zle reset-prompt; return; }
|
||||
file="${file/#\\~/~}"
|
||||
LBUFFER+="$file"
|
||||
zle reset-prompt
|
||||
}
|
||||
zle -N fzf-config-widget
|
||||
bindkey '^E' fzf-config-widget
|
||||
|
||||
[[ ! -r "$OPAMROOT/opam-init/init.zsh" ]] || source "$OPAMROOT/opam-init/init.zsh" > /dev/null 2> /dev/null
|
||||
Loading…
Add table
Add a link
Reference in a new issue