mirror of
https://github.com/ivuorinen/dotfiles.git
synced 2026-03-20 23:06:51 +00:00
Compare commits
92 Commits
3fb9d2a32e
...
renovate/a
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a91427d01c | ||
| 9bfc7702ae | |||
| 9c90d48372 | |||
| a20f21c8b3 | |||
| a285e01601 | |||
| 5d8baea825 | |||
| 73ef292bd9 | |||
| 72934232d9 | |||
| 4ca473b11c | |||
| 10cc23f471 | |||
| c17b4d6a8b | |||
| cff83e4738 | |||
| 2b867c3348 | |||
| 301ded44f3 | |||
| 3a1461a647 | |||
| f2a3ae9a4b | |||
| 98394f1220 | |||
| 066207ef45 | |||
|
|
2cdcac2a65 | ||
| 4b8ee6ffc1 | |||
|
|
9875a4d4a0 | ||
|
|
035405b22f | ||
|
|
7dd6ccbc6c | ||
| 8a5c9f9089 | |||
|
|
2410f343c2 | ||
|
|
d120839830 | ||
|
|
5662d09202 | ||
|
|
076050ad58 | ||
|
|
313915e55c | ||
|
|
e490a735c8 | ||
|
|
5fe82b2898 | ||
|
|
6621bcb470 | ||
| 3b6ace12e9 | |||
|
|
f92e4a606f | ||
| fae7a8f13f | |||
| eaa7680671 | |||
| 070c94a244 | |||
| 70cf8ccf6d | |||
| 63faf4c4bf | |||
|
|
d81ff6dabb | ||
| ed6bef5c7e | |||
| 46b9e3ebeb | |||
| f26303a0ff | |||
| 8379135c81 | |||
| 73d0d6b35f | |||
| 6a839eea56 | |||
| 28c8332058 | |||
| b956119b98 | |||
|
|
0f82f8e65b | ||
|
|
f1277ddf99 | ||
|
|
c834eab42b | ||
|
|
f93deb8bca | ||
|
|
248f57b914 | ||
|
|
86e4f9618c | ||
|
|
7eb97392fb | ||
|
|
8be1a9e7e2 | ||
|
|
a7c03fc3d6 | ||
|
|
3368e3b6dc | ||
|
|
5d87452224 | ||
|
|
d779d23723 | ||
|
|
ee812de4af | ||
| a18c16b0b9 | |||
| 785a8e8eb7 | |||
| 1cda859999 | |||
| bc69560da4 | |||
| 2ee9407a43 | |||
| 765c2fce72 | |||
| 88eceaf194 | |||
| 6d72003446 | |||
| cff3d1dd8a | |||
| a47ce85991 | |||
| 13dd701eb7 | |||
| cfde007494 | |||
| ed4aa2ffe1 | |||
| bcf11406b6 | |||
| 443361cddb | |||
| 083d30a0c3 | |||
| 81190c051a | |||
| de773ad68f | |||
| e8725c4b47 | |||
| b8070e2815 | |||
| 9de394d8e9 | |||
| 08de5ea4a6 | |||
| 0e69b7cb16 | |||
| 7c9096d666 | |||
| efd9eebc85 | |||
| fc8db1f5b5 | |||
| 4414e0c3b6 | |||
| abb6c9f615 | |||
| 57b566704e | |||
|
|
4510e62070 | ||
| 959e7c418e |
14
.claude/agents/code-reviewer.md
Normal file
14
.claude/agents/code-reviewer.md
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
---
|
||||||
|
name: code-reviewer
|
||||||
|
description: Reviews shell/fish/lua changes for correctness and style
|
||||||
|
tools: [Read, Grep, Glob, Bash]
|
||||||
|
---
|
||||||
|
|
||||||
|
Review the changed files for:
|
||||||
|
|
||||||
|
1. **Shell scripts**: POSIX compliance for /bin/sh scripts, proper quoting, shellcheck issues
|
||||||
|
2. **Fish files**: fish syntax correctness, consistent function patterns
|
||||||
|
3. **Lua files**: stylua compliance, Neovim API usage patterns
|
||||||
|
4. **All**: EditorConfig compliance (2-space indent, LF endings)
|
||||||
|
|
||||||
|
Report only high-confidence issues. Skip vendor files (fzf-tmux).
|
||||||
13
.claude/hooks/async-bats.sh
Executable file
13
.claude/hooks/async-bats.sh
Executable file
@@ -0,0 +1,13 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
# Async Bats runner: run matching test file when a script is edited.
|
||||||
|
# Runs in background (async: true) — output appears on next turn.
|
||||||
|
|
||||||
|
fp=$(jq -r '.tool_input.file_path // empty')
|
||||||
|
[ -z "$fp" ] && exit 0
|
||||||
|
|
||||||
|
name=$(basename "$fp")
|
||||||
|
test_file="$CLAUDE_PROJECT_DIR/tests/${name}.bats"
|
||||||
|
[ ! -f "$test_file" ] && exit 0
|
||||||
|
|
||||||
|
echo "Running $test_file ..."
|
||||||
|
"$CLAUDE_PROJECT_DIR/node_modules/.bin/bats" "$test_file"
|
||||||
14
.claude/hooks/log-failures.sh
Executable file
14
.claude/hooks/log-failures.sh
Executable file
@@ -0,0 +1,14 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
# PostToolUseFailure logger: append tool failures to a local log file.
|
||||||
|
|
||||||
|
log_file="$CLAUDE_PROJECT_DIR/.claude/hook-failures.log"
|
||||||
|
|
||||||
|
entry=$(jq -c '{
|
||||||
|
time: (now | strftime("%Y-%m-%dT%H:%M:%SZ")),
|
||||||
|
tool: .tool_name,
|
||||||
|
error: .error
|
||||||
|
}')
|
||||||
|
|
||||||
|
echo "$entry" >> "$log_file"
|
||||||
|
|
||||||
|
exit 0
|
||||||
13
.claude/hooks/notify-idle.sh
Executable file
13
.claude/hooks/notify-idle.sh
Executable file
@@ -0,0 +1,13 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
# Notification hook: alert when Claude goes idle.
|
||||||
|
# Uses pushover if available, falls back to macOS native notification.
|
||||||
|
|
||||||
|
msg=$(jq -r '.message // "Claude is waiting for input"')
|
||||||
|
|
||||||
|
if command -v pushover > /dev/null; then
|
||||||
|
pushover "Claude Code" "$msg"
|
||||||
|
elif command -v osascript > /dev/null; then
|
||||||
|
osascript -e "display notification \"$msg\" with title \"Claude Code\""
|
||||||
|
fi
|
||||||
|
|
||||||
|
exit 0
|
||||||
15
.claude/hooks/post-edit-config-warn.sh
Executable file
15
.claude/hooks/post-edit-config-warn.sh
Executable file
@@ -0,0 +1,15 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
# Post-edit: warn when formatter/linter configs are changed,
|
||||||
|
# since they affect the entire repo's code style.
|
||||||
|
|
||||||
|
fp=$(jq -r '.tool_input.file_path // empty')
|
||||||
|
[ -z "$fp" ] || [ ! -f "$fp" ] && exit 0
|
||||||
|
|
||||||
|
case "$(basename "$fp")" in
|
||||||
|
.editorconfig | biome.json | .prettierrc.json | .shellcheckrc | stylua.toml | .yamllint.yml)
|
||||||
|
echo "NOTE: Formatter/linter config changed ($fp)." >&2
|
||||||
|
echo "Run 'pre-commit run --all-files' to verify consistency." >&2
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
exit 0
|
||||||
28
.claude/hooks/post-edit-dotbot-validate.sh
Executable file
28
.claude/hooks/post-edit-dotbot-validate.sh
Executable file
@@ -0,0 +1,28 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
# Post-edit: validate Dotbot install.conf.yaml files after editing.
|
||||||
|
# Checks YAML syntax and verifies link targets exist.
|
||||||
|
|
||||||
|
fp=$(jq -r '.tool_input.file_path // empty')
|
||||||
|
[ -z "$fp" ] || [ ! -f "$fp" ] && exit 0
|
||||||
|
|
||||||
|
case "$fp" in
|
||||||
|
*install.conf.yaml) ;;
|
||||||
|
*) exit 0 ;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
# YAML syntax check
|
||||||
|
if command -v yamllint > /dev/null; then
|
||||||
|
if ! output=$(yamllint -d relaxed "$fp" 2>&1); then
|
||||||
|
echo "Dotbot config YAML error in $fp:" >&2
|
||||||
|
echo "$output" >&2
|
||||||
|
exit 2
|
||||||
|
fi
|
||||||
|
elif command -v python3 > /dev/null; then
|
||||||
|
if ! output=$(python3 -c "import yaml; yaml.safe_load(open('$fp'))" 2>&1); then
|
||||||
|
echo "Dotbot config YAML parse error in $fp:" >&2
|
||||||
|
echo "$output" >&2
|
||||||
|
exit 2
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
exit 0
|
||||||
30
.claude/hooks/post-edit-format.sh
Executable file
30
.claude/hooks/post-edit-format.sh
Executable file
@@ -0,0 +1,30 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
# Post-edit formatter: auto-format file based on extension.
|
||||||
|
# Receives tool output JSON on stdin.
|
||||||
|
|
||||||
|
fp=$(jq -r '.tool_input.file_path // empty')
|
||||||
|
[ -z "$fp" ] || [ ! -f "$fp" ] && exit 0
|
||||||
|
|
||||||
|
case "$fp" in
|
||||||
|
*.sh | */bin/*)
|
||||||
|
head -1 "$fp" | grep -qE '^#!.*(ba)?sh' \
|
||||||
|
&& command -v shfmt > /dev/null \
|
||||||
|
&& shfmt -i 2 -bn -ci -sr -fn -w "$fp"
|
||||||
|
;;
|
||||||
|
*.fish)
|
||||||
|
command -v fish_indent > /dev/null && fish_indent -w "$fp"
|
||||||
|
;;
|
||||||
|
*.lua)
|
||||||
|
command -v stylua > /dev/null && stylua "$fp"
|
||||||
|
;;
|
||||||
|
*.md)
|
||||||
|
command -v biome > /dev/null && biome format --write "$fp" 2> /dev/null
|
||||||
|
command -v markdown-table-formatter > /dev/null \
|
||||||
|
&& markdown-table-formatter "$fp" 2> /dev/null
|
||||||
|
;;
|
||||||
|
*.yml | *.yaml)
|
||||||
|
command -v prettier > /dev/null && prettier --write "$fp" 2> /dev/null
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
exit 0
|
||||||
35
.claude/hooks/pre-edit-block.sh
Executable file
35
.claude/hooks/pre-edit-block.sh
Executable file
@@ -0,0 +1,35 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
# Pre-edit guard: block vendor/lock files and secrets.d real fish files.
|
||||||
|
# Receives tool input JSON on stdin.
|
||||||
|
|
||||||
|
fp=$(jq -r '.tool_input.file_path // empty')
|
||||||
|
[ -z "$fp" ] && exit 0
|
||||||
|
|
||||||
|
case "$fp" in
|
||||||
|
*/fzf-tmux | */yarn.lock | */.yarn/*)
|
||||||
|
echo "BLOCKED: $fp is a vendor/lock file — do not edit directly" >&2
|
||||||
|
exit 2
|
||||||
|
;;
|
||||||
|
*/tools/dotbot/* | */tools/dotbot-include/* | */tools/antidote/*)
|
||||||
|
echo "BLOCKED: $fp is inside a git submodule — do not edit" >&2
|
||||||
|
exit 2
|
||||||
|
;;
|
||||||
|
*/config/tmux/plugins/*)
|
||||||
|
echo "BLOCKED: $fp is a tmux plugin submodule — do not edit" >&2
|
||||||
|
exit 2
|
||||||
|
;;
|
||||||
|
*/config/cheat/cheatsheets/community/* | */config/cheat/cheatsheets/tldr/*)
|
||||||
|
echo "BLOCKED: $fp is a cheat submodule — do not edit" >&2
|
||||||
|
exit 2
|
||||||
|
;;
|
||||||
|
*/secrets.d/*.fish)
|
||||||
|
case "$(basename "$fp")" in
|
||||||
|
*.example.fish | *.fish.example) exit 0 ;;
|
||||||
|
esac
|
||||||
|
echo "BLOCKED: do not edit $fp directly — it is gitignored." >&2
|
||||||
|
echo "Copy the matching .fish.example file and edit that locally." >&2
|
||||||
|
exit 2
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
exit 0
|
||||||
15
.claude/hooks/session-start-context.sh
Executable file
15
.claude/hooks/session-start-context.sh
Executable file
@@ -0,0 +1,15 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
# SessionStart context: print branch, dirty file count, and last commit.
|
||||||
|
|
||||||
|
cd "$CLAUDE_PROJECT_DIR" || exit 0
|
||||||
|
|
||||||
|
branch=$(git branch --show-current 2> /dev/null)
|
||||||
|
dirty=$(git status --short 2> /dev/null | wc -l | tr -d ' ')
|
||||||
|
last=$(git log -1 --oneline 2> /dev/null)
|
||||||
|
|
||||||
|
echo "=== Dotfiles session context ==="
|
||||||
|
echo "Branch : ${branch:-unknown}"
|
||||||
|
echo "Dirty : ${dirty} file(s)"
|
||||||
|
echo "Last : ${last}"
|
||||||
|
|
||||||
|
exit 0
|
||||||
16
.claude/hooks/stop-lint-gate.sh
Executable file
16
.claude/hooks/stop-lint-gate.sh
Executable file
@@ -0,0 +1,16 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
# Stop gate: run yarn lint before Claude finishes.
|
||||||
|
# Exit 2 sends feedback back and keeps Claude working.
|
||||||
|
|
||||||
|
cd "$CLAUDE_PROJECT_DIR" || exit 0
|
||||||
|
|
||||||
|
output=$(yarn lint 2>&1)
|
||||||
|
status=$?
|
||||||
|
|
||||||
|
if [ $status -ne 0 ]; then
|
||||||
|
echo "Lint failed — fix before finishing:" >&2
|
||||||
|
echo "$output" >&2
|
||||||
|
exit 2
|
||||||
|
fi
|
||||||
|
|
||||||
|
exit 0
|
||||||
87
.claude/settings.json
Normal file
87
.claude/settings.json
Normal file
@@ -0,0 +1,87 @@
|
|||||||
|
{
|
||||||
|
"hooks": {
|
||||||
|
"SessionStart": [
|
||||||
|
{
|
||||||
|
"hooks": [
|
||||||
|
{
|
||||||
|
"type": "command",
|
||||||
|
"command": "\"$CLAUDE_PROJECT_DIR\"/.claude/hooks/session-start-context.sh",
|
||||||
|
"statusMessage": "Loading project context..."
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"PreToolUse": [
|
||||||
|
{
|
||||||
|
"matcher": "Edit|Write",
|
||||||
|
"hooks": [
|
||||||
|
{
|
||||||
|
"type": "command",
|
||||||
|
"command": "\"$CLAUDE_PROJECT_DIR\"/.claude/hooks/pre-edit-block.sh"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"PostToolUse": [
|
||||||
|
{
|
||||||
|
"matcher": "Edit|Write",
|
||||||
|
"hooks": [
|
||||||
|
{
|
||||||
|
"type": "command",
|
||||||
|
"command": "\"$CLAUDE_PROJECT_DIR\"/.claude/hooks/post-edit-format.sh",
|
||||||
|
"statusMessage": "Formatting..."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "command",
|
||||||
|
"command": "\"$CLAUDE_PROJECT_DIR\"/.claude/hooks/post-edit-dotbot-validate.sh",
|
||||||
|
"statusMessage": "Validating Dotbot config..."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "command",
|
||||||
|
"command": "\"$CLAUDE_PROJECT_DIR\"/.claude/hooks/post-edit-config-warn.sh"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "command",
|
||||||
|
"command": "\"$CLAUDE_PROJECT_DIR\"/.claude/hooks/async-bats.sh",
|
||||||
|
"async": true,
|
||||||
|
"statusMessage": "Running tests..."
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"PostToolUseFailure": [
|
||||||
|
{
|
||||||
|
"hooks": [
|
||||||
|
{
|
||||||
|
"type": "command",
|
||||||
|
"command": "\"$CLAUDE_PROJECT_DIR\"/.claude/hooks/log-failures.sh",
|
||||||
|
"async": true
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"Notification": [
|
||||||
|
{
|
||||||
|
"matcher": "idle_prompt",
|
||||||
|
"hooks": [
|
||||||
|
{
|
||||||
|
"type": "command",
|
||||||
|
"command": "\"$CLAUDE_PROJECT_DIR\"/.claude/hooks/notify-idle.sh",
|
||||||
|
"async": true
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"Stop": [
|
||||||
|
{
|
||||||
|
"hooks": [
|
||||||
|
{
|
||||||
|
"type": "command",
|
||||||
|
"command": "\"$CLAUDE_PROJECT_DIR\"/.claude/hooks/stop-lint-gate.sh",
|
||||||
|
"statusMessage": "Running lint gate..."
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
38
.claude/skills/dotbot-validate/SKILL.md
Normal file
38
.claude/skills/dotbot-validate/SKILL.md
Normal file
@@ -0,0 +1,38 @@
|
|||||||
|
---
|
||||||
|
name: dotbot-validate
|
||||||
|
description: >-
|
||||||
|
Validate Dotbot install.conf.yaml files after editing.
|
||||||
|
Apply when writing or modifying any install.conf.yaml.
|
||||||
|
user-invocable: false
|
||||||
|
allowed-tools: Bash, Read
|
||||||
|
---
|
||||||
|
|
||||||
|
After editing any `install.conf.yaml` file, validate it:
|
||||||
|
|
||||||
|
## 1. YAML syntax
|
||||||
|
|
||||||
|
```bash
|
||||||
|
yamllint -d relaxed <file>
|
||||||
|
```
|
||||||
|
|
||||||
|
If yamllint is not available, fall back to:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
python3 -c "import yaml; yaml.safe_load(open('<file>'))"
|
||||||
|
```
|
||||||
|
|
||||||
|
## 2. Link target verification
|
||||||
|
|
||||||
|
For each `link` entry, verify the source path exists relative
|
||||||
|
to the repo root. Report any missing source files.
|
||||||
|
|
||||||
|
## 3. Host-specific configs
|
||||||
|
|
||||||
|
Files in `hosts/<hostname>/install.conf.yaml` overlay the
|
||||||
|
global config. Verify that any `include` directives reference
|
||||||
|
existing files.
|
||||||
|
|
||||||
|
## Key locations
|
||||||
|
|
||||||
|
- `install.conf.yaml` — global config
|
||||||
|
- `hosts/*/install.conf.yaml` — per-host overlays
|
||||||
38
.claude/skills/fish-validate/SKILL.md
Normal file
38
.claude/skills/fish-validate/SKILL.md
Normal file
@@ -0,0 +1,38 @@
|
|||||||
|
---
|
||||||
|
name: fish-validate
|
||||||
|
description: >-
|
||||||
|
Validate fish scripts after editing.
|
||||||
|
Apply when writing or modifying any .fish file
|
||||||
|
in config/fish/.
|
||||||
|
user-invocable: false
|
||||||
|
allowed-tools: Bash, Read
|
||||||
|
---
|
||||||
|
|
||||||
|
After editing any `.fish` file in `config/fish/`, validate it:
|
||||||
|
|
||||||
|
## 1. Syntax check
|
||||||
|
|
||||||
|
```bash
|
||||||
|
fish --no-execute <file>
|
||||||
|
```
|
||||||
|
|
||||||
|
If syntax check fails, fix the issue before proceeding.
|
||||||
|
|
||||||
|
## 2. Format check
|
||||||
|
|
||||||
|
Run `fish_indent` to verify formatting:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
fish_indent --check <file>
|
||||||
|
```
|
||||||
|
|
||||||
|
If formatting differs, apply it:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
fish_indent -w <file>
|
||||||
|
```
|
||||||
|
|
||||||
|
## Key files to never validate
|
||||||
|
|
||||||
|
- Files inside `config/fish/functions/` prefixed with `_tide_`
|
||||||
|
(managed by the tide prompt plugin)
|
||||||
58
.claude/skills/host-override/SKILL.md
Normal file
58
.claude/skills/host-override/SKILL.md
Normal file
@@ -0,0 +1,58 @@
|
|||||||
|
---
|
||||||
|
name: host-override
|
||||||
|
description: >-
|
||||||
|
Create or extend host-specific config overlays
|
||||||
|
in hosts/<hostname>/ for machine-specific settings.
|
||||||
|
user-invocable: true
|
||||||
|
allowed-tools: Bash, Read, Write, Edit
|
||||||
|
---
|
||||||
|
|
||||||
|
When creating host-specific configuration overrides:
|
||||||
|
|
||||||
|
## 1. Determine hostname
|
||||||
|
|
||||||
|
```bash
|
||||||
|
hostname -s
|
||||||
|
```
|
||||||
|
|
||||||
|
## 2. Directory structure
|
||||||
|
|
||||||
|
Host overrides live in `hosts/<hostname>/` mirroring the
|
||||||
|
global layout:
|
||||||
|
|
||||||
|
```
|
||||||
|
hosts/<hostname>/
|
||||||
|
base/ -> ~/.*
|
||||||
|
config/ -> ~/.config/
|
||||||
|
install.conf.yaml
|
||||||
|
```
|
||||||
|
|
||||||
|
## 3. Create install.conf.yaml
|
||||||
|
|
||||||
|
If it doesn't exist, create `hosts/<hostname>/install.conf.yaml`
|
||||||
|
following the Dotbot format. Use `include` to layer on top of
|
||||||
|
the global config:
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
- defaults:
|
||||||
|
link:
|
||||||
|
create: true
|
||||||
|
relink: true
|
||||||
|
force: true
|
||||||
|
```
|
||||||
|
|
||||||
|
## 4. Git config overrides
|
||||||
|
|
||||||
|
The most common override is `hosts/<hostname>/config/git/overrides/config`.
|
||||||
|
This is where host-specific git user, signing keys, and credential
|
||||||
|
helpers go. Always `[include]` the shared config:
|
||||||
|
|
||||||
|
```ini
|
||||||
|
[include]
|
||||||
|
path = ~/.dotfiles/config/git/shared
|
||||||
|
```
|
||||||
|
|
||||||
|
## 5. Test
|
||||||
|
|
||||||
|
Run `./install` to apply. Dotbot processes
|
||||||
|
`hosts/<hostname>/install.conf.yaml` after the global config.
|
||||||
22
.claude/skills/lua-format/SKILL.md
Normal file
22
.claude/skills/lua-format/SKILL.md
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
---
|
||||||
|
name: lua-format
|
||||||
|
description: >-
|
||||||
|
Format Lua files after editing.
|
||||||
|
Apply when writing or modifying any .lua file.
|
||||||
|
user-invocable: false
|
||||||
|
allowed-tools: Bash
|
||||||
|
---
|
||||||
|
|
||||||
|
After editing any `.lua` file, format it with stylua:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
stylua <file>
|
||||||
|
```
|
||||||
|
|
||||||
|
Project settings are in `stylua.toml` (90-char line length).
|
||||||
|
|
||||||
|
If stylua is not available, skip formatting silently.
|
||||||
|
|
||||||
|
## Files to never format
|
||||||
|
|
||||||
|
- Files inside `config/nvim/` managed by plugins (lazy.nvim lockfile)
|
||||||
40
.claude/skills/new-fish-function/SKILL.md
Normal file
40
.claude/skills/new-fish-function/SKILL.md
Normal file
@@ -0,0 +1,40 @@
|
|||||||
|
---
|
||||||
|
name: new-fish-function
|
||||||
|
description: >-
|
||||||
|
Scaffold a new fish function in config/fish/functions/
|
||||||
|
with proper conventions and event handling.
|
||||||
|
user-invocable: true
|
||||||
|
allowed-tools: Bash, Read, Write, Edit
|
||||||
|
---
|
||||||
|
|
||||||
|
When creating a new fish function in `config/fish/functions/`:
|
||||||
|
|
||||||
|
## 1. Create the function file
|
||||||
|
|
||||||
|
Create `config/fish/functions/<name>.fish`:
|
||||||
|
|
||||||
|
```fish
|
||||||
|
function <name> --description '<one-line description>'
|
||||||
|
# Function logic here
|
||||||
|
end
|
||||||
|
```
|
||||||
|
|
||||||
|
- One function per file, filename must match function name
|
||||||
|
- Always include `--description`
|
||||||
|
- Use `--argument-names` for named parameters
|
||||||
|
|
||||||
|
## 2. Conventions
|
||||||
|
|
||||||
|
- Do NOT use `_tide_` prefix (reserved for tide prompt plugin)
|
||||||
|
- Use `--wraps` if the function wraps an existing command
|
||||||
|
- For abbreviation-like functions, prefer fish abbreviations
|
||||||
|
in `config/fish/alias.fish` instead
|
||||||
|
|
||||||
|
## 3. Validate
|
||||||
|
|
||||||
|
Run the fish-validate skill checks:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
fish --no-execute config/fish/functions/<name>.fish
|
||||||
|
fish_indent --check config/fish/functions/<name>.fish
|
||||||
|
```
|
||||||
53
.claude/skills/new-script/SKILL.md
Normal file
53
.claude/skills/new-script/SKILL.md
Normal file
@@ -0,0 +1,53 @@
|
|||||||
|
---
|
||||||
|
name: new-script
|
||||||
|
description: >-
|
||||||
|
Scaffold a new helper script in local/bin/ with proper
|
||||||
|
boilerplate, msgr sourcing, and documentation tag.
|
||||||
|
user-invocable: true
|
||||||
|
allowed-tools: Bash, Read, Write, Edit
|
||||||
|
---
|
||||||
|
|
||||||
|
When creating a new script in `local/bin/`, follow this template:
|
||||||
|
|
||||||
|
## 1. Script file
|
||||||
|
|
||||||
|
Create `local/bin/<name>` with:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
# @description <one-line description>
|
||||||
|
|
||||||
|
set -euo pipefail
|
||||||
|
|
||||||
|
# shellcheck source=msgr
|
||||||
|
. "$(dirname "$0")/msgr"
|
||||||
|
|
||||||
|
# Script logic here
|
||||||
|
```
|
||||||
|
|
||||||
|
- Use `msgr` functions for output: `msgr msg`, `msgr run`,
|
||||||
|
`msgr yay`, `msgr err`, `msgr warn`
|
||||||
|
- The `@description` tag is required — `dfm scripts` discovers
|
||||||
|
scripts by it
|
||||||
|
- POSIX scripts (`/bin/sh`) should NOT source msgr
|
||||||
|
|
||||||
|
## 2. Make executable
|
||||||
|
|
||||||
|
```bash
|
||||||
|
chmod +x local/bin/<name>
|
||||||
|
```
|
||||||
|
|
||||||
|
## 3. Generate docs
|
||||||
|
|
||||||
|
Run `dfm docs script <name>` or manually create `local/bin/<name>.md`
|
||||||
|
with a usage summary.
|
||||||
|
|
||||||
|
## 4. Validate
|
||||||
|
|
||||||
|
Run the shell-validate skill checks (syntax + shellcheck).
|
||||||
|
|
||||||
|
## Naming conventions
|
||||||
|
|
||||||
|
- `x-` prefix for standalone utilities (e.g., `x-ssl-expiry-date`)
|
||||||
|
- Short names for frequently used commands (e.g., `a`, `ad`, `ae`)
|
||||||
|
- `git-` prefix for git subcommands (e.g., `git-dirty`)
|
||||||
44
.claude/skills/shell-validate/SKILL.md
Normal file
44
.claude/skills/shell-validate/SKILL.md
Normal file
@@ -0,0 +1,44 @@
|
|||||||
|
---
|
||||||
|
name: shell-validate
|
||||||
|
description: >-
|
||||||
|
Validate shell scripts after editing.
|
||||||
|
Apply when writing or modifying any shell script
|
||||||
|
in local/bin/ or scripts/.
|
||||||
|
user-invocable: false
|
||||||
|
allowed-tools: Bash, Read, Grep
|
||||||
|
---
|
||||||
|
|
||||||
|
After editing any shell script in `local/bin/`, `scripts/`, or `config/`
|
||||||
|
(files with a `#!` shebang or `# shellcheck shell=` directive),
|
||||||
|
validate it:
|
||||||
|
|
||||||
|
## 1. Determine the shell
|
||||||
|
|
||||||
|
- `/bin/sh` or `#!/usr/bin/env sh` shebang -> POSIX, use `sh -n`
|
||||||
|
- `/bin/bash` or `#!/usr/bin/env bash` shebang -> Bash, use `bash -n`
|
||||||
|
- `# shellcheck shell=bash` directive (no shebang) -> use `bash -n`
|
||||||
|
- `# shellcheck shell=sh` directive (no shebang) -> use `sh -n`
|
||||||
|
- No shebang and no directive -> default to `bash -n`
|
||||||
|
|
||||||
|
## 2. Syntax check
|
||||||
|
|
||||||
|
Run the appropriate syntax checker:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
bash -n <file> # for bash scripts
|
||||||
|
sh -n <file> # for POSIX sh scripts
|
||||||
|
```
|
||||||
|
|
||||||
|
If syntax check fails, fix the issue before proceeding.
|
||||||
|
|
||||||
|
## 3. ShellCheck
|
||||||
|
|
||||||
|
Run `shellcheck <file>`. The project `.shellcheckrc` already
|
||||||
|
disables SC2039, SC2166, SC2154, SC1091, SC2174, SC2016.
|
||||||
|
Only report and fix warnings that are NOT in that exclude list.
|
||||||
|
|
||||||
|
## Key files to never validate (not shell scripts)
|
||||||
|
|
||||||
|
- `local/bin/fzf-tmux` (vendor file)
|
||||||
|
- `*.md` files
|
||||||
|
- `*.bats` test files (Bats, not plain shell)
|
||||||
38
.claude/skills/yaml-validate/SKILL.md
Normal file
38
.claude/skills/yaml-validate/SKILL.md
Normal file
@@ -0,0 +1,38 @@
|
|||||||
|
---
|
||||||
|
name: yaml-validate
|
||||||
|
description: >-
|
||||||
|
Validate YAML files after editing.
|
||||||
|
Apply when writing or modifying any .yml or .yaml file.
|
||||||
|
user-invocable: false
|
||||||
|
allowed-tools: Bash, Read
|
||||||
|
---
|
||||||
|
|
||||||
|
After editing any YAML file, validate it:
|
||||||
|
|
||||||
|
## 1. Syntax check
|
||||||
|
|
||||||
|
Run yamllint on the file:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
yamllint <file>
|
||||||
|
```
|
||||||
|
|
||||||
|
If yamllint is not available, fall back to:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
python3 -c "import yaml; yaml.safe_load(open('<file>'))"
|
||||||
|
```
|
||||||
|
|
||||||
|
## 2. GitHub Actions workflows
|
||||||
|
|
||||||
|
If the file is under `.github/workflows/`, also run:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
actionlint <file>
|
||||||
|
```
|
||||||
|
|
||||||
|
If actionlint is not available, skip silently.
|
||||||
|
|
||||||
|
## Files to skip
|
||||||
|
|
||||||
|
- `config/gh/hosts.yml` — managed by `gh` CLI, not hand-edited
|
||||||
@@ -8,6 +8,10 @@ indent_style = space
|
|||||||
insert_final_newline = true
|
insert_final_newline = true
|
||||||
trim_trailing_whitespace = true
|
trim_trailing_whitespace = true
|
||||||
|
|
||||||
|
[*.py]
|
||||||
|
indent_size = 4
|
||||||
|
max_line_length = 120
|
||||||
|
|
||||||
[*.fish]
|
[*.fish]
|
||||||
max_line_length = 120
|
max_line_length = 120
|
||||||
|
|
||||||
|
|||||||
@@ -7,6 +7,7 @@
|
|||||||
"Exclude": [
|
"Exclude": [
|
||||||
"base/plan",
|
"base/plan",
|
||||||
"config/fish/completions/.*",
|
"config/fish/completions/.*",
|
||||||
|
"config/karabiner/.*",
|
||||||
"config/fish/conf.d/.*",
|
"config/fish/conf.d/.*",
|
||||||
"config/fish/functions/.*",
|
"config/fish/functions/.*",
|
||||||
"config/fzf/key-bindings.fish",
|
"config/fzf/key-bindings.fish",
|
||||||
|
|||||||
6
.github/README.md
vendored
6
.github/README.md
vendored
@@ -37,7 +37,7 @@ see what interesting stuff you've done with it. Sharing is caring.
|
|||||||
### Interesting folders
|
### Interesting folders
|
||||||
|
|
||||||
| Path | Description |
|
| Path | Description |
|
||||||
| ------------------- | -------------------------------------------- |
|
|---------------------|----------------------------------------------|
|
||||||
| `.github` | GitHub Repository configuration files, meta. |
|
| `.github` | GitHub Repository configuration files, meta. |
|
||||||
| `hosts/{hostname}/` | Configs that should apply to that host only. |
|
| `hosts/{hostname}/` | Configs that should apply to that host only. |
|
||||||
| `local/bin` | Helper scripts that I've collected or wrote. |
|
| `local/bin` | Helper scripts that I've collected or wrote. |
|
||||||
@@ -52,7 +52,7 @@ is processed by Dotbot during installation.
|
|||||||
### dotfile folders
|
### dotfile folders
|
||||||
|
|
||||||
| Repo | Destination | Description |
|
| Repo | Destination | Description |
|
||||||
| --------- | ----------- | ------------------------------------------- |
|
|-----------|-------------|---------------------------------------------|
|
||||||
| `base/` | `.*` | `$HOME` level files. |
|
| `base/` | `.*` | `$HOME` level files. |
|
||||||
| `config/` | `.config/` | Configurations for applications. |
|
| `config/` | `.config/` | Configurations for applications. |
|
||||||
| `local/` | `.local/` | XDG Base folder: `bin`, `share` and `state` |
|
| `local/` | `.local/` | XDG Base folder: `bin`, `share` and `state` |
|
||||||
@@ -86,7 +86,7 @@ The folder structure follows [XDG Base Directory Specification][xdg] where possi
|
|||||||
### XDG Variables
|
### XDG Variables
|
||||||
|
|
||||||
| Env | Default | Short description |
|
| Env | Default | Short description |
|
||||||
| ------------------ | -------------------- | ---------------------------------------------- |
|
|--------------------|----------------------|------------------------------------------------|
|
||||||
| `$XDG_BIN_HOME` | `$HOME/.local/bin` | Local binaries |
|
| `$XDG_BIN_HOME` | `$HOME/.local/bin` | Local binaries |
|
||||||
| `$XDG_CONFIG_HOME` | `$HOME/.config` | User-specific configs |
|
| `$XDG_CONFIG_HOME` | `$HOME/.config` | User-specific configs |
|
||||||
| `$XDG_DATA_HOME` | `$HOME/.local/share` | User-specific data files |
|
| `$XDG_DATA_HOME` | `$HOME/.local/share` | User-specific data files |
|
||||||
|
|||||||
10
.github/workflows/changelog.yml
vendored
10
.github/workflows/changelog.yml
vendored
@@ -9,25 +9,27 @@ concurrency:
|
|||||||
group: ${{ github.workflow }}-${{ github.ref }}
|
group: ${{ github.workflow }}-${{ github.ref }}
|
||||||
cancel-in-progress: true
|
cancel-in-progress: true
|
||||||
|
|
||||||
permissions: read-all
|
permissions:
|
||||||
|
contents: read
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
debug-changelog:
|
debug-changelog:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
permissions: write-all
|
permissions:
|
||||||
|
contents: read
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||||
|
|
||||||
- name: Create changelog text
|
- name: Create changelog text
|
||||||
id: changelog
|
id: changelog
|
||||||
uses: loopwerk/tag-changelog@941366edb8920e2071eae0449031830984b9f26e # v1.3.0
|
uses: loopwerk/tag-changelog@8dd150d55fbf1fe93e0ea00a29a6153aaeb81912 # v1.5.0
|
||||||
with:
|
with:
|
||||||
token: ${{ secrets.GITHUB_TOKEN }}
|
token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
config_file: .github/tag-changelog-config.js
|
config_file: .github/tag-changelog-config.js
|
||||||
|
|
||||||
- name: 'Echo results'
|
- name: "Echo results"
|
||||||
id: output-changelog
|
id: output-changelog
|
||||||
run: |
|
run: |
|
||||||
echo "${{ steps.changelog.outputs.changes }}"
|
echo "${{ steps.changelog.outputs.changes }}"
|
||||||
|
|||||||
9
.github/workflows/linters.yml
vendored
9
.github/workflows/linters.yml
vendored
@@ -5,13 +5,14 @@ name: Lint Code Base
|
|||||||
# yamllint disable-line
|
# yamllint disable-line
|
||||||
on:
|
on:
|
||||||
pull_request:
|
pull_request:
|
||||||
branches: [master, main]
|
branches: [main]
|
||||||
|
|
||||||
concurrency:
|
concurrency:
|
||||||
group: ${{ github.workflow }}-${{ github.ref }}
|
group: ${{ github.workflow }}-${{ github.ref }}
|
||||||
cancel-in-progress: true
|
cancel-in-progress: true
|
||||||
|
|
||||||
permissions: read-all
|
permissions:
|
||||||
|
contents: read
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
Linter:
|
Linter:
|
||||||
@@ -30,9 +31,9 @@ jobs:
|
|||||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||||
|
|
||||||
- name: Yarn Lock Changes
|
- name: Yarn Lock Changes
|
||||||
uses: Simek/yarn-lock-changes@c7543145aaafdd8fc925cea5d85b2bd5a73091f8 # v0.14.0
|
uses: Simek/yarn-lock-changes@59f47ee499424d2c2437c5aebf863b5c6d50a5bc # v0.14.1
|
||||||
with:
|
with:
|
||||||
token: ${{ secrets.GITHUB_TOKEN }}
|
token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
- name: Run PR Lint
|
- name: Run PR Lint
|
||||||
uses: ivuorinen/actions/pr-lint@f98ae7cd7d0feb1f9d6b01de0addbb11414cfc73 # v2026.01.21
|
uses: ivuorinen/actions/pr-lint@1da3a0e79fcd7da6bed9ee1979f1449ba11f58f9 # v2026.03.14
|
||||||
|
|||||||
12
.github/workflows/new-release.yml
vendored
12
.github/workflows/new-release.yml
vendored
@@ -5,19 +5,21 @@ name: Release Daily State
|
|||||||
on:
|
on:
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
schedule:
|
schedule:
|
||||||
- cron: '0 21 * * *' # 00:00 at Europe/Helsinki
|
- cron: "0 21 * * *" # 00:00 at Europe/Helsinki
|
||||||
|
|
||||||
concurrency:
|
concurrency:
|
||||||
group: ${{ github.workflow }}-${{ github.ref }}
|
group: ${{ github.workflow }}-${{ github.ref }}
|
||||||
cancel-in-progress: true
|
cancel-in-progress: true
|
||||||
|
|
||||||
permissions: read-all
|
permissions:
|
||||||
|
contents: read
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
new-daily-release:
|
new-daily-release:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
permissions: write-all
|
permissions:
|
||||||
|
contents: write
|
||||||
|
|
||||||
outputs:
|
outputs:
|
||||||
created: ${{ steps.daily-version.outputs.created }}
|
created: ${{ steps.daily-version.outputs.created }}
|
||||||
@@ -33,14 +35,14 @@ jobs:
|
|||||||
- name: Create changelog text
|
- name: Create changelog text
|
||||||
if: steps.daily-version.outputs.created
|
if: steps.daily-version.outputs.created
|
||||||
id: changelog
|
id: changelog
|
||||||
uses: loopwerk/tag-changelog@941366edb8920e2071eae0449031830984b9f26e # v1.3.0
|
uses: loopwerk/tag-changelog@8dd150d55fbf1fe93e0ea00a29a6153aaeb81912 # v1.5.0
|
||||||
with:
|
with:
|
||||||
token: ${{ secrets.GITHUB_TOKEN }}
|
token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
config_file: .github/tag-changelog-config.js
|
config_file: .github/tag-changelog-config.js
|
||||||
|
|
||||||
- name: Create release
|
- name: Create release
|
||||||
if: steps.daily-version.outputs.created
|
if: steps.daily-version.outputs.created
|
||||||
uses: softprops/action-gh-release@a06a81a03ee405af7f2048a818ed3f03bbf83c7b # v2.5.0
|
uses: softprops/action-gh-release@153bb8e04406b158c6c84fc1615b65b24149a1fe # v2.6.1
|
||||||
with:
|
with:
|
||||||
token: ${{ secrets.GITHUB_TOKEN }}
|
token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
tag_name: ${{ steps.daily-version.outputs.version }}
|
tag_name: ${{ steps.daily-version.outputs.version }}
|
||||||
|
|||||||
9
.github/workflows/pre-commit-autoupdate.yml
vendored
9
.github/workflows/pre-commit-autoupdate.yml
vendored
@@ -5,14 +5,15 @@ name: Pre-commit autoupdate
|
|||||||
on:
|
on:
|
||||||
schedule:
|
schedule:
|
||||||
# At 04:00 on Monday and Thursday.
|
# At 04:00 on Monday and Thursday.
|
||||||
- cron: '0 4 * * 1,4'
|
- cron: "0 4 * * 1,4"
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
|
||||||
concurrency:
|
concurrency:
|
||||||
group: ${{ github.workflow }}-${{ github.ref }}
|
group: ${{ github.workflow }}-${{ github.ref }}
|
||||||
cancel-in-progress: true
|
cancel-in-progress: true
|
||||||
|
|
||||||
permissions: read-all
|
permissions:
|
||||||
|
contents: read
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
auto-update:
|
auto-update:
|
||||||
@@ -33,6 +34,6 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
token: ${{ secrets.GITHUB_TOKEN }}
|
token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
branch: update/pre-commit-hooks
|
branch: update/pre-commit-hooks
|
||||||
title: 'chore: update pre-commit hooks'
|
title: "chore: update pre-commit hooks"
|
||||||
commit-message: 'chore: update pre-commit hooks'
|
commit-message: "chore: update pre-commit hooks"
|
||||||
body: Update versions of pre-commit hooks to latest version.
|
body: Update versions of pre-commit hooks to latest version.
|
||||||
|
|||||||
3
.github/workflows/semantic-pr.yml
vendored
3
.github/workflows/semantic-pr.yml
vendored
@@ -14,7 +14,8 @@ concurrency:
|
|||||||
group: ${{ github.workflow }}-${{ github.ref }}
|
group: ${{ github.workflow }}-${{ github.ref }}
|
||||||
cancel-in-progress: true
|
cancel-in-progress: true
|
||||||
|
|
||||||
permissions: read-all
|
permissions:
|
||||||
|
pull-requests: read
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
semantic-pr:
|
semantic-pr:
|
||||||
|
|||||||
7
.github/workflows/sync-labels.yml
vendored
7
.github/workflows/sync-labels.yml
vendored
@@ -11,7 +11,7 @@ on:
|
|||||||
- .github/workflows/sync-labels.yml
|
- .github/workflows/sync-labels.yml
|
||||||
- .github/labels.yml
|
- .github/labels.yml
|
||||||
schedule:
|
schedule:
|
||||||
- cron: '34 5 * * *'
|
- cron: "34 5 * * *"
|
||||||
workflow_call:
|
workflow_call:
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
|
||||||
@@ -19,7 +19,8 @@ concurrency:
|
|||||||
group: ${{ github.workflow }}-${{ github.ref }}
|
group: ${{ github.workflow }}-${{ github.ref }}
|
||||||
cancel-in-progress: true
|
cancel-in-progress: true
|
||||||
|
|
||||||
permissions: read-all
|
permissions:
|
||||||
|
contents: read
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
SyncLabels:
|
SyncLabels:
|
||||||
@@ -29,4 +30,4 @@ jobs:
|
|||||||
issues: write
|
issues: write
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: ivuorinen/actions/sync-labels@f98ae7cd7d0feb1f9d6b01de0addbb11414cfc73 # v2026.01.21
|
- uses: ivuorinen/actions/sync-labels@1da3a0e79fcd7da6bed9ee1979f1449ba11f58f9 # v2026.03.14
|
||||||
|
|||||||
8
.github/workflows/update-submodules.yml
vendored
8
.github/workflows/update-submodules.yml
vendored
@@ -5,20 +5,22 @@ name: Update submodules
|
|||||||
on:
|
on:
|
||||||
schedule:
|
schedule:
|
||||||
# At 04:00 on Monday and Thursday.
|
# At 04:00 on Monday and Thursday.
|
||||||
- cron: '0 4 * * 1'
|
- cron: "0 4 * * 1,4"
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
|
||||||
concurrency:
|
concurrency:
|
||||||
group: ${{ github.workflow }}-${{ github.ref }}
|
group: ${{ github.workflow }}-${{ github.ref }}
|
||||||
cancel-in-progress: true
|
cancel-in-progress: true
|
||||||
|
|
||||||
permissions: read-all
|
permissions:
|
||||||
|
contents: read
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
update-submodules:
|
update-submodules:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
permissions: write-all
|
permissions:
|
||||||
|
contents: write
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
|
|||||||
12
.gitignore
vendored
12
.gitignore
vendored
@@ -25,8 +25,13 @@ config/alacritty/theme-active.toml
|
|||||||
config/cheat/cheatsheets/pure-bash-bible/*
|
config/cheat/cheatsheets/pure-bash-bible/*
|
||||||
config/cheat/cheatsheets/tldr/*
|
config/cheat/cheatsheets/tldr/*
|
||||||
config/fish/completions/asdf.fish
|
config/fish/completions/asdf.fish
|
||||||
|
config/fish/completions/kubectl.fish
|
||||||
|
config/fish/completions/orbctl.fish
|
||||||
config/fish/fish_variables
|
config/fish/fish_variables
|
||||||
config/fish/fish_variables.*
|
config/fish/fish_variables.*
|
||||||
|
config/fish/secrets.d/*
|
||||||
|
!config/fish/secrets.d/*.example
|
||||||
|
!config/fish/secrets.d/README.md
|
||||||
config/gh/hosts.yml
|
config/gh/hosts.yml
|
||||||
config/git/credentials
|
config/git/credentials
|
||||||
config/git/local.d/*
|
config/git/local.d/*
|
||||||
@@ -56,5 +61,12 @@ local/man/yabai.1
|
|||||||
local/share/fonts/*
|
local/share/fonts/*
|
||||||
lock
|
lock
|
||||||
node_modules
|
node_modules
|
||||||
|
__pycache__
|
||||||
ssh/local.d/*
|
ssh/local.d/*
|
||||||
config/fish/fish_variables*
|
config/fish/fish_variables*
|
||||||
|
|
||||||
|
# Allow .claude directory (overrides global **/.claude/* ignore)
|
||||||
|
!.claude/
|
||||||
|
!.claude/**
|
||||||
|
.claude/**/*.log
|
||||||
|
.claude/settings.local.json
|
||||||
|
|||||||
12
.gitmodules
vendored
12
.gitmodules
vendored
@@ -4,11 +4,6 @@
|
|||||||
url = https://github.com/anishathalye/dotbot.git
|
url = https://github.com/anishathalye/dotbot.git
|
||||||
ignore = dirty
|
ignore = dirty
|
||||||
|
|
||||||
[submodule "dotbot-brew"]
|
|
||||||
path = tools/dotbot-brew
|
|
||||||
url = https://github.com/wren/dotbot-brew.git
|
|
||||||
ignore = dirty
|
|
||||||
|
|
||||||
[submodule "dotbot-include"]
|
[submodule "dotbot-include"]
|
||||||
path = tools/dotbot-include
|
path = tools/dotbot-include
|
||||||
url = https://gitlab.com/gnfzdz/dotbot-include.git
|
url = https://gitlab.com/gnfzdz/dotbot-include.git
|
||||||
@@ -29,11 +24,6 @@
|
|||||||
url = https://github.com/tmux-plugins/tmux-sessionist.git
|
url = https://github.com/tmux-plugins/tmux-sessionist.git
|
||||||
ignore = dirty
|
ignore = dirty
|
||||||
|
|
||||||
[submodule "dotbot-pip"]
|
|
||||||
path = tools/dotbot-pip
|
|
||||||
url = https://github.com/sobolevn/dotbot-pip.git
|
|
||||||
ignore = dirty
|
|
||||||
|
|
||||||
[submodule "tmux/tmux-suspend"]
|
[submodule "tmux/tmux-suspend"]
|
||||||
path = config/tmux/plugins/tmux-suspend
|
path = config/tmux/plugins/tmux-suspend
|
||||||
url = https://github.com/MunifTanjim/tmux-suspend.git
|
url = https://github.com/MunifTanjim/tmux-suspend.git
|
||||||
@@ -63,6 +53,8 @@
|
|||||||
[submodule "tmux/tmux-resurrect"]
|
[submodule "tmux/tmux-resurrect"]
|
||||||
path = config/tmux/plugins/tmux-resurrect
|
path = config/tmux/plugins/tmux-resurrect
|
||||||
url = https://github.com/tmux-plugins/tmux-resurrect.git
|
url = https://github.com/tmux-plugins/tmux-resurrect.git
|
||||||
|
ignore = dirty
|
||||||
[submodule "tmux/catppuccin"]
|
[submodule "tmux/catppuccin"]
|
||||||
path = config/tmux/plugins/catppuccin
|
path = config/tmux/plugins/catppuccin
|
||||||
url = https://github.com/catppuccin/tmux.git
|
url = https://github.com/catppuccin/tmux.git
|
||||||
|
ignore = dirty
|
||||||
|
|||||||
@@ -1 +0,0 @@
|
|||||||
1.25.5
|
|
||||||
1
.ignore
1
.ignore
@@ -6,6 +6,5 @@ config/tmux/plugins/**
|
|||||||
config/vim/plugged/**
|
config/vim/plugged/**
|
||||||
node_modules
|
node_modules
|
||||||
tools/antidote/**
|
tools/antidote/**
|
||||||
tools/dotbot-brew/**
|
|
||||||
tools/dotbot-include/**
|
tools/dotbot-include/**
|
||||||
tools/dotbot/**
|
tools/dotbot/**
|
||||||
|
|||||||
@@ -9,16 +9,21 @@ VALIDATE_ALL_CODEBASE: true
|
|||||||
FILEIO_REPORTER: false # Generate file.io report
|
FILEIO_REPORTER: false # Generate file.io report
|
||||||
GITHUB_STATUS_REPORTER: true # Generate GitHub status report
|
GITHUB_STATUS_REPORTER: true # Generate GitHub status report
|
||||||
IGNORE_GENERATED_FILES: true # Ignore generated files
|
IGNORE_GENERATED_FILES: true # Ignore generated files
|
||||||
JAVASCRIPT_DEFAULT_STYLE: prettier # Default style for JavaScript
|
|
||||||
PRINT_ALPACA: false # Print Alpaca logo in console
|
PRINT_ALPACA: false # Print Alpaca logo in console
|
||||||
SARIF_REPORTER: true # Generate SARIF report
|
SARIF_REPORTER: true # Generate SARIF report
|
||||||
SHOW_SKIPPED_LINTERS: false # Show skipped linters in MegaLinter log
|
SHOW_SKIPPED_LINTERS: false # Show skipped linters in MegaLinter log
|
||||||
TYPESCRIPT_DEFAULT_STYLE: prettier # Default style for TypeScript
|
|
||||||
DISABLE_LINTERS:
|
DISABLE_LINTERS:
|
||||||
- REPOSITORY_DEVSKIM
|
- REPOSITORY_DEVSKIM
|
||||||
- JAVASCRIPT_ES # using biome
|
- JAVASCRIPT_ES # using biome
|
||||||
- JAVASCRIPT_PRETTIER # using biome
|
- JAVASCRIPT_PRETTIER # using biome
|
||||||
|
- TYPESCRIPT_PRETTIER # using biome
|
||||||
|
- JSON_PRETTIER # using biome
|
||||||
|
- PYTHON_BLACK # using ruff
|
||||||
|
- PYTHON_FLAKE8 # using ruff
|
||||||
|
- PYTHON_PYLINT # using ruff
|
||||||
|
- PYTHON_ISORT # using ruff (I rules)
|
||||||
YAML_YAMLLINT_CONFIG_FILE: .yamllint.yml
|
YAML_YAMLLINT_CONFIG_FILE: .yamllint.yml
|
||||||
REPOSITORY_GIT_DIFF_DISABLE_ERRORS: true
|
REPOSITORY_GIT_DIFF_DISABLE_ERRORS: true
|
||||||
|
BASH_SHFMT_ARGUMENTS: -i 2 -bn -ci -sr -fn
|
||||||
FILTER_REGEX_EXCLUDE: >
|
FILTER_REGEX_EXCLUDE: >
|
||||||
(node_modules|tools|config/cheat/cheatsheets/community|config/cheat/cheatsheets/tldr|config/fzf|config/zsh|config/tmux/plugins)
|
(node_modules|tools|config/cheat/cheatsheets/community|config/cheat/cheatsheets/tldr|config/fzf|config/zsh|config/tmux/plugins)
|
||||||
|
|||||||
4
.mise.toml
Normal file
4
.mise.toml
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
[tools]
|
||||||
|
node = "24.14.0"
|
||||||
|
python = "3.14.3"
|
||||||
|
go = "1.26.1"
|
||||||
@@ -27,13 +27,26 @@ repos:
|
|||||||
name: Biome Check
|
name: Biome Check
|
||||||
entry: yarn biome check --write --files-ignore-unknown=true --no-errors-on-unmatched
|
entry: yarn biome check --write --files-ignore-unknown=true --no-errors-on-unmatched
|
||||||
language: system
|
language: system
|
||||||
files: \.(js|ts|jsx|tsx|json|md)$
|
files: \.(js|ts|jsx|tsx|json)$
|
||||||
|
- id: markdown-table-formatter
|
||||||
|
name: Markdown Table Formatter
|
||||||
|
entry: yarn markdown-table-formatter
|
||||||
|
language: system
|
||||||
|
types: [markdown]
|
||||||
|
|
||||||
- repo: https://github.com/adrienverge/yamllint
|
- repo: https://github.com/adrienverge/yamllint
|
||||||
rev: v1.38.0
|
rev: v1.38.0
|
||||||
hooks:
|
hooks:
|
||||||
- id: yamllint
|
- id: yamllint
|
||||||
|
|
||||||
|
- repo: local
|
||||||
|
hooks:
|
||||||
|
- id: prettier
|
||||||
|
name: Prettier (YAML)
|
||||||
|
entry: yarn prettier --write
|
||||||
|
language: system
|
||||||
|
types_or: [yaml]
|
||||||
|
|
||||||
- repo: https://github.com/shellcheck-py/shellcheck-py
|
- repo: https://github.com/shellcheck-py/shellcheck-py
|
||||||
rev: v0.11.0.1
|
rev: v0.11.0.1
|
||||||
hooks:
|
hooks:
|
||||||
@@ -43,14 +56,15 @@ repos:
|
|||||||
rev: v3.12.0-2
|
rev: v3.12.0-2
|
||||||
hooks:
|
hooks:
|
||||||
- id: shfmt
|
- id: shfmt
|
||||||
|
args: [-i, "2", -bn, -ci, -sr, -fn, -w]
|
||||||
|
|
||||||
- repo: https://github.com/rhysd/actionlint
|
- repo: https://github.com/rhysd/actionlint
|
||||||
rev: v1.7.10
|
rev: v1.7.11
|
||||||
hooks:
|
hooks:
|
||||||
- id: actionlint
|
- id: actionlint
|
||||||
|
|
||||||
- repo: https://github.com/JohnnyMorganz/StyLua
|
- repo: https://github.com/JohnnyMorganz/StyLua
|
||||||
rev: v2.3.1
|
rev: v2.4.0
|
||||||
hooks:
|
hooks:
|
||||||
- id: stylua # or stylua-system / stylua-github
|
- id: stylua # or stylua-system / stylua-github
|
||||||
exclude: hammerspoon\.types\.lua$
|
exclude: hammerspoon\.types\.lua$
|
||||||
@@ -60,3 +74,10 @@ repos:
|
|||||||
hooks:
|
hooks:
|
||||||
- id: fish_syntax
|
- id: fish_syntax
|
||||||
- id: fish_indent
|
- id: fish_indent
|
||||||
|
|
||||||
|
- repo: https://github.com/astral-sh/ruff-pre-commit
|
||||||
|
rev: v0.15.7
|
||||||
|
hooks:
|
||||||
|
- id: ruff-check
|
||||||
|
args: [--fix]
|
||||||
|
- id: ruff-format
|
||||||
|
|||||||
18
.prettierignore
Normal file
18
.prettierignore
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
node_modules
|
||||||
|
.yarn
|
||||||
|
.pnp.*
|
||||||
|
.mypy_cache
|
||||||
|
Brewfile.lock.json
|
||||||
|
lazy-lock.json
|
||||||
|
config/cheat/cheatsheets/community
|
||||||
|
config/cheat/cheatsheets/tldr
|
||||||
|
config/fzf
|
||||||
|
config/nvim
|
||||||
|
config/op/plugins/used_plugins
|
||||||
|
config/tmux/plugins
|
||||||
|
config/vim/plugged
|
||||||
|
config/zsh
|
||||||
|
local/bin/antigen.zsh
|
||||||
|
local/bin/asdf
|
||||||
|
tools
|
||||||
|
config/gh/hosts.yml
|
||||||
9
.prettierrc.json
Normal file
9
.prettierrc.json
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
{
|
||||||
|
"$schema": "https://json.schemastore.org/prettierrc",
|
||||||
|
"printWidth": 200,
|
||||||
|
"tabWidth": 2,
|
||||||
|
"useTabs": false,
|
||||||
|
"endOfLine": "lf",
|
||||||
|
"singleQuote": false,
|
||||||
|
"proseWrap": "preserve"
|
||||||
|
}
|
||||||
@@ -1 +0,0 @@
|
|||||||
3.14.2
|
|
||||||
@@ -50,12 +50,11 @@ the primary installation framework to manage symlinks and setup configurations.
|
|||||||
|
|
||||||
- **Platform**: Darwin (macOS) - Version 24.6.0
|
- **Platform**: Darwin (macOS) - Version 24.6.0
|
||||||
- **Architecture**: Universal (Intel/Apple Silicon via Homebrew)
|
- **Architecture**: Universal (Intel/Apple Silicon via Homebrew)
|
||||||
- **Dependencies**: Git, Homebrew, Yarn, various CLI tools managed via asdf/aqua
|
- **Dependencies**: Git, Homebrew, Yarn, various CLI tools managed via mise
|
||||||
|
|
||||||
## Development Environment
|
## Development Environment
|
||||||
|
|
||||||
- Node.js managed via nvm/asdf
|
- Node.js, Go, Python, Ruby, Rust managed via mise
|
||||||
- Go version specified (.go-version)
|
- Version files (.nvmrc, .go-version, .python-version) consumed by mise via idiomatic_version_file
|
||||||
- Python version specified (.python-version)
|
|
||||||
- Package management via Yarn with lockfile
|
- Package management via Yarn with lockfile
|
||||||
- TypeScript support for configuration files
|
- TypeScript support for configuration files
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ Configuration files for development tools and applications:
|
|||||||
- `starship.toml` - Starship prompt configuration
|
- `starship.toml` - Starship prompt configuration
|
||||||
- `shared.sh` - Cross-shell compatibility functions
|
- `shared.sh` - Cross-shell compatibility functions
|
||||||
- `aerospace/`, `amethyst/`, `yabai/`, `skhd/` - Window managers
|
- `aerospace/`, `amethyst/`, `yabai/`, `skhd/` - Window managers
|
||||||
- `direnv/`, `asdf/`, `aqua/` - Development environment tools
|
- `direnv/`, `mise/`, `aqua/` - Development environment tools
|
||||||
- `gpg-tui/`, `op/`, `gh/` - Security and CLI tools
|
- `gpg-tui/`, `op/`, `gh/` - Security and CLI tools
|
||||||
- Theme configurations: everforest color schemes across multiple tools
|
- Theme configurations: everforest color schemes across multiple tools
|
||||||
|
|
||||||
@@ -97,7 +97,7 @@ Installation and setup automation scripts
|
|||||||
- `.shellcheckrc` - ShellCheck configuration
|
- `.shellcheckrc` - ShellCheck configuration
|
||||||
- `.mega-linter.yml` - MegaLinter configuration
|
- `.mega-linter.yml` - MegaLinter configuration
|
||||||
- `.luarc.json` - Lua language server configuration
|
- `.luarc.json` - Lua language server configuration
|
||||||
- `.nvmrc`, `.go-version`, `.python-version` - Version management
|
- `.nvmrc`, `.go-version`, `.python-version` - Version files (consumed by mise)
|
||||||
- Various ignore files (.gitignore, .prettierignore, .yamlignore, etc.)
|
- Various ignore files (.gitignore, .prettierignore, .yamlignore, etc.)
|
||||||
|
|
||||||
## Testing Infrastructure
|
## Testing Infrastructure
|
||||||
|
|||||||
@@ -59,10 +59,11 @@ pre-commit run --all-files
|
|||||||
## Version Management
|
## Version Management
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
# Check current versions
|
# Check current versions (all managed by mise)
|
||||||
node --version # Managed by nvm (.nvmrc: v20.18.1)
|
node --version # mise (.nvmrc via idiomatic_version_file)
|
||||||
go version # Managed by asdf (.go-version)
|
go version # mise (.go-version)
|
||||||
python --version # Managed by asdf (.python-version)
|
python --version # mise (.python-version)
|
||||||
|
mise ls # List all installed tool versions
|
||||||
```
|
```
|
||||||
|
|
||||||
## System Utilities (Darwin-specific)
|
## System Utilities (Darwin-specific)
|
||||||
|
|||||||
@@ -1,10 +1,4 @@
|
|||||||
# language of the project (csharp, python, rust, java, typescript, go, cpp, or ruby)
|
---
|
||||||
# * For C, use cpp
|
|
||||||
# * For JavaScript, use typescript
|
|
||||||
# Special requirements:
|
|
||||||
# * csharp: Requires the presence of a .sln file in the project folder.
|
|
||||||
language: bash
|
|
||||||
|
|
||||||
# whether to use the project's gitignore file to ignore files
|
# whether to use the project's gitignore file to ignore files
|
||||||
# Added on 2025-04-07
|
# Added on 2025-04-07
|
||||||
ignore_all_files_in_gitignore: true
|
ignore_all_files_in_gitignore: true
|
||||||
@@ -13,11 +7,11 @@ ignore_all_files_in_gitignore: true
|
|||||||
# Was previously called `ignored_dirs`, please update your config if you are using that.
|
# Was previously called `ignored_dirs`, please update your config if you are using that.
|
||||||
# Added (renamed) on 2025-04-07
|
# Added (renamed) on 2025-04-07
|
||||||
ignored_paths:
|
ignored_paths:
|
||||||
- '*.swp'
|
- "*.swp"
|
||||||
- '*.tmp'
|
- "*.tmp"
|
||||||
- '*.tmp.*'
|
- "*.tmp.*"
|
||||||
- '.DS_Store'
|
- ".DS_Store"
|
||||||
- '.git/**'
|
- ".git/**"
|
||||||
- /config/cheat/cheatsheets/community/**
|
- /config/cheat/cheatsheets/community/**
|
||||||
- /config/cheat/cheatsheets/pure-bash-bible/**
|
- /config/cheat/cheatsheets/pure-bash-bible/**
|
||||||
- /config/cheat/cheatsheets/tldr/**
|
- /config/cheat/cheatsheets/tldr/**
|
||||||
@@ -85,6 +79,82 @@ excluded_tools: []
|
|||||||
|
|
||||||
# initial prompt for the project. It will always be given to the LLM upon activating the project
|
# initial prompt for the project. It will always be given to the LLM upon activating the project
|
||||||
# (contrary to the memories, which are loaded on demand).
|
# (contrary to the memories, which are loaded on demand).
|
||||||
initial_prompt: ''
|
initial_prompt: ""
|
||||||
|
# the name by which the project can be referenced within Serena
|
||||||
|
project_name: ".dotfiles"
|
||||||
|
|
||||||
project_name: '.dotfiles'
|
# list of tools to include that would otherwise be disabled (particularly optional tools that are disabled by default).
|
||||||
|
# This extends the existing inclusions (e.g. from the global configuration).
|
||||||
|
included_optional_tools: []
|
||||||
|
|
||||||
|
# fixed set of tools to use as the base tool set (if non-empty), replacing Serena's default set of tools.
|
||||||
|
# This cannot be combined with non-empty excluded_tools or included_optional_tools.
|
||||||
|
fixed_tools: []
|
||||||
|
|
||||||
|
# list of mode names to that are always to be included in the set of active modes
|
||||||
|
# The full set of modes to be activated is base_modes + default_modes.
|
||||||
|
# If the setting is undefined, the base_modes from the global configuration (serena_config.yml) apply.
|
||||||
|
# Otherwise, this setting overrides the global configuration.
|
||||||
|
# Set this to [] to disable base modes for this project.
|
||||||
|
# Set this to a list of mode names to always include the respective modes for this project.
|
||||||
|
base_modes:
|
||||||
|
|
||||||
|
# list of mode names that are to be activated by default.
|
||||||
|
# The full set of modes to be activated is base_modes + default_modes.
|
||||||
|
# If the setting is undefined, the default_modes from the global configuration (serena_config.yml) apply.
|
||||||
|
# Otherwise, this overrides the setting from the global configuration (serena_config.yml).
|
||||||
|
# This setting can, in turn, be overridden by CLI parameters (--mode).
|
||||||
|
default_modes:
|
||||||
|
|
||||||
|
# time budget (seconds) per tool call for the retrieval of additional symbol information
|
||||||
|
# such as docstrings or parameter information.
|
||||||
|
# This overrides the corresponding setting in the global configuration; see the documentation there.
|
||||||
|
# If null or missing, use the setting from the global configuration.
|
||||||
|
symbol_info_budget:
|
||||||
|
|
||||||
|
# The language backend to use for this project.
|
||||||
|
# If not set, the global setting from serena_config.yml is used.
|
||||||
|
# Valid values: LSP, JetBrains
|
||||||
|
# Note: the backend is fixed at startup. If a project with a different backend
|
||||||
|
# is activated post-init, an error will be returned.
|
||||||
|
language_backend:
|
||||||
|
|
||||||
|
# line ending convention to use when writing source files.
|
||||||
|
# Possible values: unset (use global setting), "lf", "crlf", or "native" (platform default)
|
||||||
|
# This does not affect Serena's own files (e.g. memories and configuration files), which always use native line endings.
|
||||||
|
line_ending:
|
||||||
|
|
||||||
|
# list of regex patterns which, when matched, mark a memory entry as read‑only.
|
||||||
|
# Extends the list from the global configuration, merging the two lists.
|
||||||
|
read_only_memory_patterns: []
|
||||||
|
|
||||||
|
# the encoding used by text files in the project
|
||||||
|
# For a list of possible encodings, see https://docs.python.org/3.11/library/codecs.html#standard-encodings
|
||||||
|
encoding: utf-8
|
||||||
|
|
||||||
|
# list of languages for which language servers are started; choose from:
|
||||||
|
# al bash clojure cpp csharp
|
||||||
|
# csharp_omnisharp dart elixir elm erlang
|
||||||
|
# fortran fsharp go groovy haskell
|
||||||
|
# java julia kotlin lua markdown
|
||||||
|
# matlab nix pascal perl php
|
||||||
|
# php_phpactor powershell python python_jedi r
|
||||||
|
# rego ruby ruby_solargraph rust scala
|
||||||
|
# swift terraform toml typescript typescript_vts
|
||||||
|
# vue yaml zig
|
||||||
|
# (This list may be outdated. For the current list, see values of Language enum here:
|
||||||
|
# https://github.com/oraios/serena/blob/main/src/solidlsp/ls_config.py
|
||||||
|
# For some languages, there are alternative language servers, e.g. csharp_omnisharp, ruby_solargraph.)
|
||||||
|
# Note:
|
||||||
|
# - For C, use cpp
|
||||||
|
# - For JavaScript, use typescript
|
||||||
|
# - For Free Pascal/Lazarus, use pascal
|
||||||
|
# Special requirements:
|
||||||
|
# Some languages require additional setup/installations.
|
||||||
|
# See here for details: https://oraios.github.io/serena/01-about/020_programming-languages.html#language-servers
|
||||||
|
# When using multiple languages, the first language server that supports a given file will be used for that file.
|
||||||
|
# The first language is the default language and the respective language server will be used as a fallback.
|
||||||
|
# Note that when using the JetBrains backend, language servers are not used and this list is correspondingly ignored.
|
||||||
|
languages:
|
||||||
|
- bash
|
||||||
|
- lua
|
||||||
|
|||||||
55
AGENTS.md
55
AGENTS.md
@@ -1,55 +0,0 @@
|
|||||||
# Project guidelines
|
|
||||||
|
|
||||||
This repository contains configuration files and helper scripts for managing
|
|
||||||
a development environment.
|
|
||||||
Dotbot drives installation, and host-specific folders under `hosts/` contain extra configs.
|
|
||||||
|
|
||||||
## Setup
|
|
||||||
|
|
||||||
1. Run `yarn install` to fetch linting tools and the Bats test framework.
|
|
||||||
2. Re-run `yarn install` whenever `package.json` changes.
|
|
||||||
3. Yarn is the package manager of choice; avoid `npm` commands.
|
|
||||||
|
|
||||||
## Keeping the repository up to date
|
|
||||||
|
|
||||||
1. Update submodules with `git submodule update --remote --merge`.
|
|
||||||
2. Pull the latest changes and run `./install`.
|
|
||||||
|
|
||||||
## Linting and tests
|
|
||||||
|
|
||||||
- Format files with:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
yarn fix:prettier
|
|
||||||
yarn fix:markdown
|
|
||||||
```
|
|
||||||
|
|
||||||
- Shell scripts must pass `shellcheck`.
|
|
||||||
|
|
||||||
```bash
|
|
||||||
find . -path ./node_modules -prune -o -name '*.sh' -print0 | xargs -0 shellcheck
|
|
||||||
```
|
|
||||||
|
|
||||||
- Ensure `.editorconfig` rules pass:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
tools/install-ec.sh
|
|
||||||
ec
|
|
||||||
```
|
|
||||||
|
|
||||||
- Execute tests with `yarn test` when code changes.
|
|
||||||
|
|
||||||
## Debugging lint issues
|
|
||||||
|
|
||||||
- `yarn lint:prettier` and `yarn lint:markdown` show formatting errors.
|
|
||||||
- Ensure shell scripts have a shebang or `# shellcheck shell=bash` directive.
|
|
||||||
- Consult `.shellcheckrc` for project specific checks.
|
|
||||||
|
|
||||||
Scripts rely on helpers in `config/shared.sh` so they run under Bash, Zsh and Fish by default.
|
|
||||||
|
|
||||||
## Commits and PRs
|
|
||||||
|
|
||||||
- Use Semantic Commit messages: `type(scope): summary`.
|
|
||||||
- Keep PR titles in the same format.
|
|
||||||
|
|
||||||
<!-- vim: set ft=markdown spell spelllang=en_us cc=80 : -->
|
|
||||||
277
CLAUDE.md
Normal file
277
CLAUDE.md
Normal file
@@ -0,0 +1,277 @@
|
|||||||
|
# CLAUDE.md
|
||||||
|
|
||||||
|
This file provides guidance to Claude Code (claude.ai/code)
|
||||||
|
when working with code in this repository.
|
||||||
|
|
||||||
|
## Repository Overview
|
||||||
|
|
||||||
|
Personal dotfiles repository for Ismo Vuorinen.
|
||||||
|
Uses **Dotbot** (not GNU Stow) to symlink configuration files into place.
|
||||||
|
The directory layout follows the XDG Base Directory Specification.
|
||||||
|
|
||||||
|
## Directory Layout and Linking
|
||||||
|
|
||||||
|
| Source | Destination | Notes |
|
||||||
|
|---------------------|-------------------|-------------------------------------------|
|
||||||
|
| `base/*` | `~/.*` | Home-level dotfiles (`.` added by Dotbot) |
|
||||||
|
| `config/*` | `~/.config/` | Application configurations |
|
||||||
|
| `local/bin/*` | `~/.local/bin/` | Helper scripts and utilities |
|
||||||
|
| `local/share/*` | `~/.local/share/` | Data files |
|
||||||
|
| `local/man/**` | `~/.local/man/` | Manual pages |
|
||||||
|
| `ssh/*` | `~/.ssh/` | SSH configuration (mode 0600) |
|
||||||
|
| `hosts/<hostname>/` | Overlays | Host-specific overrides |
|
||||||
|
|
||||||
|
Installation: `./install` runs Dotbot with `install.conf.yaml`,
|
||||||
|
then applies `hosts/<hostname>/install.conf.yaml` if it exists.
|
||||||
|
|
||||||
|
## Commands
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# Install dependencies (required before lint/test)
|
||||||
|
yarn install
|
||||||
|
|
||||||
|
# Linting
|
||||||
|
yarn lint # Run biome + prettier + editorconfig-checker
|
||||||
|
yarn lint:biome # Biome only
|
||||||
|
yarn lint:ec # EditorConfig checker only
|
||||||
|
yarn lint:md-table # Markdown table formatting check
|
||||||
|
yarn fix:md-table # Auto-fix markdown tables
|
||||||
|
|
||||||
|
# Formatting
|
||||||
|
yarn fix:biome # Autofix with biome (JS/TS/JSON/MD)
|
||||||
|
yarn fix:prettier # Autofix with prettier (YAML)
|
||||||
|
yarn format # Format with biome
|
||||||
|
yarn format:yaml # Format YAML files with prettier
|
||||||
|
|
||||||
|
# Testing (Bats - Bash Automated Testing System)
|
||||||
|
yarn test # Run all tests in tests/
|
||||||
|
# Run a single test file:
|
||||||
|
./node_modules/.bin/bats tests/dfm.bats
|
||||||
|
|
||||||
|
# Shell linting
|
||||||
|
shellcheck <script> # Lint shell scripts
|
||||||
|
|
||||||
|
# Tooling maintenance
|
||||||
|
npx @biomejs/biome migrate --write # Update biome schema version
|
||||||
|
```
|
||||||
|
|
||||||
|
## Pre-commit Hooks
|
||||||
|
|
||||||
|
Configured in `.pre-commit-config.yaml`: shellcheck, shfmt, biome,
|
||||||
|
yamllint, prettier, actionlint, stylua, fish_syntax/fish_indent, ruff.
|
||||||
|
Run `pre-commit run --all-files` to check everything.
|
||||||
|
|
||||||
|
## Commit Convention
|
||||||
|
|
||||||
|
Semantic Commit messages: `type(scope): summary`
|
||||||
|
(e.g., `fix(tmux): correct prefix binding`).
|
||||||
|
Enforced by commitlint extending `@ivuorinen/commitlint-config`.
|
||||||
|
|
||||||
|
## Architecture
|
||||||
|
|
||||||
|
### Shell Configuration Chain
|
||||||
|
|
||||||
|
Both `base/bashrc` and `base/zshrc` source `config/shared.sh`,
|
||||||
|
which loads:
|
||||||
|
- `config/exports` — environment variables, XDG dirs, PATH
|
||||||
|
- `config/alias` — shell aliases
|
||||||
|
|
||||||
|
Zsh additionally uses **antidote** (in `tools/antidote/`)
|
||||||
|
for plugin management and **oh-my-posh** for the prompt.
|
||||||
|
|
||||||
|
### msgr — Messaging Helper
|
||||||
|
|
||||||
|
`local/bin/msgr` provides colored output functions (`msgr msg`,
|
||||||
|
`msgr run`, `msgr yay`, `msgr err`, `msgr warn`). Sourced by `dfm`
|
||||||
|
and most scripts in `local/bin/`.
|
||||||
|
|
||||||
|
### dfm — Dotfiles Manager
|
||||||
|
|
||||||
|
`local/bin/dfm` is the main management script. Key commands:
|
||||||
|
- `dfm install all` — install everything in tiered stages
|
||||||
|
- `dfm brew install` / `dfm brew update` — Homebrew management
|
||||||
|
- `dfm apt upkeep` — APT package maintenance (Debian/Ubuntu)
|
||||||
|
- `dfm dotfiles fmt` / `dfm dotfiles shfmt` — format configs/scripts
|
||||||
|
- `dfm helpers <name>` — inspect aliases, colors, env, functions, path
|
||||||
|
- `dfm docs all` — regenerate documentation under `docs/`
|
||||||
|
- `dfm check arch` / `dfm check host` — system info
|
||||||
|
- `dfm scripts` — run scripts from `scripts/` (discovered via `@description` tags)
|
||||||
|
- `dfm tests` — test visualization helpers
|
||||||
|
|
||||||
|
### mise — Unified Tool Manager
|
||||||
|
|
||||||
|
`config/mise/config.toml` manages language runtimes (Node LTS, Python 3,
|
||||||
|
Go latest, Rust stable) and CLI tools (fd, ripgrep, eza, neovim, delta,
|
||||||
|
zoxide, etc.). Activated via `eval "$(mise activate bash)"` in
|
||||||
|
`config/exports`. Run `mise install` after adding new tools.
|
||||||
|
|
||||||
|
### Submodules
|
||||||
|
|
||||||
|
External dependencies are git submodules (Dotbot, plugins,
|
||||||
|
tmux plugins, cheatsheets, antidote).
|
||||||
|
Managed by `add-submodules.sh`. All set to `ignore = dirty`.
|
||||||
|
Updated automatically via GitHub Actions on a schedule.
|
||||||
|
|
||||||
|
### Host-specific Configs
|
||||||
|
|
||||||
|
Machine-specific overrides live in `hosts/<hostname>/`
|
||||||
|
with their own `base/`, `config/`, and `install.conf.yaml`.
|
||||||
|
These are layered on top of the global config during installation.
|
||||||
|
|
||||||
|
## Code Style
|
||||||
|
|
||||||
|
- **EditorConfig**: 2-space indent, UTF-8, LF line endings.
|
||||||
|
See `.editorconfig` for per-filetype overrides
|
||||||
|
(4-space for PHP/fish, tabs for git config).
|
||||||
|
- **Shell scripts**: Must have a shebang or
|
||||||
|
`# shellcheck shell=bash` directive.
|
||||||
|
Follow shfmt settings in `.editorconfig`
|
||||||
|
(2-space indent, `binary_next_line`,
|
||||||
|
`switch_case_indent`, `space_redirects`, `function_next_line`).
|
||||||
|
- **Lua** (neovim config): Formatted with stylua (`stylua.toml`),
|
||||||
|
90-char line length.
|
||||||
|
- **JSON/JS/TS/Markdown**: Formatted with Biome (`biome.json`),
|
||||||
|
80-char width (Markdown uses 120-char override).
|
||||||
|
- **YAML**: Formatted with Prettier (`.prettierrc.json`),
|
||||||
|
validated with yamllint (`.yamllint.yml`).
|
||||||
|
|
||||||
|
## ShellCheck Disabled Rules
|
||||||
|
|
||||||
|
Defined in `.shellcheckrc`:
|
||||||
|
SC2039 (POSIX `local`), SC2166 (`-o` in test),
|
||||||
|
SC2154 (unassigned variables), SC1091 (source following),
|
||||||
|
SC2174 (mkdir -p -m), SC2016 (single-quote expressions).
|
||||||
|
|
||||||
|
## Gotchas
|
||||||
|
|
||||||
|
- **POSIX scripts**: `x-ssh-audit`, `x-codeql`, `x-until-error`,
|
||||||
|
`x-until-success`, `x-ssl-expiry-date` use `/bin/sh`.
|
||||||
|
Validate with `sh -n`, not `bash -n`.
|
||||||
|
- **Vendor file**: `local/bin/fzf-tmux` is vendored from
|
||||||
|
junegunn/fzf — do not modify.
|
||||||
|
- **Fish config**: `config/fish/` has its own config chain
|
||||||
|
(`config.fish`, `exports.fish`, `alias.fish`) plus 60+ functions.
|
||||||
|
- **gh CLI config**: `config/gh/hosts.yml` is managed by `gh` CLI
|
||||||
|
and excluded from prettier (see `.prettierignore`).
|
||||||
|
- **Python**: Two scripts (`x-compare-versions.py`,
|
||||||
|
`x-git-largest-files.py`) linted by Ruff (config in `pyproject.toml`).
|
||||||
|
- **Fish secrets**: `config/fish/secrets.d/*.fish` files are auto-sourced
|
||||||
|
by `exports.fish`. Copy `github.fish.example` → `github.fish` for local
|
||||||
|
secrets. These files are gitignored; only `*.example` and `README.md`
|
||||||
|
are tracked.
|
||||||
|
|
||||||
|
## Claude Code Configuration
|
||||||
|
|
||||||
|
- **Hooks** (`.claude/settings.json`):
|
||||||
|
- *PreToolUse*: Blocks edits to `fzf-tmux`, `yarn.lock`,
|
||||||
|
`.yarn/`, submodule paths, and real secrets.d files
|
||||||
|
- *PostToolUse*: Auto-formats files by extension
|
||||||
|
(shfmt, fish_indent, stylua, biome, prettier)
|
||||||
|
- *PostToolUse*: Validates Dotbot `install.conf.yaml`
|
||||||
|
after edits
|
||||||
|
- *PostToolUse*: Warns on formatter/linter config changes
|
||||||
|
- *Stop*: Runs `yarn lint` gate before finishing
|
||||||
|
- **Skills** (`.claude/skills/`):
|
||||||
|
- `shell-validate`: Auto-validates shell scripts
|
||||||
|
(syntax + shellcheck)
|
||||||
|
- `fish-validate`: Auto-validates fish scripts
|
||||||
|
(syntax + fish_indent)
|
||||||
|
- `lua-format`: Auto-formats Lua files with stylua
|
||||||
|
- `yaml-validate`: Auto-validates YAML files
|
||||||
|
(yamllint + actionlint)
|
||||||
|
- `dotbot-validate`: Validates Dotbot install.conf.yaml
|
||||||
|
- `new-script`: Scaffolds helper scripts in local/bin/
|
||||||
|
- `new-fish-function`: Scaffolds fish functions
|
||||||
|
- `host-override`: Creates host-specific config overlays
|
||||||
|
- **Subagents** (`.claude/agents/`):
|
||||||
|
- `code-reviewer`: Reviews shell/fish/lua changes
|
||||||
|
- **Plugins** (required):
|
||||||
|
- `context-mode`: Context window protection — must be
|
||||||
|
installed for this repo. See routing rules below.
|
||||||
|
- `context7`: Live documentation lookup
|
||||||
|
|
||||||
|
## Package Manager
|
||||||
|
|
||||||
|
Yarn (v4+) is the package manager. Do not use npm.
|
||||||
|
|
||||||
|
# context-mode — MANDATORY routing rules
|
||||||
|
|
||||||
|
You have context-mode MCP tools available. These rules are NOT optional —
|
||||||
|
they protect your context window from flooding. A single unrouted command
|
||||||
|
can dump 56 KB into context and waste the entire session.
|
||||||
|
|
||||||
|
## BLOCKED commands — do NOT attempt these
|
||||||
|
|
||||||
|
### curl / wget — BLOCKED
|
||||||
|
Any Bash command containing `curl` or `wget` is intercepted and replaced with an error message. Do NOT retry.
|
||||||
|
Instead use:
|
||||||
|
- `ctx_fetch_and_index(url, source)` to fetch and index web pages
|
||||||
|
- `ctx_execute(language: "javascript", code: "const r = await fetch(...)")` to run HTTP calls in sandbox
|
||||||
|
|
||||||
|
### Inline HTTP — BLOCKED
|
||||||
|
Any Bash command containing `fetch('http`, `requests.get(`,
|
||||||
|
`requests.post(`, `http.get(`, or `http.request(` is intercepted
|
||||||
|
and replaced with an error message. Do NOT retry with Bash.
|
||||||
|
Instead use:
|
||||||
|
- `ctx_execute(language, code)` to run HTTP calls in sandbox — only stdout enters context
|
||||||
|
|
||||||
|
### WebFetch — BLOCKED
|
||||||
|
WebFetch calls are denied entirely. The URL is extracted and you are told to use `ctx_fetch_and_index` instead.
|
||||||
|
Instead use:
|
||||||
|
- `ctx_fetch_and_index(url, source)` then `ctx_search(queries)` to query the indexed content
|
||||||
|
|
||||||
|
## REDIRECTED tools — use sandbox equivalents
|
||||||
|
|
||||||
|
### Bash (>20 lines output)
|
||||||
|
Bash is ONLY for: `git`, `mkdir`, `rm`, `mv`, `cd`, `ls`, `npm install`, `pip install`, and other short-output commands.
|
||||||
|
For everything else, use:
|
||||||
|
- `ctx_batch_execute(commands, queries)` — run multiple commands + search in ONE call
|
||||||
|
- `ctx_execute(language: "shell", code: "...")` — run in sandbox, only stdout enters context
|
||||||
|
|
||||||
|
### Read (for analysis)
|
||||||
|
If you are reading a file to **Edit** it → Read is correct (Edit needs content in context).
|
||||||
|
If you are reading to **analyze, explore, or summarize** →
|
||||||
|
use `ctx_execute_file(path, language, code)` instead. Only your
|
||||||
|
printed summary enters context. The raw file stays in the sandbox.
|
||||||
|
|
||||||
|
### Grep (large results)
|
||||||
|
Grep results can flood context.
|
||||||
|
Use `ctx_execute(language: "shell", code: "grep ...")` to run
|
||||||
|
searches in sandbox. Only your printed summary enters context.
|
||||||
|
|
||||||
|
## Tool selection hierarchy
|
||||||
|
|
||||||
|
1. **GATHER**: `ctx_batch_execute(commands, queries)` — Primary
|
||||||
|
tool. Runs all commands, auto-indexes output, returns search
|
||||||
|
results. ONE call replaces 30+ individual calls.
|
||||||
|
2. **FOLLOW-UP**: `ctx_search(queries: ["q1", "q2", ...])` —
|
||||||
|
Query indexed content. Pass ALL questions as array in ONE call.
|
||||||
|
3. **PROCESSING**: `ctx_execute(language, code)` |
|
||||||
|
`ctx_execute_file(path, language, code)` — Sandbox execution.
|
||||||
|
Only stdout enters context.
|
||||||
|
4. **WEB**: `ctx_fetch_and_index(url, source)` then
|
||||||
|
`ctx_search(queries)` — Fetch, chunk, index, query.
|
||||||
|
Raw HTML never enters context.
|
||||||
|
5. **INDEX**: `ctx_index(content, source)` — Store content in FTS5 knowledge base for later search.
|
||||||
|
|
||||||
|
## Subagent routing
|
||||||
|
|
||||||
|
When spawning subagents (Agent/Task tool), the routing block is
|
||||||
|
automatically injected into their prompt. Bash-type subagents are
|
||||||
|
upgraded to general-purpose so they have access to MCP tools.
|
||||||
|
You do NOT need to manually instruct subagents about context-mode.
|
||||||
|
|
||||||
|
## Output constraints
|
||||||
|
|
||||||
|
- Keep responses under 500 words.
|
||||||
|
- Write artifacts (code, configs, PRDs) to FILES — never return
|
||||||
|
them as inline text. Return only: file path + 1-line description.
|
||||||
|
- When indexing content, use descriptive source labels so others can `ctx_search(source: "label")` later.
|
||||||
|
|
||||||
|
## ctx commands
|
||||||
|
|
||||||
|
| Command | Action |
|
||||||
|
|---------------|---------------------------------------------------------------------------------------|
|
||||||
|
| `ctx stats` | Call the `ctx_stats` MCP tool and display the full output verbatim |
|
||||||
|
| `ctx doctor` | Call the `ctx_doctor` MCP tool, run the returned shell command, display as checklist |
|
||||||
|
| `ctx upgrade` | Call the `ctx_upgrade` MCP tool, run the returned shell command, display as checklist |
|
||||||
@@ -5,12 +5,8 @@ git submodule sync --recursive
|
|||||||
# dotbot and plugins
|
# dotbot and plugins
|
||||||
git submodule add --name dotbot \
|
git submodule add --name dotbot \
|
||||||
-f https://github.com/anishathalye/dotbot.git tools/dotbot
|
-f https://github.com/anishathalye/dotbot.git tools/dotbot
|
||||||
git submodule add --name dotbot-brew \
|
|
||||||
-f https://github.com/wren/dotbot-brew.git tools/dotbot-brew
|
|
||||||
git submodule add --name dotbot-include \
|
git submodule add --name dotbot-include \
|
||||||
-f https://gitlab.com/gnfzdz/dotbot-include.git tools/dotbot-include
|
-f https://gitlab.com/gnfzdz/dotbot-include.git tools/dotbot-include
|
||||||
git submodule add --name dotbot-pip \
|
|
||||||
-f https://github.com/sobolevn/dotbot-pip.git tools/dotbot-pip
|
|
||||||
|
|
||||||
# other repos
|
# other repos
|
||||||
git submodule add --name cheat-community \
|
git submodule add --name cheat-community \
|
||||||
@@ -46,26 +42,70 @@ done
|
|||||||
# Mark certain repositories shallow
|
# Mark certain repositories shallow
|
||||||
git config -f .gitmodules submodule.antidote.shallow true
|
git config -f .gitmodules submodule.antidote.shallow true
|
||||||
|
|
||||||
# remove old submodules
|
# Log a message using msgr if available, else echo
|
||||||
folders=(
|
_log()
|
||||||
"config/tmux/plugins/tpm"
|
{
|
||||||
"config/tmux/plugins/tmux"
|
local msg="$1"
|
||||||
"config/tmux/plugins/tmux-menus"
|
if command -v msgr > /dev/null 2>&1; then
|
||||||
"tools/dotbot-crontab"
|
msgr run_done "$msg"
|
||||||
"tools/dotbot-snap"
|
else
|
||||||
"config/tmux/plugins/tmux-window-name"
|
echo " [ok] $msg"
|
||||||
"config/tmux/plugins/tmux-sensible"
|
fi
|
||||||
"config/tmux/plugins/tmux-mode-indicator"
|
return 0
|
||||||
"config/tmux/plugins/tmux-yank"
|
}
|
||||||
"config/tmux/plugins/tmux-fzf-url"
|
|
||||||
"config/nvim-kickstart"
|
# Remove a stale git submodule and clean up references
|
||||||
"local/bin/asdf"
|
remove_old_submodule()
|
||||||
"local/asdf"
|
{
|
||||||
"tools/dotbot-asdf"
|
local name="$1" path="$2"
|
||||||
|
|
||||||
|
# Remove working tree
|
||||||
|
if [[ -d "$path" ]]; then
|
||||||
|
rm -rf "$path"
|
||||||
|
_log "Removed $path"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Remove stale git index entry
|
||||||
|
git rm --cached "$path" 2> /dev/null || true
|
||||||
|
|
||||||
|
# Remove .git/config section keyed by path
|
||||||
|
git config --remove-section "submodule.$path" 2> /dev/null || true
|
||||||
|
|
||||||
|
# Skip name-based cleanup if no submodule name provided
|
||||||
|
[[ -z "$name" ]] && return 0
|
||||||
|
|
||||||
|
# Remove .git/config section keyed by name
|
||||||
|
git config --remove-section "submodule.$name" 2> /dev/null || true
|
||||||
|
|
||||||
|
# Remove .git/modules/<name>/ cached repository
|
||||||
|
if [[ -d ".git/modules/$name" ]]; then
|
||||||
|
rm -rf ".git/modules/$name"
|
||||||
|
_log "Removed .git/modules/$name"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
# remove old submodules (name:path pairs)
|
||||||
|
old_submodules=(
|
||||||
|
"tmux/tpm:config/tmux/plugins/tpm"
|
||||||
|
":config/tmux/plugins/tmux"
|
||||||
|
"tmux/tmux-menus:config/tmux/plugins/tmux-menus"
|
||||||
|
"dotbot-crontab:tools/dotbot-crontab"
|
||||||
|
"dotbot-snap:tools/dotbot-snap"
|
||||||
|
"tmux/tmux-window-name:config/tmux/plugins/tmux-window-name"
|
||||||
|
"tmux/tmux-sensible:config/tmux/plugins/tmux-sensible"
|
||||||
|
"tmux/tmux-mode-indicator:config/tmux/plugins/tmux-mode-indicator"
|
||||||
|
"tmux/tmux-yank:config/tmux/plugins/tmux-yank"
|
||||||
|
":config/tmux/plugins/tmux-fzf-url"
|
||||||
|
"nvim-kickstart:config/nvim-kickstart"
|
||||||
|
"asdf:local/bin/asdf"
|
||||||
|
"asdf:local/asdf"
|
||||||
|
"dotbot-asdf:tools/dotbot-asdf"
|
||||||
|
"dotbot-pip:tools/dotbot-pip"
|
||||||
|
"dotbot-brew:tools/dotbot-brew"
|
||||||
)
|
)
|
||||||
|
|
||||||
for folder in "${folders[@]}"; do
|
for entry in "${old_submodules[@]}"; do
|
||||||
[ -d "$folder" ] \
|
name="${entry%%:*}"
|
||||||
&& rm -rf "$folder" \
|
path="${entry#*:}"
|
||||||
&& msgr run_done "Removed old submodule $folder"
|
remove_old_submodule "$name" "$path"
|
||||||
done
|
done
|
||||||
|
|||||||
10
base/bashrc
10
base/bashrc
@@ -2,20 +2,17 @@
|
|||||||
# shellcheck shell=bash
|
# shellcheck shell=bash
|
||||||
|
|
||||||
export DOTFILES="$HOME/.dotfiles"
|
export DOTFILES="$HOME/.dotfiles"
|
||||||
|
# Minimal PATH for x-have and utilities; full PATH set in shared.sh/exports
|
||||||
export PATH="$HOME/.local/bin:$DOTFILES/local/bin:$PATH"
|
export PATH="$HOME/.local/bin:$DOTFILES/local/bin:$PATH"
|
||||||
export SHARED_SCRIPTS_SOURCED=0
|
export SHARED_SCRIPTS_SOURCED=0
|
||||||
|
|
||||||
source "$DOTFILES/config/shared.sh"
|
source "$DOTFILES/config/shared.sh"
|
||||||
|
|
||||||
if [ -n "${GHOSTTY_RESOURCES_DIR}" ]; then
|
|
||||||
builtin source "${GHOSTTY_RESOURCES_DIR}/shell-integration/bash/ghostty.bash"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# shellcheck source=../config/fzf/fzf.bash
|
# shellcheck source=../config/fzf/fzf.bash
|
||||||
[ -f "${DOTFILES}/config/fzf/fzf.bash" ] &&
|
[ -f "${DOTFILES}/config/fzf/fzf.bash" ] &&
|
||||||
source "${DOTFILES}/config/fzf/fzf.bash"
|
source "${DOTFILES}/config/fzf/fzf.bash"
|
||||||
|
|
||||||
# Import ssh keys in keychain
|
# Import ssh keys in keychain (macOS-specific -A flag, silently fails on Linux)
|
||||||
ssh-add -A 2>/dev/null
|
ssh-add -A 2>/dev/null
|
||||||
|
|
||||||
x-have antidot && {
|
x-have antidot && {
|
||||||
@@ -25,6 +22,3 @@ x-have antidot && {
|
|||||||
PROMPT_DIRTRIM=3
|
PROMPT_DIRTRIM=3
|
||||||
PROMPT_COMMAND='PS1_CMD1=$(git branch --show-current 2>/dev/null)'
|
PROMPT_COMMAND='PS1_CMD1=$(git branch --show-current 2>/dev/null)'
|
||||||
PS1='\[\e[95m\]\u\[\e[0m\]@\[\e[38;5;22;2m\]\h\[\e[0m\] \[\e[38;5;33m\]\w\[\e[0m\] \[\e[92;2m\]${PS1_CMD1}\n\[\e[39m\]➜\[\e[0m\] '
|
PS1='\[\e[95m\]\u\[\e[0m\]@\[\e[38;5;22;2m\]\h\[\e[0m\] \[\e[38;5;33m\]\w\[\e[0m\] \[\e[92;2m\]${PS1_CMD1}\n\[\e[39m\]➜\[\e[0m\] '
|
||||||
|
|
||||||
# Added by LM Studio CLI (lms)
|
|
||||||
export PATH="$PATH:$HOME/.lmstudio/bin"
|
|
||||||
|
|||||||
@@ -1 +0,0 @@
|
|||||||
use node
|
|
||||||
@@ -2,14 +2,14 @@
|
|||||||
-- These globals can be set and accessed:
|
-- These globals can be set and accessed:
|
||||||
--
|
--
|
||||||
globals = {
|
globals = {
|
||||||
"rawrequire",
|
"rawrequire",
|
||||||
}
|
}
|
||||||
|
|
||||||
--
|
--
|
||||||
-- These globals can only be accessed:
|
-- These globals can only be accessed:
|
||||||
--
|
--
|
||||||
read_globals = {
|
read_globals = {
|
||||||
"hs",
|
"hs",
|
||||||
"ls",
|
"ls",
|
||||||
"spoon",
|
"spoon",
|
||||||
}
|
}
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
16
base/zshrc
16
base/zshrc
@@ -7,18 +7,13 @@
|
|||||||
autoload -U promptinit; promptinit
|
autoload -U promptinit; promptinit
|
||||||
|
|
||||||
export DOTFILES="$HOME/.dotfiles"
|
export DOTFILES="$HOME/.dotfiles"
|
||||||
LOCAL_SHARE="$HOME/.local/share"
|
# Minimal PATH for x-have and utilities; full PATH set in shared.sh/exports
|
||||||
export PATH="$HOME/.local/bin:$DOTFILES/local/bin:$LOCAL_SHARE/nvim/mason/bin:$LOCAL_SHARE/bob/nvim-bin:$LOCAL_SHARE/cargo/bin:/opt/homebrew/bin:/usr/local/bin:$PATH"
|
export PATH="$HOME/.local/bin:$DOTFILES/local/bin:$PATH"
|
||||||
export SHARED_SCRIPTS_SOURCED=0
|
export SHARED_SCRIPTS_SOURCED=0
|
||||||
|
|
||||||
source "$DOTFILES/config/shared.sh"
|
source "$DOTFILES/config/shared.sh"
|
||||||
|
|
||||||
# zsh completions directory
|
# zsh completions directory (ZSH_CUSTOM_COMPLETION_PATH set in shared.sh)
|
||||||
[ -z "$ZSH_COMPLETIONS" ] && export ZSH_COMPLETIONS="$XDG_CONFIG_HOME/zsh/completion"
|
|
||||||
|
|
||||||
# Add zsh completions to FPATH, compinit will be called later
|
|
||||||
FPATH="$ZSH_COMPLETIONS:$FPATH"
|
|
||||||
|
|
||||||
ZSH_COMPDUMP="$XDG_CACHE_HOME/zsh/zcompdump-${SHORT_HOST}-${ZSH_VERSION}"
|
ZSH_COMPDUMP="$XDG_CACHE_HOME/zsh/zcompdump-${SHORT_HOST}-${ZSH_VERSION}"
|
||||||
|
|
||||||
source "$DOTFILES/config/zsh/antidote.zsh"
|
source "$DOTFILES/config/zsh/antidote.zsh"
|
||||||
@@ -37,12 +32,9 @@ source_fzf_config
|
|||||||
x-have antidot && eval "$(antidot init)"
|
x-have antidot && eval "$(antidot init)"
|
||||||
|
|
||||||
autoload -Uz compinit bashcompinit
|
autoload -Uz compinit bashcompinit
|
||||||
compinit -d $ZSH_COMPDUMP
|
compinit -d "$ZSH_COMPDUMP"
|
||||||
bashcompinit
|
bashcompinit
|
||||||
|
|
||||||
# To customize prompt, run `p10k configure` or edit ~/.p10k.zsh.
|
# To customize prompt, run `p10k configure` or edit ~/.p10k.zsh.
|
||||||
export P10K_CONFIG="$DOTFILES/config/zsh/p10k.zsh"
|
export P10K_CONFIG="$DOTFILES/config/zsh/p10k.zsh"
|
||||||
[[ ! -f "$P10K_CONFIG" ]] || source "$P10K_CONFIG"
|
[[ ! -f "$P10K_CONFIG" ]] || source "$P10K_CONFIG"
|
||||||
|
|
||||||
# Added by LM Studio CLI (lms)
|
|
||||||
export PATH="$PATH:$HOME/.lmstudio/bin"
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"$schema": "https://biomejs.dev/schemas/2.3.1/schema.json",
|
"$schema": "https://biomejs.dev/schemas/2.4.7/schema.json",
|
||||||
"vcs": {
|
"vcs": {
|
||||||
"enabled": true,
|
"enabled": true,
|
||||||
"clientKind": "git",
|
"clientKind": "git",
|
||||||
@@ -20,6 +20,7 @@
|
|||||||
"!!**/config/op/plugins/used_plugins",
|
"!!**/config/op/plugins/used_plugins",
|
||||||
"!!**/config/tmux/plugins",
|
"!!**/config/tmux/plugins",
|
||||||
"!!**/config/zsh",
|
"!!**/config/zsh",
|
||||||
|
"!!**/config/karabiner",
|
||||||
"!!**/config/vim",
|
"!!**/config/vim",
|
||||||
"!!**/lazy-lock.json",
|
"!!**/lazy-lock.json",
|
||||||
"!!**/local/bin/antigen.zsh",
|
"!!**/local/bin/antigen.zsh",
|
||||||
|
|||||||
@@ -1,251 +0,0 @@
|
|||||||
# Start AeroSpace at login
|
|
||||||
start-at-login = false
|
|
||||||
|
|
||||||
# Normalizations. See: https://nikitabobko.github.io/AeroSpace/guide#normalization
|
|
||||||
enable-normalization-flatten-containers = true
|
|
||||||
enable-normalization-opposite-orientation-for-nested-containers = true
|
|
||||||
|
|
||||||
# See: https://nikitabobko.github.io/AeroSpace/guide#layouts
|
|
||||||
# The 'accordion-padding' specifies the size of accordion padding
|
|
||||||
# You can set 0 to disable the padding feature
|
|
||||||
accordion-padding = 10
|
|
||||||
|
|
||||||
# Possible values: tiles|accordion
|
|
||||||
default-root-container-layout = 'tiles'
|
|
||||||
|
|
||||||
# Possible values: horizontal|vertical|auto
|
|
||||||
# 'auto' means: wide monitor (anything wider than high) gets horizontal orientation,
|
|
||||||
# tall monitor (anything higher than wide) gets vertical orientation
|
|
||||||
default-root-container-orientation = 'auto'
|
|
||||||
|
|
||||||
# Mouse follows focus when focused monitor changes
|
|
||||||
# Drop it from your config, if you don't like this behavior
|
|
||||||
# See https://nikitabobko.github.io/AeroSpace/guide#on-focus-changed-callbacks
|
|
||||||
# See https://nikitabobko.github.io/AeroSpace/commands#move-mouse
|
|
||||||
# Fallback value (if you omit the key): on-focused-monitor-changed = []
|
|
||||||
on-focused-monitor-changed = ['move-mouse monitor-lazy-center']
|
|
||||||
|
|
||||||
# You can effectively turn off macOS "Hide application" (cmd-h) feature by toggling this flag
|
|
||||||
# Useful if you don't use this macOS feature, but accidentally hit cmd-h or cmd-alt-h key
|
|
||||||
# Also see: https://nikitabobko.github.io/AeroSpace/goodness#disable-hide-app
|
|
||||||
automatically-unhide-macos-hidden-apps = true
|
|
||||||
|
|
||||||
# [[on-window-detected]]
|
|
||||||
# if.app-id = 'com.apple.systempreferences'
|
|
||||||
# if.app-name-regex-substring = 'settings'
|
|
||||||
# if.window-title-regex-substring = 'substring'
|
|
||||||
# if.workspace = 'workspace-name'
|
|
||||||
# if.during-aerospace-startup = true
|
|
||||||
# check-further-callbacks = true
|
|
||||||
# run = ['layout floating', 'move-node-to-workspace S'] # The callback itself
|
|
||||||
|
|
||||||
[[on-window-detected]]
|
|
||||||
if.app-name-regex-substring = 'settings' # All settings
|
|
||||||
run = ['layout floating']
|
|
||||||
|
|
||||||
[[on-window-detected]]
|
|
||||||
if.app-id = 'com.apple.systempreferences' # macOS System Preferences
|
|
||||||
run = ['layout floating']
|
|
||||||
|
|
||||||
[[on-window-detected]]
|
|
||||||
if.app-id = 'com.1password.1password' # 1Password
|
|
||||||
run = ['layout floating']
|
|
||||||
|
|
||||||
[[on-window-detected]]
|
|
||||||
if.app-id = 'org.ferdium.ferdium-app' # Ferdium, has WhatsApp etc.
|
|
||||||
run = ['layout floating']
|
|
||||||
|
|
||||||
[[on-window-detected]]
|
|
||||||
if.app-id = 'com.jetbrains.PhpStorm' # PhpStorm
|
|
||||||
run = ['layout floating']
|
|
||||||
|
|
||||||
[[on-window-detected]]
|
|
||||||
if.app-id = 'com.apple.finder' # Finder
|
|
||||||
run = ['layout floating']
|
|
||||||
|
|
||||||
[[on-window-detected]]
|
|
||||||
if.app-id = 'com.apple.Preview' # Preview
|
|
||||||
run = ['layout floating']
|
|
||||||
|
|
||||||
[[on-window-detected]]
|
|
||||||
if.app-id = 'com.apple.mail' # Mail
|
|
||||||
run = ['layout floating']
|
|
||||||
|
|
||||||
[[on-window-detected]]
|
|
||||||
if.app-id = 'com.DanPristupov.Fork' # Fork
|
|
||||||
run = ['layout floating']
|
|
||||||
|
|
||||||
[[on-window-detected]]
|
|
||||||
if.app-id = 'com.flexibits.fantastical2.mac' # Fantastical
|
|
||||||
run = ['layout floating']
|
|
||||||
|
|
||||||
[[on-window-detected]]
|
|
||||||
if.app-id = 'org.whispersystems.signal-desktop' # Signal
|
|
||||||
run = ['layout floating']
|
|
||||||
|
|
||||||
[[on-window-detected]]
|
|
||||||
if.app-id = 'com.tidal.desktop' # TIDAL
|
|
||||||
run = ['layout floating', 'move-node-to-workspace 2'] # Float and move to workspace 2
|
|
||||||
|
|
||||||
[[on-window-detected]]
|
|
||||||
if.app-id = 'com.apple.TV' # Apple TV app
|
|
||||||
run = ['layout floating']
|
|
||||||
|
|
||||||
[[on-window-detected]]
|
|
||||||
if.app-id = 'com.setapp.DesktopClient' # Setapp
|
|
||||||
run = ['layout floating']
|
|
||||||
|
|
||||||
[[on-window-detected]]
|
|
||||||
if.app-id = 'com.electron.dockerdesktop' # Docker Desktop
|
|
||||||
run = ['layout floating']
|
|
||||||
|
|
||||||
[[on-window-detected]]
|
|
||||||
if.app-id = 'com.tinyspeck.slackmacgap' # Slack
|
|
||||||
run = ['layout floating']
|
|
||||||
|
|
||||||
[[on-window-detected]]
|
|
||||||
if.app-id = 'md.obsidia' # Obsidian
|
|
||||||
run = ['layout floating']
|
|
||||||
|
|
||||||
[[on-window-detected]]
|
|
||||||
if.app-id = 'com.todoist.mac.Todoist' # Todoist
|
|
||||||
run = ['layout floating']
|
|
||||||
|
|
||||||
[[on-window-detected]]
|
|
||||||
if.app-id = 'com.apple.backup.launcher' # TimeMachine
|
|
||||||
run = ['layout floating']
|
|
||||||
|
|
||||||
[[on-window-detected]]
|
|
||||||
if.app-id = 'com.philipyoungg.session-setapp' # Session app (Setapp)
|
|
||||||
run = ['layout floating']
|
|
||||||
|
|
||||||
[[on-window-detected]]
|
|
||||||
if.app-id = 'com.microsoft.rdc.macos' # Remote Desktop
|
|
||||||
run = ['layout floating']
|
|
||||||
|
|
||||||
# Possible values: (qwerty|dvorak)
|
|
||||||
# See https://nikitabobko.github.io/AeroSpace/guide#key-mapping
|
|
||||||
[key-mapping]
|
|
||||||
preset = 'qwerty'
|
|
||||||
|
|
||||||
# Gaps between windows (inner-*) and between monitor edges (outer-*).
|
|
||||||
# Possible values:
|
|
||||||
# - Constant: gaps.outer.top = 8
|
|
||||||
# - Per monitor: gaps.outer.top = [{ monitor.main = 16 }, { monitor."some-pattern" = 32 }, 24]
|
|
||||||
# In this example, 24 is a default value when there is no match.
|
|
||||||
# Monitor pattern is the same as for 'workspace-to-monitor-force-assignment'.
|
|
||||||
# See: https://nikitabobko.github.io/AeroSpace/guide#assign-workspaces-to-monitors
|
|
||||||
[gaps]
|
|
||||||
inner.horizontal = 5
|
|
||||||
inner.vertical = 5
|
|
||||||
outer.top = [{ monitor.'^built-in retina display$' = 0 }, 0]
|
|
||||||
outer.right = 0
|
|
||||||
outer.bottom = 0
|
|
||||||
outer.left = 0
|
|
||||||
|
|
||||||
# 'main' binding mode declaration
|
|
||||||
# See: https://nikitabobko.github.io/AeroSpace/guide#binding-modes
|
|
||||||
# 'main' binding mode must be always presented
|
|
||||||
# Fallback value (if you omit the key): mode.main.binding = {}
|
|
||||||
[mode.main.binding]
|
|
||||||
|
|
||||||
cmd-h = [] # Disable "hide application"
|
|
||||||
cmd-alt-h = [] # Disable "hide others"
|
|
||||||
|
|
||||||
# All possible keys:
|
|
||||||
# - Letters. a, b, c, ..., z
|
|
||||||
# - Numbers. 0, 1, 2, ..., 9
|
|
||||||
# - Keypad numbers. keypad0, keypad1, keypad2, ..., keypad9
|
|
||||||
# - F-keys. f1, f2, ..., f20
|
|
||||||
# - Special keys. minus, equal, period, comma, slash, backslash, quote, semicolon, backtick,
|
|
||||||
# leftSquareBracket, rightSquareBracket, space, enter, esc, backspace, tab
|
|
||||||
# - Keypad special. keypadClear, keypadDecimalMark, keypadDivide, keypadEnter, keypadEqual,
|
|
||||||
# keypadMinus, keypadMultiply, keypadPlus
|
|
||||||
# - Arrows. left, down, up, right
|
|
||||||
|
|
||||||
# All possible modifiers: cmd, alt, ctrl, shift
|
|
||||||
|
|
||||||
# All possible commands: https://nikitabobko.github.io/AeroSpace/commands
|
|
||||||
|
|
||||||
# See: https://nikitabobko.github.io/AeroSpace/commands#exec-and-forget
|
|
||||||
# You can uncomment the following lines to open up terminal with alt + enter shortcut (like in i3)
|
|
||||||
# alt-enter = '''exec-and-forget osascript -e '
|
|
||||||
# tell application "Terminal"
|
|
||||||
# do script
|
|
||||||
# activate
|
|
||||||
# end tell'
|
|
||||||
# '''
|
|
||||||
|
|
||||||
# alt-cmd-shift-f = 'fullscreen'
|
|
||||||
# alt-shift-f = 'layout floating'
|
|
||||||
# alt-shift-tab = 'move-workspace-to-monitor --wrap-around next'
|
|
||||||
|
|
||||||
# See: https://nikitabobko.github.io/AeroSpace/commands#focus
|
|
||||||
alt-h = 'focus left'
|
|
||||||
alt-j = 'focus down'
|
|
||||||
alt-k = 'focus up'
|
|
||||||
alt-l = 'focus right'
|
|
||||||
|
|
||||||
# See: https://nikitabobko.github.io/AeroSpace/commands#workspace
|
|
||||||
alt-shift-1 = 'workspace 1' # Main
|
|
||||||
alt-shift-2 = 'workspace 2' # Media
|
|
||||||
ctrl-shift-1 = 'move-node-to-workspace 1' # Move node to Main
|
|
||||||
ctrl-shift-2 = 'move-node-to-workspace 2' # Move node to Media
|
|
||||||
|
|
||||||
alt-shift-tab = 'workspace-back-and-forth' # Switch between workspaces
|
|
||||||
ctrl-shift-tab = 'move-workspace-to-monitor --wrap-around prev'
|
|
||||||
|
|
||||||
# See: https://nikitabobko.github.io/AeroSpace/commands#mode
|
|
||||||
# See: https://nikitabobko.github.io/AeroSpace/guide#binding-modes
|
|
||||||
alt-a = 'mode apps'
|
|
||||||
alt-s = 'mode service'
|
|
||||||
alt-m = 'mode move'
|
|
||||||
|
|
||||||
# ╭──────────────────────────────────────────────────────────╮
|
|
||||||
# │ alt-m │
|
|
||||||
# ╰──────────────────────────────────────────────────────────╯
|
|
||||||
[mode.move.binding]
|
|
||||||
esc = ['reload-config', 'mode main']
|
|
||||||
# See: https://nikitabobko.github.io/AeroSpace/commands#move-node-to-workspace
|
|
||||||
1 = ['move-node-to-workspace 1 --focus-follows-window']
|
|
||||||
2 = ['move-node-to-workspace 2 --focus-follows-window']
|
|
||||||
# See: https://nikitabobko.github.io/AeroSpace/commands#move
|
|
||||||
h = 'move left'
|
|
||||||
j = 'move down'
|
|
||||||
k = 'move up'
|
|
||||||
l = 'move right'
|
|
||||||
# See: https://nikitabobko.github.io/AeroSpace/commands#join-with
|
|
||||||
shift-h = 'join-with left'
|
|
||||||
shift-j = 'join-with down'
|
|
||||||
shift-k = 'join-with up'
|
|
||||||
shift-l = 'join-with right'
|
|
||||||
# https://nikitabobko.github.io/AeroSpace/commands#resize
|
|
||||||
ctrl-h = 'resize smart -70'
|
|
||||||
ctrl-l = 'resize smart +70'
|
|
||||||
shift-left = 'resize smart +70'
|
|
||||||
shift-right = 'resize smart -70'
|
|
||||||
# https://nikitabobko.github.io/AeroSpace/commands#flatten-workspace-tree
|
|
||||||
r = ['flatten-workspace-tree', 'mode main'] # reset layout
|
|
||||||
|
|
||||||
# ╭──────────────────────────────────────────────────────────╮
|
|
||||||
# │ alt-a │
|
|
||||||
# ╰──────────────────────────────────────────────────────────╯
|
|
||||||
[mode.apps.binding]
|
|
||||||
esc = ['reload-config', 'mode main']
|
|
||||||
b = ['exec-and-forget open -a /Applications/Brave Browser.app', 'mode main'] # Browser
|
|
||||||
c = ['exec-and-forget open -a /Applications/Ferdium.app', 'mode main'] # Chat
|
|
||||||
g = ['exec-and-forget open -a /Applications/Ghostty.app', 'mode main'] # Ghostty
|
|
||||||
o = ['exec-and-forget open -a /Applications/Obsidian.app', 'mode main'] # Obsidian
|
|
||||||
s = ['exec-and-forget open -a /Applications/Slack.app', 'mode main'] # Slack
|
|
||||||
t = ['exec-and-forget open -a /Applications/TIDAL.app', 'mode main'] # Tidal
|
|
||||||
w = ['exec-and-forget open -a /Applications/WezTerm.app', 'mode main'] # WezTerm
|
|
||||||
|
|
||||||
# ╭──────────────────────────────────────────────────────────╮
|
|
||||||
# │ alt-s │
|
|
||||||
# ╰──────────────────────────────────────────────────────────╯
|
|
||||||
[mode.service.binding]
|
|
||||||
esc = ['reload-config', 'mode main'] # reload config
|
|
||||||
r = ['flatten-workspace-tree', 'mode main'] # reset layout
|
|
||||||
# See: https://nikitabobko.github.io/AeroSpace/commands#layout
|
|
||||||
f = ['layout floating tiling', 'mode main'] # Toggle between floating and tiling layout
|
|
||||||
backspace = ['close-all-windows-but-current', 'mode main']
|
|
||||||
@@ -7,8 +7,6 @@ x-have eza && {
|
|||||||
alias ls="eza -h -s=type --git --icons --group-directories-first"
|
alias ls="eza -h -s=type --git --icons --group-directories-first"
|
||||||
}
|
}
|
||||||
|
|
||||||
alias vim='vim -u "$XDG_CONFIG_HOME/vim/vimrc"'
|
|
||||||
|
|
||||||
# Easier navigation: .., ..., ....
|
# Easier navigation: .., ..., ....
|
||||||
alias ..="cd .."
|
alias ..="cd .."
|
||||||
alias ...="cd ../.."
|
alias ...="cd ../.."
|
||||||
@@ -35,6 +33,8 @@ alias .c='cd $HOME/Code'
|
|||||||
alias .d='cd $DOTFILES'
|
alias .d='cd $DOTFILES'
|
||||||
alias .l='cd $HOME/.local'
|
alias .l='cd $HOME/.local'
|
||||||
alias .o='cd $HOME/Code/ivuorinen/obsidian/'
|
alias .o='cd $HOME/Code/ivuorinen/obsidian/'
|
||||||
|
alias .s='cd $HOME/Code/s'
|
||||||
|
alias .p='cd $HOME/Code/ivuorinen'
|
||||||
|
|
||||||
# Shortcuts for listing
|
# Shortcuts for listing
|
||||||
alias ll="ls -la"
|
alias ll="ls -la"
|
||||||
|
|||||||
@@ -93,13 +93,13 @@ expand-main:
|
|||||||
# Note that not all layouts respond to this command.
|
# Note that not all layouts respond to this command.
|
||||||
increase-main:
|
increase-main:
|
||||||
mod: mod1
|
mod: mod1
|
||||||
key: ','
|
key: ","
|
||||||
|
|
||||||
# Decrease the number of windows in the main pane.
|
# Decrease the number of windows in the main pane.
|
||||||
# Note that not all layouts respond to this command.
|
# Note that not all layouts respond to this command.
|
||||||
decrease-main:
|
decrease-main:
|
||||||
mod: mod1
|
mod: mod1
|
||||||
key: '.'
|
key: "."
|
||||||
|
|
||||||
# General purpose command for custom layouts.
|
# General purpose command for custom layouts.
|
||||||
# Functionality is layout-dependent.
|
# Functionality is layout-dependent.
|
||||||
|
|||||||
@@ -1,15 +0,0 @@
|
|||||||
---
|
|
||||||
# yaml-language-server: $schema=https://raw.githubusercontent.com/aquaproj/aqua/main/json-schema/aqua-yaml.json
|
|
||||||
# aqua - Declarative CLI Version Manager
|
|
||||||
# https://aquaproj.github.io/
|
|
||||||
# checksum:
|
|
||||||
# enabled: true
|
|
||||||
# require_checksum: true
|
|
||||||
# supported_envs:
|
|
||||||
# - all
|
|
||||||
registries:
|
|
||||||
- type: standard
|
|
||||||
ref: v4.346.0 # renovate: depName=aquaproj/aqua-registry
|
|
||||||
packages:
|
|
||||||
- name: cli/cli
|
|
||||||
version: 'v2.69.0'
|
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
# See the docs for explanations: https://asdf-vm.com/manage/configuration.html
|
|
||||||
|
|
||||||
legacy_version_file=yes
|
|
||||||
use_release_candidates=no
|
|
||||||
concurrency=auto
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
bundler
|
|
||||||
@@ -1,20 +0,0 @@
|
|||||||
1password-cli https://github.com/NeoHsu/asdf-1password-cli.git f5d5aab
|
|
||||||
age https://github.com/threkk/asdf-age.git 396bdf6
|
|
||||||
asdf-plugin-manager https://github.com/asdf-community/asdf-plugin-manager.git b5862c1
|
|
||||||
direnv https://github.com/asdf-community/asdf-direnv.git 6ff3dbe
|
|
||||||
dotenv-linter https://github.com/wesleimp/asdf-dotenv-linter.git 1369f53
|
|
||||||
editorconfig-checker https://github.com/gabitchov/asdf-editorconfig-checker.git 585c1d5
|
|
||||||
fd https://gitlab.com/wt0f/asdf-fd.git 17d56e0
|
|
||||||
github-cli https://github.com/bartlomiejdanek/asdf-github-cli.git e0605b7
|
|
||||||
golang https://github.com/asdf-community/asdf-golang.git e2527a3
|
|
||||||
hadolint https://github.com/devlincashman/asdf-hadolint.git c8eb88b
|
|
||||||
kubectl https://github.com/asdf-community/asdf-kubectl.git 2fb3b57
|
|
||||||
pre-commit https://github.com/jonathanmorley/asdf-pre-commit.git 26bfc42
|
|
||||||
ripgrep https://gitlab.com/wt0f/asdf-ripgrep.git e836665
|
|
||||||
rust https://github.com/code-lever/asdf-rust.git 95acf4f
|
|
||||||
shellcheck https://github.com/luizm/asdf-shellcheck.git 66200ff
|
|
||||||
shfmt https://github.com/luizm/asdf-shfmt.git a42c5ff
|
|
||||||
terragrunt https://github.com/ohmer/asdf-terragrunt.git 29f2935
|
|
||||||
tf-summarize https://github.com/adamcrews/asdf-tf-summarize.git 880ad26
|
|
||||||
yamllint https://github.com/ericcornelissen/asdf-yamllint.git e4cfb17
|
|
||||||
yq https://github.com/sudermanjr/asdf-yq.git 772992f
|
|
||||||
@@ -1,12 +0,0 @@
|
|||||||
[global]
|
|
||||||
disable_stdin = false
|
|
||||||
load_dotenv = true
|
|
||||||
hide_env_diff = false
|
|
||||||
|
|
||||||
[whitelist]
|
|
||||||
prefix = [
|
|
||||||
"~/Code/"
|
|
||||||
]
|
|
||||||
exact = [
|
|
||||||
"~/.dotfiles/.envrc"
|
|
||||||
]
|
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
### Do not edit. This was autogenerated by 'asdf direnv setup' ###
|
|
||||||
# shellcheck shell=bash
|
|
||||||
use_asdf()
|
|
||||||
{
|
|
||||||
source_env "$(asdf direnv envrc "$@")"
|
|
||||||
}
|
|
||||||
134
config/exports
134
config/exports
@@ -4,17 +4,30 @@
|
|||||||
|
|
||||||
# Set XDG directories if not already set
|
# Set XDG directories if not already set
|
||||||
# https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html
|
# https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html
|
||||||
[ -z "$XDG_CONFIG_HOME" ] && export XDG_CONFIG_HOME="$HOME/.config"
|
[ -z "${XDG_CONFIG_HOME:-}" ] && export XDG_CONFIG_HOME="$HOME/.config"
|
||||||
[ -z "$XDG_DATA_HOME" ] && export XDG_DATA_HOME="$HOME/.local/share"
|
[ -z "${XDG_DATA_HOME:-}" ] && export XDG_DATA_HOME="$HOME/.local/share"
|
||||||
[ -z "$XDG_CACHE_HOME" ] && export XDG_CACHE_HOME="$HOME/.cache"
|
[ -z "${XDG_CACHE_HOME:-}" ] && export XDG_CACHE_HOME="$HOME/.cache"
|
||||||
[ -z "$XDG_STATE_HOME" ] && export XDG_STATE_HOME="$HOME/.local/state"
|
[ -z "${XDG_STATE_HOME:-}" ] && export XDG_STATE_HOME="$HOME/.local/state"
|
||||||
[ -z "$XDG_BIN_HOME" ] && export XDG_BIN_HOME="$HOME/.local/bin"
|
[ -z "${XDG_BIN_HOME:-}" ] && export XDG_BIN_HOME="$HOME/.local/bin"
|
||||||
[ -z "$XDG_RUNTIME_DIR" ] && export XDG_RUNTIME_DIR="$HOME/.local/run"
|
[ -z "${XDG_RUNTIME_DIR:-}" ] && export XDG_RUNTIME_DIR="$HOME/.local/run"
|
||||||
|
|
||||||
# if DOTFILES is not set, set it to the default location
|
# if DOTFILES is not set, set it to the default location
|
||||||
[ -z "$DOTFILES" ] && export DOTFILES="$HOME/.dotfiles"
|
[ -z "${DOTFILES:-}" ] && export DOTFILES="$HOME/.dotfiles"
|
||||||
|
|
||||||
export PATH="$XDG_BIN_HOME:$DOTFILES/local/bin:$XDG_DATA_HOME/bob/nvim-bin:$XDG_DATA_HOME/cargo/bin:/opt/homebrew/bin:/usr/local/bin:$PATH"
|
# Editor settings
|
||||||
|
[ -z "${EDITOR:-}" ] && export EDITOR="nvim"
|
||||||
|
[ -z "${VISUAL:-}" ] && export VISUAL="code"
|
||||||
|
|
||||||
|
# Bootstrap: ensure local/bin is on PATH so x-path is available
|
||||||
|
PATH="$DOTFILES/local/bin:$PATH"
|
||||||
|
# Use x-path to deduplicate PATH entries (only if x-path is available)
|
||||||
|
if command -v x-path &> /dev/null; then
|
||||||
|
# shellcheck source=../local/bin/x-path
|
||||||
|
source "$(command -v x-path)"
|
||||||
|
normalize_path_var
|
||||||
|
do_prepend "$XDG_BIN_HOME" "$DOTFILES/local/bin" "/opt/homebrew/bin" "/usr/local/bin"
|
||||||
|
fi
|
||||||
|
export PATH
|
||||||
|
|
||||||
if ! command -v msg &> /dev/null; then
|
if ! command -v msg &> /dev/null; then
|
||||||
# Function to print messages if VERBOSE is enabled
|
# Function to print messages if VERBOSE is enabled
|
||||||
@@ -150,6 +163,7 @@ commit()
|
|||||||
git commit -a -m "$commitMessage"
|
git commit -a -m "$commitMessage"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Run Laravel scheduler in a loop
|
||||||
scheduler()
|
scheduler()
|
||||||
{
|
{
|
||||||
while :; do
|
while :; do
|
||||||
@@ -282,7 +296,8 @@ export LESSHISTFILE="$XDG_STATE_HOME"/less/history
|
|||||||
export MANPAGER="less -X"
|
export MANPAGER="less -X"
|
||||||
|
|
||||||
# Always enable colored `grep` output
|
# Always enable colored `grep` output
|
||||||
export GREP_OPTIONS="--color=auto"
|
# Note: GREP_OPTIONS is deprecated since GNU grep 2.21
|
||||||
|
# Color is handled via alias in config/alias
|
||||||
|
|
||||||
# check the window size after each command and, if necessary,
|
# check the window size after each command and, if necessary,
|
||||||
# update the values of LINES and COLUMNS.
|
# update the values of LINES and COLUMNS.
|
||||||
@@ -302,7 +317,7 @@ export ANTIDOTE_PLUGINS="$XDG_CONFIG_HOME/zsh/antidote_plugins"
|
|||||||
# https://docs.ansible.com/ansible/latest/reference_appendices/config.html
|
# https://docs.ansible.com/ansible/latest/reference_appendices/config.html
|
||||||
msg "Setting up Ansible configuration"
|
msg "Setting up Ansible configuration"
|
||||||
export ANSIBLE_HOME="$XDG_CONFIG_HOME/ansible"
|
export ANSIBLE_HOME="$XDG_CONFIG_HOME/ansible"
|
||||||
export ANSIBLE_CONFIG="$XDG_CONFIG_HOME/ansible.cfg"
|
export ANSIBLE_CONFIG="$ANSIBLE_HOME/ansible.cfg"
|
||||||
export ANSIBLE_GALAXY_CACHE_DIR="$XDG_CACHE_HOME/ansible/galaxy_cache"
|
export ANSIBLE_GALAXY_CACHE_DIR="$XDG_CACHE_HOME/ansible/galaxy_cache"
|
||||||
x-dc "$ANSIBLE_HOME"
|
x-dc "$ANSIBLE_HOME"
|
||||||
x-dc "$ANSIBLE_GALAXY_CACHE_DIR"
|
x-dc "$ANSIBLE_GALAXY_CACHE_DIR"
|
||||||
@@ -323,10 +338,25 @@ export AWS_CONFIGURE_OUTPUT=true
|
|||||||
export AWS_CONFIGURE_PROFILE=true
|
export AWS_CONFIGURE_PROFILE=true
|
||||||
export AWS_CONFIGURE_PROMPT=true
|
export AWS_CONFIGURE_PROMPT=true
|
||||||
export AWS_CONFIGURE_PROMPT_DEFAULT="default"
|
export AWS_CONFIGURE_PROMPT_DEFAULT="default"
|
||||||
|
export AWS_SESSION_TOKEN_FILE="${XDG_STATE_HOME}/aws/session_token"
|
||||||
|
export AWS_CONFIGURE_SESSION=true
|
||||||
|
export AWS_CONFIGURE_SESSION_DURATION=7200
|
||||||
|
export AWS_CONFIGURE_SESSION_MFA=true
|
||||||
|
|
||||||
# bob manages nvim versions
|
# Mason (nvim package manager)
|
||||||
msg "Setting up bob configuration"
|
msg "Setting up Mason configuration"
|
||||||
x-path-prepend "$XDG_DATA_HOME/bob/nvim-bin"
|
export MASON_HOME="$XDG_DATA_HOME/nvim/mason"
|
||||||
|
|
||||||
|
# Neovim environment variables
|
||||||
|
msg "Setting up Neovim configuration"
|
||||||
|
[ -z "${NVIM_STATE:-}" ] && export NVIM_STATE="$XDG_STATE_HOME/nvim"
|
||||||
|
[ -z "${NVIM_CONFIG_HOME:-}" ] && export NVIM_CONFIG_HOME="$XDG_CONFIG_HOME/nvim"
|
||||||
|
[ -z "${NVIM_DATA_HOME:-}" ] && export NVIM_DATA_HOME="$XDG_DATA_HOME/nvim"
|
||||||
|
[ -z "${NVIM_CACHE_HOME:-}" ] && export NVIM_CACHE_HOME="$XDG_CACHE_HOME/nvim"
|
||||||
|
[ -z "${NVIM_LOG_PATH:-}" ] && export NVIM_LOG_PATH="$NVIM_STATE/log"
|
||||||
|
[ -z "${NVIM_SESSION_PATH:-}" ] && export NVIM_SESSION_PATH="$NVIM_STATE/session"
|
||||||
|
[ -z "${NVIM_SHADA_PATH:-}" ] && export NVIM_SHADA_PATH="$NVIM_STATE/shada"
|
||||||
|
[ -z "${NVIM_UNDO_PATH:-}" ] && export NVIM_UNDO_PATH="$NVIM_STATE/undo"
|
||||||
|
|
||||||
# bkt (shell command caching tool) configuration
|
# bkt (shell command caching tool) configuration
|
||||||
msg "Setting up bkt configuration"
|
msg "Setting up bkt configuration"
|
||||||
@@ -348,11 +378,9 @@ export COMPOSER_HOME="$XDG_STATE_HOME/composer"
|
|||||||
export COMPOSER_BIN="$COMPOSER_HOME/vendor/bin"
|
export COMPOSER_BIN="$COMPOSER_HOME/vendor/bin"
|
||||||
export PATH="$COMPOSER_BIN:$PATH"
|
export PATH="$COMPOSER_BIN:$PATH"
|
||||||
|
|
||||||
# direnv, https://direnv.net/
|
# Yarn
|
||||||
# https://direnv.net/docs/hook.html
|
msg "Setting up Yarn configuration"
|
||||||
# Set the hook to show the direnv message in a different color
|
export YARN_GLOBAL_FOLDER="$XDG_DATA_HOME/yarn"
|
||||||
# export DIRENV_LOG_FORMAT=$'\033[2mdirenv: %s\033[0m'
|
|
||||||
export DIRENV_LOG_FORMAT=
|
|
||||||
|
|
||||||
# docker, https://docs.docker.com/engine/reference/commandline/cli/
|
# docker, https://docs.docker.com/engine/reference/commandline/cli/
|
||||||
msg "Setting up Docker configuration"
|
msg "Setting up Docker configuration"
|
||||||
@@ -360,6 +388,11 @@ export DOCKER_CONFIG="${XDG_CONFIG_HOME}/docker"
|
|||||||
x-dc "$DOCKER_CONFIG"
|
x-dc "$DOCKER_CONFIG"
|
||||||
# Docker: Disable snyk ad
|
# Docker: Disable snyk ad
|
||||||
export DOCKER_SCAN_SUGGEST=false
|
export DOCKER_SCAN_SUGGEST=false
|
||||||
|
export DOCKER_HIDE_LEGACY_COMMANDS=true
|
||||||
|
|
||||||
|
# direnv
|
||||||
|
msg "Setting up direnv configuration"
|
||||||
|
export DIRENV_LOG_FORMAT=""
|
||||||
|
|
||||||
# fzf
|
# fzf
|
||||||
export FZF_BASE="${XDG_CONFIG_HOME}/fzf"
|
export FZF_BASE="${XDG_CONFIG_HOME}/fzf"
|
||||||
@@ -379,13 +412,6 @@ export GOBIN="$XDG_BIN_HOME"
|
|||||||
# Lando
|
# Lando
|
||||||
export PATH="$HOME/.lando/bin${PATH+:$PATH}" #landopath
|
export PATH="$HOME/.lando/bin${PATH+:$PATH}" #landopath
|
||||||
|
|
||||||
# NPM: Add npm packages to path
|
|
||||||
msg "Setting up NPM configuration"
|
|
||||||
x-have node && {
|
|
||||||
NVM_NODE_BIN_DIR="$(dirname "$(which node)")"
|
|
||||||
export PATH="$NVM_NODE_BIN_DIR:$PATH"
|
|
||||||
}
|
|
||||||
|
|
||||||
# oh-my-posh (omp) configuration
|
# oh-my-posh (omp) configuration
|
||||||
msg "Setting up oh-my-posh configuration"
|
msg "Setting up oh-my-posh configuration"
|
||||||
export OHMYPOSH_CFG="$DOTFILES/config/omp/own.toml"
|
export OHMYPOSH_CFG="$DOTFILES/config/omp/own.toml"
|
||||||
@@ -395,25 +421,21 @@ msg "Setting up 1Password CLI configuration"
|
|||||||
export OP_CACHE="$XDG_STATE_HOME/1password"
|
export OP_CACHE="$XDG_STATE_HOME/1password"
|
||||||
|
|
||||||
# Python
|
# Python
|
||||||
#
|
|
||||||
# pyenv, python environments
|
|
||||||
msg "Setting up Python configuration"
|
msg "Setting up Python configuration"
|
||||||
export WORKON_HOME="$XDG_DATA_HOME/virtualenvs"
|
export WORKON_HOME="$XDG_DATA_HOME/virtualenvs"
|
||||||
export PYENV_ROOT="$XDG_STATE_HOME/pyenv"
|
|
||||||
## for MichaelAquilina/zsh-autoswitch-virtualenv
|
## for MichaelAquilina/zsh-autoswitch-virtualenv
|
||||||
export AUTOSWITCH_VIRTUAL_ENV_DIR="$WORKON_HOME"
|
export AUTOSWITCH_VIRTUAL_ENV_DIR="$WORKON_HOME"
|
||||||
export PATH="$PYENV_ROOT/bin:$PYENV_ROOT/shims:$PATH"
|
|
||||||
[[ -d $PYENV_ROOT/bin ]] && export PATH="$PYENV_ROOT/bin:$PATH"
|
|
||||||
x-have pyenv && eval "$(pyenv init -)"
|
|
||||||
|
|
||||||
# Rust / cargo
|
# Rust / cargo
|
||||||
msg "Setting up Rust/Cargo configuration"
|
msg "Setting up Rust/Cargo configuration"
|
||||||
export RUST_WITHOUT=rust-docs
|
export CARGO_HOME="$XDG_DATA_HOME/cargo"
|
||||||
|
export CARGO_BIN_HOME="$XDG_BIN_HOME"
|
||||||
|
export RUSTUP_HOME="$XDG_DATA_HOME/rustup"
|
||||||
|
export RUST_WITHOUT="clippy,docs,rls"
|
||||||
|
|
||||||
# screen
|
# Poetry
|
||||||
# https://www.gnu.org/software/screen/manual/screen.html
|
msg "Setting up Poetry configuration"
|
||||||
msg "Setting up screen configuration"
|
export POETRY_HOME="$XDG_DATA_HOME/poetry"
|
||||||
export SCREENRC="$XDG_CONFIG_HOME/misc/screenrc"
|
|
||||||
|
|
||||||
# sonarlint
|
# sonarlint
|
||||||
# https://www.sonarlint.org/
|
# https://www.sonarlint.org/
|
||||||
@@ -442,23 +464,51 @@ export ZSH_TMUX_UNICODE=true
|
|||||||
export ZSH_TMUX_AUTOQUIT=false
|
export ZSH_TMUX_AUTOQUIT=false
|
||||||
export ZSH_TMUX_DEFAULT_SESSION_NAME=main
|
export ZSH_TMUX_DEFAULT_SESSION_NAME=main
|
||||||
|
|
||||||
# tms, https://github.com/jrmoulton/tmux-sessionizer
|
# tms (tmux session manager)
|
||||||
export TMS_CONFIG_FILE="${XDG_CONFIG_HOME}/tms/config.toml"
|
msg "Setting up tms configuration"
|
||||||
|
export TMS_CONFIG_FILE="$XDG_CONFIG_HOME/tms/config.toml"
|
||||||
|
|
||||||
# wakatime, https://github.com/wakatime/wakatime-cli
|
# wakatime, https://github.com/wakatime/wakatime-cli
|
||||||
msg "Setting up Wakatime configuration"
|
msg "Setting up Wakatime configuration"
|
||||||
export WAKATIME_HOME="$XDG_STATE_HOME/wakatime"
|
export WAKATIME_HOME="$XDG_STATE_HOME/wakatime"
|
||||||
x-dc "$WAKATIME_HOME"
|
x-dc "$WAKATIME_HOME"
|
||||||
|
|
||||||
|
# LM Studio CLI
|
||||||
|
msg "Setting up LM Studio configuration"
|
||||||
|
export PATH="$PATH:$HOME/.lmstudio/bin"
|
||||||
|
|
||||||
|
# Screen
|
||||||
|
msg "Setting up screen configuration"
|
||||||
|
export SCREENRC="$XDG_CONFIG_HOME/misc/screenrc"
|
||||||
|
|
||||||
|
# Zoxide
|
||||||
|
msg "Setting up Zoxide configuration"
|
||||||
|
export _ZO_DATA_DIR="$XDG_DATA_HOME/zoxide"
|
||||||
|
export _ZO_EXCLUDE_DIRS="$XDG_DATA_HOME"
|
||||||
|
|
||||||
# Misc
|
# Misc
|
||||||
msg "Setting up miscellaneous configuration"
|
msg "Setting up miscellaneous configuration"
|
||||||
export ZSHZ_DATA="$XDG_STATE_HOME/z"
|
export ZSHZ_DATA="$XDG_STATE_HOME/z"
|
||||||
export CHEAT_USE_FZF=true
|
export CHEAT_USE_FZF=true
|
||||||
export SQLITE_HISTORY="${XDG_CACHE_HOME}/sqlite_history"
|
export SQLITE_HISTORY="${XDG_CACHE_HOME}/sqlite_history"
|
||||||
|
|
||||||
[ -f "$XDG_CONFIG_HOME/exports-secret" ] && source "$XDG_CONFIG_HOME/exports-secret"
|
# Additional PATH entries (aligned with fish config)
|
||||||
[ -f "$XDG_CONFIG_HOME/exports-local" ] && source "$XDG_CONFIG_HOME/exports-local"
|
[ -d "$XDG_DATA_HOME/mise/shims" ] && export PATH="$XDG_DATA_HOME/mise/shims:$PATH"
|
||||||
|
[ -d "$YARN_GLOBAL_FOLDER/bin" ] && export PATH="$PATH:$YARN_GLOBAL_FOLDER/bin"
|
||||||
|
[ -d "$MASON_HOME/bin" ] && export PATH="$PATH:$MASON_HOME/bin"
|
||||||
|
[ -d "$HOME/.dotnet/tools" ] && export PATH="$PATH:$HOME/.dotnet/tools"
|
||||||
|
[ -d "$POETRY_HOME/bin" ] && export PATH="$PATH:$POETRY_HOME/bin"
|
||||||
|
[ -d "$HOME/.opencode/bin" ] && export PATH="$PATH:$HOME/.opencode/bin"
|
||||||
|
|
||||||
|
# mise — unified tool version manager
|
||||||
|
# https://mise.jdx.dev
|
||||||
|
if command -v mise &> /dev/null; then
|
||||||
|
eval "$(mise activate bash)"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -f "$XDG_CONFIG_HOME/exports-secret" ]; then source "$XDG_CONFIG_HOME/exports-secret"; fi
|
||||||
|
if [ -f "$XDG_CONFIG_HOME/exports-local" ]; then source "$XDG_CONFIG_HOME/exports-local"; fi
|
||||||
# shellcheck source=./exports-lakka
|
# shellcheck source=./exports-lakka
|
||||||
[ -f "$XDG_CONFIG_HOME/exports-$(hostname)" ] && source "$XDG_CONFIG_HOME/exports-$(hostname)"
|
if [ -f "$XDG_CONFIG_HOME/exports-$(hostname)" ]; then source "$XDG_CONFIG_HOME/exports-$(hostname)"; fi
|
||||||
# shellcheck source=./exports-lakka-secret
|
# shellcheck source=./exports-lakka-secret
|
||||||
[ -f "$XDG_CONFIG_HOME/exports-$(hostname)-secret" ] && source "$XDG_CONFIG_HOME/exports-$(hostname)-secret"
|
if [ -f "$XDG_CONFIG_HOME/exports-$(hostname)-secret" ]; then source "$XDG_CONFIG_HOME/exports-$(hostname)-secret"; fi
|
||||||
|
|||||||
@@ -8,7 +8,6 @@ fi
|
|||||||
export PATH="$HOME/.local/go/bin:$PATH"
|
export PATH="$HOME/.local/go/bin:$PATH"
|
||||||
|
|
||||||
alias logrotate='/usr/sbin/logrotate -s "$HOME/logs/state"'
|
alias logrotate='/usr/sbin/logrotate -s "$HOME/logs/state"'
|
||||||
alias nano='nano -wS -$'
|
|
||||||
alias gpg=gpg2
|
alias gpg=gpg2
|
||||||
|
|
||||||
ACME_PATH="$HOME/.acme.sh"
|
ACME_PATH="$HOME/.acme.sh"
|
||||||
|
|||||||
@@ -1,6 +1,9 @@
|
|||||||
# Set aliases for fish shell
|
# Set aliases for fish shell
|
||||||
|
|
||||||
alias vim='vim -u "$XDG_CONFIG_HOME/vim/vimrc"'
|
if type -q nvim
|
||||||
|
alias vim='nvim'
|
||||||
|
alias vi='nvim'
|
||||||
|
end
|
||||||
|
|
||||||
# eza aliases if eza is installed
|
# eza aliases if eza is installed
|
||||||
if type -q eza >/dev/null
|
if type -q eza >/dev/null
|
||||||
@@ -30,6 +33,19 @@ if type -q eza >/dev/null
|
|||||||
function l --wraps='eza_git' --description eza
|
function l --wraps='eza_git' --description eza
|
||||||
eza_git $argv
|
eza_git $argv
|
||||||
end
|
end
|
||||||
|
else
|
||||||
|
function ls --description 'ls (system fallback)'
|
||||||
|
command ls $argv
|
||||||
|
end
|
||||||
|
function ll --description 'ls -lh (system fallback)'
|
||||||
|
command ls -lh $argv
|
||||||
|
end
|
||||||
|
function l --description 'ls (system fallback)'
|
||||||
|
command ls $argv
|
||||||
|
end
|
||||||
|
function lsa --description 'ls -lah (system fallback)'
|
||||||
|
command ls -lah $argv
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
# Edit fish alias file
|
# Edit fish alias file
|
||||||
@@ -92,5 +108,43 @@ function configure_tide \
|
|||||||
--transient=Yes
|
--transient=Yes
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# Navigation aliases
|
||||||
|
abbr --add .. 'cd ..'
|
||||||
|
abbr --add ... 'cd ../..'
|
||||||
|
abbr --add .... 'cd ../../..'
|
||||||
|
|
||||||
|
# Interesting folders
|
||||||
|
function .b --wraps='cd $XDG_BIN_HOME' --description 'cd $XDG_BIN_HOME'
|
||||||
|
cd $XDG_BIN_HOME $argv
|
||||||
|
end
|
||||||
|
|
||||||
|
function .l --wraps='cd ~/.local' --description 'cd ~/.local'
|
||||||
|
cd ~/.local $argv
|
||||||
|
end
|
||||||
|
|
||||||
|
function .o --wraps='cd ~/Code/ivuorinen/obsidian/' --description 'cd ~/Code/ivuorinen/obsidian/'
|
||||||
|
cd ~/Code/ivuorinen/obsidian/ $argv
|
||||||
|
end
|
||||||
|
|
||||||
|
# cd to git root directory
|
||||||
|
function cdgr --description 'cd to git root'
|
||||||
|
if git rev-parse --is-inside-work-tree &>/dev/null
|
||||||
|
cd (git rev-parse --show-toplevel); or return $status
|
||||||
|
else
|
||||||
|
echo >&2 "Not in a git repository"
|
||||||
|
return 1
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
# Colored grep
|
||||||
|
abbr --add grep 'grep --color'
|
||||||
|
|
||||||
|
# Date helpers
|
||||||
|
alias isodate="date +'%Y-%m-%d'"
|
||||||
|
alias x-datetime="date +'%Y-%m-%d %H:%M:%S'"
|
||||||
|
alias x-timestamp="date +'%s'"
|
||||||
|
|
||||||
# Random abbreviations
|
# Random abbreviations
|
||||||
abbr --add stats onefetch --nerd-fonts --true-color never
|
if type -q onefetch
|
||||||
|
abbr --add stats onefetch --nerd-fonts --true-color never
|
||||||
|
end
|
||||||
|
|||||||
@@ -1 +0,0 @@
|
|||||||
/Applications/OrbStack.app/Contents/MacOS/../Resources/completions/fish/kubectl.fish
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
/Applications/OrbStack.app/Contents/MacOS/../Resources/completions/fish/orbctl.fish
|
|
||||||
@@ -2,21 +2,21 @@
|
|||||||
# Place in ~/.config/fish/completions/phpenv.fish
|
# Place in ~/.config/fish/completions/phpenv.fish
|
||||||
|
|
||||||
# Complete main commands
|
# Complete main commands
|
||||||
complete -c phpenv -f -n "__fish_use_subcommand" -a "install" -d "Install a PHP version"
|
complete -c phpenv -f -n __fish_use_subcommand -a install -d "Install a PHP version"
|
||||||
complete -c phpenv -f -n "__fish_use_subcommand" -a "uninstall" -d "Uninstall a PHP version"
|
complete -c phpenv -f -n __fish_use_subcommand -a uninstall -d "Uninstall a PHP version"
|
||||||
complete -c phpenv -f -n "__fish_use_subcommand" -a "use" -d "Use PHP version for current shell"
|
complete -c phpenv -f -n __fish_use_subcommand -a use -d "Use PHP version for current shell"
|
||||||
complete -c phpenv -f -n "__fish_use_subcommand" -a "local" -d "Set PHP version for current project"
|
complete -c phpenv -f -n __fish_use_subcommand -a local -d "Set PHP version for current project"
|
||||||
complete -c phpenv -f -n "__fish_use_subcommand" -a "global" -d "Set global PHP version"
|
complete -c phpenv -f -n __fish_use_subcommand -a global -d "Set global PHP version"
|
||||||
complete -c phpenv -f -n "__fish_use_subcommand" -a "list" -d "List installed PHP versions"
|
complete -c phpenv -f -n __fish_use_subcommand -a list -d "List installed PHP versions"
|
||||||
complete -c phpenv -f -n "__fish_use_subcommand" -a "ls" -d "List installed PHP versions"
|
complete -c phpenv -f -n __fish_use_subcommand -a ls -d "List installed PHP versions"
|
||||||
complete -c phpenv -f -n "__fish_use_subcommand" -a "current" -d "Show current PHP version"
|
complete -c phpenv -f -n __fish_use_subcommand -a current -d "Show current PHP version"
|
||||||
complete -c phpenv -f -n "__fish_use_subcommand" -a "which" -d "Show path to PHP binary"
|
complete -c phpenv -f -n __fish_use_subcommand -a which -d "Show path to PHP binary"
|
||||||
complete -c phpenv -f -n "__fish_use_subcommand" -a "versions" -d "Show all available versions"
|
complete -c phpenv -f -n __fish_use_subcommand -a versions -d "Show all available versions"
|
||||||
complete -c phpenv -f -n "__fish_use_subcommand" -a "doctor" -d "Check phpenv installation"
|
complete -c phpenv -f -n __fish_use_subcommand -a doctor -d "Check phpenv installation"
|
||||||
complete -c phpenv -f -n "__fish_use_subcommand" -a "config" -d "Manage configuration"
|
complete -c phpenv -f -n __fish_use_subcommand -a config -d "Manage configuration"
|
||||||
complete -c phpenv -f -n "__fish_use_subcommand" -a "extensions" -d "Manage PHP extensions"
|
complete -c phpenv -f -n __fish_use_subcommand -a extensions -d "Manage PHP extensions"
|
||||||
complete -c phpenv -f -n "__fish_use_subcommand" -a "ext" -d "Manage PHP extensions"
|
complete -c phpenv -f -n __fish_use_subcommand -a ext -d "Manage PHP extensions"
|
||||||
complete -c phpenv -f -n "__fish_use_subcommand" -a "help" -d "Show help"
|
complete -c phpenv -f -n __fish_use_subcommand -a help -d "Show help"
|
||||||
|
|
||||||
# Helper functions for completions
|
# Helper functions for completions
|
||||||
function __phpenv_complete_installed_versions
|
function __phpenv_complete_installed_versions
|
||||||
@@ -26,13 +26,13 @@ end
|
|||||||
function __phpenv_complete_available_versions
|
function __phpenv_complete_available_versions
|
||||||
# Try to get dynamic versions first
|
# Try to get dynamic versions first
|
||||||
if command -q curl -a command -q jq; and functions -q __phpenv_parse_version_field
|
if command -q curl -a command -q jq; and functions -q __phpenv_parse_version_field
|
||||||
echo "latest"
|
echo latest
|
||||||
echo "nightly"
|
echo nightly
|
||||||
echo "5.x"
|
echo "5.x"
|
||||||
echo "7.x"
|
echo "7.x"
|
||||||
echo "8.x"
|
echo "8.x"
|
||||||
__phpenv_parse_version_field "latest" "8.4"
|
__phpenv_parse_version_field latest "8.4"
|
||||||
__phpenv_parse_version_field "nightly" "8.5"
|
__phpenv_parse_version_field nightly "8.5"
|
||||||
__phpenv_parse_version_field "5.x" "5.6"
|
__phpenv_parse_version_field "5.x" "5.6"
|
||||||
__phpenv_parse_version_field "7.x" "7.4"
|
__phpenv_parse_version_field "7.x" "7.4"
|
||||||
__phpenv_parse_version_field "8.x" "8.4"
|
__phpenv_parse_version_field "8.x" "8.4"
|
||||||
@@ -64,18 +64,18 @@ complete -c phpenv -f -n "__fish_seen_subcommand_from uninstall use local global
|
|||||||
-a "(__phpenv_complete_installed_versions)" -d "Installed PHP version"
|
-a "(__phpenv_complete_installed_versions)" -d "Installed PHP version"
|
||||||
|
|
||||||
# Add system option for use command
|
# Add system option for use command
|
||||||
complete -c phpenv -f -n "__fish_seen_subcommand_from use" -a "system" -d "Use system PHP"
|
complete -c phpenv -f -n "__fish_seen_subcommand_from use" -a system -d "Use system PHP"
|
||||||
|
|
||||||
# Complete binaries for which command
|
# Complete binaries for which command
|
||||||
complete -c phpenv -f -n "__fish_seen_subcommand_from which" -a "(__phpenv_complete_binaries)" -d "PHP binary"
|
complete -c phpenv -f -n "__fish_seen_subcommand_from which" -a "(__phpenv_complete_binaries)" -d "PHP binary"
|
||||||
|
|
||||||
# Complete config subcommands
|
# Complete config subcommands
|
||||||
complete -c phpenv -f -n "__fish_seen_subcommand_from config; and not __fish_seen_subcommand_from get set list" \
|
complete -c phpenv -f -n "__fish_seen_subcommand_from config; and not __fish_seen_subcommand_from get set list" \
|
||||||
-a "get" -d "Get configuration value"
|
-a get -d "Get configuration value"
|
||||||
complete -c phpenv -f -n "__fish_seen_subcommand_from config; and not __fish_seen_subcommand_from get set list" \
|
complete -c phpenv -f -n "__fish_seen_subcommand_from config; and not __fish_seen_subcommand_from get set list" \
|
||||||
-a "set" -d "Set configuration value"
|
-a set -d "Set configuration value"
|
||||||
complete -c phpenv -f -n "__fish_seen_subcommand_from config; and not __fish_seen_subcommand_from get set list" \
|
complete -c phpenv -f -n "__fish_seen_subcommand_from config; and not __fish_seen_subcommand_from get set list" \
|
||||||
-a "list" -d "List all configuration"
|
-a list -d "List all configuration"
|
||||||
|
|
||||||
# Complete config keys
|
# Complete config keys
|
||||||
complete -c phpenv -f -n "__fish_seen_subcommand_from config; and __fish_seen_subcommand_from get set" \
|
complete -c phpenv -f -n "__fish_seen_subcommand_from config; and __fish_seen_subcommand_from get set" \
|
||||||
@@ -91,27 +91,27 @@ complete -c phpenv -f \
|
|||||||
complete -c phpenv -f \
|
complete -c phpenv -f \
|
||||||
-n "__fish_seen_subcommand_from extensions ext" \
|
-n "__fish_seen_subcommand_from extensions ext" \
|
||||||
-n "not __fish_seen_subcommand_from install uninstall remove list ls available" \
|
-n "not __fish_seen_subcommand_from install uninstall remove list ls available" \
|
||||||
-a "install" -d "Install PHP extension"
|
-a install -d "Install PHP extension"
|
||||||
complete -c phpenv -f \
|
complete -c phpenv -f \
|
||||||
-n "__fish_seen_subcommand_from extensions ext" \
|
-n "__fish_seen_subcommand_from extensions ext" \
|
||||||
-n "not __fish_seen_subcommand_from install uninstall remove list ls available" \
|
-n "not __fish_seen_subcommand_from install uninstall remove list ls available" \
|
||||||
-a "uninstall" -d "Uninstall PHP extension"
|
-a uninstall -d "Uninstall PHP extension"
|
||||||
complete -c phpenv -f \
|
complete -c phpenv -f \
|
||||||
-n "__fish_seen_subcommand_from extensions ext" \
|
-n "__fish_seen_subcommand_from extensions ext" \
|
||||||
-n "not __fish_seen_subcommand_from install uninstall remove list ls available" \
|
-n "not __fish_seen_subcommand_from install uninstall remove list ls available" \
|
||||||
-a "remove" -d "Remove PHP extension"
|
-a remove -d "Remove PHP extension"
|
||||||
complete -c phpenv -f \
|
complete -c phpenv -f \
|
||||||
-n "__fish_seen_subcommand_from extensions ext" \
|
-n "__fish_seen_subcommand_from extensions ext" \
|
||||||
-n "not __fish_seen_subcommand_from install uninstall remove list ls available" \
|
-n "not __fish_seen_subcommand_from install uninstall remove list ls available" \
|
||||||
-a "list" -d "List installed extensions"
|
-a list -d "List installed extensions"
|
||||||
complete -c phpenv -f \
|
complete -c phpenv -f \
|
||||||
-n "__fish_seen_subcommand_from extensions ext" \
|
-n "__fish_seen_subcommand_from extensions ext" \
|
||||||
-n "not __fish_seen_subcommand_from install uninstall remove list ls available" \
|
-n "not __fish_seen_subcommand_from install uninstall remove list ls available" \
|
||||||
-a "ls" -d "List installed extensions"
|
-a ls -d "List installed extensions"
|
||||||
complete -c phpenv -f \
|
complete -c phpenv -f \
|
||||||
-n "__fish_seen_subcommand_from extensions ext" \
|
-n "__fish_seen_subcommand_from extensions ext" \
|
||||||
-n "not __fish_seen_subcommand_from install uninstall remove list ls available" \
|
-n "not __fish_seen_subcommand_from install uninstall remove list ls available" \
|
||||||
-a "available" -d "Show available extensions"
|
-a available -d "Show available extensions"
|
||||||
|
|
||||||
# Complete extension names
|
# Complete extension names
|
||||||
complete -c phpenv -f \
|
complete -c phpenv -f \
|
||||||
|
|||||||
@@ -1,22 +0,0 @@
|
|||||||
function ___paths_plugin_set_colors
|
|
||||||
if not set -q ___paths_plugin_colors
|
|
||||||
set -Ux ___paths_plugin_colors 27e6ff 29e0ff 5cd8ff 77d0ff 8ac8ff 9cbfff afb5ff c5a7ff d99bfe ea8feb f684d5 fe7abd ff73a3 ff708a fa7070 ff708a ff73a3 fe7abd f684d5 ea8feb d99bfe c5a7ff afb5ff 9cbfff 8ac8ff 77d0ff 5cd8ff 29e0ff
|
|
||||||
end
|
|
||||||
return 0
|
|
||||||
end
|
|
||||||
|
|
||||||
function _paths_uninstall --on-event paths_uninstall
|
|
||||||
for i in ___paths_plugin_wrap_color ___paths_plugin_output ___paths_plugin_handle_found_item ___paths_plugin_handle_source ___paths_plugin_cycle_color
|
|
||||||
functions -e $i
|
|
||||||
end
|
|
||||||
set -e ___paths_plugin_colors
|
|
||||||
set -e ___paths_plugin_current_color
|
|
||||||
end
|
|
||||||
|
|
||||||
function _paths_install --on-event _paths_install
|
|
||||||
___paths_plugin_set_colors
|
|
||||||
end
|
|
||||||
|
|
||||||
function _paths_update --on-event paths_update
|
|
||||||
___paths_plugin_set_colors
|
|
||||||
end
|
|
||||||
@@ -23,7 +23,7 @@ if not set -q PHPENV_AUTO_SWITCH
|
|||||||
end
|
end
|
||||||
|
|
||||||
if not set -q PHPENV_DEFAULT_EXTENSIONS
|
if not set -q PHPENV_DEFAULT_EXTENSIONS
|
||||||
set -g PHPENV_DEFAULT_EXTENSIONS "opcache"
|
set -g PHPENV_DEFAULT_EXTENSIONS opcache
|
||||||
end
|
end
|
||||||
|
|
||||||
# Initialize PATH on shell startup if global version is set (less aggressive)
|
# Initialize PATH on shell startup if global version is set (less aggressive)
|
||||||
|
|||||||
@@ -2,6 +2,8 @@
|
|||||||
# │ fish/config.fish │
|
# │ fish/config.fish │
|
||||||
# ╰──────────────────────────────────────────────────────────╯
|
# ╰──────────────────────────────────────────────────────────╯
|
||||||
|
|
||||||
|
set -g fish_greeting
|
||||||
|
|
||||||
fish_config theme choose "Catppuccin Mocha"
|
fish_config theme choose "Catppuccin Mocha"
|
||||||
|
|
||||||
test -e "$HOME/.config/fish/alias.fish" &&
|
test -e "$HOME/.config/fish/alias.fish" &&
|
||||||
@@ -20,19 +22,17 @@ if status is-interactive
|
|||||||
type -q op; and test -e "$HOME/.config/op/plugins.sh" &&
|
type -q op; and test -e "$HOME/.config/op/plugins.sh" &&
|
||||||
source "$HOME/.config/op/plugins.sh"
|
source "$HOME/.config/op/plugins.sh"
|
||||||
|
|
||||||
# version manager initializers
|
# mise version manager
|
||||||
type -q rbenv; and source (rbenv init -|psub)
|
type -q mise; and mise activate fish | source
|
||||||
type -q pyenv; and source (pyenv init -|psub)
|
|
||||||
type -q pyenv; and source (pyenv virtualenv-init -|psub)
|
|
||||||
type -q goenv; and source (goenv init -|psub)
|
|
||||||
# type -q fnm; and fnm env --use-on-cd --shell fish | source
|
|
||||||
type -q load_nvm; and load_nvm >/dev/stderr
|
|
||||||
|
|
||||||
# Initialize other tools if available
|
# Initialize other tools if available
|
||||||
type -q zoxide; and zoxide init fish | source
|
type -q zoxide; and zoxide init fish | source
|
||||||
|
|
||||||
# Start tmux if not already running and not in SSH
|
# Start tmux if not already running and not in SSH
|
||||||
#open-tmux # defined in functions/open-tmux.fish
|
#.t # defined in functions/.t.fish
|
||||||
|
else
|
||||||
|
# Non-interactive shells (IDE subprocesses) use shims for tool discovery
|
||||||
|
type -q mise; and mise activate fish --shims | source
|
||||||
end
|
end
|
||||||
|
|
||||||
# Added by LM Studio CLI (lms)
|
# Added by LM Studio CLI (lms)
|
||||||
@@ -47,3 +47,9 @@ fish_add_path $HOME/.opencode/bin
|
|||||||
# Added by OrbStack: command-line tools and integration
|
# Added by OrbStack: command-line tools and integration
|
||||||
# This won't be added again if you remove it.
|
# This won't be added again if you remove it.
|
||||||
source ~/.orbstack/shell/init2.fish 2>/dev/null || :
|
source ~/.orbstack/shell/init2.fish 2>/dev/null || :
|
||||||
|
|
||||||
|
# Warn if GITHUB_TOKEN is not set
|
||||||
|
if status is-interactive; and not set -q GITHUB_TOKEN
|
||||||
|
echo "Warning: GITHUB_TOKEN is not set" >&2
|
||||||
|
end
|
||||||
|
eval "$(/opt/homebrew/bin/brew shellenv fish)"
|
||||||
|
|||||||
@@ -17,13 +17,11 @@ set -q HOSTNAME; or set -x HOSTNAME (hostname -s)
|
|||||||
# Add local bin to path
|
# Add local bin to path
|
||||||
fish_add_path "$XDG_BIN_HOME"
|
fish_add_path "$XDG_BIN_HOME"
|
||||||
|
|
||||||
# Add cargo bin to path
|
# Add mise shims to path
|
||||||
fish_add_path "$XDG_SHARE_HOME/cargo/bin"
|
fish_add_path "$XDG_DATA_HOME/mise/shims"
|
||||||
|
|
||||||
# NPM/NVM configuration
|
# Add cargo bin to path
|
||||||
set -q NVM_DIR; or set -x NVM_DIR "$XDG_DATA_HOME/nvm"
|
fish_add_path "$XDG_DATA_HOME/cargo/bin"
|
||||||
fish_add_path "$NVM_DIR/bin"
|
|
||||||
fish_add_path "$XDG_CONFIG_HOME/nvm"
|
|
||||||
|
|
||||||
# Yarn configuration
|
# Yarn configuration
|
||||||
set -q YARN_GLOBAL_FOLDER; or set -x YARN_GLOBAL_FOLDER "$XDG_DATA_HOME/yarn"
|
set -q YARN_GLOBAL_FOLDER; or set -x YARN_GLOBAL_FOLDER "$XDG_DATA_HOME/yarn"
|
||||||
@@ -33,6 +31,9 @@ fish_add_path "$YARN_GLOBAL_FOLDER/bin"
|
|||||||
set -q MASON_HOME; or set -x MASON_HOME "$XDG_DATA_HOME/nvim/mason"
|
set -q MASON_HOME; or set -x MASON_HOME "$XDG_DATA_HOME/nvim/mason"
|
||||||
fish_add_path "$MASON_HOME/bin"
|
fish_add_path "$MASON_HOME/bin"
|
||||||
|
|
||||||
|
# Add dotnet tools to path
|
||||||
|
fish_add_path "$HOME/.dotnet/tools/"
|
||||||
|
|
||||||
# Set Neovim environment variables
|
# Set Neovim environment variables
|
||||||
test -z "$NVIM_STATE" && set -x NVIM_STATE "$XDG_STATE_HOME/nvim"
|
test -z "$NVIM_STATE" && set -x NVIM_STATE "$XDG_STATE_HOME/nvim"
|
||||||
test -z "$NVIM_CONFIG_HOME" && set -x NVIM_CONFIG_HOME "$XDG_CONFIG_HOME/nvim"
|
test -z "$NVIM_CONFIG_HOME" && set -x NVIM_CONFIG_HOME "$XDG_CONFIG_HOME/nvim"
|
||||||
@@ -55,11 +56,14 @@ set -q AWS_CONFIG_FILE; or set -x AWS_CONFIG_FILE "$XDG_STATE_HOME/aws/config"
|
|||||||
set -q AWS_SHARED_CREDENTIALS_FILE; or set -x AWS_SHARED_CREDENTIALS_FILE "$XDG_STATE_HOME/aws/credentials"
|
set -q AWS_SHARED_CREDENTIALS_FILE; or set -x AWS_SHARED_CREDENTIALS_FILE "$XDG_STATE_HOME/aws/credentials"
|
||||||
set -q AWS_SESSION_TOKEN; or set -x AWS_SESSION_TOKEN "$XDG_STATE_HOME/aws/session_token"
|
set -q AWS_SESSION_TOKEN; or set -x AWS_SESSION_TOKEN "$XDG_STATE_HOME/aws/session_token"
|
||||||
set -q AWS_DATA_PATH; or set -x AWS_DATA_PATH "$XDG_DATA_HOME/aws"
|
set -q AWS_DATA_PATH; or set -x AWS_DATA_PATH "$XDG_DATA_HOME/aws"
|
||||||
|
set -q AWS_DEFAULT_REGION; or set -x AWS_DEFAULT_REGION eu-west-1
|
||||||
set -q AWS_DEFAULT_OUTPUT; or set -x AWS_DEFAULT_OUTPUT table
|
set -q AWS_DEFAULT_OUTPUT; or set -x AWS_DEFAULT_OUTPUT table
|
||||||
set -q AWS_CONFIGURE_KEYS; or set -x AWS_CONFIGURE_KEYS true
|
set -q AWS_CONFIGURE_KEYS; or set -x AWS_CONFIGURE_KEYS true
|
||||||
set -q AWS_CONFIGURE_SESSION; or set -x AWS_CONFIGURE_SESSION true
|
set -q AWS_CONFIGURE_SESSION; or set -x AWS_CONFIGURE_SESSION true
|
||||||
set -q AWS_CONFIGURE_SESSION_DURATION; or set -x AWS_CONFIGURE_SESSION_DURATION 7200
|
set -q AWS_CONFIGURE_SESSION_DURATION; or set -x AWS_CONFIGURE_SESSION_DURATION 7200
|
||||||
set -q AWS_CONFIGURE_SESSION_MFA; or set -x AWS_CONFIGURE_SESSION_MFA true
|
set -q AWS_CONFIGURE_SESSION_MFA; or set -x AWS_CONFIGURE_SESSION_MFA true
|
||||||
|
set -q AWS_CONFIGURE_REGION; or set -x AWS_CONFIGURE_REGION true
|
||||||
|
set -q AWS_CONFIGURE_OUTPUT; or set -x AWS_CONFIGURE_OUTPUT true
|
||||||
set -q AWS_CONFIGURE_PROFILE; or set -x AWS_CONFIGURE_PROFILE true
|
set -q AWS_CONFIGURE_PROFILE; or set -x AWS_CONFIGURE_PROFILE true
|
||||||
set -q AWS_CONFIGURE_PROMPT; or set -x AWS_CONFIGURE_PROMPT true
|
set -q AWS_CONFIGURE_PROMPT; or set -x AWS_CONFIGURE_PROMPT true
|
||||||
set -q AWS_CONFIGURE_PROMPT_DEFAULT; or set -x AWS_CONFIGURE_PROMPT_DEFAULT true
|
set -q AWS_CONFIGURE_PROMPT_DEFAULT; or set -x AWS_CONFIGURE_PROMPT_DEFAULT true
|
||||||
@@ -84,14 +88,6 @@ x-dc "$DOCKER_CONFIG"
|
|||||||
set -q DOCKER_HIDE_LEGACY_COMMANDS; or set -x DOCKER_HIDE_LEGACY_COMMANDS true
|
set -q DOCKER_HIDE_LEGACY_COMMANDS; or set -x DOCKER_HIDE_LEGACY_COMMANDS true
|
||||||
set -q DOCKER_SCAN_SUGGEST; or set -x DOCKER_SCAN_SUGGEST false
|
set -q DOCKER_SCAN_SUGGEST; or set -x DOCKER_SCAN_SUGGEST false
|
||||||
|
|
||||||
# FNM / Node.js configuration
|
|
||||||
set -q FNM_DIR; or set -x FNM_DIR "$XDG_DATA_HOME/fnm"
|
|
||||||
fish_add_path "$FNM_DIR"
|
|
||||||
set -q FNM_VERSION_FILE_STRATEGY; or set -x FNM_VERSION_FILE_STRATEGY recursive
|
|
||||||
set -q FNM_USE_ON_CD; or set -x FNM_USE_ON_CD true
|
|
||||||
set -q FNM_COREPACK_ENABLED; or set -x FNM_COREPACK_ENABLED true
|
|
||||||
set -q FNM_RESOLVE_ENGINES; or set -x FNM_RESOLVE_ENGINES true
|
|
||||||
|
|
||||||
# fzf configuration
|
# fzf configuration
|
||||||
set -q FZF_BASE; or set -x FZF_BASE "$XDG_CONFIG_HOME/fzf"
|
set -q FZF_BASE; or set -x FZF_BASE "$XDG_CONFIG_HOME/fzf"
|
||||||
set -q FZF_DEFAULT_OPTS; or set -x FZF_DEFAULT_OPTS \
|
set -q FZF_DEFAULT_OPTS; or set -x FZF_DEFAULT_OPTS \
|
||||||
@@ -101,19 +97,15 @@ set -q FZF_DEFAULT_OPTS; or set -x FZF_DEFAULT_OPTS \
|
|||||||
set -q GNUPGHOME; or set -x GNUPGHOME "$XDG_DATA_HOME/gnupg"
|
set -q GNUPGHOME; or set -x GNUPGHOME "$XDG_DATA_HOME/gnupg"
|
||||||
|
|
||||||
# Go configuration
|
# Go configuration
|
||||||
# set -q GOPATH; or set -x GOPATH "$XDG_DATA_HOME/go"
|
set -x GOPATH "$XDG_DATA_HOME/go"
|
||||||
set -q GOBIN; or set -x GOBIN "$XDG_BIN_HOME"
|
set -x GOBIN "$XDG_BIN_HOME"
|
||||||
|
set -e GOROOT
|
||||||
set -q GOENV_ROOT; or set -x GOENV_ROOT "$XDG_DATA_HOME/goenv"
|
|
||||||
set -q GOENV_RC_FILE; or set -x GOENV_RC_FILE "$XDG_CONFIG_HOME/goenv/goenvrc.fish"
|
|
||||||
|
|
||||||
# 1Password configuration
|
# 1Password configuration
|
||||||
set -q OP_CACHE; or set -x OP_CACHE "$XDG_STATE_HOME/1password"
|
set -q OP_CACHE; or set -x OP_CACHE "$XDG_STATE_HOME/1password"
|
||||||
|
|
||||||
# Python configuration
|
# Python configuration
|
||||||
set -q WORKON_HOME; or set -x WORKON_HOME "$XDG_DATA_HOME/virtualenvs"
|
set -q WORKON_HOME; or set -x WORKON_HOME "$XDG_DATA_HOME/virtualenvs"
|
||||||
set -q PYENV_ROOT; or set -x PYENV_ROOT "$XDG_DATA_HOME/pyenv"
|
|
||||||
fish_add_path "$PYENV_ROOT/bin"
|
|
||||||
|
|
||||||
# Poetry configuration
|
# Poetry configuration
|
||||||
set -q POETRY_HOME; or set -x POETRY_HOME "$XDG_DATA_HOME/poetry"
|
set -q POETRY_HOME; or set -x POETRY_HOME "$XDG_DATA_HOME/poetry"
|
||||||
@@ -125,7 +117,6 @@ set -q CARGO_BIN_HOME; or set -x CARGO_BIN_HOME "$XDG_BIN_HOME"
|
|||||||
set -q RUSTUP_HOME; or set -x RUSTUP_HOME "$XDG_DATA_HOME/rustup"
|
set -q RUSTUP_HOME; or set -x RUSTUP_HOME "$XDG_DATA_HOME/rustup"
|
||||||
set -x RUST_WITHOUT "clippy,docs,rls"
|
set -x RUST_WITHOUT "clippy,docs,rls"
|
||||||
fish_add_path "$CARGO_HOME/bin"
|
fish_add_path "$CARGO_HOME/bin"
|
||||||
fish_add_path "$XDG_SHARE_HOME/bob/nvim-bin"
|
|
||||||
|
|
||||||
# screen configuration
|
# screen configuration
|
||||||
set -q SCREENRC; or set -x SCREENRC "$XDG_CONFIG_HOME/misc/screenrc"
|
set -q SCREENRC; or set -x SCREENRC "$XDG_CONFIG_HOME/misc/screenrc"
|
||||||
@@ -163,6 +154,15 @@ x-dc "$WAKATIME_HOME"
|
|||||||
set -q _ZO_DATA_DIR; or set -x _ZO_DATA_DIR "$XDG_DATA_HOME/zoxide"
|
set -q _ZO_DATA_DIR; or set -x _ZO_DATA_DIR "$XDG_DATA_HOME/zoxide"
|
||||||
set -q _ZO_EXCLUDE_DIRS; or set -x _ZO_EXCLUDE_DIRS "$XDG_DATA_HOME"
|
set -q _ZO_EXCLUDE_DIRS; or set -x _ZO_EXCLUDE_DIRS "$XDG_DATA_HOME"
|
||||||
|
|
||||||
|
# bkt (shell command caching tool) configuration
|
||||||
|
set -q BKT_TTL; or set -x BKT_TTL 1m
|
||||||
|
|
||||||
|
# Manpager
|
||||||
|
set -q MANPAGER; or set -x MANPAGER "less -X"
|
||||||
|
|
||||||
|
# Lando
|
||||||
|
fish_add_path "$HOME/.lando/bin"
|
||||||
|
|
||||||
# Miscellaneous configuration
|
# Miscellaneous configuration
|
||||||
set -q CHEAT_USE_FZF; or set -x CHEAT_USE_FZF true
|
set -q CHEAT_USE_FZF; or set -x CHEAT_USE_FZF true
|
||||||
set -q SQLITE_HISTORY; or set -x SQLITE_HISTORY "$XDG_CACHE_HOME/sqlite/sqlite_history"
|
set -q SQLITE_HISTORY; or set -x SQLITE_HISTORY "$XDG_CACHE_HOME/sqlite/sqlite_history"
|
||||||
@@ -180,6 +180,15 @@ if test -f "$DOTFILES/hosts/$HOSTNAME/config/fish/exports-secret.fish"
|
|||||||
source "$DOTFILES/hosts/$HOSTNAME/config/fish/exports-secret.fish"
|
source "$DOTFILES/hosts/$HOSTNAME/config/fish/exports-secret.fish"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# Source secret environment variables from secrets.d directory
|
||||||
|
if test -d "$DOTFILES/config/fish/secrets.d"
|
||||||
|
for secret_file in "$DOTFILES/config/fish/secrets.d"/*.fish
|
||||||
|
if test -f "$secret_file"
|
||||||
|
source "$secret_file"
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
# Configure tide prompt
|
# Configure tide prompt
|
||||||
set -gx tide_prompt_transient_enabled true
|
set -gx tide_prompt_transient_enabled true
|
||||||
set -gx tide_prompt_add_newline_before true
|
set -gx tide_prompt_add_newline_before true
|
||||||
|
|||||||
@@ -3,3 +3,4 @@ jethrokuan/z
|
|||||||
ivuorinen/phpenv.fish
|
ivuorinen/phpenv.fish
|
||||||
ilancosman/tide@v6
|
ilancosman/tide@v6
|
||||||
catppuccin/fish
|
catppuccin/fish
|
||||||
|
edc/bass
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
# Description: Open tmux session if not already open
|
# Description: Open tmux session if not already open
|
||||||
# Dependencies: tmux
|
# Dependencies: tmux
|
||||||
# Usage: open-tmux
|
# Usage: .t
|
||||||
function open-tmux --wraps='tmux attach-session -t main || tmux new-session -s main' --description 'open tmux session'
|
function .t --wraps='tmux attach-session -t main || tmux new-session -s main' --description 'open tmux session'
|
||||||
# Check if not in an SSH session and not already in a tmux session
|
# Check if not in an SSH session and not already in a tmux session
|
||||||
if test -z "$SSH_TTY"; and not set -q TMUX
|
if test -z "$SSH_TTY"; and not set -q TMUX
|
||||||
command tmux attach-session -t main || command tmux new-session -s main
|
command tmux attach-session -t main || command tmux new-session -s main
|
||||||
@@ -7,65 +7,67 @@ To be used with a companion fish function like this:
|
|||||||
|
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from __future__ import print_function
|
|
||||||
|
|
||||||
import json
|
import json
|
||||||
import os
|
import os
|
||||||
import signal
|
import signal
|
||||||
import subprocess
|
import subprocess
|
||||||
import sys
|
import sys
|
||||||
import traceback
|
|
||||||
|
|
||||||
|
BASH = "bash"
|
||||||
BASH = 'bash'
|
|
||||||
|
|
||||||
FISH_READONLY = [
|
FISH_READONLY = [
|
||||||
'PWD', 'SHLVL', 'history', 'pipestatus', 'status', 'version',
|
"PWD",
|
||||||
'FISH_VERSION', 'fish_pid', 'hostname', '_', 'fish_private_mode'
|
"SHLVL",
|
||||||
|
"history",
|
||||||
|
"pipestatus",
|
||||||
|
"status",
|
||||||
|
"version",
|
||||||
|
"FISH_VERSION",
|
||||||
|
"fish_pid",
|
||||||
|
"hostname",
|
||||||
|
"_",
|
||||||
|
"fish_private_mode",
|
||||||
]
|
]
|
||||||
|
|
||||||
IGNORED = [
|
IGNORED = ["PS1", "XPC_SERVICE_NAME"]
|
||||||
'PS1', 'XPC_SERVICE_NAME'
|
|
||||||
]
|
|
||||||
|
|
||||||
def ignored(name):
|
def ignored(name):
|
||||||
if name == 'PWD': # this is read only, but has special handling
|
if name == "PWD": # this is read only, but has special handling
|
||||||
return False
|
return False
|
||||||
# ignore other read only variables
|
# ignore other read only variables
|
||||||
if name in FISH_READONLY:
|
if name in FISH_READONLY:
|
||||||
return True
|
return True
|
||||||
if name in IGNORED or name.startswith("BASH_FUNC"):
|
if name in IGNORED or name.startswith("BASH_FUNC"):
|
||||||
return True
|
return True
|
||||||
if name.startswith('%'):
|
return name.startswith("%")
|
||||||
return True
|
|
||||||
return False
|
|
||||||
|
|
||||||
def escape(string):
|
def escape(string):
|
||||||
# use json.dumps to reliably escape quotes and backslashes
|
# use json.dumps to reliably escape quotes and backslashes
|
||||||
return json.dumps(string).replace(r'$', r'\$')
|
return json.dumps(string).replace(r"$", r"\$")
|
||||||
|
|
||||||
|
|
||||||
def escape_identifier(word):
|
def escape_identifier(word):
|
||||||
return escape(word.replace('?', '\\?'))
|
return escape(word.replace("?", "\\?"))
|
||||||
|
|
||||||
|
|
||||||
def comment(string):
|
def comment(string):
|
||||||
return '\n'.join(['# ' + line for line in string.split('\n')])
|
return "\n".join(["# " + line for line in string.split("\n")])
|
||||||
|
|
||||||
|
|
||||||
def gen_script():
|
def gen_script():
|
||||||
# Use the following instead of /usr/bin/env to read environment so we can
|
# Use the following instead of /usr/bin/env to read environment so we can
|
||||||
# deal with multi-line environment variables (and other odd cases).
|
# deal with multi-line environment variables (and other odd cases).
|
||||||
env_reader = "%s -c 'import os,json; print(json.dumps({k:v for k,v in os.environ.items()}))'" % (sys.executable)
|
env_reader = f"{sys.executable} -c 'import os,json; print(json.dumps({{k:v for k,v in os.environ.items()}}))'"
|
||||||
args = [BASH, '-c', env_reader]
|
args = [BASH, "-c", env_reader]
|
||||||
output = subprocess.check_output(args, universal_newlines=True)
|
output = subprocess.check_output(args, universal_newlines=True)
|
||||||
old_env = output.strip()
|
old_env = output.strip()
|
||||||
|
|
||||||
pipe_r, pipe_w = os.pipe()
|
pipe_r, pipe_w = os.pipe()
|
||||||
if sys.version_info >= (3, 4):
|
os.set_inheritable(pipe_w, True)
|
||||||
os.set_inheritable(pipe_w, True)
|
command = f"eval $1 && ({env_reader}; alias) >&{pipe_w}"
|
||||||
command = 'eval $1 && ({}; alias) >&{}'.format(
|
args = [BASH, "-c", command, "bass", " ".join(sys.argv[1:])]
|
||||||
env_reader,
|
|
||||||
pipe_w
|
|
||||||
)
|
|
||||||
args = [BASH, '-c', command, 'bass', ' '.join(sys.argv[1:])]
|
|
||||||
p = subprocess.Popen(args, universal_newlines=True, close_fds=False)
|
p = subprocess.Popen(args, universal_newlines=True, close_fds=False)
|
||||||
os.close(pipe_w)
|
os.close(pipe_w)
|
||||||
with os.fdopen(pipe_r) as f:
|
with os.fdopen(pipe_r) as f:
|
||||||
@@ -73,9 +75,7 @@ def gen_script():
|
|||||||
alias_str = f.read()
|
alias_str = f.read()
|
||||||
if p.wait() != 0:
|
if p.wait() != 0:
|
||||||
raise subprocess.CalledProcessError(
|
raise subprocess.CalledProcessError(
|
||||||
returncode=p.returncode,
|
returncode=p.returncode, cmd=" ".join(sys.argv[1:]), output=new_env + alias_str
|
||||||
cmd=' '.join(sys.argv[1:]),
|
|
||||||
output=new_env + alias_str
|
|
||||||
)
|
)
|
||||||
new_env = new_env.strip()
|
new_env = new_env.strip()
|
||||||
|
|
||||||
@@ -89,41 +89,41 @@ def gen_script():
|
|||||||
continue
|
continue
|
||||||
v1 = old_env.get(k)
|
v1 = old_env.get(k)
|
||||||
if not v1:
|
if not v1:
|
||||||
script_lines.append(comment('adding %s=%s' % (k, v)))
|
script_lines.append(comment(f"adding {k}={v}"))
|
||||||
elif v1 != v:
|
elif v1 != v:
|
||||||
script_lines.append(comment('updating %s=%s -> %s' % (k, v1, v)))
|
script_lines.append(comment(f"updating {k}={v1} -> {v}"))
|
||||||
# process special variables
|
# process special variables
|
||||||
if k == 'PWD':
|
if k == "PWD":
|
||||||
script_lines.append('cd %s' % escape(v))
|
script_lines.append(f"cd {escape(v)}")
|
||||||
continue
|
continue
|
||||||
else:
|
else:
|
||||||
continue
|
continue
|
||||||
if k == 'PATH':
|
if k == "PATH": # noqa: SIM108
|
||||||
value = ' '.join([escape(directory)
|
value = " ".join([escape(directory) for directory in v.split(":")])
|
||||||
for directory in v.split(':')])
|
|
||||||
else:
|
else:
|
||||||
value = escape(v)
|
value = escape(v)
|
||||||
script_lines.append('set -g -x %s %s' % (k, value))
|
script_lines.append(f"set -g -x {k} {value}")
|
||||||
|
|
||||||
for var in set(old_env.keys()) - set(new_env.keys()):
|
for var in set(old_env.keys()) - set(new_env.keys()):
|
||||||
script_lines.append(comment('removing %s' % var))
|
script_lines.append(comment(f"removing {var}"))
|
||||||
script_lines.append('set -e %s' % var)
|
script_lines.append(f"set -e {var}")
|
||||||
|
|
||||||
script = '\n'.join(script_lines)
|
script = "\n".join(script_lines)
|
||||||
|
|
||||||
alias_lines = []
|
alias_lines = []
|
||||||
for line in alias_str.splitlines():
|
for line in alias_str.splitlines():
|
||||||
_, rest = line.split(None, 1)
|
_, rest = line.split(None, 1)
|
||||||
k, v = rest.split("=", 1)
|
k, v = rest.split("=", 1)
|
||||||
alias_lines.append("alias " + escape_identifier(k) + "=" + v)
|
alias_lines.append("alias " + escape_identifier(k) + "=" + v)
|
||||||
alias = '\n'.join(alias_lines)
|
alias = "\n".join(alias_lines)
|
||||||
|
|
||||||
return script + '\n' + alias
|
return script + "\n" + alias
|
||||||
|
|
||||||
script_file = os.fdopen(3, 'w')
|
|
||||||
|
script_file = os.fdopen(3, "w")
|
||||||
|
|
||||||
if not sys.argv[1:]:
|
if not sys.argv[1:]:
|
||||||
print('__bass_usage', file=script_file, end='')
|
print("__bass_usage", file=script_file, end="")
|
||||||
sys.exit(0)
|
sys.exit(0)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
@@ -131,8 +131,8 @@ try:
|
|||||||
except subprocess.CalledProcessError as e:
|
except subprocess.CalledProcessError as e:
|
||||||
sys.exit(e.returncode)
|
sys.exit(e.returncode)
|
||||||
except Exception:
|
except Exception:
|
||||||
print('Bass internal error!', file=sys.stderr)
|
print("Bass internal error!", file=sys.stderr)
|
||||||
raise # traceback will output to stderr
|
raise # traceback will output to stderr
|
||||||
except KeyboardInterrupt:
|
except KeyboardInterrupt:
|
||||||
signal.signal(signal.SIGINT, signal.SIG_DFL)
|
signal.signal(signal.SIGINT, signal.SIG_DFL)
|
||||||
os.kill(os.getpid(), signal.SIGINT)
|
os.kill(os.getpid(), signal.SIGINT)
|
||||||
|
|||||||
@@ -8,8 +8,8 @@ function fisher --argument-names cmd --description "A plugin manager for Fish"
|
|||||||
echo "fisher, version $fisher_version"
|
echo "fisher, version $fisher_version"
|
||||||
case "" -h --help
|
case "" -h --help
|
||||||
echo "Usage: fisher install <plugins...> Install plugins"
|
echo "Usage: fisher install <plugins...> Install plugins"
|
||||||
echo " fisher remove <plugins...> Remove installed plugins"
|
echo " fisher remove <plugins...> Remove installed plugins"
|
||||||
echo " fisher uninstall <plugins...> Remove installed plugins (alias)"
|
echo " fisher uninstall <plugins...> Remove installed plugins (alias)"
|
||||||
echo " fisher update <plugins...> Update installed plugins"
|
echo " fisher update <plugins...> Update installed plugins"
|
||||||
echo " fisher update Update all installed plugins"
|
echo " fisher update Update all installed plugins"
|
||||||
echo " fisher list [<regex>] List installed plugins matching regex"
|
echo " fisher list [<regex>] List installed plugins matching regex"
|
||||||
@@ -41,7 +41,7 @@ function fisher --argument-names cmd --description "A plugin manager for Fish"
|
|||||||
echo "fisher: \"$fish_plugins\" file not found: \"$cmd\"" >&2 && return 1
|
echo "fisher: \"$fish_plugins\" file not found: \"$cmd\"" >&2 && return 1
|
||||||
end
|
end
|
||||||
set arg_plugins $file_plugins
|
set arg_plugins $file_plugins
|
||||||
else if test "$cmd" = install && ! set --query old_plugins[1]
|
else if test "$cmd" = install && ! set --query old_plugins[1]
|
||||||
set --append arg_plugins $file_plugins
|
set --append arg_plugins $file_plugins
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -1,16 +0,0 @@
|
|||||||
function load_nvm --on-variable="PWD"
|
|
||||||
set -l default_node_version (nvm version default)
|
|
||||||
set -l node_version (nvm version)
|
|
||||||
set -l nvmrc_path (nvm_find_nvmrc)
|
|
||||||
if test -n "$nvmrc_path"
|
|
||||||
set -l nvmrc_node_version (nvm version (cat $nvmrc_path))
|
|
||||||
if test "$nvmrc_node_version" = N/A
|
|
||||||
nvm install (cat $nvmrc_path)
|
|
||||||
else if test "$nvmrc_node_version" != "$node_version"
|
|
||||||
nvm use $nvmrc_node_version
|
|
||||||
end
|
|
||||||
else if test "$node_version" != "$default_node_version"
|
|
||||||
echo "Reverting to default Node version"
|
|
||||||
nvm use default
|
|
||||||
end
|
|
||||||
end
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
function nvm
|
|
||||||
bass source $NVM_DIR/nvm.sh --no-use ';' nvm $argv
|
|
||||||
end
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
function nvm_find_nvmrc
|
|
||||||
bass source $NVM_DIR/nvm.sh --no-use ';' nvm_find_nvmrc
|
|
||||||
end
|
|
||||||
@@ -1,175 +0,0 @@
|
|||||||
function ___paths_plugin_wrap_color
|
|
||||||
set_color normal
|
|
||||||
set_color "$argv[1]"
|
|
||||||
echo -n (set_color "$argv[1]")"$argv[2..]"
|
|
||||||
set_color normal
|
|
||||||
end
|
|
||||||
|
|
||||||
# duplicated in conf.d
|
|
||||||
function ___paths_plugin_set_colors
|
|
||||||
if not set -q ___paths_plugin_colors
|
|
||||||
set -Ux ___paths_plugin_colors 27e6ff 29e0ff 5cd8ff 77d0ff 8ac8ff 9cbfff afb5ff c5a7ff d99bfe ea8feb f684d5 fe7abd ff73a3 ff708a fa7070 ff708a ff73a3 fe7abd f684d5 ea8feb d99bfe c5a7ff afb5ff 9cbfff 8ac8ff 77d0ff 5cd8ff 29e0ff
|
|
||||||
end
|
|
||||||
return 0
|
|
||||||
end
|
|
||||||
|
|
||||||
function ___paths_plugin_cycle_color
|
|
||||||
if not set -q ___paths_plugin_current_color
|
|
||||||
set -Ux ___paths_plugin_current_color 1
|
|
||||||
else if test $___paths_plugin_current_color -gt (count $___paths_plugin_colors)
|
|
||||||
set -Ux ___paths_plugin_current_color 1
|
|
||||||
end
|
|
||||||
echo $___paths_plugin_colors[$___paths_plugin_current_color]
|
|
||||||
set -Ux ___paths_plugin_current_color (math $___paths_plugin_current_color + 1)
|
|
||||||
end
|
|
||||||
|
|
||||||
function ___paths_plugin_handle_found_item -a testName outFlags
|
|
||||||
set -f flags (string split -n ' ' -- "$outFlags")
|
|
||||||
set -f options (fish_opt -s c -l clean)
|
|
||||||
set -a options (fish_opt -s s -l single)
|
|
||||||
set -a options (fish_opt -s k -l no-color)
|
|
||||||
set -a options (fish_opt -s n -l inline)
|
|
||||||
argparse $options -- $flags
|
|
||||||
|
|
||||||
set -f arrow "=>"
|
|
||||||
# check if file exists
|
|
||||||
if test -e "$testName"
|
|
||||||
set -f nameOut (string trim -- "$testName")
|
|
||||||
if not set -q _flag_c # is not clean
|
|
||||||
if test -L "$testName" # is symlink
|
|
||||||
set -f __linkname (readlink -f "$testName")
|
|
||||||
set __linkname (string trim -- "$__linkname")
|
|
||||||
set testName (string trim -- "$testName")
|
|
||||||
if not set -q _flag_k # is color
|
|
||||||
set nameOut (___paths_plugin_wrap_color (___paths_plugin_cycle_color) $testName) (___paths_plugin_wrap_color "yellow" "$arrow") (___paths_plugin_wrap_color (___paths_plugin_cycle_color) $__linkname)
|
|
||||||
else # is color
|
|
||||||
set nameOut (echo -n "$testName" "$arrow" "$__linkname")
|
|
||||||
end
|
|
||||||
else # is not symlink
|
|
||||||
if not set -q _flag_k # is color
|
|
||||||
set testName (string trim -- "$testName")
|
|
||||||
set nameOut (___paths_plugin_wrap_color (___paths_plugin_cycle_color) "$testName")
|
|
||||||
else
|
|
||||||
set testName (string trim -- "$testName")
|
|
||||||
set nameOut "$testName"
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
set nameOut (string trim -- "$nameOut")
|
|
||||||
# do the tick
|
|
||||||
if set -q _flag_k # is not color
|
|
||||||
set nameOut "- $nameOut"
|
|
||||||
else # is color
|
|
||||||
set nameOut (___paths_plugin_wrap_color "yellow" "-") "$nameOut"
|
|
||||||
end
|
|
||||||
end
|
|
||||||
set nameOut (string trim -- "$nameOut")
|
|
||||||
echo -n $nameOut
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
function paths --description "Reveal the executable matches in shell paths or fish autoload."
|
|
||||||
set -f options (fish_opt -s c -l clean)
|
|
||||||
set -a options (fish_opt -s s -l single)
|
|
||||||
set -a options (fish_opt -s k -l no-color)
|
|
||||||
set -a options (fish_opt -s q -l quiet)
|
|
||||||
set -a options (fish_opt -s n -l inline)
|
|
||||||
argparse $options -- $argv
|
|
||||||
|
|
||||||
if test (count $argv) -lt 1
|
|
||||||
echo "paths - executable matches in shell paths or fish autoload."
|
|
||||||
and echo "usage: paths [-c|-s|-k] <name>"
|
|
||||||
and echo -e "\t-c or --no-color: output without color"
|
|
||||||
and echo -e "\t-s or --single: output without color or headers, the first result"
|
|
||||||
and echo -e "\t-k or --clean: output without tick marks or headers"
|
|
||||||
# and echo -e "\t-n or --inline: output without endline"
|
|
||||||
and return 1
|
|
||||||
end
|
|
||||||
|
|
||||||
set -f foundStatus 1
|
|
||||||
set -f input (string trim -- $argv)
|
|
||||||
# deprecated
|
|
||||||
if set -q _flag_q
|
|
||||||
set _flag_c True
|
|
||||||
end
|
|
||||||
|
|
||||||
if set -q _flag_s
|
|
||||||
set _flag_k True
|
|
||||||
set _flag_c True
|
|
||||||
end
|
|
||||||
|
|
||||||
set -f outFlags ''
|
|
||||||
set -q _flag_n; and set -a outFlags -n
|
|
||||||
set -q _flag_c; and set -a outFlags -c
|
|
||||||
set -q _flag_k; and set -a outFlags -k
|
|
||||||
set -q _flag_s; and set -a outFlags -s
|
|
||||||
set outFlags (string split -n " " -- "$outFlags")
|
|
||||||
___paths_plugin_set_colors
|
|
||||||
# loop over list of path lists
|
|
||||||
for pVar in VIRTUAL_ENV fisher_path fish_function_path fish_user_paths PATH
|
|
||||||
set -e acc
|
|
||||||
set -f acc ''
|
|
||||||
set -e hit
|
|
||||||
# see if variable is empty
|
|
||||||
if test -z "$pVar"
|
|
||||||
continue
|
|
||||||
end
|
|
||||||
set -f acc (begin
|
|
||||||
for t in $$pVar
|
|
||||||
for snit in "$t/$input.fish" "$t/$input"
|
|
||||||
set -f found (___paths_plugin_handle_found_item "$snit" "$outFlags")
|
|
||||||
set found (string trim -- "$found")
|
|
||||||
if test -n "$found"
|
|
||||||
set -f hit True
|
|
||||||
echo "$found"
|
|
||||||
if set -q _flag_s
|
|
||||||
break
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
if set -q _flag_s
|
|
||||||
if set -q hit
|
|
||||||
break
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end)
|
|
||||||
|
|
||||||
# prepend source
|
|
||||||
if not set -q _flag_c
|
|
||||||
if set -q hit
|
|
||||||
set pVar (string trim -- "$pVar")
|
|
||||||
echo -e -n "$pVar\n"
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
if test -n "$acc"
|
|
||||||
set foundStatus 0
|
|
||||||
for fk in $acc
|
|
||||||
echo $fk
|
|
||||||
if set -q _flag_s
|
|
||||||
# stop after one
|
|
||||||
return $foundStatus
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
# check
|
|
||||||
set -l built (type --type $input 12&>/dev/null)
|
|
||||||
if test -n "$built"
|
|
||||||
and test "$built" = builtin
|
|
||||||
set $foundStatus 0
|
|
||||||
if not set -q _flag_c
|
|
||||||
echo -e -n "builtin\n"
|
|
||||||
if set -q _flag_k
|
|
||||||
echo - "$input"
|
|
||||||
else # is color
|
|
||||||
echo (___paths_plugin_wrap_color "yellow" "-") (___paths_plugin_wrap_color (___paths_plugin_cycle_color) "$input")
|
|
||||||
end
|
|
||||||
else
|
|
||||||
echo "$input"
|
|
||||||
end
|
|
||||||
end
|
|
||||||
return $foundStatus
|
|
||||||
end
|
|
||||||
@@ -103,7 +103,7 @@ end
|
|||||||
|
|
||||||
function __phpenv_find_version_file -a phpenv_filename
|
function __phpenv_find_version_file -a phpenv_filename
|
||||||
set -l phpenv_dir (pwd)
|
set -l phpenv_dir (pwd)
|
||||||
while test "$phpenv_dir" != "/"
|
while test "$phpenv_dir" != /
|
||||||
if test -f "$phpenv_dir/$phpenv_filename"
|
if test -f "$phpenv_dir/$phpenv_filename"
|
||||||
echo "$phpenv_dir/$phpenv_filename"
|
echo "$phpenv_dir/$phpenv_filename"
|
||||||
return
|
return
|
||||||
@@ -130,13 +130,13 @@ function __phpenv_parse_composer_version
|
|||||||
end
|
end
|
||||||
|
|
||||||
set -l phpenv_platform_php (jq -r '.config.platform.php // empty' composer.json 2>/dev/null)
|
set -l phpenv_platform_php (jq -r '.config.platform.php // empty' composer.json 2>/dev/null)
|
||||||
if test $status -eq 0 -a -n "$phpenv_platform_php" -a "$phpenv_platform_php" != "null"
|
if test $status -eq 0 -a -n "$phpenv_platform_php" -a "$phpenv_platform_php" != null
|
||||||
echo $phpenv_platform_php
|
echo $phpenv_platform_php
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
set -l phpenv_require_php (jq -r '.require.php // empty' composer.json 2>/dev/null)
|
set -l phpenv_require_php (jq -r '.require.php // empty' composer.json 2>/dev/null)
|
||||||
if test $status -eq 0 -a -n "$phpenv_require_php" -a "$phpenv_require_php" != "null"
|
if test $status -eq 0 -a -n "$phpenv_require_php" -a "$phpenv_require_php" != null
|
||||||
__phpenv_parse_semver_constraint $phpenv_require_php
|
__phpenv_parse_semver_constraint $phpenv_require_php
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
@@ -196,7 +196,7 @@ set -g __phpenv_version_cache_time 0
|
|||||||
|
|
||||||
function __phpenv_get_version_info
|
function __phpenv_get_version_info
|
||||||
set -l current_time (date +%s)
|
set -l current_time (date +%s)
|
||||||
set -l cache_duration 300 # 5 minutes
|
set -l cache_duration 300 # 5 minutes
|
||||||
|
|
||||||
# Return cached version if still valid
|
# Return cached version if still valid
|
||||||
if test -n "$__phpenv_version_cache"
|
if test -n "$__phpenv_version_cache"
|
||||||
@@ -236,12 +236,12 @@ end
|
|||||||
# Check if Ondřej PPA is configured on the system
|
# Check if Ondřej PPA is configured on the system
|
||||||
function __phpenv_has_ondrej_ppa
|
function __phpenv_has_ondrej_ppa
|
||||||
if test -d /etc/apt/sources.list.d
|
if test -d /etc/apt/sources.list.d
|
||||||
if grep -rq "ondrej/php" /etc/apt/sources.list.d/ 2>/dev/null
|
if grep -rq ondrej/php /etc/apt/sources.list.d/ 2>/dev/null
|
||||||
return 0
|
return 0
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
if test -f /etc/apt/sources.list
|
if test -f /etc/apt/sources.list
|
||||||
if grep -q "ondrej/php" /etc/apt/sources.list 2>/dev/null
|
if grep -q ondrej/php /etc/apt/sources.list 2>/dev/null
|
||||||
return 0
|
return 0
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -262,34 +262,34 @@ function __phpenv_get_provider
|
|||||||
end
|
end
|
||||||
|
|
||||||
# macOS always uses Homebrew
|
# macOS always uses Homebrew
|
||||||
if test (uname -s) = "Darwin"
|
if test (uname -s) = Darwin
|
||||||
echo "homebrew"
|
echo homebrew
|
||||||
return 0
|
return 0
|
||||||
end
|
end
|
||||||
|
|
||||||
# Linux: check for apt with Ondřej PPA first
|
# Linux: check for apt with Ondřej PPA first
|
||||||
if test (uname -s) = "Linux"
|
if test (uname -s) = Linux
|
||||||
if command -q apt-get; and __phpenv_has_ondrej_ppa
|
if command -q apt-get; and __phpenv_has_ondrej_ppa
|
||||||
echo "apt"
|
echo apt
|
||||||
return 0
|
return 0
|
||||||
end
|
end
|
||||||
|
|
||||||
# Fall back to Homebrew (Linuxbrew) if available
|
# Fall back to Homebrew (Linuxbrew) if available
|
||||||
if command -q brew
|
if command -q brew
|
||||||
echo "homebrew"
|
echo homebrew
|
||||||
return 0
|
return 0
|
||||||
end
|
end
|
||||||
|
|
||||||
# If apt is available but no PPA yet, still use apt provider
|
# If apt is available but no PPA yet, still use apt provider
|
||||||
# (it will prompt to add the PPA when needed)
|
# (it will prompt to add the PPA when needed)
|
||||||
if command -q apt-get
|
if command -q apt-get
|
||||||
echo "apt"
|
echo apt
|
||||||
return 0
|
return 0
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
# Default fallback
|
# Default fallback
|
||||||
echo "homebrew"
|
echo homebrew
|
||||||
return 0
|
return 0
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -319,7 +319,7 @@ function __phpenv_provider_homebrew_ensure_source
|
|||||||
end
|
end
|
||||||
|
|
||||||
# Check and add required taps only if missing
|
# Check and add required taps only if missing
|
||||||
set -l required_taps "shivammathur/php" "shivammathur/extensions"
|
set -l required_taps shivammathur/php shivammathur/extensions
|
||||||
for tap in $required_taps
|
for tap in $required_taps
|
||||||
if not brew tap | grep -qx $tap 2>/dev/null
|
if not brew tap | grep -qx $tap 2>/dev/null
|
||||||
if not brew tap $tap 2>/dev/null
|
if not brew tap $tap 2>/dev/null
|
||||||
@@ -343,7 +343,7 @@ function __phpenv_provider_homebrew_list_installed
|
|||||||
continue
|
continue
|
||||||
end
|
end
|
||||||
|
|
||||||
if test "$phpenv_basename" = "php"
|
if test "$phpenv_basename" = php
|
||||||
set -l phpenv_latest (__phpenv_parse_version_field "latest" "8.4")
|
set -l phpenv_latest (__phpenv_parse_version_field "latest" "8.4")
|
||||||
set -a phpenv_versions $phpenv_latest
|
set -a phpenv_versions $phpenv_latest
|
||||||
else if echo $phpenv_basename | grep -qE '^php@[0-9]+\.[0-9]+$'
|
else if echo $phpenv_basename | grep -qE '^php@[0-9]+\.[0-9]+$'
|
||||||
@@ -375,7 +375,7 @@ function __phpenv_provider_homebrew_list_available
|
|||||||
continue
|
continue
|
||||||
end
|
end
|
||||||
|
|
||||||
if test "$phpenv_clean_name" = "php"
|
if test "$phpenv_clean_name" = php
|
||||||
set -a phpenv_versions "$phpenv_latest_version (latest)"
|
set -a phpenv_versions "$phpenv_latest_version (latest)"
|
||||||
else if echo $phpenv_clean_name | grep -qE '^php@[0-9]+\.[0-9]+$'
|
else if echo $phpenv_clean_name | grep -qE '^php@[0-9]+\.[0-9]+$'
|
||||||
set -l phpenv_version (echo $phpenv_clean_name | sed 's/php@//')
|
set -l phpenv_version (echo $phpenv_clean_name | sed 's/php@//')
|
||||||
@@ -502,7 +502,7 @@ function __phpenv_provider_homebrew_ext_list -a phpenv_version
|
|||||||
for phpenv_ext_dir in $phpenv_cellar_path/*@$phpenv_version
|
for phpenv_ext_dir in $phpenv_cellar_path/*@$phpenv_version
|
||||||
if test -d $phpenv_ext_dir
|
if test -d $phpenv_ext_dir
|
||||||
set -l phpenv_ext_name (basename $phpenv_ext_dir | sed "s/@$phpenv_version//")
|
set -l phpenv_ext_name (basename $phpenv_ext_dir | sed "s/@$phpenv_version//")
|
||||||
if test "$phpenv_ext_name" != "php"
|
if test "$phpenv_ext_name" != php
|
||||||
echo $phpenv_ext_name
|
echo $phpenv_ext_name
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -574,7 +574,7 @@ function __phpenv_provider_apt_ensure_source
|
|||||||
echo ""
|
echo ""
|
||||||
read -P "Add ppa:ondrej/php? [y/N] " -l confirm
|
read -P "Add ppa:ondrej/php? [y/N] " -l confirm
|
||||||
|
|
||||||
if test "$confirm" = "y" -o "$confirm" = "Y"
|
if test "$confirm" = y -o "$confirm" = Y
|
||||||
echo "Adding ppa:ondrej/php..."
|
echo "Adding ppa:ondrej/php..."
|
||||||
if command -q add-apt-repository
|
if command -q add-apt-repository
|
||||||
if sudo add-apt-repository -y ppa:ondrej/php
|
if sudo add-apt-repository -y ppa:ondrej/php
|
||||||
@@ -603,8 +603,7 @@ function __phpenv_provider_apt_list_installed
|
|||||||
return 1
|
return 1
|
||||||
end
|
end
|
||||||
|
|
||||||
dpkg -l 'php[0-9]*-cli' 2>/dev/null | grep '^ii' | \
|
dpkg -l 'php[0-9]*-cli' 2>/dev/null | grep '^ii' | sed -E 's/^ii\s+php([0-9]+\.[0-9]+)-cli.*/\1/' | sort -V | uniq
|
||||||
sed -E 's/^ii\s+php([0-9]+\.[0-9]+)-cli.*/\1/' | sort -V | uniq
|
|
||||||
end
|
end
|
||||||
|
|
||||||
function __phpenv_provider_apt_list_available
|
function __phpenv_provider_apt_list_available
|
||||||
@@ -613,8 +612,7 @@ function __phpenv_provider_apt_list_available
|
|||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
apt-cache search '^php[0-9]+\.[0-9]+-cli$' 2>/dev/null | \
|
apt-cache search '^php[0-9]+\.[0-9]+-cli$' 2>/dev/null | sed -E 's/^php([0-9]+\.[0-9]+)-cli.*/\1/' | sort -V | uniq
|
||||||
sed -E 's/^php([0-9]+\.[0-9]+)-cli.*/\1/' | sort -V | uniq
|
|
||||||
end
|
end
|
||||||
|
|
||||||
function __phpenv_provider_apt_get_php_path -a phpenv_version
|
function __phpenv_provider_apt_get_php_path -a phpenv_version
|
||||||
@@ -644,7 +642,7 @@ function __phpenv_provider_apt_get_php_path -a phpenv_version
|
|||||||
set -l temp_link "$target.$fish_pid"
|
set -l temp_link "$target.$fish_pid"
|
||||||
ln -s "$source" "$temp_link" 2>/dev/null
|
ln -s "$source" "$temp_link" 2>/dev/null
|
||||||
and mv -f "$temp_link" "$target" 2>/dev/null
|
and mv -f "$temp_link" "$target" 2>/dev/null
|
||||||
else if test "$binary" = "phar"; and test -x "/usr/bin/phar$phpenv_version"
|
else if test "$binary" = phar; and test -x "/usr/bin/phar$phpenv_version"
|
||||||
set -l temp_link "$target.$fish_pid"
|
set -l temp_link "$target.$fish_pid"
|
||||||
ln -s "/usr/bin/phar$phpenv_version" "$temp_link" 2>/dev/null
|
ln -s "/usr/bin/phar$phpenv_version" "$temp_link" 2>/dev/null
|
||||||
and mv -f "$temp_link" "$target" 2>/dev/null
|
and mv -f "$temp_link" "$target" 2>/dev/null
|
||||||
@@ -819,8 +817,7 @@ function __phpenv_provider_apt_ext_list -a phpenv_version
|
|||||||
# Filter out core packages (cli, common, etc.)
|
# Filter out core packages (cli, common, etc.)
|
||||||
set -l core_packages cli common opcache fpm cgi phpdbg
|
set -l core_packages cli common opcache fpm cgi phpdbg
|
||||||
|
|
||||||
dpkg -l "php$phpenv_version-*" 2>/dev/null | grep '^ii' | awk '{print $2}' | \
|
dpkg -l "php$phpenv_version-*" 2>/dev/null | grep '^ii' | awk '{print $2}' | sed "s/php$phpenv_version-//" | while read ext
|
||||||
sed "s/php$phpenv_version-//" | while read ext
|
|
||||||
# Skip core packages
|
# Skip core packages
|
||||||
set -l is_core 0
|
set -l is_core 0
|
||||||
for core in $core_packages
|
for core in $core_packages
|
||||||
@@ -837,9 +834,7 @@ end
|
|||||||
|
|
||||||
function __phpenv_provider_apt_ext_available -a phpenv_version
|
function __phpenv_provider_apt_ext_available -a phpenv_version
|
||||||
# List available extensions from apt cache
|
# List available extensions from apt cache
|
||||||
apt-cache search "^php$phpenv_version-" 2>/dev/null | \
|
apt-cache search "^php$phpenv_version-" 2>/dev/null | sed "s/php$phpenv_version-//" | awk '{print $1}' | grep -v -E '^(cli|common|fpm|cgi|phpdbg|dev)$' | sort | uniq
|
||||||
sed "s/php$phpenv_version-//" | awk '{print $1}' | \
|
|
||||||
grep -v -E '^(cli|common|fpm|cgi|phpdbg|dev)$' | sort | uniq
|
|
||||||
end
|
end
|
||||||
|
|
||||||
function __phpenv_provider_apt_get_path_pattern
|
function __phpenv_provider_apt_get_path_pattern
|
||||||
@@ -979,9 +974,9 @@ end
|
|||||||
function __phpenv_resolve_version_alias -a phpenv_version
|
function __phpenv_resolve_version_alias -a phpenv_version
|
||||||
switch $phpenv_version
|
switch $phpenv_version
|
||||||
case latest
|
case latest
|
||||||
__phpenv_parse_version_field "latest" "8.4"
|
__phpenv_parse_version_field latest "8.4"
|
||||||
case nightly
|
case nightly
|
||||||
__phpenv_parse_version_field "nightly" "8.5"
|
__phpenv_parse_version_field nightly "8.5"
|
||||||
case '8.x'
|
case '8.x'
|
||||||
__phpenv_parse_version_field "8.x" "8.4"
|
__phpenv_parse_version_field "8.x" "8.4"
|
||||||
case '7.x'
|
case '7.x'
|
||||||
@@ -997,7 +992,7 @@ function __phpenv_get_formula_name -a phpenv_version
|
|||||||
set -l phpenv_latest_version (__phpenv_parse_version_field "latest" "8.4")
|
set -l phpenv_latest_version (__phpenv_parse_version_field "latest" "8.4")
|
||||||
|
|
||||||
if test "$phpenv_version" = "$phpenv_latest_version"
|
if test "$phpenv_version" = "$phpenv_latest_version"
|
||||||
echo "shivammathur/php/php"
|
echo shivammathur/php/php
|
||||||
else
|
else
|
||||||
echo "shivammathur/php/php@$phpenv_version"
|
echo "shivammathur/php/php@$phpenv_version"
|
||||||
end
|
end
|
||||||
@@ -1140,7 +1135,7 @@ function __phpenv_use
|
|||||||
set -l phpenv_version $argv[1]
|
set -l phpenv_version $argv[1]
|
||||||
|
|
||||||
# Handle special case: restore system PHP
|
# Handle special case: restore system PHP
|
||||||
if test "$phpenv_version" = "system"
|
if test "$phpenv_version" = system
|
||||||
__phpenv_restore_system_path
|
__phpenv_restore_system_path
|
||||||
echo "Restored system PHP"
|
echo "Restored system PHP"
|
||||||
return 0
|
return 0
|
||||||
@@ -1157,7 +1152,7 @@ function __phpenv_use
|
|||||||
end
|
end
|
||||||
|
|
||||||
if not __phpenv_is_version_installed $phpenv_version
|
if not __phpenv_is_version_installed $phpenv_version
|
||||||
if test "$(__phpenv_config_get auto-install)" = "true"
|
if test "$(__phpenv_config_get auto-install)" = true
|
||||||
__phpenv_install $phpenv_version
|
__phpenv_install $phpenv_version
|
||||||
else
|
else
|
||||||
echo "PHP $phpenv_version is not installed. Install with: phpenv install $phpenv_version"
|
echo "PHP $phpenv_version is not installed. Install with: phpenv install $phpenv_version"
|
||||||
@@ -1179,7 +1174,7 @@ function __phpenv_local -a phpenv_version
|
|||||||
return 1
|
return 1
|
||||||
end
|
end
|
||||||
|
|
||||||
echo $phpenv_version > .php-version
|
echo $phpenv_version >.php-version
|
||||||
echo "Set local PHP version to $phpenv_version"
|
echo "Set local PHP version to $phpenv_version"
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -1272,7 +1267,7 @@ function __phpenv_get_tap_versions
|
|||||||
continue
|
continue
|
||||||
end
|
end
|
||||||
|
|
||||||
if test "$phpenv_clean_name" = "php"
|
if test "$phpenv_clean_name" = php
|
||||||
set -a phpenv_versions "$phpenv_latest_version (latest)"
|
set -a phpenv_versions "$phpenv_latest_version (latest)"
|
||||||
else if echo $phpenv_clean_name | grep -qE '^php@[0-9]+\.[0-9]+$'
|
else if echo $phpenv_clean_name | grep -qE '^php@[0-9]+\.[0-9]+$'
|
||||||
set -l phpenv_version (echo $phpenv_clean_name | sed 's/php@//')
|
set -l phpenv_version (echo $phpenv_clean_name | sed 's/php@//')
|
||||||
@@ -1310,7 +1305,7 @@ function __phpenv_doctor
|
|||||||
|
|
||||||
# Show provider information
|
# Show provider information
|
||||||
set -l provider (__phpenv_get_provider)
|
set -l provider (__phpenv_get_provider)
|
||||||
set -l provider_source "auto-detected"
|
set -l provider_source auto-detected
|
||||||
if set -q PHPENV_PROVIDER; and test -n "$PHPENV_PROVIDER"
|
if set -q PHPENV_PROVIDER; and test -n "$PHPENV_PROVIDER"
|
||||||
set provider_source "PHPENV_PROVIDER override"
|
set provider_source "PHPENV_PROVIDER override"
|
||||||
end
|
end
|
||||||
@@ -1429,7 +1424,7 @@ function __phpenv_config_get -a phpenv_key
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
if test "$argv[2]" = "--verbose"
|
if test "$argv[2]" = --verbose
|
||||||
if test -n "$phpenv_value"
|
if test -n "$phpenv_value"
|
||||||
echo "$phpenv_key = $phpenv_value (from $phpenv_source)"
|
echo "$phpenv_key = $phpenv_value (from $phpenv_source)"
|
||||||
else
|
else
|
||||||
@@ -1581,19 +1576,18 @@ function __phpenv_get_tap_formulas -a tap_name
|
|||||||
return 1
|
return 1
|
||||||
end
|
end
|
||||||
|
|
||||||
brew tap-info $tap_name --json 2>/dev/null | \
|
brew tap-info $tap_name --json 2>/dev/null | jq -r '.[]|(.formula_names[]?)' 2>/dev/null
|
||||||
jq -r '.[]|(.formula_names[]?)' 2>/dev/null
|
|
||||||
end
|
end
|
||||||
|
|
||||||
function __phpenv_get_available_extensions
|
function __phpenv_get_available_extensions
|
||||||
__phpenv_get_tap_formulas "shivammathur/extensions"
|
__phpenv_get_tap_formulas shivammathur/extensions
|
||||||
end
|
end
|
||||||
|
|
||||||
function __phpenv_extension_available -a phpenv_extension phpenv_version
|
function __phpenv_extension_available -a phpenv_extension phpenv_version
|
||||||
set -l phpenv_available_extensions (__phpenv_get_available_extensions)
|
set -l phpenv_available_extensions (__phpenv_get_available_extensions)
|
||||||
|
|
||||||
if test -z "$phpenv_available_extensions"
|
if test -z "$phpenv_available_extensions"
|
||||||
return 0 # Assume available if can't check
|
return 0 # Assume available if can't check
|
||||||
end
|
end
|
||||||
|
|
||||||
for phpenv_ext_formula in $phpenv_available_extensions
|
for phpenv_ext_formula in $phpenv_available_extensions
|
||||||
@@ -1695,7 +1689,7 @@ function __phpenv_auto_switch --on-variable PWD
|
|||||||
end
|
end
|
||||||
|
|
||||||
set -l phpenv_auto_switch (__phpenv_config_get auto-switch)
|
set -l phpenv_auto_switch (__phpenv_config_get auto-switch)
|
||||||
if test "$phpenv_auto_switch" = "false"
|
if test "$phpenv_auto_switch" = false
|
||||||
return 0
|
return 0
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -1718,7 +1712,7 @@ function __phpenv_auto_switch --on-variable PWD
|
|||||||
set -g PHPENV_LAST_SWITCH_TIME $phpenv_current_time
|
set -g PHPENV_LAST_SWITCH_TIME $phpenv_current_time
|
||||||
else
|
else
|
||||||
set -l phpenv_auto_install (__phpenv_config_get auto-install)
|
set -l phpenv_auto_install (__phpenv_config_get auto-install)
|
||||||
if test "$phpenv_auto_install" = "true"
|
if test "$phpenv_auto_install" = true
|
||||||
echo "Auto-installing PHP $phpenv_new_version..."
|
echo "Auto-installing PHP $phpenv_new_version..."
|
||||||
if phpenv install "$phpenv_new_version"
|
if phpenv install "$phpenv_new_version"
|
||||||
set -g PHPENV_LAST_SWITCH_TIME $phpenv_current_time
|
set -g PHPENV_LAST_SWITCH_TIME $phpenv_current_time
|
||||||
@@ -1771,7 +1765,7 @@ function __phpenv_help
|
|||||||
end
|
end
|
||||||
|
|
||||||
function __phpenv_validate_boolean -a phpenv_value
|
function __phpenv_validate_boolean -a phpenv_value
|
||||||
test "$phpenv_value" = "true" -o "$phpenv_value" = "false"
|
test "$phpenv_value" = true -o "$phpenv_value" = false
|
||||||
end
|
end
|
||||||
|
|
||||||
function __phpenv_validate_version -a phpenv_version
|
function __phpenv_validate_version -a phpenv_version
|
||||||
|
|||||||
72
config/fish/secrets.d/README.md
Normal file
72
config/fish/secrets.d/README.md
Normal file
@@ -0,0 +1,72 @@
|
|||||||
|
# Fish Shell Secrets Directory
|
||||||
|
|
||||||
|
This directory contains sensitive environment variables like API tokens and credentials.
|
||||||
|
|
||||||
|
## Usage
|
||||||
|
|
||||||
|
1. Copy an example file (e.g., `github.fish.example`) to remove the `.example` suffix:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
cp github.fish.example github.fish
|
||||||
|
```
|
||||||
|
|
||||||
|
2. Edit the file and replace placeholder values with your actual secrets:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
$EDITOR github.fish
|
||||||
|
```
|
||||||
|
|
||||||
|
3. Reload your fish shell or source the exports:
|
||||||
|
|
||||||
|
```fish
|
||||||
|
source ~/.config/fish/exports.fish
|
||||||
|
```
|
||||||
|
|
||||||
|
## Adding New Secret Files
|
||||||
|
|
||||||
|
Create a new `.fish` file in this directory with your environment variables:
|
||||||
|
|
||||||
|
```fish
|
||||||
|
# Example: openai.fish
|
||||||
|
set -x OPENAI_API_KEY "sk-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
|
||||||
|
```
|
||||||
|
|
||||||
|
Common secret patterns:
|
||||||
|
|
||||||
|
- `github.fish` - GitHub Personal Access Token (`GITHUB_TOKEN`)
|
||||||
|
- `aws.fish` - AWS credentials (`AWS_ACCESS_KEY_ID`, `AWS_SECRET_ACCESS_KEY`)
|
||||||
|
- `openai.fish` - OpenAI API key (`OPENAI_API_KEY`)
|
||||||
|
- `anthropic.fish` - Anthropic API key (`ANTHROPIC_API_KEY`)
|
||||||
|
|
||||||
|
## Security Best Practices
|
||||||
|
|
||||||
|
- **Never commit actual secrets** - Only `.example` files are tracked by git
|
||||||
|
- **Use specific permissions** - Consider `chmod 600` for secret files
|
||||||
|
- **Rotate credentials regularly** - Update tokens when compromised
|
||||||
|
- **Use environment-specific files** - Separate dev/staging/prod credentials
|
||||||
|
- **Check before committing** - Run `git status` to verify secrets aren't staged
|
||||||
|
|
||||||
|
## How It Works
|
||||||
|
|
||||||
|
The `exports.fish` file automatically sources all `*.fish` files from this directory:
|
||||||
|
|
||||||
|
```fish
|
||||||
|
if test -d "$DOTFILES/config/fish/secrets.d"
|
||||||
|
for secret_file in "$DOTFILES/config/fish/secrets.d"/*.fish
|
||||||
|
if test -f "$secret_file"
|
||||||
|
source "$secret_file"
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
```
|
||||||
|
|
||||||
|
Files ending in `.example` are ignored by the loader but tracked by git as templates.
|
||||||
|
|
||||||
|
## Backward Compatibility
|
||||||
|
|
||||||
|
This directory supplements the existing `exports-secret.fish` pattern. Both methods work:
|
||||||
|
|
||||||
|
- **Legacy**: `config/fish/exports-secret.fish` (single file, still supported)
|
||||||
|
- **New**: `config/fish/secrets.d/*.fish` (multiple files, recommended)
|
||||||
|
|
||||||
|
Use whichever approach fits your workflow best.
|
||||||
5
config/fish/secrets.d/github.fish.example
Normal file
5
config/fish/secrets.d/github.fish.example
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
# GitHub Personal Access Token
|
||||||
|
# Copy this file to github.fish (remove .example) and set your token
|
||||||
|
# Generate token at: https://github.com/settings/tokens
|
||||||
|
|
||||||
|
set -x GITHUB_TOKEN "ghp_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
|
||||||
@@ -59,3 +59,31 @@ fish_pager_color_prefix f4b8e4
|
|||||||
fish_pager_color_completion c6d0f5
|
fish_pager_color_completion c6d0f5
|
||||||
fish_pager_color_description 737994
|
fish_pager_color_description 737994
|
||||||
|
|
||||||
|
[unknown]
|
||||||
|
# preferred_background: 303446
|
||||||
|
fish_color_normal c6d0f5
|
||||||
|
fish_color_command 8caaee
|
||||||
|
fish_color_param eebebe
|
||||||
|
fish_color_keyword ca9ee6
|
||||||
|
fish_color_quote a6d189
|
||||||
|
fish_color_redirection f4b8e4
|
||||||
|
fish_color_end ef9f76
|
||||||
|
fish_color_comment 838ba7
|
||||||
|
fish_color_error e78284
|
||||||
|
fish_color_gray 737994
|
||||||
|
fish_color_selection --background=414559
|
||||||
|
fish_color_search_match --background=414559
|
||||||
|
fish_color_option a6d189
|
||||||
|
fish_color_operator f4b8e4
|
||||||
|
fish_color_escape ea999c
|
||||||
|
fish_color_autosuggestion 737994
|
||||||
|
fish_color_cancel e78284
|
||||||
|
fish_color_cwd e5c890
|
||||||
|
fish_color_user 81c8be
|
||||||
|
fish_color_host 8caaee
|
||||||
|
fish_color_host_remote a6d189
|
||||||
|
fish_color_status e78284
|
||||||
|
fish_pager_color_progress 737994
|
||||||
|
fish_pager_color_prefix f4b8e4
|
||||||
|
fish_pager_color_completion c6d0f5
|
||||||
|
fish_pager_color_description 737994
|
||||||
|
|||||||
@@ -59,3 +59,31 @@ fish_pager_color_prefix f5bde6
|
|||||||
fish_pager_color_completion cad3f5
|
fish_pager_color_completion cad3f5
|
||||||
fish_pager_color_description 6e738d
|
fish_pager_color_description 6e738d
|
||||||
|
|
||||||
|
[unknown]
|
||||||
|
# preferred_background: 24273a
|
||||||
|
fish_color_normal cad3f5
|
||||||
|
fish_color_command 8aadf4
|
||||||
|
fish_color_param f0c6c6
|
||||||
|
fish_color_keyword c6a0f6
|
||||||
|
fish_color_quote a6da95
|
||||||
|
fish_color_redirection f5bde6
|
||||||
|
fish_color_end f5a97f
|
||||||
|
fish_color_comment 8087a2
|
||||||
|
fish_color_error ed8796
|
||||||
|
fish_color_gray 6e738d
|
||||||
|
fish_color_selection --background=363a4f
|
||||||
|
fish_color_search_match --background=363a4f
|
||||||
|
fish_color_option a6da95
|
||||||
|
fish_color_operator f5bde6
|
||||||
|
fish_color_escape ee99a0
|
||||||
|
fish_color_autosuggestion 6e738d
|
||||||
|
fish_color_cancel ed8796
|
||||||
|
fish_color_cwd eed49f
|
||||||
|
fish_color_user 8bd5ca
|
||||||
|
fish_color_host 8aadf4
|
||||||
|
fish_color_host_remote a6da95
|
||||||
|
fish_color_status ed8796
|
||||||
|
fish_pager_color_progress 6e738d
|
||||||
|
fish_pager_color_prefix f5bde6
|
||||||
|
fish_pager_color_completion cad3f5
|
||||||
|
fish_pager_color_description 6e738d
|
||||||
|
|||||||
@@ -59,3 +59,31 @@ fish_pager_color_prefix f5c2e7
|
|||||||
fish_pager_color_completion cdd6f4
|
fish_pager_color_completion cdd6f4
|
||||||
fish_pager_color_description 6c7086
|
fish_pager_color_description 6c7086
|
||||||
|
|
||||||
|
[unknown]
|
||||||
|
# preferred_background: 1e1e2e
|
||||||
|
fish_color_normal cdd6f4
|
||||||
|
fish_color_command 89b4fa
|
||||||
|
fish_color_param f2cdcd
|
||||||
|
fish_color_keyword cba6f7
|
||||||
|
fish_color_quote a6e3a1
|
||||||
|
fish_color_redirection f5c2e7
|
||||||
|
fish_color_end fab387
|
||||||
|
fish_color_comment 7f849c
|
||||||
|
fish_color_error f38ba8
|
||||||
|
fish_color_gray 6c7086
|
||||||
|
fish_color_selection --background=313244
|
||||||
|
fish_color_search_match --background=313244
|
||||||
|
fish_color_option a6e3a1
|
||||||
|
fish_color_operator f5c2e7
|
||||||
|
fish_color_escape eba0ac
|
||||||
|
fish_color_autosuggestion 6c7086
|
||||||
|
fish_color_cancel f38ba8
|
||||||
|
fish_color_cwd f9e2af
|
||||||
|
fish_color_user 94e2d5
|
||||||
|
fish_color_host 89b4fa
|
||||||
|
fish_color_host_remote a6e3a1
|
||||||
|
fish_color_status f38ba8
|
||||||
|
fish_pager_color_progress 6c7086
|
||||||
|
fish_pager_color_prefix f5c2e7
|
||||||
|
fish_pager_color_completion cdd6f4
|
||||||
|
fish_pager_color_description 6c7086
|
||||||
|
|||||||
@@ -1,6 +0,0 @@
|
|||||||
[General]
|
|
||||||
ApplicationUpdateChannel=release
|
|
||||||
CheckApplicatonUpdates=true
|
|
||||||
FirmwareUpdateChannel=release
|
|
||||||
LastFolderUrl=/Users/ivuorinen
|
|
||||||
ShowHiddenFiles=false
|
|
||||||
@@ -13,32 +13,37 @@
|
|||||||
if [[ $- =~ i ]]; then
|
if [[ $- =~ i ]]; then
|
||||||
|
|
||||||
# To use custom commands instead of find, override _fzf_compgen_{path,dir}
|
# To use custom commands instead of find, override _fzf_compgen_{path,dir}
|
||||||
if ! declare -f _fzf_compgen_path >/dev/null; then
|
if ! declare -f _fzf_compgen_path > /dev/null; then
|
||||||
_fzf_compgen_path() {
|
_fzf_compgen_path()
|
||||||
|
{
|
||||||
echo "$1"
|
echo "$1"
|
||||||
command find -L "$1" \
|
command find -L "$1" \
|
||||||
-name .git -prune -o -name .hg -prune -o -name .svn -prune -o \( -type d -o -type f -o -type l \) \
|
-name .git -prune -o -name .hg -prune -o -name .svn -prune -o \( -type d -o -type f -o -type l \) \
|
||||||
-a -not -path "$1" -print 2>/dev/null | sed 's@^\./@@'
|
-a -not -path "$1" -print 2> /dev/null | sed 's@^\./@@'
|
||||||
}
|
}
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if ! declare -f _fzf_compgen_dir >/dev/null; then
|
if ! declare -f _fzf_compgen_dir > /dev/null; then
|
||||||
_fzf_compgen_dir() {
|
_fzf_compgen_dir()
|
||||||
|
{
|
||||||
command find -L "$1" \
|
command find -L "$1" \
|
||||||
-name .git -prune -o -name .hg -prune -o -name .svn -prune -o -type d \
|
-name .git -prune -o -name .hg -prune -o -name .svn -prune -o -type d \
|
||||||
-a -not -path "$1" -print 2>/dev/null | sed 's@^\./@@'
|
-a -not -path "$1" -print 2> /dev/null | sed 's@^\./@@'
|
||||||
}
|
}
|
||||||
fi
|
fi
|
||||||
|
|
||||||
###########################################################
|
###########################################################
|
||||||
|
|
||||||
# To redraw line after fzf closes (printf '\e[5n')
|
# To redraw line after fzf closes (printf '\e[5n')
|
||||||
bind '"\e[0n": redraw-current-line' 2>/dev/null
|
bind '"\e[0n": redraw-current-line' 2> /dev/null
|
||||||
|
|
||||||
__fzf_comprun() {
|
__fzf_comprun()
|
||||||
|
{
|
||||||
if [[ "$(type -t _fzf_comprun 2>&1)" = function ]]; then
|
if [[ "$(type -t _fzf_comprun 2>&1)" = function ]]; then
|
||||||
_fzf_comprun "$@"
|
_fzf_comprun "$@"
|
||||||
elif [[ -n "${TMUX_PANE-}" ]] && { [[ "${FZF_TMUX:-0}" != 0 ]] || [[ -n "${FZF_TMUX_OPTS-}" ]]; }; then
|
elif [[ -n "${TMUX_PANE-}" ]] && {
|
||||||
|
[[ "${FZF_TMUX:-0}" != 0 ]] || [[ -n "${FZF_TMUX_OPTS-}" ]]
|
||||||
|
}; then
|
||||||
shift
|
shift
|
||||||
fzf-tmux ${FZF_TMUX_OPTS:--d${FZF_TMUX_HEIGHT:-40%}} -- "$@"
|
fzf-tmux ${FZF_TMUX_OPTS:--d${FZF_TMUX_HEIGHT:-40%}} -- "$@"
|
||||||
else
|
else
|
||||||
@@ -47,7 +52,8 @@ if [[ $- =~ i ]]; then
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
__fzf_orig_completion() {
|
__fzf_orig_completion()
|
||||||
|
{
|
||||||
local l comp f cmd
|
local l comp f cmd
|
||||||
while read -r l; do
|
while read -r l; do
|
||||||
if [[ "$l" =~ ^(.*\ -F)\ *([^ ]*).*\ ([^ ]*)$ ]]; then
|
if [[ "$l" =~ ^(.*\ -F)\ *([^ ]*).*\ ([^ ]*)$ ]]; then
|
||||||
@@ -63,7 +69,8 @@ if [[ $- =~ i ]]; then
|
|||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
_fzf_opts_completion() {
|
_fzf_opts_completion()
|
||||||
|
{
|
||||||
local cur prev opts
|
local cur prev opts
|
||||||
COMPREPLY=()
|
COMPREPLY=()
|
||||||
cur="${COMP_WORDS[COMP_CWORD]}"
|
cur="${COMP_WORDS[COMP_CWORD]}"
|
||||||
@@ -112,18 +119,18 @@ if [[ $- =~ i ]]; then
|
|||||||
--sync"
|
--sync"
|
||||||
|
|
||||||
case "${prev}" in
|
case "${prev}" in
|
||||||
--tiebreak)
|
--tiebreak)
|
||||||
COMPREPLY=($(compgen -W "length begin end index" -- "$cur"))
|
COMPREPLY=($(compgen -W "length begin end index" -- "$cur"))
|
||||||
return 0
|
return 0
|
||||||
;;
|
;;
|
||||||
--color)
|
--color)
|
||||||
COMPREPLY=($(compgen -W "dark light 16 bw" -- "$cur"))
|
COMPREPLY=($(compgen -W "dark light 16 bw" -- "$cur"))
|
||||||
return 0
|
return 0
|
||||||
;;
|
;;
|
||||||
--history)
|
--history)
|
||||||
COMPREPLY=()
|
COMPREPLY=()
|
||||||
return 0
|
return 0
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
if [[ "$cur" =~ ^-|\+ ]]; then
|
if [[ "$cur" =~ ^-|\+ ]]; then
|
||||||
@@ -134,7 +141,8 @@ if [[ $- =~ i ]]; then
|
|||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
_fzf_handle_dynamic_completion() {
|
_fzf_handle_dynamic_completion()
|
||||||
|
{
|
||||||
local cmd orig_var orig ret orig_cmd orig_complete
|
local cmd orig_var orig ret orig_cmd orig_complete
|
||||||
cmd="$1"
|
cmd="$1"
|
||||||
shift
|
shift
|
||||||
@@ -142,15 +150,15 @@ if [[ $- =~ i ]]; then
|
|||||||
orig_var="_fzf_orig_completion_$cmd"
|
orig_var="_fzf_orig_completion_$cmd"
|
||||||
orig="${!orig_var-}"
|
orig="${!orig_var-}"
|
||||||
orig="${orig##*#}"
|
orig="${orig##*#}"
|
||||||
if [[ -n "$orig" ]] && type "$orig" >/dev/null 2>&1; then
|
if [[ -n "$orig" ]] && type "$orig" > /dev/null 2>&1; then
|
||||||
$orig "$@"
|
$orig "$@"
|
||||||
elif [[ -n "${_fzf_completion_loader-}" ]]; then
|
elif [[ -n "${_fzf_completion_loader-}" ]]; then
|
||||||
orig_complete=$(complete -p "$orig_cmd" 2>/dev/null)
|
orig_complete=$(complete -p "$orig_cmd" 2> /dev/null)
|
||||||
_completion_loader "$@"
|
_completion_loader "$@"
|
||||||
ret=$?
|
ret=$?
|
||||||
# _completion_loader may not have updated completion for the command
|
# _completion_loader may not have updated completion for the command
|
||||||
if [[ "$(complete -p "$orig_cmd" 2>/dev/null)" != "$orig_complete" ]]; then
|
if [[ "$(complete -p "$orig_cmd" 2> /dev/null)" != "$orig_complete" ]]; then
|
||||||
__fzf_orig_completion < <(complete -p "$orig_cmd" 2>/dev/null)
|
__fzf_orig_completion < <(complete -p "$orig_cmd" 2> /dev/null)
|
||||||
if [[ "${__fzf_nospace_commands-}" = *" $orig_cmd "* ]]; then
|
if [[ "${__fzf_nospace_commands-}" = *" $orig_cmd "* ]]; then
|
||||||
eval "${orig_complete/ -F / -o nospace -F }"
|
eval "${orig_complete/ -F / -o nospace -F }"
|
||||||
else
|
else
|
||||||
@@ -161,7 +169,8 @@ if [[ $- =~ i ]]; then
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
__fzf_generic_path_completion() {
|
__fzf_generic_path_completion()
|
||||||
|
{
|
||||||
local cur base dir leftover matches trigger cmd
|
local cur base dir leftover matches trigger cmd
|
||||||
cmd="${COMP_WORDS[0]}"
|
cmd="${COMP_WORDS[0]}"
|
||||||
if [[ $cmd == \\* ]]; then
|
if [[ $cmd == \\* ]]; then
|
||||||
@@ -207,7 +216,8 @@ if [[ $- =~ i ]]; then
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
_fzf_complete() {
|
_fzf_complete()
|
||||||
|
{
|
||||||
# Split arguments around --
|
# Split arguments around --
|
||||||
local args rest str_arg i sep
|
local args rest str_arg i sep
|
||||||
args=("$@")
|
args=("$@")
|
||||||
@@ -231,7 +241,7 @@ if [[ $- =~ i ]]; then
|
|||||||
|
|
||||||
local cur selected trigger cmd post
|
local cur selected trigger cmd post
|
||||||
post="$(caller 0 | awk '{print $2}')_post"
|
post="$(caller 0 | awk '{print $2}')_post"
|
||||||
type -t "$post" >/dev/null 2>&1 || post=cat
|
type -t "$post" > /dev/null 2>&1 || post=cat
|
||||||
|
|
||||||
cmd="${COMP_WORDS[0]//[^A-Za-z0-9_=]/_}"
|
cmd="${COMP_WORDS[0]//[^A-Za-z0-9_=]/_}"
|
||||||
trigger=${FZF_COMPLETION_TRIGGER-'**'}
|
trigger=${FZF_COMPLETION_TRIGGER-'**'}
|
||||||
@@ -253,50 +263,59 @@ if [[ $- =~ i ]]; then
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
_fzf_path_completion() {
|
_fzf_path_completion()
|
||||||
|
{
|
||||||
__fzf_generic_path_completion _fzf_compgen_path "-m" "" "$@"
|
__fzf_generic_path_completion _fzf_compgen_path "-m" "" "$@"
|
||||||
}
|
}
|
||||||
|
|
||||||
# Deprecated. No file only completion.
|
# Deprecated. No file only completion.
|
||||||
_fzf_file_completion() {
|
_fzf_file_completion()
|
||||||
|
{
|
||||||
_fzf_path_completion "$@"
|
_fzf_path_completion "$@"
|
||||||
}
|
}
|
||||||
|
|
||||||
_fzf_dir_completion() {
|
_fzf_dir_completion()
|
||||||
|
{
|
||||||
__fzf_generic_path_completion _fzf_compgen_dir "" "/" "$@"
|
__fzf_generic_path_completion _fzf_compgen_dir "" "/" "$@"
|
||||||
}
|
}
|
||||||
|
|
||||||
_fzf_complete_kill() {
|
_fzf_complete_kill()
|
||||||
|
{
|
||||||
_fzf_proc_completion "$@"
|
_fzf_proc_completion "$@"
|
||||||
}
|
}
|
||||||
|
|
||||||
_fzf_proc_completion() {
|
_fzf_proc_completion()
|
||||||
|
{
|
||||||
_fzf_complete -m --header-lines=1 --preview 'echo {}' --preview-window down:3:wrap --min-height 15 -- "$@" < <(
|
_fzf_complete -m --header-lines=1 --preview 'echo {}' --preview-window down:3:wrap --min-height 15 -- "$@" < <(
|
||||||
command ps -eo user,pid,ppid,start,time,command 2>/dev/null ||
|
command ps -eo user,pid,ppid,start,time,command 2> /dev/null \
|
||||||
command ps -eo user,pid,ppid,time,args # For BusyBox
|
|| command ps -eo user,pid,ppid,time,args # For BusyBox
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
_fzf_proc_completion_post() {
|
_fzf_proc_completion_post()
|
||||||
|
{
|
||||||
awk '{print $2}'
|
awk '{print $2}'
|
||||||
}
|
}
|
||||||
|
|
||||||
_fzf_host_completion() {
|
_fzf_host_completion()
|
||||||
|
{
|
||||||
_fzf_complete +m -- "$@" < <(
|
_fzf_complete +m -- "$@" < <(
|
||||||
command cat <(command tail -n +1 ~/.ssh/config ~/.ssh/config.d/* /etc/ssh/ssh_config 2>/dev/null | command grep -i '^\s*host\(name\)\? ' | awk '{for (i = 2; i <= NF; i++) print $1 " " $i}' | command grep -v '[*?%]') \
|
command cat <(command tail -n +1 ~/.ssh/config ~/.ssh/config.d/* /etc/ssh/ssh_config 2> /dev/null | command grep -i '^\s*host\(name\)\? ' | awk '{for (i = 2; i <= NF; i++) print $1 " " $i}' | command grep -v '[*?%]') \
|
||||||
<(command grep -oE '^[[a-z0-9.,:-]+' ~/.ssh/known_hosts | tr ',' '\n' | tr -d '[' | awk '{ print $1 " " $1 }') \
|
<(command grep -oE '^[[a-z0-9.,:-]+' ~/.ssh/known_hosts | tr ',' '\n' | tr -d '[' | awk '{ print $1 " " $1 }') \
|
||||||
<(command grep -v '^\s*\(#\|$\)' /etc/hosts | command grep -Fv '0.0.0.0') |
|
<(command grep -v '^\s*\(#\|$\)' /etc/hosts | command grep -Fv '0.0.0.0') \
|
||||||
awk '{if (length($2) > 0) {print $2}}' | sort -u
|
| awk '{if (length($2) > 0) {print $2}}' | sort -u
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
_fzf_var_completion() {
|
_fzf_var_completion()
|
||||||
|
{
|
||||||
_fzf_complete -m -- "$@" < <(
|
_fzf_complete -m -- "$@" < <(
|
||||||
declare -xp | sed -En 's|^declare [^ ]+ ([^=]+).*|\1|p'
|
declare -xp | sed -En 's|^declare [^ ]+ ([^=]+).*|\1|p'
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
_fzf_alias_completion() {
|
_fzf_alias_completion()
|
||||||
|
{
|
||||||
_fzf_complete -m -- "$@" < <(
|
_fzf_complete -m -- "$@" < <(
|
||||||
alias | sed -En 's|^alias ([^=]+).*|\1|p'
|
alias | sed -En 's|^alias ([^=]+).*|\1|p'
|
||||||
)
|
)
|
||||||
@@ -321,13 +340,14 @@ if [[ $- =~ i ]]; then
|
|||||||
svn tar unzip zip"
|
svn tar unzip zip"
|
||||||
|
|
||||||
# Preserve existing completion
|
# Preserve existing completion
|
||||||
__fzf_orig_completion < <(complete -p $d_cmds $a_cmds 2>/dev/null)
|
__fzf_orig_completion < <(complete -p $d_cmds $a_cmds 2> /dev/null)
|
||||||
|
|
||||||
if type _completion_loader >/dev/null 2>&1; then
|
if type _completion_loader > /dev/null 2>&1; then
|
||||||
_fzf_completion_loader=1
|
_fzf_completion_loader=1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
__fzf_defc() {
|
__fzf_defc()
|
||||||
|
{
|
||||||
local cmd func opts orig_var orig def
|
local cmd func opts orig_var orig def
|
||||||
cmd="$1"
|
cmd="$1"
|
||||||
func="$2"
|
func="$2"
|
||||||
@@ -354,22 +374,23 @@ if [[ $- =~ i ]]; then
|
|||||||
|
|
||||||
unset cmd d_cmds a_cmds
|
unset cmd d_cmds a_cmds
|
||||||
|
|
||||||
_fzf_setup_completion() {
|
_fzf_setup_completion()
|
||||||
|
{
|
||||||
local kind fn cmd
|
local kind fn cmd
|
||||||
kind=$1
|
kind=$1
|
||||||
fn=_fzf_${1}_completion
|
fn=_fzf_${1}_completion
|
||||||
if [[ $# -lt 2 ]] || ! type -t "$fn" >/dev/null; then
|
if [[ $# -lt 2 ]] || ! type -t "$fn" > /dev/null; then
|
||||||
echo "usage: ${FUNCNAME[0]} path|dir|var|alias|host|proc COMMANDS..."
|
echo "usage: ${FUNCNAME[0]} path|dir|var|alias|host|proc COMMANDS..."
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
shift
|
shift
|
||||||
__fzf_orig_completion < <(complete -p "$@" 2>/dev/null)
|
__fzf_orig_completion < <(complete -p "$@" 2> /dev/null)
|
||||||
for cmd in "$@"; do
|
for cmd in "$@"; do
|
||||||
case "$kind" in
|
case "$kind" in
|
||||||
dir) __fzf_defc "$cmd" "$fn" "-o nospace -o dirnames" ;;
|
dir) __fzf_defc "$cmd" "$fn" "-o nospace -o dirnames" ;;
|
||||||
var) __fzf_defc "$cmd" "$fn" "-o default -o nospace -v" ;;
|
var) __fzf_defc "$cmd" "$fn" "-o default -o nospace -v" ;;
|
||||||
alias) __fzf_defc "$cmd" "$fn" "-a" ;;
|
alias) __fzf_defc "$cmd" "$fn" "-a" ;;
|
||||||
*) __fzf_defc "$cmd" "$fn" "-o default -o bashdefault" ;;
|
*) __fzf_defc "$cmd" "$fn" "-o default -o bashdefault" ;;
|
||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
# Auto-completion
|
# Auto-completion
|
||||||
# ---------------
|
# ---------------
|
||||||
# shellcheck source=completion.bash
|
# shellcheck source=completion.bash
|
||||||
[[ $- == *i* ]] && source "$HOME/.dotfiles/config/fzf/completion.bash" 2>/dev/null
|
[[ $- == *i* ]] && source "$HOME/.dotfiles/config/fzf/completion.bash" 2> /dev/null
|
||||||
|
|
||||||
# Key bindings
|
# Key bindings
|
||||||
# ------------
|
# ------------
|
||||||
|
|||||||
@@ -13,7 +13,8 @@
|
|||||||
|
|
||||||
# Key bindings
|
# Key bindings
|
||||||
# ------------
|
# ------------
|
||||||
__fzf_select__() {
|
__fzf_select__()
|
||||||
|
{
|
||||||
local cmd opts
|
local cmd opts
|
||||||
cmd="${FZF_CTRL_T_COMMAND:-"command find -L . -mindepth 1 \\( -path '*/\\.*' -o -fstype 'sysfs' -o -fstype 'devfs' -o -fstype 'devtmpfs' -o -fstype 'proc' \\) -prune \
|
cmd="${FZF_CTRL_T_COMMAND:-"command find -L . -mindepth 1 \\( -path '*/\\.*' -o -fstype 'sysfs' -o -fstype 'devfs' -o -fstype 'devtmpfs' -o -fstype 'proc' \\) -prune \
|
||||||
-o -type f -print \
|
-o -type f -print \
|
||||||
@@ -21,27 +22,32 @@ __fzf_select__() {
|
|||||||
-o -type l -print 2> /dev/null | cut -b3-"}"
|
-o -type l -print 2> /dev/null | cut -b3-"}"
|
||||||
opts="--height ${FZF_TMUX_HEIGHT:-40%} --bind=ctrl-z:ignore --reverse ${FZF_DEFAULT_OPTS-} ${FZF_CTRL_T_OPTS-} -m"
|
opts="--height ${FZF_TMUX_HEIGHT:-40%} --bind=ctrl-z:ignore --reverse ${FZF_DEFAULT_OPTS-} ${FZF_CTRL_T_OPTS-} -m"
|
||||||
# shellcheck disable=SC2091 # Intentionally execute output of __fzfcmd
|
# shellcheck disable=SC2091 # Intentionally execute output of __fzfcmd
|
||||||
eval "$cmd" | FZF_DEFAULT_OPTS="$opts" $(__fzfcmd) "$@" |
|
eval "$cmd" | FZF_DEFAULT_OPTS="$opts" $(__fzfcmd) "$@" \
|
||||||
while read -r item; do
|
| while read -r item; do
|
||||||
printf '%q ' "$item" # escape special chars
|
printf '%q ' "$item" # escape special chars
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
if [[ $- =~ i ]]; then
|
if [[ $- =~ i ]]; then
|
||||||
|
|
||||||
__fzfcmd() {
|
__fzfcmd()
|
||||||
[[ -n "${TMUX_PANE-}" ]] && { [[ "${FZF_TMUX:-0}" != 0 ]] || [[ -n "${FZF_TMUX_OPTS-}" ]]; } &&
|
{
|
||||||
echo "fzf-tmux ${FZF_TMUX_OPTS:--d${FZF_TMUX_HEIGHT:-40%}} -- " || echo "fzf"
|
[[ -n "${TMUX_PANE-}" ]] && {
|
||||||
|
[[ "${FZF_TMUX:-0}" != 0 ]] || [[ -n "${FZF_TMUX_OPTS-}" ]]
|
||||||
|
} \
|
||||||
|
&& echo "fzf-tmux ${FZF_TMUX_OPTS:--d${FZF_TMUX_HEIGHT:-40%}} -- " || echo "fzf"
|
||||||
}
|
}
|
||||||
|
|
||||||
fzf-file-widget() {
|
fzf-file-widget()
|
||||||
|
{
|
||||||
local selected
|
local selected
|
||||||
selected="$(__fzf_select__ "$@")"
|
selected="$(__fzf_select__ "$@")"
|
||||||
READLINE_LINE="${READLINE_LINE:0:$READLINE_POINT}$selected${READLINE_LINE:$READLINE_POINT}"
|
READLINE_LINE="${READLINE_LINE:0:$READLINE_POINT}$selected${READLINE_LINE:$READLINE_POINT}"
|
||||||
READLINE_POINT=$((READLINE_POINT + ${#selected}))
|
READLINE_POINT=$((READLINE_POINT + ${#selected}))
|
||||||
}
|
}
|
||||||
|
|
||||||
__fzf_cd__() {
|
__fzf_cd__()
|
||||||
|
{
|
||||||
local cmd opts dir
|
local cmd opts dir
|
||||||
cmd="${FZF_ALT_C_COMMAND:-"command find -L . -mindepth 1 \\( -path '*/\\.*' -o -fstype 'sysfs' -o -fstype 'devfs' -o -fstype 'devtmpfs' -o -fstype 'proc' \\) -prune \
|
cmd="${FZF_ALT_C_COMMAND:-"command find -L . -mindepth 1 \\( -path '*/\\.*' -o -fstype 'sysfs' -o -fstype 'devfs' -o -fstype 'devtmpfs' -o -fstype 'proc' \\) -prune \
|
||||||
-o -type d -print 2> /dev/null | cut -b3-"}"
|
-o -type d -print 2> /dev/null | cut -b3-"}"
|
||||||
@@ -53,16 +59,17 @@ if [[ $- =~ i ]]; then
|
|||||||
) && printf 'builtin cd -- %q' "$dir"
|
) && printf 'builtin cd -- %q' "$dir"
|
||||||
}
|
}
|
||||||
|
|
||||||
__fzf_history__() {
|
__fzf_history__()
|
||||||
|
{
|
||||||
local output opts script
|
local output opts script
|
||||||
opts="--height ${FZF_TMUX_HEIGHT:-40%} --bind=ctrl-z:ignore ${FZF_DEFAULT_OPTS-} -n2..,.. --scheme=history --bind=ctrl-r:toggle-sort ${FZF_CTRL_R_OPTS-} +m --read0"
|
opts="--height ${FZF_TMUX_HEIGHT:-40%} --bind=ctrl-z:ignore ${FZF_DEFAULT_OPTS-} -n2..,.. --scheme=history --bind=ctrl-r:toggle-sort ${FZF_CTRL_R_OPTS-} +m --read0"
|
||||||
script='BEGIN { getc; $/ = "\n\t"; $HISTCOUNT = $ENV{last_hist} + 1 } s/^[ *]//; print $HISTCOUNT - $. . "\t$_" if !$seen{$_}++'
|
script='BEGIN { getc; $/ = "\n\t"; $HISTCOUNT = $ENV{last_hist} + 1 } s/^[ *]//; print $HISTCOUNT - $. . "\t$_" if !$seen{$_}++'
|
||||||
# shellcheck disable=SC2091 # Intentionally execute output of __fzfcmd
|
# shellcheck disable=SC2091 # Intentionally execute output of __fzfcmd
|
||||||
output=$(
|
output=$(
|
||||||
set +o pipefail
|
set +o pipefail
|
||||||
builtin fc -lnr -2147483648 |
|
builtin fc -lnr -2147483648 \
|
||||||
last_hist=$(HISTTIMEFORMAT='' builtin history 1) perl -n -l0 -e "$script" |
|
| last_hist=$(HISTTIMEFORMAT='' builtin history 1) perl -n -l0 -e "$script" \
|
||||||
FZF_DEFAULT_OPTS="$opts" $(__fzfcmd) --query "$READLINE_LINE"
|
| FZF_DEFAULT_OPTS="$opts" $(__fzfcmd) --query "$READLINE_LINE"
|
||||||
) || return
|
) || return
|
||||||
READLINE_LINE=${output#*$'\t'}
|
READLINE_LINE=${output#*$'\t'}
|
||||||
if [[ -z "$READLINE_POINT" ]]; then
|
if [[ -z "$READLINE_POINT" ]]; then
|
||||||
|
|||||||
@@ -52,4 +52,4 @@ keybindings:
|
|||||||
prs: []
|
prs: []
|
||||||
repoPaths: {}
|
repoPaths: {}
|
||||||
pager:
|
pager:
|
||||||
diff: ''
|
diff: ""
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
---
|
---
|
||||||
git_protocol: https
|
git_protocol: https
|
||||||
version: '1'
|
version: "1"
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
---
|
|
||||||
github.com:
|
github.com:
|
||||||
git_protocol: https
|
git_protocol: ssh
|
||||||
users:
|
users:
|
||||||
ivuorinen:
|
ivuorinen:
|
||||||
user: ivuorinen
|
user: ivuorinen
|
||||||
|
|||||||
@@ -1,15 +0,0 @@
|
|||||||
# vim: ft=ghostty
|
|
||||||
theme = "light:tokyonight-day,dark:tokyonight-storm"
|
|
||||||
font-family = "JetBrainsMono Nerd Font Mono"
|
|
||||||
|
|
||||||
background-blur-radius = 15
|
|
||||||
background-opacity = 0.95
|
|
||||||
|
|
||||||
clipboard-read = allow
|
|
||||||
clipboard-write = allow
|
|
||||||
cursor-style = bar
|
|
||||||
custom-shader-animation = true
|
|
||||||
gtk-single-instance = true
|
|
||||||
mouse-hide-while-typing = true
|
|
||||||
shell-integration-features = true
|
|
||||||
window-theme = system
|
|
||||||
@@ -7,6 +7,7 @@
|
|||||||
*-secret
|
*-secret
|
||||||
__secret
|
__secret
|
||||||
__ignored
|
__ignored
|
||||||
|
__ignored/*
|
||||||
__test_*.php
|
__test_*.php
|
||||||
__test_*.txt
|
__test_*.txt
|
||||||
__test.php
|
__test.php
|
||||||
|
|||||||
1
config/git/overrides/.gitignore
vendored
1
config/git/overrides/.gitignore
vendored
@@ -1,2 +1,3 @@
|
|||||||
!.gitkeep
|
!.gitkeep
|
||||||
config
|
config
|
||||||
|
ignore
|
||||||
|
|||||||
@@ -19,8 +19,8 @@
|
|||||||
logs = log --graph --pretty=format:'%C(magenta)%h%Creset -%C(red)%d%Creset %s %C(dim green)(%cr) %C(cyan)<%an>%Creset' --abbrev-commit
|
logs = log --graph --pretty=format:'%C(magenta)%h%Creset -%C(red)%d%Creset %s %C(dim green)(%cr) %C(cyan)<%an>%Creset' --abbrev-commit
|
||||||
nah = !git reset --hard && git clean -df
|
nah = !git reset --hard && git clean -df
|
||||||
recent = "!r() { count=$1; git for-each-ref --sort=-committerdate refs/heads --format='%(HEAD)%(color:yellow)%(refname:short)|%(color:bold green)%(committerdate:relative)|%(color:blue)%(subject)|%(color:magenta)%(authorname)%(color:reset)' --color=always --count=${count:=10} | column -ts'|';}; r"
|
recent = "!r() { count=$1; git for-each-ref --sort=-committerdate refs/heads --format='%(HEAD)%(color:yellow)%(refname:short)|%(color:bold green)%(committerdate:relative)|%(color:blue)%(subject)|%(color:magenta)%(authorname)%(color:reset)' --color=always --count=${count:=10} | column -ts'|';}; r"
|
||||||
reset-origin = !git fetch origin && git reset --hard origin/master && git clean -f -d
|
reset-origin = !git fetch origin && git reset --hard origin/HEAD && git clean -f -d
|
||||||
reset-upstream = !git fetch upstream && git reset --hard upstream/master && git clean -f -d
|
reset-upstream = !git fetch upstream && git reset --hard upstream/HEAD && git clean -f -d
|
||||||
rl = reflog --format='%C(auto)%h %<|(20)%gd %C(blue)%cr%C(reset) %gs (%s)'
|
rl = reflog --format='%C(auto)%h %<|(20)%gd %C(blue)%cr%C(reset) %gs (%s)'
|
||||||
tagdate = log --date-order --graph --tags --simplify-by-decoration --pretty=format:\"%ai %h %d\"
|
tagdate = log --date-order --graph --tags --simplify-by-decoration --pretty=format:\"%ai %h %d\"
|
||||||
undo = reset --soft HEAD^
|
undo = reset --soft HEAD^
|
||||||
|
|||||||
@@ -1,6 +0,0 @@
|
|||||||
# Detect shell
|
|
||||||
if [ -n "$BASH_VERSION" ] || [ -n "$ZSH_VERSION" ]; then
|
|
||||||
export GOENV_PATH_ORDER=front
|
|
||||||
export GOENV_PREPEND_GOPATH=true
|
|
||||||
export GOENV_AUTO_INSTALL=true
|
|
||||||
fi
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
set -gx GOENV_PATH_ORDER front
|
|
||||||
set -gx GOENV_PREPEND_GOPATH true
|
|
||||||
set -gx GOENV_AUTO_INSTALL true
|
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user