Compare commits

..

9 Commits

581 changed files with 19248 additions and 23018 deletions

View File

@@ -1,14 +0,0 @@
---
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).

View File

@@ -1,34 +0,0 @@
{
"hooks": {
"PreToolUse": [
{
"matcher": "Edit|Write",
"hooks": [
{
"type": "command",
"command": "fp=$(cat | jq -r '.tool_input.file_path // empty') && [ -n \"$fp\" ] && case \"$fp\" in */fzf-tmux|*/yarn.lock|*/.yarn/*) echo \"BLOCKED: $fp is a vendor/lock file — do not edit directly\" >&2; exit 2;; esac; exit 0"
}
]
}
],
"PostToolUse": [
{
"matcher": "Edit|Write",
"hooks": [
{
"type": "command",
"command": "fp=$(cat | jq -r '.tool_input.file_path // empty') && [ -n \"$fp\" ] && [ -f \"$fp\" ] && 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\";; esac; exit 0"
},
{
"type": "command",
"command": "fp=$(cat | jq -r '.tool_input.file_path // empty') && [ -n \"$fp\" ] && [ -f \"$fp\" ] && case \"$fp\" in *.fish) command -v fish_indent > /dev/null && fish_indent -w \"$fp\";; esac; exit 0"
},
{
"type": "command",
"command": "fp=$(cat | jq -r '.tool_input.file_path // empty') && [ -n \"$fp\" ] && [ -f \"$fp\" ] && case \"$fp\" in *.lua) command -v stylua > /dev/null && stylua \"$fp\";; esac; exit 0"
}
]
}
]
}
}

View File

@@ -1,38 +0,0 @@
---
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)

View File

@@ -1,22 +0,0 @@
---
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)

View File

@@ -1,44 +0,0 @@
---
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)

View File

@@ -1,38 +0,0 @@
---
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

View File

@@ -1,21 +1,11 @@
{
"Version": "2.7.0",
"Verbose": false,
"Debug": false,
"IgnoreDefaults": false,
"SpacesAfterTabs": false,
"SpacesAftertabs": false,
"NoColor": false,
"Exclude": [
"base/plan",
"config/fish/completions/.*",
"config/fish/conf.d/.*",
"config/fish/functions/.*",
"config/fzf/key-bindings.fish",
"config/irssi/scripts/autorun/.*",
"config/vim/autoload/.*",
"docs/.*",
"local/man/.*",
"local/share/.*"
],
"Exclude": [],
"AllowedContentTypes": [],
"PassedFiles": [],
"Disable": {

View File

@@ -8,27 +8,23 @@ indent_style = space
insert_final_newline = true
trim_trailing_whitespace = true
[*.py]
indent_size = 4
max_line_length = 120
[*.fish]
max_line_length = 120
[*.md]
max_line_length = 120
trim_trailing_whitespace = false
max_line_length = 100
[*.lua]
max_line_length = 90
max_line_length = 120
[*.{php,fish}]
[*.php]
indent_size = 4
[.git{ignore,modules}]
indent_style = tab
indent_size = 1
[*.plist]
indent_size = 1
indent_style = tab
[{local/bin/*,**/*.sh,**/zshrc,config/*,scripts/*}]
indent_size = 2
tab_width = 2
@@ -39,20 +35,9 @@ space_redirects = true
keep_padding = false
function_next_line = true # --func-next-line
[{*.plist,config/git/**,**/config/git/**}]
indent_size = 1
indent_style = tab
# Ignore the entire "third_party" directory when calling shfmt on directories,
# such as "shfmt -l -w .". When formatting files directly,
# like "shfmt -w third_party/foo.sh" or "shfmt --filename=third_party/foo.sh",
# the ignore logic is applied only when the --apply-ignore flag is given.
[{tools/**,local/bin/asdf/**,config/cheat/cheatsheets/**,config/tmux/plugins/**}]
ignore = true
[plan]
trim_trailing_whitespace = false
max_line_length = off
[base/hammerspoon/hammerspoon.types.lua]
max_line_length = off

1
.envrc Normal file
View File

@@ -0,0 +1 @@
use asdf

3
.eslintrc.json Normal file
View File

@@ -0,0 +1,3 @@
{
"extends": ["@ivuorinen"]
}

50
.gitattributes vendored
View File

@@ -1,4 +1,4 @@
## GITATTRIBUTES
## GITATTRIBUTES FOR WEB PROJECTS
#
# These settings are for any web project.
#
@@ -20,23 +20,20 @@
*.bat text eol=crlf
*.cmd text eol=crlf
*.coffee text
*.css text diff=css eol=lf
*.fish text diff=shell eol=lf
*.htm text diff=html eol=lf
*.html text diff=html eol=lf
*.css text diff=css
*.htm text diff=html
*.html text diff=html
*.inc text
*.ini text
*.js text
*.json text
*.jsx text
*.less text
*.lua text diff=lua eol=lf
*.ls text
*.map text -diff
*.od text
*.onlydata text
*.php text diff=php
*.plist text eol=lf
*.pl text
*.ps1 text eol=crlf
*.py text diff=python
@@ -44,18 +41,15 @@
*.sass text
*.scm text
*.scss text diff=css
*.sh text eol=lf diff=shell
*.sh text eol=lf
.husky/* text eol=lf
*.sql text
*.styl text
*.tag text
*.tmux text eol=lf diff=tmux
*.ts text
*.tsx text
*.vim text eol=lf
*.xml text
*.xhtml text diff=html
*.zsh text diff=zsh eol=lf
# Docker
Dockerfile text
@@ -74,7 +68,6 @@ Dockerfile text
AUTHORS text
CHANGELOG text
CHANGES text
CODEOWNERS text
CONTRIBUTING text
COPYING text
copyright text
@@ -85,7 +78,6 @@ LICENSE text
NEWS text
readme text
*README* text
# Files literally named "TODO", not a todo list item
TODO text
# Templates
@@ -113,8 +105,6 @@ TODO text
*.config text
.editorconfig text
.env text
*.env text
*.env.* text
.gitattributes text
.gitconfig text
.htaccess text
@@ -123,8 +113,7 @@ package.json text eol=lf
package-lock.json text eol=lf -diff
pnpm-lock.yaml text eol=lf -diff
.prettierrc text
# Ensure yarn.lock shows textual diffs
yarn.lock text eol=lf
yarn.lock text -diff
*.toml text
*.yaml text
*.yml text
@@ -219,38 +208,15 @@ Procfile text
*.gitignore text
*.gitkeep text
.gitattributes text export-ignore
*.gitattributes text export-ignore
.gitmodules text export-ignore
*.gitmodules text export-ignore
.gitattributes export-ignore
**/.gitignore export-ignore
**/.gitkeep export-ignore
# Repo specials
local/bin/* text eol=lf diff=shell
local/bin/*.md text eol=lf diff=markdown
local/bin/* text eol=lf
config/antigen.zsh text
git/* text
**/git/* text
**/alias text
ssh/* text
ssh/shared.d/* text
ssh/local.d/* text
# Auto-generated rules - 2025-04-16 10:28:04
# Shell scripts detected by content
install text eol=lf diff=shell
# File extension-based rules
*.1 text eol=lf
*.applescript text eol=lf
*.d/work-git text eol=lf
*.dirs text eol=lf
*.example text eol=lf
*.itermcolors text eol=lf
*.locale text eol=lf
*.python-version text eol=lf
*.snippets text eol=lf
*.theme text eol=lf
*.yamlfmt text eol=lf
*.bats text eol=lf diff=shell

View File

@@ -60,7 +60,7 @@ representative at an online or offline event.
Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported to the community leaders responsible for enforcement at
<ismo@ivuorinen.net>.
ismo@ivuorinen.net.
All complaints will be reviewed and investigated promptly and fairly.
All community leaders are obligated to respect the privacy and security of the
@@ -116,7 +116,7 @@ the community.
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
version 2.0, available at
<https://www.contributor-covenant.org/version/2/0/code_of_conduct.html>.
https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
Community Impact Guidelines were inspired by [Mozilla's code of conduct
enforcement ladder](https://github.com/mozilla/diversity).
@@ -124,5 +124,5 @@ enforcement ladder](https://github.com/mozilla/diversity).
[homepage]: https://www.contributor-covenant.org
For answers to common questions about this code of conduct, see the FAQ at
<https://www.contributor-covenant.org/faq>. Translations are available at
<https://www.contributor-covenant.org/translations>.
https://www.contributor-covenant.org/faq. Translations are available at
https://www.contributor-covenant.org/translations.

52
.github/README.md vendored
View File

@@ -37,22 +37,16 @@ see what interesting stuff you've done with it. Sharing is caring.
### Interesting folders
| Path | Description |
|---------------------|----------------------------------------------|
| ------------------- | -------------------------------------------- |
| `.github` | GitHub Repository configuration files, meta. |
| `hosts/{hostname}/` | Configs that should apply to that host only. |
| `local/bin` | Helper scripts that I've collected or wrote. |
| `scripts` | Setup scripts. |
### Host specific configuration
Configurations under `hosts/<hostname>` are applied only when running on the
matching machine. Each host folder contains its own `install.conf.yaml` that
is processed by Dotbot during installation.
### dotfile folders
| Repo | Destination | Description |
|-----------|-------------|---------------------------------------------|
| --------- | ----------- | ------------------------------------------- |
| `base/` | `.*` | `$HOME` level files. |
| `config/` | `.config/` | Configurations for applications. |
| `local/` | `.local/` | XDG Base folder: `bin`, `share` and `state` |
@@ -64,21 +58,6 @@ is processed by Dotbot during installation.
Running `dfm` gives you a list of available commands.
#### Documentation generation
`dfm docs` generates Markdown documentation under the `docs/` directory. The
subcommands are:
```bash
dfm docs alias # regenerate alias table
dfm docs folders # document interesting folders
dfm docs keybindings # update keybinding docs for tmux, nvim and others
dfm docs all # run every docs task
```
The `docs/` folder contains generated cheat sheets, keybindings and other
reference files. New documentation can be added without modifying this README.
## Configuration
The folder structure follows [XDG Base Directory Specification][xdg] where possible.
@@ -86,7 +65,7 @@ The folder structure follows [XDG Base Directory Specification][xdg] where possi
### XDG Variables
| Env | Default | Short description |
|--------------------|----------------------|------------------------------------------------|
| ------------------ | -------------------- | ---------------------------------------------- |
| `$XDG_BIN_HOME` | `$HOME/.local/bin` | Local binaries |
| `$XDG_CONFIG_HOME` | `$HOME/.config` | User-specific configs |
| `$XDG_DATA_HOME` | `$HOME/.local/share` | User-specific data files |
@@ -94,31 +73,6 @@ The folder structure follows [XDG Base Directory Specification][xdg] where possi
Please see [docs/folders.md][docs-folders] for more information.
## Managing submodules
This repository uses Git submodules for external dependencies. After cloning,
run:
```bash
git submodule update --init --recursive
```
To pull submodule updates later use:
```bash
git submodule update --remote --merge
```
The helper script `add-submodules.sh` documents how each submodule is added and
configured. Submodules are automatically updated by the
[update-submodules.yml](.github/workflows/update-submodules.yml) workflow.
## Testing
Shell scripts under `local/bin` are validated with [Bats](https://github.com/bats-core/bats-core).
Run `yarn test` to execute every test file. Bats is installed as a development
dependency, so run `yarn install` first if needed.
[dfm]: https://github.com/ivuorinen/dotfiles/blob/main/local/bin/dfm
[docs-folders]: https://github.com/ivuorinen/dotfiles/blob/main/docs/folders.md
[xdg]: https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html

7
.github/dependabot.yml vendored Normal file
View File

@@ -0,0 +1,7 @@
version: 2
updates:
# Maintain dependencies for GitHub Actions
- package-ecosystem: 'github-actions'
directory: '/'
schedule:
interval: 'weekly'

View File

@@ -16,10 +16,10 @@ module.exports = {
excludeTypes: [],
renderTypeSection: (label, commits) => {
renderTypeSection: function (label, commits) {
let text = `\n## ${label}\n\n`
commits.forEach((commit) => {
commits.forEach(commit => {
const scope = commit.scope ? `**${commit.scope}:** ` : ''
text += `- ${scope}${commit.subject}\n`
})
@@ -27,10 +27,10 @@ module.exports = {
return text
},
renderChangelog: (release, changes) => {
renderChangelog: function (release, changes) {
const now = new Date()
const d = now.toISOString().substring(0, 10)
const header = `# ${release} - ${d}\n`
return `${header}${changes}\n\n`
return header + changes + '\n\n'
},
}

View File

@@ -1,35 +1,19 @@
---
# $schema: "https://json.schemastore.org/github-workflow.json"
name: Debug Changelog # Workflow name displayed on GitHub
on:
workflow_dispatch: # Trigger manually
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
jobs:
debug-changelog:
runs-on: ubuntu-latest
permissions:
contents: read
runs-on: self-hosted
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: actions/checkout@v4
- name: Create changelog text
id: changelog
uses: loopwerk/tag-changelog@8dd150d55fbf1fe93e0ea00a29a6153aaeb81912 # v1.5.0
uses: loopwerk/tag-changelog@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
config_file: .github/tag-changelog-config.js
- name: "Echo results"
- name: 'Echo results'
id: output-changelog
run: |
echo "${{ steps.changelog.outputs.changes }}"

View File

@@ -1,39 +1,40 @@
---
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json
name: Lint Code Base
# yamllint disable-line
on:
pull_request:
branches: [main]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
name: reviewdog
on: [push]
jobs:
Linter:
name: PR Lint
runs-on: ubuntu-latest
timeout-minutes: 15
permissions:
contents: read
issues: write
packages: read
pull-requests: write
statuses: write
linters:
name: Linters
runs-on: self-hosted
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Yarn Lock Changes
uses: Simek/yarn-lock-changes@59f47ee499424d2c2437c5aebf863b5c6d50a5bc # v0.14.1
- uses: actions/checkout@v4
- name: GitHub Actions
uses: reviewdog/action-actionlint@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
- name: Run PR Lint
uses: ivuorinen/actions/pr-lint@7f6a23b59316795c4b3cb3b3b28dd53e53655a33 # v2026.03.11
github_token: ${{ secrets.GITHUB_TOKEN }}
reporter: github-pr-review
- name: detect-secrets
uses: reviewdog/action-detect-secrets@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
reporter: github-pr-review
- name: markdownlint
uses: reviewdog/action-markdownlint@v0
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
reporter: github-pr-review
- name: shfmt
uses: reviewdog/action-shfmt@v1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
shfmt_flags: |
--find
--list
--write
--diff
--simplify
--language-dialect bash
--indent 2
--binary-next-line
--case-indent
--space-redirects
--func-next-line

View File

@@ -1,50 +1,38 @@
---
# $schema: "https://json.schemastore.org/github-workflow.json"
name: Release Daily State
on:
workflow_dispatch:
schedule:
- cron: "0 21 * * *" # 00:00 at Europe/Helsinki
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
- cron: '0 21 * * *' # 00:00 at Europe/Helsinki
jobs:
new-daily-release:
runs-on: ubuntu-latest
runs-on: self-hosted
permissions:
contents: write
outputs:
created: ${{ steps.daily-version.outputs.created }}
version: ${{ steps.daily-version.outputs.version }}
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: actions/checkout@v4
- name: Create tag if necessary
uses: fregante/daily-version-action@fb1a60b7c4daf1410cd755e360ebec3901e58588 # v2.1.3
uses: fregante/daily-version-action@v2
id: daily-version
- name: Create changelog text
if: steps.daily-version.outputs.created
id: changelog
uses: loopwerk/tag-changelog@8dd150d55fbf1fe93e0ea00a29a6153aaeb81912 # v1.5.0
uses: loopwerk/tag-changelog@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
config_file: .github/tag-changelog-config.js
- name: Create release
if: steps.daily-version.outputs.created
uses: softprops/action-gh-release@a06a81a03ee405af7f2048a818ed3f03bbf83c7b # v2.5.0
uses: actions/create-release@latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
token: ${{ secrets.GITHUB_TOKEN }}
tag_name: ${{ steps.daily-version.outputs.version }}
name: Release ${{ steps.daily-version.outputs.version }}
release_name: Release ${{ steps.daily-version.outputs.version }}
body: ${{ steps.changelog.outputs.changes }}

View File

@@ -1,36 +1,21 @@
---
# $schema: "https://json.schemastore.org/github-workflow.json"
name: Pre-commit autoupdate
on:
schedule:
# At 04:00 on Monday and Thursday.
- cron: "0 4 * * 1,4"
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
jobs:
auto-update:
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
- uses: actions/checkout@v4
- uses: actions/setup-python@v5.4.0
- run: pip install pre-commit && pre-commit autoupdate
- uses: peter-evans/create-pull-request@c0f553fe549906ede9cf27b5156039d195d2ece0 # v8.1.0
- uses: peter-evans/create-pull-request@v7
with:
token: ${{ secrets.GITHUB_TOKEN }}
branch: update/pre-commit-hooks

View File

@@ -1,28 +1,18 @@
---
# $schema: "https://json.schemastore.org/github-workflow.json"
name: Semantic PR
# yamllint disable-line
on:
pull_request:
pull_request_target:
types:
- opened
- edited
- synchronize
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions:
pull-requests: read
jobs:
semantic-pr:
runs-on: ubuntu-latest
runs-on: self-hosted
steps:
- uses: amannn/action-semantic-pull-request@48f256284bd46cdaab1048c3721360e808335d50 # v6.1.1
- uses: amannn/action-semantic-pull-request@v5.5.3
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:

View File

@@ -1,5 +1,4 @@
---
# $schema: "https://json.schemastore.org/github-workflow.json"
name: Sync labels
# yamllint disable-line rule:truthy
@@ -15,19 +14,10 @@ on:
workflow_call:
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
jobs:
SyncLabels:
runs-on: ubuntu-latest
permissions:
issues: write
runs-on: ubuntu-latest
steps:
- uses: ivuorinen/actions/sync-labels@7f6a23b59316795c4b3cb3b3b28dd53e53655a33 # v2026.03.11
- uses: ivuorinen/actions/sync-labels@main

View File

@@ -1,53 +1,39 @@
---
# $schema: "https://json.schemastore.org/github-workflow.json"
name: Update submodules
on:
schedule:
# At 04:00 on Monday and Thursday.
- cron: "0 4 * * 1,4"
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
jobs:
update-submodules:
runs-on: ubuntu-latest
permissions:
contents: write
issues: write
pull-requests: write
runs-on: self-hosted
steps:
- name: Checkout repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
uses: actions/checkout@v4
with:
submodules: true
fetch-depth: 2
fetch-depth: 0
token: ${{secrets.GITHUB_TOKEN}}
- name: Config Git User
shell: bash
run: |
git config --global user.name "${{ github.actor }}"
git config --global user.email "${{ github.actor }}@users.noreply.github.com"
- name: Update submodules
shell: bash
run: |
git submodule sync
git submodule foreach --quiet "
tag=\"$(git describe --tags --abbrev=0 origin/HEAD)\"
if [ \"$(git describe --tags)\" != \"$tag\" ]; then
git checkout --quiet \"$tag\"
echo \"$name updated to $tag\"
git submodule foreach --quiet '
tag="$(git describe --tags --abbrev=0 origin/HEAD)"
if [ "$(git describe --tags)" != "$tag" ]; then
git checkout --quiet "$tag"
echo "$name updated to $tag"
fi
"
'
if git diff --quiet; then
echo "No updates for submodules."
else

37
.gitignore vendored
View File

@@ -3,59 +3,36 @@
*.bak
*.log
*.socket
*.swp
*.old
*cache
.env
.idea
.nfs*
.scannerwork
.vscode
.yarn/
!config/git/local.d/.gitkeep
!config/nvim/spell/.gitkeep
!config/zed/settings.json
!ssh/local.d/.gitkeep
**/exports-secret.fish
**/exports.secret.fish
*.tmp.*
Brewfile.lock.json
antidote_plugins.zsh
config/alacritty/theme-active.toml
config/cheat/cheatsheets/pure-bash-bible/*
config/cheat/cheatsheets/tldr/*
config/fish/completions/asdf.fish
config/fish/fish_variables
config/fish/fish_variables.*
config/gh/hosts.yml
config/git/credentials
config/git/local.d/*
config/gnupg/S.*
config/gnupg/private-keys-v1.d
config/gnupg/s
config/iterm2/AppSupport
config/karabiner/automatic_backups
config/npm/npmrc
config/nvim/lazy-lock.json
config/nvim/spell/*
config/op/plugins/gh.json
config/op/plugins/used_items/gh.json
config/vim/.netrwhist
config/vim/extra/*
config/vim/fzf
config/vim/plugged/*
!config/nvim/spell/.gitkeep
config/zed/*
config/zed/settings.json
!config/zed/settings.json
config/zsh/.zcompdump
dependency-check-report.html
iTermServer-*
lazy-lock.json
local/bin/asdf/plugins/*
local/bin/yabai
local/man/yabai.1
local/share/fonts/*
local/bin/asdf/plugins/*
lock
node_modules
__pycache__
ssh/local.d/*
config/fish/fish_variables*
!ssh/local.d/.gitkeep
config/fish/fish_variables
**/exports-secret.fish
config/fish/completions/asdf.fish

43
.gitmodules vendored
View File

@@ -4,6 +4,11 @@
url = https://github.com/anishathalye/dotbot.git
ignore = dirty
[submodule "dotbot-brew"]
path = tools/dotbot-brew
url = https://github.com/wren/dotbot-brew.git
ignore = dirty
[submodule "dotbot-include"]
path = tools/dotbot-include
url = https://gitlab.com/gnfzdz/dotbot-include.git
@@ -19,16 +24,41 @@
url = https://github.com/tmux-plugins/tmux-continuum
ignore = dirty
[submodule "tmux/tmux-sensible"]
path = config/tmux/plugins/tmux-sensible
url = https://github.com/tmux-plugins/tmux-sensible.git
ignore = dirty
[submodule "tmux/tmux-sessionist"]
path = config/tmux/plugins/tmux-sessionist
url = https://github.com/tmux-plugins/tmux-sessionist.git
ignore = dirty
[submodule "tmux/tmux-yank"]
path = config/tmux/plugins/tmux-yank
url = https://github.com/tmux-plugins/tmux-yank.git
ignore = dirty
[submodule "tmux/tmux-window-name"]
path = config/tmux/plugins/tmux-window-name
url = https://github.com/ivuorinen/tmux-window-name.git
ignore = dirty
[submodule "dotbot-pip"]
path = tools/dotbot-pip
url = https://github.com/sobolevn/dotbot-pip.git
ignore = dirty
[submodule "tmux/tmux-suspend"]
path = config/tmux/plugins/tmux-suspend
url = https://github.com/MunifTanjim/tmux-suspend.git
ignore = dirty
[submodule "tmux/tmux-mode-indicator"]
path = config/tmux/plugins/tmux-mode-indicator
url = https://github.com/MunifTanjim/tmux-mode-indicator.git
ignore = dirty
[submodule "tmux/tmux-current-pane-hostname"]
path = config/tmux/plugins/tmux-current-pane-hostname
url = https://github.com/soyuka/tmux-current-pane-hostname.git
@@ -41,7 +71,7 @@
[submodule "tmux/tmux-dark-notify"]
path = config/tmux/plugins/tmux-dark-notify
url = https://github.com/ivuorinen/tmux-dark-notify.git
url = https://github.com/erikw/tmux-dark-notify.git
ignore = dirty
[submodule "antidote"]
@@ -50,11 +80,6 @@
shallow = true
ignore = dirty
[submodule "tmux/tmux-resurrect"]
path = config/tmux/plugins/tmux-resurrect
url = https://github.com/tmux-plugins/tmux-resurrect.git
ignore = dirty
[submodule "tmux/catppuccin"]
path = config/tmux/plugins/catppuccin
url = https://github.com/catppuccin/tmux.git
ignore = dirty
[submodule "dotbot-asdf"]
path = tools/dotbot-asdf
url = https://github.com/sobolevn/dotbot-asdf

View File

@@ -1 +0,0 @@
1.25.5

View File

@@ -1,10 +1,10 @@
**/__pycache__/**
*.pyc
.git/**
config/cheat/cheatsheets/community/**
config/tmux/plugins/**
config/vim/plugged/**
node_modules
tools/antidote/**
tools/dotbot-brew/**
tools/dotbot-include/**
tools/dotbot/**
*.pyc

View File

@@ -1,3 +1,5 @@
{
"diagnostics.globals": ["vim"]
"diagnostics.globals": [
"vim"
]
}

20
.markdownlint.json Normal file
View File

@@ -0,0 +1,20 @@
{
"extends": "@ivuorinen/markdownlint-config",
"code-block-style": {
"style": "fenced"
},
"code-fence-style": {
"style": "backtick"
},
"heading-style": {
"style": "atx"
},
"no-duplicate-heading": {
"siblings_only": true
},
"required-headings": false,
"ol-prefix": false,
"ul-style": {
"style": "dash"
}
}

View File

@@ -1,10 +1,8 @@
# only care about files that are directly under our control
.git/*
config/cheat/cheatsheets/community/*
config/cheat/cheatsheets/tldr/*
config/op/plugins/used_plugins/*
config/tmux/plugins/*
config/vim/*
local/bin/asdf/*
node_modules/*
tools/*
node_modules/*

View File

@@ -1,29 +0,0 @@
---
# Configuration file for MegaLinter
# See all available variables at
# https://megalinter.io/configuration/ and in linters documentation
APPLY_FIXES: all
SHOW_ELAPSED_TIME: false # Show elapsed time at the end of MegaLinter run
PARALLEL: true
VALIDATE_ALL_CODEBASE: true
FILEIO_REPORTER: false # Generate file.io report
GITHUB_STATUS_REPORTER: true # Generate GitHub status report
IGNORE_GENERATED_FILES: true # Ignore generated files
PRINT_ALPACA: false # Print Alpaca logo in console
SARIF_REPORTER: true # Generate SARIF report
SHOW_SKIPPED_LINTERS: false # Show skipped linters in MegaLinter log
DISABLE_LINTERS:
- REPOSITORY_DEVSKIM
- JAVASCRIPT_ES # 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
REPOSITORY_GIT_DIFF_DISABLE_ERRORS: true
BASH_SHFMT_ARGUMENTS: -i 2 -bn -ci -sr -fn
FILTER_REGEX_EXCLUDE: >
(node_modules|tools|config/cheat/cheatsheets/community|config/cheat/cheatsheets/tldr|config/fzf|config/zsh|config/tmux/plugins)

2
.nvmrc
View File

@@ -1 +1 @@
24.14.0
22.14.0

View File

@@ -1,7 +1,6 @@
---
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v6.0.0
rev: v5.0.0
hooks:
- id: requirements-txt-fixer
- id: detect-aws-credentials
@@ -20,64 +19,41 @@ repos:
- id: end-of-file-fixer
- id: mixed-line-ending
args: [--fix=auto]
- id: pretty-format-json
args: [--autofix, --no-sort-keys]
- repo: local
- repo: https://github.com/igorshubovych/markdownlint-cli
rev: v0.44.0
hooks:
- id: biome-check
name: Biome Check
entry: yarn biome check --write --files-ignore-unknown=true --no-errors-on-unmatched
language: system
files: \.(js|ts|jsx|tsx|json|md)$
- id: markdown-table-formatter
name: Markdown Table Formatter
entry: yarn markdown-table-formatter
language: system
types: [markdown]
- id: markdownlint
args: [-c, .markdownlint.json, --fix]
- repo: https://github.com/adrienverge/yamllint
rev: v1.38.0
rev: v1.35.1
hooks:
- 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
rev: v0.11.0.1
- repo: https://github.com/koalaman/shellcheck-precommit
rev: v0.10.0
hooks:
- id: shellcheck
- repo: https://github.com/scop/pre-commit-shfmt
rev: v3.12.0-2
rev: v3.10.0-2
hooks:
- id: shfmt
args: [-i, "2", -bn, -ci, -sr, -fn, -w]
- repo: https://github.com/rhysd/actionlint
rev: v1.7.11
rev: v1.7.7
hooks:
- id: actionlint
- repo: https://github.com/renovatebot/pre-commit-hooks
rev: 39.178.1
hooks:
- id: renovate-config-validator
- repo: https://github.com/JohnnyMorganz/StyLua
rev: v2.4.0
rev: v2.0.2
hooks:
- id: stylua # or stylua-system / stylua-github
exclude: hammerspoon\.types\.lua$
- repo: https://github.com/hugoh/pre-commit-fish.git
rev: v1.2
hooks:
- id: fish_syntax
- id: fish_indent
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.15.6
hooks:
- id: ruff-check
args: [--fix]
- id: ruff-format

View File

@@ -1,18 +1,14 @@
node_modules
.yarn
.pnp.*
.mypy_cache
# vim: ft=gitignore
.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
config/fzf/*
config/nvim/*
config/tmux/plugins/*
config/zsh/*
lazy-lock.json
local/bin/antigen.zsh
local/bin/asdf
tools
config/gh/hosts.yml
tools/antidote/*
tools/dotbot*

14
.prettierrc.js Normal file
View File

@@ -0,0 +1,14 @@
module.exports = {
...require('@ivuorinen/prettier-config'),
trailingComma: 'all',
// Add custom options below:
overrides: [
{
files: '*.md',
options: {
printWidth: 120,
proseWrap: 'preserve',
},
},
],
}

View File

@@ -1,9 +0,0 @@
{
"$schema": "https://json.schemastore.org/prettierrc",
"printWidth": 200,
"tabWidth": 2,
"useTabs": false,
"endOfLine": "lf",
"singleQuote": false,
"proseWrap": "preserve"
}

View File

@@ -1 +1 @@
3.14.3
3.13.2

1
.serena/.gitignore vendored
View File

@@ -1 +0,0 @@
/cache

View File

@@ -1,67 +0,0 @@
# Areas for Improvement
## Code Quality Enhancements
### 1. Configuration Management
- **Inconsistent indentation**: Mixed tabs/spaces across config files
- **Line length management**: Need consistent enforcement of limits
- **Template standardization**: Memory files need consistent formatting template
### 2. Linting Configuration Improvements
- **Shellcheck exclusions**: Add proper ignore patterns for submodules
- **EditorConfig refinement**: Some rules too strict for generated/third-party content
- **Prettier ignore patterns**: Better exclusion of binary/generated files
### 3. Testing Infrastructure
- **Bats test errors**: Tests failing due to missing `rm` command in PATH
- **Test coverage**: Limited test coverage for shell functions
- **CI/CD integration**: Need automated linting in GitHub Actions
### 4. Documentation Gaps
- **Onboarding docs**: Missing clear setup instructions for new contributors
- **Troubleshooting guide**: Need common error resolution steps
- **Architecture overview**: Missing high-level system architecture
## Performance & Maintenance
### 5. Submodule Management
- **Large submodules**: Some submodules contain unnecessary files
- **Update frequency**: Need systematic submodule update process
- **Dependency tracking**: Better documentation of submodule purposes
### 6. Cross-Platform Considerations
- **Darwin-specific paths**: Some hardcoded macOS paths could be parameterized
- **Shell compatibility**: More testing across bash/zsh/fish environments
- **Tool availability**: Better fallbacks when optional tools missing
### 7. Security & Privacy
- **Secret management**: Better examples for secret configuration
- **Permission handling**: Some scripts could use more restrictive permissions
- **Audit trail**: Track configuration changes and their impact
## Development Workflow
### 8. Automation Opportunities
- **Auto-formatting**: Pre-commit hooks for consistent formatting
- **Dependency updates**: Automated updates for package.json dependencies
- **Health checks**: Scripts to validate configuration integrity
### 9. Error Handling
- **Graceful degradation**: Better fallbacks when tools unavailable
- **Error messages**: More informative error output
- **Recovery procedures**: Automated recovery from common failures
### 10. Modularity
- **Configuration splitting**: Some large config files could be modularized
- **Feature flags**: Optional components for minimal installations
- **Host-specific configs**: Better organization of machine-specific settings

View File

@@ -1,50 +0,0 @@
# Code Style and Conventions
## EditorConfig Rules (.editorconfig)
- **Charset**: UTF-8
- **Line endings**: LF
- **Indent style**: Spaces (except for specific files)
- **Indent size**: 2 spaces (default)
- **Final newline**: Required
- **Trailing whitespace**: Trimmed
### Language-specific Rules
- **Fish scripts**: 4-space indent, 80 char line limit
- **PHP files**: 4-space indent
- **Markdown**: 120 char line limit
- **Lua**: 90 char line limit
- **Git files**: Tab indentation
- **Shell scripts**: 2-space indent with specific shfmt settings
## Prettier Configuration
- Extends `@ivuorinen/prettier-config`
- **Trailing commas**: Always
- **Markdown**: 120 char width, preserve prose wrapping
## ESLint Configuration
- Extends `@ivuorinen` base configuration
- Applied to JavaScript/TypeScript files
## Shell Script Standards (.shellcheckrc)
- External sources following enabled
- Disabled checks: SC2039, SC2166, SC2154, SC1091, SC2174, SC2016
- Must include shebang or `# shellcheck shell=bash`
## Formatting Tools
- **Shell scripts**: shfmt with specific rules
- **Markdown**: markdownlint + prettier
- **JavaScript/TypeScript**: prettier + eslint
- **YAML**: yamllint
## Naming Conventions
- **Shell functions**: Use `x-` prefix for cross-shell compatibility
- **Environment variables**: UPPERCASE with underscores
- **File names**: lowercase with hyphens for scripts
- **Directory structure**: lowercase, organized by tool/purpose

View File

@@ -1,80 +0,0 @@
# Critical Linting Errors That Must Be Fixed
## Current Status: BLOCKING Issues Identified
The linting system has revealed 150+ violations across multiple categories that must be addressed immediately.
## EditorConfig Violations (High Priority)
### Missing Final Newlines
- All `.serena/memories/*.md` files missing final newlines
- Multiple project configuration files affected
- This is a BLOCKING issue per user instructions
### Line Length Violations
- Fish shell configs exceed 80-character limit (`.editorconfig` enforced)
- Memory files have lines exceeding 120-character limit
- WezTerm configuration files have long lines
### Indentation Errors
- Git configuration using tabs instead of spaces
- WezTerm color scheme files using tabs vs spaces
- Perl scripts with inconsistent indentation
## Markdownlint Issues (Memory Files)
### Systematic Problems Across All Memory Files
- Missing blank lines around headings (MD022)
- Lists not surrounded by blank lines (MD032)
- Fenced code blocks not surrounded by blank lines (MD031)
- Trailing punctuation in headings (MD026)
- Missing language specification for fenced code blocks (MD040)
- Missing final newlines (MD047)
### Specific Files Affected
- `areas_for_improvement.md`: 20+ violations
- `code_style_conventions.md`: 15+ violations
- `critical_linting_errors.md`: 25+ violations
- `darwin_system_utilities.md`: 15+ violations
- `immediate_action_items.md`: 25+ violations
- `project_overview.md`: 15+ violations
- `project_structure.md`: 20+ violations
- `shellcheck_issues.md`: 15+ violations
- `suggested_commands.md`: 25+ violations
- `task_completion_checklist.md`: 10+ violations
## Prettier Formatting Issues
### JSON Configuration Files
- `.commitlintrc.json`, `.eslintrc.json`, `.luarc.json`
- `.releaserc.json`, `.github/renovate.json`
- Host-specific configurations in `config/` directory
### YAML Files
- `.mega-linter.yml` formatting inconsistencies
- Various configuration files needing formatting
## Immediate Action Required
1. **Fix memory files**: Apply markdown formatting rules
2. **Run auto-fixers**: `yarn fix` to address automatic fixes
3. **Manual corrections**: Address remaining EditorConfig violations
4. **Validation**: Ensure `yarn lint` passes completely
## Impact Assessment
These violations prevent:
- Successful CI/CD pipeline execution
- Code quality standards compliance
- Pre-commit hook success
- Project maintainability standards
Per user instructions: "Linting issues ARE NOT ACCEPTABLE" and "EditorConfig problems are blocking errors"

View File

@@ -1,66 +0,0 @@
# Darwin (macOS) System Utilities
## Available Command Paths
Based on the current system setup:
### Core System Commands
- `git`: `/opt/homebrew/bin/git` (Homebrew version)
- `find`: `/usr/bin/find` (system version)
- `cd`: shell built-in command
- `ls`: aliased to `eza -h -s=type --git --icons --group-directories-first`
- `grep`: aliased to `grep --color`
### Modern Alternatives (Rust-based)
- `fd`: `/Users/ivuorinen/.local/share/cargo/bin/fd` (modern find)
- `rg`: `/Users/ivuorinen/.local/share/cargo/bin/rg` (ripgrep for text search)
## Recommended Usage Patterns
### File Search
```bash
# Use fd instead of find when possible
fd "*.sh" # Find shell scripts
fd -t f -e lua # Find Lua files
find . -name "*.sh" # Fallback to system find
```
### Text Search
```bash
# Use rg (ripgrep) instead of grep when possible
rg "function.*bash" # Search for bash functions
rg -t shell "export" # Search in shell files only
grep "pattern" file.txt # Fallback to system grep
```
### Directory Navigation
```bash
# Use eza features via ls alias
ls # Shows icons, git status, grouped directories
ls -la # Long format with hidden files
cd /full/path # Always use full paths in scripts
```
## Path Configuration
The system is configured with these PATH priorities:
1. `~/.local/bin` (user scripts)
2. `~/.dotfiles/local/bin` (dotfiles scripts)
3. `~/.local/share/bob/nvim-bin` (Neovim)
4. `~/.local/share/cargo/bin` (Rust tools like fd, rg)
5. `/opt/homebrew/bin` (Homebrew packages)
6. `/usr/local/bin` (system packages)
## Shell Compatibility
The dotfiles support multiple shells through `config/shared.sh`:
- Functions prefixed with `x-` work across bash, zsh, and fish
- Path management handled automatically per shell
- Environment variables set appropriately per shell

View File

@@ -1,114 +0,0 @@
# Immediate Action Items - Priority Order
## HIGH PRIORITY (Must Fix Before Any Development)
### 1. Fix Memory File Formatting (BLOCKING)
```bash
# These files prevent any linting from passing:
- .serena/memories/code_style_conventions.md
- .serena/memories/darwin_system_utilities.md
- .serena/memories/project_overview.md
- .serena/memories/project_structure.md
- .serena/memories/suggested_commands.md
- .serena/memories/task_completion_checklist.md
# Issues: Missing final newlines, markdown formatting, line length
# Impact: Blocks all linting commands
```
### 2. Fix Fish Shell Line Length Violations (BLOCKING)
```bash
# Files exceeding 80-char limit:
config/fish/alias.fish (4 violations)
config/fish/exports.fish (15 violations)
# These are CRITICAL - Fish config has strict limits
# Must be fixed before any fish-related changes
```
### 3. Fix Git Configuration Indentation (BLOCKING)
```bash
# Files with tab/space mixing:
config/git/shared (40+ violations)
hosts/s/config/git/overrides/config
hosts/s/config/git/local.d/work-git
# Impact: Git configuration may not work correctly
```
## MEDIUM PRIORITY (Fix During Next Development Cycle)
### 4. Prettier Formatting Issues
```bash
# 17 files need prettier formatting:
yarn fix:prettier
# Most are JSON/YAML configuration files
```
### 5. WezTerm Color Scheme Indentation
```bash
# All files in config/wezterm/colors/ using tabs instead of spaces
# Affects terminal appearance configuration
```
### 6. Update Linting Configuration
```bash
# Add shellcheck exclusions for submodules:
# - tools/antidote/
# - config/tmux/plugins/
# - config/vim/extra/fzf/
# - config/cheat/cheatsheets/tldr/
```
## LOW PRIORITY (Future Improvements)
### 7. Test Infrastructure
```bash
# Fix bats test PATH issues
# Tests pass but show rm command not found errors
```
### 8. Documentation Updates
```bash
# Add troubleshooting section to AGENTS.md
# Create shellcheck exclusion documentation
```
## Immediate Commands to Run
### Step 1: Auto-fix What's Possible
```bash
yarn fix:prettier # Fix 17 files
yarn fix:markdown # Attempt markdown fixes
```
### Step 2: Manual Fixes Required
- Add final newlines to all memory files
- Wrap long lines in Fish configuration files
- Convert tabs to spaces in Git configuration files
### Step 3: Verify Progress
```bash
yarn lint:ec # Check EditorConfig compliance
yarn lint:markdown # Check markdown issues
yarn lint:prettier # Check remaining prettier issues
```
## Success Criteria
`yarn lint` passes without errors
✅ All EditorConfig violations resolved
✅ Memory files properly formatted
✅ Fish configuration under line limits
✅ Git configuration uses consistent indentation

View File

@@ -1,61 +0,0 @@
# .dotfiles Project Overview
## Purpose
This is a comprehensive personal dotfiles repository for managing development
environment configurations across macOS systems. The project uses **Dotbot** as
the primary installation framework to manage symlinks and setup configurations.
## Key Features
- Automated configuration management using Dotbot
- Support for multiple development tools and applications
- Host-specific configurations in `/hosts/` directory
- Comprehensive testing and linting setup with pre-commit hooks
- Cross-shell compatibility (bash, zsh, fish)
- Large collection of custom utility scripts in `local/bin/`
- Git submodules for external tools (dotbot, antidote, tmux plugins)
- Environment-specific configurations (secrets management)
## Recent Notable Changes (from git status)
- New everforest color theme configurations added
- Multiple temporary fish configuration files present
- Updates to various configuration files (.commitlintrc.json, .eslintrc.json, etc.)
- New x-pr-comments script and documentation added
- Various tmux plugin updates
- Husky configuration relocated from base/ to config/husky/
## Tech Stack
- **Shell**: Bash (primary), with Fish and Zsh support
- **Configuration Manager**: Dotbot with plugins (asdf, brew, include, pip)
- **Package Manager**: Yarn 1.22.22 (Node.js), Homebrew (macOS), pipx (Python)
- **Testing**: Bats test framework, custom test-all.sh script
- **Linting**: MegaLinter, Prettier, ESLint, Markdownlint, ShellCheck, EditorConfig
- **Automation**: Pre-commit hooks, GitHub Actions, Renovate
## Project Structure Highlights
- `/config/` - Main configuration directory (74+ subdirectories)
- `/local/bin/` - Custom utility scripts (100+ scripts with documentation)
- `/hosts/` - Host-specific configurations
- `/tools/` - Git submodules for external tools
- `/base/` - Base configuration files
- `/secrets/` - Secret management configurations
- `/scripts/` - Installation and setup scripts
- `/.github/` - GitHub Actions workflows and configurations
## Target System
- **Platform**: Darwin (macOS) - Version 24.6.0
- **Architecture**: Universal (Intel/Apple Silicon via Homebrew)
- **Dependencies**: Git, Homebrew, Yarn, various CLI tools managed via asdf/aqua
## Development Environment
- Node.js managed via nvm/asdf
- Go version specified (.go-version)
- Python version specified (.python-version)
- Package management via Yarn with lockfile
- TypeScript support for configuration files

View File

@@ -1,116 +0,0 @@
# Project Structure
## Root Directory
```text
.dotfiles/
├── install # Main installation script (Dotbot runner)
├── install.conf.yaml # Dotbot configuration
├── package.json # Node.js dependencies for linting/testing (Yarn managed)
├── AGENTS.md # Project documentation and guidelines
├── test-all.sh # Bats test runner
├── add-submodules.sh # Git submodule management
└── .serena/ # Claude Code/Serena analysis cache (new)
```
## Main Directories
### `config/` (74+ subdirectories)
Configuration files for development tools and applications:
- `git/` - Git configuration with delta integration and everforest theme
- `nvim/` - Neovim configuration with Lua plugins
- `tmux/` - Tmux configuration with multiple plugins (dark-notify, window-name, etc.)
- `fish/` - Fish shell configuration with completions and functions
- `zsh/` - Zsh configuration with antidote plugin manager
- `fzf/` - Fuzzy finder configuration with everforest theme
- `wezterm/` - WezTerm terminal configuration
- `homebrew/` - Homebrew environment configuration
- `starship.toml` - Starship prompt configuration
- `shared.sh` - Cross-shell compatibility functions
- `aerospace/`, `amethyst/`, `yabai/`, `skhd/` - Window managers
- `direnv/`, `asdf/`, `aqua/` - Development environment tools
- `gpg-tui/`, `op/`, `gh/` - Security and CLI tools
- Theme configurations: everforest color schemes across multiple tools
### `base/`
Dotfiles that get symlinked to home directory with `.` prefix:
- Contains traditional dotfiles like `.bashrc`, `.zshrc`, etc.
- `plan` - Planning/note-taking configuration
- `shellcheckrc` - ShellCheck rules
### `local/`
- `bin/` - 100+ custom scripts with comprehensive documentation
- Homegrown utilities (dfm, git tools, backup scripts, etc.)
- Sourced utilities (from skx/sysadmin-util, mvdan/dotfiles)
- Each script has corresponding .md documentation
- Recent additions: x-pr-comments for GitHub PR analysis
- `share/fonts/` - JetBrains Mono font files
- `man/` - Manual pages
### `ssh/`
SSH configuration files (mode 0600/0700)
- `shared.d/` - Shared SSH configurations for specific hosts
### `tools/` (Git submodules)
External tools and Dotbot plugins:
- `dotbot/` - Dotbot installation framework
- `dotbot-*` - Dotbot plugins (asdf, brew, include, pip)
- `antidote/` - Zsh plugin manager
- Various tmux plugins (continuum, resurrect, yank, etc.)
### `hosts/`
Host-specific configurations:
- `air/`, `s/`, `v/` - Individual host configurations
- Applied after main configuration
### `secrets/`
Secret and credential management configuration
### `scripts/`
Installation and setup automation scripts
### `.github/`
- GitHub Actions workflows
- Renovate configuration
- Issue templates and documentation
### Development Configuration Files
- `.editorconfig` - Editor configuration rules
- `.prettierrc.js` - Prettier formatting rules
- `.eslintrc.json` - ESLint linting rules
- `.commitlintrc.json` - Commit message linting
- `.shellcheckrc` - ShellCheck configuration
- `.mega-linter.yml` - MegaLinter configuration
- `.luarc.json` - Lua language server configuration
- `.nvmrc`, `.go-version`, `.python-version` - Version management
- Various ignore files (.gitignore, .prettierignore, .yamlignore, etc.)
## Testing Infrastructure
- `tests/` - Bats test files
- `test-all.sh` - Main test runner
- Pre-commit hooks for automated testing
- GitHub Actions for CI/CD
## Recent Structural Changes
- Husky configuration moved from `base/huskyrc` to `config/husky/init.sh`
- Addition of everforest theme configurations across multiple tools
- New .serena directory for AI analysis caching
- Multiple temporary fish configuration files (everforest themes)
- Enhanced git configuration with delta and everforest theming

View File

@@ -1,62 +0,0 @@
# ShellCheck Issues Analysis
## Critical Shell Script Problems
### Missing Shebangs (SC2148)
Multiple shell scripts missing proper shebang lines:
- `tools/antidote/tests/` - Test scripts
- `config/vim/*/test/lib/common.sh` - FZF test libraries
- `config/tmux/plugins/*/scripts/helpers.sh` - Plugin helper scripts
- Various submodule scripts
### Syntax Errors (SC1036, SC1088, SC1073)
- `config/vim/fzf/test/lib/common.sh` - Invalid ERB template syntax
- `config/cheat/cheatsheets/tldr/` - Markdown files incorrectly parsed as shell
- `tmux-sessionist/scripts/list_sessions.sh` - Brace parsing errors
### Variable Assignment Issues (SC1007, SC2155)
- `config/vim/extra/fzf/test/lib/common.sh` - Incorrect empty variable assignments
- Multiple tmux plugin scripts - Declare and assign should be separate
### Quoting Problems (SC2086, SC2006)
- Unquoted variable expansions in tmux plugin scripts
- Legacy backtick usage instead of $(...) syntax
- Missing quotes around variable expansions
## Third-Party Code Issues
### Submodule Problems
Most shellcheck errors are in **third-party submodules**:
- `tools/antidote/` - Zsh plugin manager
- `config/tmux/plugins/` - Tmux plugins
- `config/vim/extra/fzf/` - FZF integration
- `config/cheat/cheatsheets/tldr/` - Cheat sheet collection
### Recommendation
- These should be **excluded from shellcheck** via configuration
- Focus linting only on **project-owned scripts**
- Add shellcheck ignore patterns for submodule directories
## Project-Owned Script Issues
### Main Scripts Status
- `install` - ✅ Clean (no shellcheck errors)
- `test-all.sh` - ✅ Clean
- `add-submodules.sh` - ✅ Clean
- `config/shared.sh` - ✅ Clean
- Scripts in `local/bin/` - ✅ Mostly clean
### Minor Issues Found
- Some scripts could benefit from stricter quoting
- Consistent shebang usage across all scripts
- Consider adding `set -euo pipefail` to more scripts

View File

@@ -1,121 +0,0 @@
# Essential Commands for .dotfiles Development
## Installation & Setup
```bash
# Initial setup - install linting tools and dependencies
yarn install
# Install/update all dotfiles configurations
./install
# Update git submodules (multiple approaches)
git submodule update --remote --merge
git submodule update --init --recursive --force
bash add-submodules.sh
```
## Development Commands
```bash
# Linting (run all linters - ALWAYS fix all issues)
yarn lint
# Individual linting commands
yarn lint:markdown # Markdownlint
yarn lint:prettier # Prettier check
yarn lint:ec # EditorConfig checker
# Auto-fixing (use these BEFORE manual linting)
yarn fix # Fix all format issues
yarn fix:markdown # Fix markdown formatting
yarn fix:prettier # Fix prettier formatting
# Testing
yarn test # Run all Bats tests
bash test-all.sh # Alternative test runner
```
## Pre-commit Hooks (Comprehensive)
Current pre-commit configuration includes:
- **Security**: detect-aws-credentials, detect-private-key
- **File integrity**: check-case-conflict, check-merge-conflict, check-symlinks
- **Shell scripts**: shellcheck, shfmt (formatting)
- **YAML/JSON**: yamllint, check-yaml, check-toml, pretty-format-json
- **Markdown**: markdownlint with auto-fix
- **Lua**: stylua formatting for Neovim configs
- **Fish**: fish_syntax, fish_indent for shell configs
- **GitHub Actions**: actionlint validation
- **Renovate**: renovate-config-validator
- **General**: trailing-whitespace, end-of-file-fixer, mixed-line-ending
```bash
# Run pre-commit manually
pre-commit run --all-files
```
## Version Management
```bash
# Check current versions
node --version # Managed by nvm (.nvmrc: v20.18.1)
go version # Managed by asdf (.go-version)
python --version # Managed by asdf (.python-version)
```
## System Utilities (Darwin-specific)
```bash
# Modern CLI tools available
ls # aliased to eza with icons and git info
grep # aliased to grep --color
fd pattern # modern find alternative
rg pattern # ripgrep for text search
bat file # modern cat with syntax highlighting
```
## Project-specific Scripts (100+ available)
```bash
# Dotfiles management
bash local/bin/dfm install all
# Git utilities
git-dirty # Check for dirty git repositories
git-fsck-dirs # Run fsck on git directories
git-update-dirs # Update multiple git directories
# Development utilities
x-pr-comments <pr> # Analyze GitHub PR comments (NEW)
x-set-php-aliases # Generate PHP version aliases
x-env-list # List environment variables
x-open-ports # Check open network ports
# Backup utilities
x-backup-folder # Backup directories
x-backup-mysql-with-prefix # MySQL backup with prefix
```
## Configuration Management
```bash
# Load shell configurations
source config/shared.sh # Cross-shell compatibility functions
source x-set-php-aliases # PHP version management
# Host-specific configurations
# Automatically applied: hosts/{hostname}/
```
## Quality Assurance (CRITICAL)
**All linting errors are BLOCKING and must be fixed:**
- EditorConfig violations are considered blocking errors
- ShellCheck warnings must be addressed
- Prettier formatting must be consistent
- Markdownlint rules must be followed
- NEVER use --no-verify with git operations
- ALWAYS run autofixers before manual intervention

View File

@@ -1,115 +0,0 @@
# Task Completion Checklist
When completing any development task in this dotfiles repository, follow this
checklist to ensure compliance with project standards.
## Required Steps (BLOCKING)
### 1. Code Quality Checks
```bash
# Run all linting tools - MUST PASS with zero errors
yarn lint
# Individual checks if needed:
yarn lint:markdown # Markdownlint validation
yarn lint:prettier # Prettier formatting check
yarn lint:ec # EditorConfig compliance verification
```
### 2. Shell Script Validation (if applicable)
```bash
# All shell scripts must pass shellcheck without warnings
find . -path ./node_modules -prune -o -name '*.sh' -print0 | xargs -0 shellcheck
# For individual scripts:
shellcheck path/to/script.sh
```
### 3. Testing Infrastructure
```bash
# Run all tests - MUST PASS completely
yarn test
# OR alternative runner
bash test-all.sh
# For specific test categories:
# Bats tests in tests/ directory
# Individual script functionality tests
```
### 4. EditorConfig Compliance (CRITICAL)
- **BLOCKING REQUIREMENT**: EditorConfig violations prevent completion
- All code must follow `.editorconfig` rules exactly:
- UTF-8 charset
- LF line endings
- Final newline required
- Trailing whitespace removal
- Language-specific indentation (2-space default, 4-space for Fish)
- Use autofixers before attempting manual fixes
- Never modify linting configuration to bypass errors
## Auto-fixing Protocol
```bash
# ALWAYS run auto-fixers first, in this order:
yarn fix # Fix all auto-fixable issues
yarn fix:markdown # Fix markdown formatting violations
yarn fix:prettier # Fix code formatting issues
# Verify fixes applied correctly:
yarn lint # Should show reduced error count
```
## Pre-commit Hook Integration
Current pre-commit configuration enforces:
- Security checks (credentials, private keys)
- Shell script validation (shellcheck, shfmt)
- Markdown formatting (markdownlint with auto-fix)
- YAML/JSON validation and formatting
- Lua formatting (stylua for Neovim configs)
- Fish shell syntax validation
- GitHub Actions validation (actionlint)
- Renovate configuration validation
## Memory File Maintenance
When updating memory files:
1. Follow markdown best practices (blank lines around headings/lists)
2. Specify language for fenced code blocks
3. Ensure final newline exists
4. Respect line length limits (120 chars for markdown)
5. Use proper heading hierarchy
## Critical Success Criteria
✅ **REQUIRED FOR TASK COMPLETION:**
- `yarn lint` exits with code 0 (no errors)
- `yarn test` passes all test suites
- EditorConfig compliance verified
- No trailing whitespace or missing final newlines
- Shell scripts have proper shebangs and pass shellcheck
- All temporary/cache files cleaned up
❌ **BLOCKING ISSUES:**
- Any linting errors or warnings
- EditorConfig violations of any kind
- Test failures or incomplete test coverage
- Use of `--no-verify` flag with git operations
- Modified linting configurations to bypass errors
## Quality Assurance Notes
- **Use `which command`** to get full paths in scripts
- **Prefer modern tools**: `rg` over `grep`, `fd` over `find`, `bat` over `cat`
- **Test cross-shell compatibility**: bash, zsh, fish
- **Validate host-specific configurations** don't break general setup
- **Document any new utilities** in `local/bin/README.md`

View File

@@ -1,90 +0,0 @@
# 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
# Added on 2025-04-07
ignore_all_files_in_gitignore: true
# list of additional paths to ignore
# same syntax as gitignore, so you can use * and **
# Was previously called `ignored_dirs`, please update your config if you are using that.
# Added (renamed) on 2025-04-07
ignored_paths:
- "*.swp"
- "*.tmp"
- "*.tmp.*"
- ".DS_Store"
- ".git/**"
- /config/cheat/cheatsheets/community/**
- /config/cheat/cheatsheets/pure-bash-bible/**
- /config/cheat/cheatsheets/tldr/**
- /config/fish/cheatsheets/community/**
- /config/fzf/**
- /config/nvim/snippets/**
- /config/nvim/spell/**
- /config/op/plugins/**
- /config/tmux/plugins/**
- /config/vim/extra/**
- /config/zsh/completions/**
- /config/zsh/plugins/**
- /local/man/fzf
- /local/share/fonts
- /tools/antidote
- /tools/dotbot
- /tools/dotbot-*/**
- node_modules/**
# whether the project is in read-only mode
# If set to true, all editing tools will be disabled and attempts to use them will result in an error
# Added on 2025-04-18
read_only: false
# list of tool names to exclude. We recommend not excluding any tools, see the readme for more details.
# Below is the complete list of tools for convenience.
# To make sure you have the latest list of tools, and to view their descriptions,
# execute `uv run scripts/print_tool_overview.py`.
#
# * `activate_project`: Activates a project by name.
# * `check_onboarding_performed`: Checks whether project onboarding was already performed.
# * `create_text_file`: Creates/overwrites a file in the project directory.
# * `delete_lines`: Deletes a range of lines within a file.
# * `delete_memory`: Deletes a memory from Serena's project-specific memory store.
# * `execute_shell_command`: Executes a shell command.
# * `find_referencing_code_snippets`: Finds code snippets in which the symbol at the given location is referenced.
# * `find_referencing_symbols`: Finds symbols that reference the symbol at the given location (optionally filtered by type).
# * `find_symbol`: Performs a global (or local) search for symbols with/containing a given name/substring (optionally filtered by type).
# * `get_current_config`: Prints the current configuration of the agent, including the active and available projects, tools, contexts, and modes.
# * `get_symbols_overview`: Gets an overview of the top-level symbols defined in a given file.
# * `initial_instructions`: Gets the initial instructions for the current project.
# Should only be used in settings where the system prompt cannot be set,
# e.g. in clients you have no control over, like Claude Desktop.
# * `insert_after_symbol`: Inserts content after the end of the definition of a given symbol.
# * `insert_at_line`: Inserts content at a given line in a file.
# * `insert_before_symbol`: Inserts content before the beginning of the definition of a given symbol.
# * `list_dir`: Lists files and directories in the given directory (optionally with recursion).
# * `list_memories`: Lists memories in Serena's project-specific memory store.
# * `onboarding`: Performs onboarding (identifying the project structure and essential tasks, e.g. for testing or building).
# * `prepare_for_new_conversation`: Provides instructions for preparing for a new conversation (in order to continue with the necessary context).
# * `read_file`: Reads a file within the project directory.
# * `read_memory`: Reads the memory with the given name from Serena's project-specific memory store.
# * `remove_project`: Removes a project from the Serena configuration.
# * `replace_lines`: Replaces a range of lines within a file with new content.
# * `replace_symbol_body`: Replaces the full definition of a symbol.
# * `restart_language_server`: Restarts the language server, may be necessary when edits not through Serena happen.
# * `search_for_pattern`: Performs a search for a pattern in the project.
# * `summarize_changes`: Provides instructions for summarizing the changes made to the codebase.
# * `switch_modes`: Activates modes by providing a list of their names
# * `think_about_collected_information`: Thinking tool for pondering the completeness of collected information.
# * `think_about_task_adherence`: Thinking tool for determining whether the agent is still on track with the current task.
# * `think_about_whether_you_are_done`: Thinking tool for determining whether the task is truly completed.
# * `write_memory`: Writes a named memory (for future reference) to Serena's project-specific memory store.
excluded_tools: []
# 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).
initial_prompt: ""
project_name: ".dotfiles"

View File

@@ -1,5 +0,0 @@
{
"sonarCloudOrganization": "ivuorinen",
"projectKey": "ivuorinen_dotfiles",
"region": "EU"
}

View File

@@ -1,16 +0,0 @@
# vim: ft=gitignore
.mypy_cache/*
Brewfile.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/*
lazy-lock.json
local/bin/antigen.zsh
local/bin/asdf
tools/antidote/*
tools/dotbot*

View File

@@ -1,21 +0,0 @@
---
extends: default
ignore: |
node_modules
tools
config/tmux/plugins
rules:
empty-lines:
level: warning
max: 1
line-length:
max: 200
level: warning
truthy:
check-keys: false
comments:
min-spaces-from-content: 1
trailing-spaces:
level: warning

View File

@@ -1 +0,0 @@
nodeLinker: node-modules

171
CLAUDE.md
View File

@@ -1,171 +0,0 @@
# 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
### 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`).
## Claude Code Configuration
- **Hooks** (`.claude/settings.json`):
- *PreToolUse*: Blocks edits to `fzf-tmux`, `yarn.lock`, `.yarn/`
- *PostToolUse*: Auto-runs `shfmt` on shell scripts after Edit/Write
- *PostToolUse*: Auto-runs `fish_indent` on `.fish` files after Edit/Write
- *PostToolUse*: Auto-runs `stylua` on `.lua` files after Edit/Write
- **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)
- **Subagents** (`.claude/agents/`):
- `code-reviewer`: Reviews shell/fish/lua changes for correctness and style
- **MCP Servers**:
- `context7`: Live documentation lookup for tools and libraries
## Package Manager
Yarn (v4.12.0) is the package manager. Do not use npm.

View File

@@ -5,8 +5,14 @@ git submodule sync --recursive
# dotbot and plugins
git submodule add --name 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 \
-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
git submodule add --name dotbot-asdf \
-f https://github.com/sobolevn/dotbot-asdf tools/dotbot-asdf
# other repos
git submodule add --name cheat-community \
@@ -20,18 +26,22 @@ git submodule add --name antidote \
# tmux plugin manager and plugins
git submodule add --name tmux/tmux-continuum \
-f https://github.com/tmux-plugins/tmux-continuum config/tmux/plugins/tmux-continuum
git submodule add --name tmux/tmux-resurrect \
-f https://github.com/tmux-plugins/tmux-resurrect.git config/tmux/plugins/tmux-resurrect
git submodule add --name tmux/tmux-mode-indicator \
-f https://github.com/MunifTanjim/tmux-mode-indicator.git config/tmux/plugins/tmux-mode-indicator
git submodule add --name tmux/tmux-sensible \
-f https://github.com/tmux-plugins/tmux-sensible.git config/tmux/plugins/tmux-sensible
git submodule add --name tmux/tmux-sessionist \
-f https://github.com/tmux-plugins/tmux-sessionist.git config/tmux/plugins/tmux-sessionist
git submodule add --name tmux/tmux-suspend \
-f https://github.com/MunifTanjim/tmux-suspend.git config/tmux/plugins/tmux-suspend
git submodule add --name tmux/tmux-window-name \
-f https://github.com/ivuorinen/tmux-window-name.git config/tmux/plugins/tmux-window-name
git submodule add --name tmux/tmux-yank \
-f https://github.com/tmux-plugins/tmux-yank.git config/tmux/plugins/tmux-yank
git submodule add --name tmux/tmux-current-pane-hostname \
-f https://github.com/soyuka/tmux-current-pane-hostname.git config/tmux/plugins/tmux-current-pane-hostname
git submodule add --name tmux/tmux-dark-notify \
-f https://github.com/ivuorinen/tmux-dark-notify.git config/tmux/plugins/tmux-dark-notify
git submodule add --name tmux/catppuccin \
-f https://github.com/catppuccin/tmux.git config/tmux/plugins/catppuccin
-f https://github.com/erikw/tmux-dark-notify.git config/tmux/plugins/tmux-dark-notify
# Takes submodules and sets them to ignore all changes
for MODULE in $(git config --file .gitmodules --get-regexp path | awk '{ print $2 }'); do
@@ -42,70 +52,22 @@ done
# Mark certain repositories shallow
git config -f .gitmodules submodule.antidote.shallow true
# Log a message using msgr if available, else echo
_log()
{
local msg="$1"
if command -v msgr > /dev/null 2>&1; then
msgr run_done "$msg"
else
echo " [ok] $msg"
fi
return 0
}
# Remove a stale git submodule and clean up references
remove_old_submodule()
{
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"
# remove old submodules
folders=(
"config/tmux/plugins/tpm"
"config/tmux/plugins/tmux"
"config/tmux/plugins/tmux-menus"
"config/tmux/plugins/tmux-resurrect"
"tools/dotbot-crontab"
"tools/dotbot-snap"
"config/nvim-kickstart"
"local/bin/asdf"
"local/asdf"
"tools/dotbot-asdf"
)
for entry in "${old_submodules[@]}"; do
name="${entry%%:*}"
path="${entry#*:}"
remove_old_submodule "$name" "$path"
for folder in "${folders[@]}"; do
[ -d "$folder" ] \
&& rm -rf "$folder" \
&& msgr run_done "Removed old submodule $folder"
done

View File

@@ -2,17 +2,20 @@
# shellcheck shell=bash
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 SHARED_SCRIPTS_SOURCED=0
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
[ -f "${DOTFILES}/config/fzf/fzf.bash" ] &&
source "${DOTFILES}/config/fzf/fzf.bash"
# Import ssh keys in keychain (macOS-specific -A flag, silently fails on Linux)
# Import ssh keys in keychain
ssh-add -A 2>/dev/null
x-have antidot && {

1
base/envrc Normal file
View File

@@ -0,0 +1 @@
use node

View File

@@ -20,16 +20,6 @@
"value": "Ismo Vuorinen"
}
],
"masf": [
{
"key": "user.email",
"value": "ismo@masf.fi"
},
{
"key": "user.name",
"value": "Ismo Vuorinen"
}
],
"work": [
{
"key": "user.email",

View File

@@ -1,15 +0,0 @@
--
-- These globals can be set and accessed:
--
globals = {
"rawrequire",
}
--
-- These globals can only be accessed:
--
read_globals = {
"hs",
"ls",
"spoon",
}

View File

@@ -1,205 +0,0 @@
-- ╭─────────────────────────────────────────────────────────╮
-- │ Hammerspoon config file │
-- ╰─────────────────────────────────────────────────────────╯
-- init.lua — Pure Hammerspoon window controls
-- Converted from skhdrc logic; expanded with perdisplay grids,
-- app rules with groups, wraparound focus, crossdisplay moves,
-- and overlay/notification toggles.
-- Author: Ismo Vuorinen (ivuorinen)
--------------------------------------------------
-- Caps Lock as Meh key (Shift+Control+Alt)
--------------------------------------------------
-- Prerequisites:
-- 1. Go to System Settings → Keyboard → Keyboard Shortcuts → Modifier Keys
-- 2. Set Caps Lock to "No Action" (you mentioned you already did this)
-- 3. Install Karabiner-Elements: brew install --cask karabiner-elements
-- 4. Open Karabiner-Elements, go to "Simple Modifications"
-- 5. Add: caps_lock → f18
--
-- Then you can use F18 as your Meh key in Hammerspoon:
local f18 = hs.hotkey.modal.new()
-- Capture F18 key press/release
hs.hotkey.bind({}, 'F18', function()
f18:enter()
end, function()
f18:exit()
end)
-- Meh (F18/Caps Lock) key bindings for window management
-- These provide quick access to common window operations
-- Helper function to get focused window
local function W()
return hs.window.focusedWindow()
end
-- Window positioning: thirds (U/I/O)
f18:bind({}, 'u', function()
local w = W()
if w then
w:moveToUnit({ x = 0, y = 0, w = 1 / 3, h = 1 }, 0)
end
end)
f18:bind({}, 'i', function()
local w = W()
if w then
w:moveToUnit({ x = 1 / 3, y = 0, w = 1 / 3, h = 1 }, 0)
end
end)
f18:bind({}, 'o', function()
local w = W()
if w then
w:moveToUnit({ x = 2 / 3, y = 0, w = 1 / 3, h = 1 }, 0)
end
end)
-- Window positioning: half width, full height (Y)
f18:bind({}, 'y', function()
local w = W()
if w then
w:moveToUnit({ x = 0, y = 0, w = 0.5, h = 1 }, 0)
end
end)
-- Cycle through all windows (H/L)
-- We need to maintain state to properly cycle through all windows
local windowCycleIndex = 1
local windowCycleList = {}
local lastCycleTime = 0
local function getWindowCycleList()
local currentTime = hs.timer.secondsSinceEpoch()
-- Reset if more than 2 seconds have passed since last cycle
if currentTime - lastCycleTime > 2 then
windowCycleIndex = 1
windowCycleList = hs.window.orderedWindows()
end
lastCycleTime = currentTime
return windowCycleList
end
f18:bind({}, 'h', function()
local windows = getWindowCycleList()
if #windows <= 1 then
return
end
-- Cycle backward
windowCycleIndex = windowCycleIndex - 1
if windowCycleIndex < 1 then
windowCycleIndex = #windows
end
windows[windowCycleIndex]:focus()
end)
f18:bind({}, 'l', function()
local windows = getWindowCycleList()
if #windows <= 1 then
return
end
-- Cycle forward
windowCycleIndex = windowCycleIndex + 1
if windowCycleIndex > #windows then
windowCycleIndex = 1
end
windows[windowCycleIndex]:focus()
end)
-- Window sizing: maximize (Up/J) and center (Down)
f18:bind({}, 'up', function()
local w = W()
if w then
w:maximize(0)
end
end)
f18:bind({}, 'j', function()
local w = W()
if w then
w:maximize(0)
end
end)
f18:bind({}, 'down', function()
local w = W()
if not w then
return
end
local f = w:frame()
local sf = w:screen():frame()
if f.w < sf.w * 0.95 then
w:maximize(0)
else
local ww, hh = math.floor(sf.w * 0.5), math.floor(sf.h * 0.9)
local xx = sf.x + math.floor((sf.w - ww) / 2)
local yy = sf.y + math.floor((sf.h - hh) / 2)
w:setFrame({ x = xx, y = yy, w = ww, h = hh }, 0)
end
end)
f18:bind({}, 'k', function()
local w = W()
if w then
local sf = w:screen():frame()
local ww, hh = math.floor(sf.w * 0.9), math.floor(sf.h * 0.9)
local xx = sf.x + math.floor((sf.w - ww) / 2)
local yy = sf.y + math.floor((sf.h - hh) / 2)
w:setFrame({ x = xx, y = yy, w = ww, h = hh }, 0)
end
end)
-- Move to next/previous screen (. and ,)
f18:bind({}, '.', function()
local w = W()
if w then
local s = w:screen()
local ns = s:toEast() or s:toWest()
if ns then
w:moveToScreen(ns, true, true, 0)
end
end
end)
f18:bind({}, ',', function()
local w = W()
if w then
local s = w:screen()
local ps = s:toWest() or s:toEast()
if ps then
w:moveToScreen(ps, true, true, 0)
end
end
end)
-- Window positioning: halves (Left/Right arrows)
f18:bind({}, 'left', function()
local w = W()
if w then
w:moveToUnit(hs.layout.left50, 0)
end
end)
f18:bind({}, 'right', function()
local w = W()
if w then
w:moveToUnit(hs.layout.right50, 0)
end
end)
-- Paste from clipboard with Meh + V
f18:bind({}, 'v', function()
hs.eventtap.keyStrokes(hs.pasteboard.getContents())
end)
-- Paste 1Password secret with Meh + P
f18:bind({}, 'p', function()
local output, status =
hs.execute('op read "op://Svea/3hzhctmvovbwlgulv7mgy25rf4/login-input"', true)
if status then
hs.eventtap.keyStrokes(output:gsub('%s+$', '')) -- trim trailing whitespace
else
hs.alert.show '1Password CLI error'
end
end)
-- require 'generate_emmylua'

4
base/huskyrc Normal file
View File

@@ -0,0 +1,4 @@
#!/bin/env bash
[ -z "$NVM_DIR" ] && export NVM_DIR="$HOME/.config/nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm

View File

@@ -1 +1 @@
v22.14.0
lts/*

View File

@@ -12,3 +12,5 @@
~-.__| /_ - ~ ^| /- _ `..-' f: f:
| / | / ~-. `-. _||_||_
|_____| |_____| ~ - . _ _ _ _ _>

View File

@@ -4,3 +4,4 @@
# paths in source statements (since 0.8.0).
external-sources=true
includeAllWorkspaceSymbols=true

View File

@@ -7,16 +7,22 @@
autoload -U promptinit; promptinit
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"
LOCAL_SHARE="$HOME/.local/share"
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 SHARED_SCRIPTS_SOURCED=0
source "$DOTFILES/config/shared.sh"
# zsh completions directory (ZSH_CUSTOM_COMPLETION_PATH set in shared.sh)
# zsh completions directory
[ -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}"
source "$DOTFILES/config/zsh/antidote.zsh"
# source "$DOTFILES/config/zsh/prompt.zsh"
# Function to source FZF configuration
source_fzf_config()
@@ -28,11 +34,28 @@ source_fzf_config()
fi
}
# Function to set up tmux window name plugin if tmux is active
setup_tmux_window_name_plugin()
{
if [[ -n "$TMUX" ]]; then
local tmux_window_name_plugin="$TMUX_PLUGINS/tmux-window-name/scripts/rename_session_windows.py"
if [[ -f "$tmux_window_name_plugin" ]]; then
tmux_window_name()
{
($tmux_window_name_plugin &)
}
add-zsh-hook chpwd tmux_window_name
tmux_window_name
fi
fi
}
source_fzf_config
setup_tmux_window_name_plugin
x-have antidot && eval "$(antidot init)"
autoload -Uz compinit bashcompinit
compinit -d "$ZSH_COMPDUMP"
compinit -d $ZSH_COMPDUMP
bashcompinit
# To customize prompt, run `p10k configure` or edit ~/.p10k.zsh.

View File

@@ -1,103 +0,0 @@
{
"$schema": "https://biomejs.dev/schemas/2.4.4/schema.json",
"vcs": {
"enabled": true,
"clientKind": "git",
"useIgnoreFile": true,
"defaultBranch": "main"
},
"files": {
"ignoreUnknown": true,
"includes": [
"**",
"!!**/.mypy_cache",
"!!**/Brewfile.lock.json",
"!!**/base/plan",
"!!**/config/cheat/cheatsheets/community",
"!!**/config/cheat/cheatsheets/tldr",
"!!**/config/fzf",
"!!**/config/nvim",
"!!**/config/op/plugins/used_plugins",
"!!**/config/tmux/plugins",
"!!**/config/zsh",
"!!**/config/vim",
"!!**/lazy-lock.json",
"!!**/local/bin/antigen.zsh",
"!!**/local/bin/asdf",
"!!**/tools/antidote",
"!!**/tools/dotbot",
"!!**/node_modules"
]
},
"formatter": {
"enabled": true,
"formatWithErrors": false,
"indentStyle": "space",
"indentWidth": 2,
"lineEnding": "lf",
"lineWidth": 80
},
"linter": {
"enabled": true,
"rules": {
"recommended": true,
"correctness": {
"noUnusedVariables": "warn",
"noUnusedImports": "warn"
},
"style": {
"useConst": "warn",
"useTemplate": "warn"
},
"suspicious": {
"noExplicitAny": "warn",
"noConsole": "off"
}
}
},
"javascript": {
"formatter": {
"enabled": true,
"quoteStyle": "single",
"jsxQuoteStyle": "double",
"trailingCommas": "all",
"semicolons": "asNeeded",
"arrowParentheses": "always",
"bracketSpacing": true,
"bracketSameLine": false,
"quoteProperties": "asNeeded",
"indentStyle": "space",
"indentWidth": 2
}
},
"json": {
"parser": {
"allowComments": true,
"allowTrailingCommas": false
},
"formatter": {
"enabled": true,
"indentStyle": "space",
"indentWidth": 2,
"lineWidth": 80
}
},
"overrides": [
{
"includes": ["*.md", "*.mdx"],
"formatter": {
"enabled": true,
"lineWidth": 120
}
},
{
"includes": ["package.json"],
"json": {
"formatter": {
"enabled": true,
"indentWidth": 2
}
}
}
]
}

View File

@@ -0,0 +1,247 @@
# 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']
# 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']

View File

@@ -1,3 +1,8 @@
import = [
# Default to night if the copied one doesn't exist.
"~/.dotfiles/config/alacritty/theme-night.toml",
"~/.config/alacritty/theme-active.toml"
]
[env]
TERM = "xterm-256color"
@@ -45,10 +50,3 @@ lines = 75
[window.padding]
x = 5
y = 5
[general]
import = [
# Default to night if the copied one doesn't exist.
"~/.dotfiles/config/alacritty/theme-night.toml",
"~/.config/alacritty/theme-active.toml"
]

View File

@@ -93,13 +93,13 @@ expand-main:
# Note that not all layouts respond to this command.
increase-main:
mod: mod1
key: ","
key: ','
# Decrease the number of windows in the main pane.
# Note that not all layouts respond to this command.
decrease-main:
mod: mod1
key: "."
key: '.'
# General purpose command for custom layouts.
# Functionality is layout-dependent.
@@ -180,7 +180,7 @@ swap-main:
# Move focus to the n-th screen in the list; e.g.,
# focus-screen-3 will move mouse focus to the 3rd screen.
# Note that the main window in the given screen will be focused.
# focus-screen-n:
#focus-screen-n:
# focus-screen-<screen-number>:
# mod: mod1
# key: y
@@ -197,12 +197,12 @@ swap-main:
# key: i
# Select tall layout
# select-tall-layout:
# mod: mod1
# key: a
#select-tall-layout:
# mod: mod1
# key: a
# Select wide layout
# select-wide-layout:
#select-wide-layout:
# mod: mod1
# key: s

View File

@@ -6,19 +6,21 @@
*
* @param {Object} windows - All windows in the current space.
* @param {Object} screenFrame - The frame of the current screen.
* @param {Object} state - The state of the current space.
* @param {Object} extendedFrames - The frames of the windows in the current space.
* @return {Object} - The frames for the windows in the current space.
*/
function layout() {
return {
name: 'Almost Maximize',
getFrameAssignments: (windows, screenFrame) => {
getFrameAssignments: (windows, screenFrame, state, extendedFrames) => {
const width = screenFrame.width * 0.95
const height = screenFrame.height * 0.95
const x = (screenFrame.width - width) / 2
const y = (screenFrame.height - height) / 2
const windowFrames = {}
windows.forEach((window) => {
windows.forEach(window => {
windowFrames[window.id] = {
Y: screenFrame.y + y,
x: screenFrame.x + x,
@@ -31,5 +33,3 @@ function layout() {
},
}
}
module.exports = layout()

5
config/asdf/asdfrc Normal file
View File

@@ -0,0 +1,5 @@
# See the docs for explanations: https://asdf-vm.com/manage/configuration.html
legacy_version_file=yes
use_release_candidates=no
concurrency=auto

View File

@@ -0,0 +1,25 @@
// A cargo subcommand for checking and applying
// updates to installed executables
cargo-update
// Cargo cache management utility
cargo-cache
// An incremental parsing system for programming tools
tree-sitter-cli
// a subprocess caching utility
bkt
// a structural diff that understands syntax
difftastic
// A simple, fast and user-friendly alternative to 'find'
fd-find
// recursively searches directories for a
// regex pattern while respecting your gitignore
ripgrep
// A version manager for neovim
bob-nvim
// bottom, btm - A cross-platform graphical process/system monitor with
// a customizable interface and a multitude of features.
bottom
// A modern alternative to ls
eza
// Tmux Sessionizer: A tool for opening git repositories as tmux sessions
tmux-sessionizer

1
config/asdf/gem-packages Normal file
View File

@@ -0,0 +1 @@
bundler

View File

@@ -0,0 +1,21 @@
// These are golang packages I use,
// so they should be available with all versions
// Git Profile allows you to switch between user profiles in git repos
github.com/dotzero/git-profile@v1.4.0
// An extensible command line tool or library to format yaml files.
github.com/google/yamlfmt/cmd/yamlfmt@v0.13.0
// Parsing HTML at the command line
github.com/ericchiang/pup@v0.4.0
// HTML to Markdown converter
github.com/suntong/html2md@v1.5.0
// cheat allows you to create and view interactive cheatsheets on the cli.
github.com/cheat/cheat/cmd/cheat@4.4.2
// Render markdown on the CLI, with pizzazz! 💅
github.com/charmbracelet/glow@v1.5.1
// Static checker for GitHub Actions workflow files
github.com/rhysd/actionlint/cmd/actionlint@v1.7.1
// Cleans up your $HOME from those pesky dotfiles
github.com/doron-cohen/antidot@v0.6.3
// FZF is a general-purpose command-line fuzzy finder.
github.com/junegunn/fzf@latest

7
config/asdf/npm-packages Normal file
View File

@@ -0,0 +1,7 @@
blade-formatter
corepack
editorconfig-checker
github-release-notes
neovim
npm
stylelint-lsp

View File

@@ -0,0 +1,20 @@
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

View File

@@ -0,0 +1,4 @@
ansible
pipenv
neovim
libtmux

View File

@@ -69,3 +69,5 @@ Available format modifiers are:
'. For decimal conversions, applies the thousands grouping
separator to the integer portion of the output according
to the current LC_NUMERIC file.

View File

@@ -75,6 +75,7 @@ cheatpaths:
path: ~/.dotfiles/config/cheat/cheatsheets/personal
tags: [personal]
readonly: false
# While it requires no configuration here, it's also worth noting that
# cheat will automatically append directories named '.cheat' within the
# current working directory to the 'cheatpath'. This can be very useful if

View File

@@ -56,11 +56,11 @@ TERM xterm*
RESET 0 # reset to "normal" color
DIR 01;34 # directory
LINK 01;36 # symbolic link. (If you set this to 'target' instead of a
# numerical value, the color is as for the file pointed to.)
MULTIHARDLINK 00 # regular file with more than one link
FIFO 40;33 # pipe
SOCK 01;35 # socket
DOOR 01;35 # door
# numerical value, the color is as for the file pointed to.)
MULTIHARDLINK 00 # regular file with more than one link
FIFO 40;33 # pipe
SOCK 01;35 # socket
DOOR 01;35 # door
BLK 40;33;01 # block device driver
CHR 40;33;01 # character device driver
ORPHAN 40;31;01 # symlink to nonexistent file, or non-stat'able file ...

13
config/direnv/direnv.toml Normal file
View File

@@ -0,0 +1,13 @@
[global]
disable_stdin = false
load_dotenv = true
hide_env_diff = false
[whitelist]
prefix = [
"~/Code/"
]
exact = [
"~/.dotfiles/.envrc"
]

View File

@@ -0,0 +1,4 @@
### Do not edit. This was autogenerated by 'asdf direnv setup' ###
use_asdf() {
source_env "$(asdf direnv envrc "$@")"
}

View File

@@ -4,15 +4,15 @@
# Set XDG directories if not already set
# https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html
[ -z "${XDG_CONFIG_HOME:-}" ] && export XDG_CONFIG_HOME="$HOME/.config"
[ -z "${XDG_DATA_HOME:-}" ] && export XDG_DATA_HOME="$HOME/.local/share"
[ -z "${XDG_CACHE_HOME:-}" ] && export XDG_CACHE_HOME="$HOME/.cache"
[ -z "${XDG_STATE_HOME:-}" ] && export XDG_STATE_HOME="$HOME/.local/state"
[ -z "${XDG_BIN_HOME:-}" ] && export XDG_BIN_HOME="$HOME/.local/bin"
[ -z "${XDG_RUNTIME_DIR:-}" ] && export XDG_RUNTIME_DIR="$HOME/.local/run"
[ -z "$XDG_CONFIG_HOME" ] && export XDG_CONFIG_HOME="$HOME/.config"
[ -z "$XDG_DATA_HOME" ] && export XDG_DATA_HOME="$HOME/.local/share"
[ -z "$XDG_CACHE_HOME" ] && export XDG_CACHE_HOME="$HOME/.cache"
[ -z "$XDG_STATE_HOME" ] && export XDG_STATE_HOME="$HOME/.local/state"
[ -z "$XDG_BIN_HOME" ] && export XDG_BIN_HOME="$HOME/.local/bin"
[ -z "$XDG_RUNTIME_DIR" ] && export XDG_RUNTIME_DIR="$HOME/.local/run"
# 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"
@@ -150,7 +150,6 @@ commit()
git commit -a -m "$commitMessage"
}
# Run Laravel scheduler in a loop
scheduler()
{
while :; do
@@ -214,7 +213,7 @@ get_sha256sum()
# $2 - filename (string)
#
# Returns 1 when replaceable, 0 when not replaceable.
replaceable()
replacable()
{
FILE1="$1"
FILE2="$2"
@@ -283,8 +282,7 @@ export LESSHISTFILE="$XDG_STATE_HOME"/less/history
export MANPAGER="less -X"
# Always enable colored `grep` output
# Note: GREP_OPTIONS is deprecated since GNU grep 2.21
# Color is handled via alias in config/alias
export GREP_OPTIONS="--color=auto"
# check the window size after each command and, if necessary,
# update the values of LINES and COLUMNS.
@@ -350,6 +348,12 @@ export COMPOSER_HOME="$XDG_STATE_HOME/composer"
export COMPOSER_BIN="$COMPOSER_HOME/vendor/bin"
export PATH="$COMPOSER_BIN:$PATH"
# direnv, https://direnv.net/
# https://direnv.net/docs/hook.html
# Set the hook to show the direnv message in a different color
# export DIRENV_LOG_FORMAT=$'\033[2mdirenv: %s\033[0m'
export DIRENV_LOG_FORMAT=
# docker, https://docs.docker.com/engine/reference/commandline/cli/
msg "Setting up Docker configuration"
export DOCKER_CONFIG="${XDG_CONFIG_HOME}/docker"
@@ -406,6 +410,11 @@ x-have pyenv && eval "$(pyenv init -)"
msg "Setting up Rust/Cargo configuration"
export RUST_WITHOUT=rust-docs
# screen
# https://www.gnu.org/software/screen/manual/screen.html
msg "Setting up screen configuration"
export SCREENRC="$XDG_CONFIG_HOME/misc/screenrc"
# sonarlint
# https://www.sonarlint.org/
msg "Setting up Sonarlint configuration"
@@ -433,24 +442,21 @@ export ZSH_TMUX_UNICODE=true
export ZSH_TMUX_AUTOQUIT=false
export ZSH_TMUX_DEFAULT_SESSION_NAME=main
# tms, https://github.com/jrmoulton/tmux-sessionizer
export TMS_CONFIG_FILE="${XDG_CONFIG_HOME}/tms/config.toml"
# wakatime, https://github.com/wakatime/wakatime-cli
msg "Setting up Wakatime configuration"
export WAKATIME_HOME="$XDG_STATE_HOME/wakatime"
x-dc "$WAKATIME_HOME"
# LM Studio CLI
msg "Setting up LM Studio configuration"
export PATH="$PATH:$HOME/.lmstudio/bin"
# Misc
msg "Setting up miscellaneous configuration"
export ZSHZ_DATA="$XDG_STATE_HOME/z"
export CHEAT_USE_FZF=true
export SQLITE_HISTORY="${XDG_CACHE_HOME}/sqlite_history"
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
if [ -f "$XDG_CONFIG_HOME/exports-$(hostname)" ]; then source "$XDG_CONFIG_HOME/exports-$(hostname)"; fi
# shellcheck source=./exports-lakka-secret
if [ -f "$XDG_CONFIG_HOME/exports-$(hostname)-secret" ]; then source "$XDG_CONFIG_HOME/exports-$(hostname)-secret"; fi
[ -f "$XDG_CONFIG_HOME/exports-secret" ] && source "$XDG_CONFIG_HOME/exports-secret"
[ -f "$XDG_CONFIG_HOME/exports-local" ] && source "$XDG_CONFIG_HOME/exports-local"
[ -f "$XDG_CONFIG_HOME/exports-$(hostname)" ] && source "$XDG_CONFIG_HOME/exports-$(hostname)"
[ -f "$XDG_CONFIG_HOME/exports-$(hostname)-secret" ] && source "$XDG_CONFIG_HOME/exports-$(hostname)-secret"

View File

@@ -8,6 +8,7 @@ fi
export PATH="$HOME/.local/go/bin:$PATH"
alias logrotate='/usr/sbin/logrotate -s "$HOME/logs/state"'
alias nano='nano -wS -$'
alias gpg=gpg2
ACME_PATH="$HOME/.acme.sh"

View File

@@ -1,3 +1,5 @@
#!/usr/bin/env bash
#
# This file is secret and wont be added to the git repo.
export GITLAB_API_TOKEN=""

View File

@@ -1,96 +0,0 @@
# Set aliases for fish shell
alias vim='vim -u "$XDG_CONFIG_HOME/vim/vimrc"'
# eza aliases if eza is installed
if type -q eza >/dev/null
function eza_git -d "Use eza and its git options if in a git repo"
if git rev-parse --is-inside-work-tree &>/dev/null
eza --group-directories-first --icons=always \
--smart-group --git $argv
else
eza --group-directories-first \
--icons=always \
--smart-group $argv
end
end
function lsa --wraps='eza_git -al' --description 'eza -al'
eza_git -al $argv
end
function ls --wraps='eza_git' --description eza
eza_git $argv
end
function ll --wraps='eza_git -l' --description 'eza -l'
eza_git -l $argv
end
function l --wraps='eza_git' --description eza
eza_git $argv
end
end
# Edit fish alias file
function .a \
--wraps='nvim ~/.dotfiles/config/fish/alias.fish' \
--description 'edit alias.fish'
nvim ~/.dotfiles/config/fish/alias.fish $argv
end
# Go to the directory where my projects are stored
function .c --wraps='cd ~/Code' --description 'cd ~/Code'
cd ~/Code $argv
end
# Go to the directory where the dotfiles are stored
function .d --wraps='cd ~/.dotfiles' --description 'cd ~/.dotfiles'
cd ~/.dotfiles $argv
end
# Go to the directory where my work codes are stored
function .s --wraps='cd ~/Code/s' --description 'cd ~/Code/s'
cd ~/Code/s $argv
end
# Go to the directory where my personal codes are stored
function .p --wraps='cd ~/Code/ivuorinen' --description 'cd ~/Code/ivuorinen'
cd ~/Code/ivuorinen $argv
end
# shortcut to commit with a message
function commit \
--wraps='git commit -a -m "chore: automated commit"' \
--description 'commit shortcut'
set -l commitMessage $argv
git add .
if test -z "$commitMessage"
if type -q aicommits
aicommits --type conventional
else
git commit -a -m "chore: automated commit"
end
return
end
git commit -a -m "$commitMessage"
end
function configure_tide \
--description 'Configure tide with the lean style and my preferences'
tide configure \
--auto \
--style=Lean \
--prompt_colors='True color' \
--show_time=No \
--lean_prompt_height='Two lines' \
--prompt_connection=Disconnected \
--prompt_spacing=Sparse \
--icons='Many icons' \
--transient=Yes
end
# Random abbreviations
abbr --add stats onefetch --nerd-fonts --true-color never

View File

@@ -0,0 +1,71 @@
# @halostatue/fish-macos/completions/app.fish:v7.0.0
complete --command app --erase
complete --command app --arguments bundleid \
--exclusive --condition __fish_use_subcommand \
--description 'Show bundle IDs for macOS apps'
complete --command app --arguments find \
--exclusive --condition __fish_use_subcommand \
--description 'Find macOS apps by pattern'
complete --command app --arguments frontmost \
--exclusive --condition __fish_use_subcommand \
--description 'Shows the front-most application'
complete --command app --arguments icon \
--exclusive --condition __fish_use_subcommand \
--description 'Extracts a MacOS app icon as a png file'
complete --command app --arguments quit \
--exclusive --condition __fish_use_subcommand \
--description 'Quit macOS apps by pattern'
for subcommand in bundleid find
complete --command app --condition '__fish_seen_subcommand_from '$subcommand \
--short-option x --long-option exact --description 'Exact matches only'
complete --command app --condition '__fish_seen_subcommand_from '$subcommand \
--short-option a --long-option all --description 'Show all matches'
complete --command app --condition '__fish_seen_subcommand_from '$subcommand \
--short-option q --long-option quiet --description 'Quiet (show no output)'
complete --command app --condition '__fish_seen_subcommand_from '$subcommand \
--short-option h --long-option help --description 'Help for app '$subcommand
end
complete --command app --condition '__fish_seen_subcommand_from 'bundleid \
--short-option s --long-option short --description 'Show only the bundle ID'
complete --command app --condition '__fish_seen_subcommand_from 'frontmost \
--short-option b --long-option bundle-id --description 'Shows the app bundle ID'
complete --command app --condition '__fish_seen_subcommand_from 'frontmost \
--short-option p --long-option path --description 'Shows the app path'
complete --command app --condition '__fish_seen_subcommand_from 'frontmost \
--short-option n --long-option name --description 'Shows the app name'
complete --command app --condition '__fish_seen_subcommand_from 'frontmost \
--short-option P --long-option pid --description 'Shows the PID of the app'
complete --command app --condition '__fish_seen_subcommand_from 'frontmost \
--short-option a --long-option all --description 'Shows all details'
complete --command app --condition '__fish_seen_subcommand_from 'frontmost \
--short-option h --long-option help --description 'Help for app 'frontmost
complete --command app --condition '__fish_seen_subcommand_from 'icon \
--short-option x --long-option exact --description 'Exact matches only'
complete --command app --condition '__fish_seen_subcommand_from 'icon \
--short-option o --long-option output --description 'Extracts to this file or directory' \
--force-files
complete --command app --condition '__fish_seen_subcommand_from 'icon \
--short-option w --long-option width --description 'Uses this pixel width' \
--no-files
complete --command app --condition '__fish_seen_subcommand_from 'icon \
--short-option h --long-option help --description 'Help for app 'icon
complete --command app --condition '__fish_seen_subcommand_from 'quit \
--short-option x --long-option exact --description 'Exact matches only'
complete --command app --condition '__fish_seen_subcommand_from 'quit \
--short-option r --long-option restart --description 'Restart after quit'
complete --command app --condition '__fish_seen_subcommand_from 'quit \
--short-option h --long-option help --description 'Help for app 'quit

View File

@@ -1,124 +0,0 @@
# aqua fish shell completion
function __fish_aqua_no_subcommand --description 'Test if there has been any subcommand yet'
for i in (commandline -opc)
if contains -- $i init install i generate g update-aqua upa update-checksum upc update up completion bash zsh fish help h help h which info remove rm vacuum cp policy allow deny init init-policy exec list generate-registry gr version root-dir help h
return 1
end
end
return 0
end
complete -c aqua -n __fish_aqua_no_subcommand -f -l log-level -r -d 'log level'
complete -c aqua -n __fish_aqua_no_subcommand -f -l config -s c -r -d 'configuration file path'
complete -c aqua -n __fish_aqua_no_subcommand -f -l disable-cosign -d 'Disable Cosign verification'
complete -c aqua -n __fish_aqua_no_subcommand -f -l disable-slsa -d 'Disable SLSA verification'
complete -c aqua -n __fish_aqua_no_subcommand -f -l disable-github-artifact-attestation -d 'Disable GitHub Artifact Attestations verification'
complete -c aqua -n __fish_aqua_no_subcommand -f -l trace -r -d 'trace output file path'
complete -c aqua -n __fish_aqua_no_subcommand -f -l cpu-profile -r -d 'cpu profile output file path'
complete -c aqua -n __fish_aqua_no_subcommand -f -l help -s h -d 'show help'
complete -c aqua -n __fish_aqua_no_subcommand -f -l version -s v -d 'print the version'
complete -c aqua -n __fish_aqua_no_subcommand -f -l help -s h -d 'show help'
complete -c aqua -n __fish_aqua_no_subcommand -f -l version -s v -d 'print the version'
complete -c aqua -n '__fish_seen_subcommand_from init' -f -l help -s h -d 'show help'
complete -r -c aqua -n __fish_aqua_no_subcommand -a init -d 'Create a configuration file if it doesn\'t exist'
complete -c aqua -n '__fish_seen_subcommand_from init' -f -l use-import-dir -s u -d 'Use import_dir'
complete -c aqua -n '__fish_seen_subcommand_from init' -f -l import-dir -s i -r -d import_dir
complete -c aqua -n '__fish_seen_subcommand_from init' -f -l create-dir -s d -d 'Create a directory named aqua and create aqua.yaml in it'
complete -c aqua -n '__fish_seen_subcommand_from install i' -f -l help -s h -d 'show help'
complete -r -c aqua -n __fish_aqua_no_subcommand -a 'install i' -d 'Install tools'
complete -c aqua -n '__fish_seen_subcommand_from install i' -f -l only-link -s l -d 'create links but skip downloading packages'
complete -c aqua -n '__fish_seen_subcommand_from install i' -f -l test -d 'This flag was deprecated and had no meaning from aqua v2.0.0. This flag will be removed in aqua v3.0.0. https://github.com/aquaproj/aqua/issues/1691'
complete -c aqua -n '__fish_seen_subcommand_from install i' -f -l all -s a -d 'install all aqua configuration packages'
complete -c aqua -n '__fish_seen_subcommand_from install i' -f -l tags -s t -r -d 'filter installed packages with tags'
complete -c aqua -n '__fish_seen_subcommand_from install i' -f -l exclude-tags -r -d 'exclude installed packages with tags'
complete -c aqua -n '__fish_seen_subcommand_from generate g' -f -l help -s h -d 'show help'
complete -r -c aqua -n __fish_aqua_no_subcommand -a 'generate g' -d 'Search packages in registries and output the configuration interactively'
complete -c aqua -n '__fish_seen_subcommand_from generate g' -f -l f -r -d 'the file path of packages list. When the value is "-", the list is passed from the standard input'
complete -c aqua -n '__fish_seen_subcommand_from generate g' -f -l i -d 'Insert packages to configuration file'
complete -c aqua -n '__fish_seen_subcommand_from generate g' -f -l pin -d 'Pin version'
complete -c aqua -n '__fish_seen_subcommand_from generate g' -f -l g -d 'Insert packages in a global configuration file'
complete -c aqua -n '__fish_seen_subcommand_from generate g' -f -l detail -s d -d 'Output additional fields such as description and link'
complete -c aqua -n '__fish_seen_subcommand_from generate g' -f -l o -r -d 'inserted file'
complete -c aqua -n '__fish_seen_subcommand_from generate g' -f -l select-version -s s -d 'Select the installed version interactively. Default to display 30 versions, use --limit/-l to change it.'
complete -c aqua -n '__fish_seen_subcommand_from generate g' -f -l limit -s l -r -d 'The maximum number of versions. Non-positive number refers to no limit.'
complete -c aqua -n '__fish_seen_subcommand_from update-aqua upa' -f -l help -s h -d 'show help'
complete -r -c aqua -n __fish_aqua_no_subcommand -a 'update-aqua upa' -d 'Update aqua'
complete -c aqua -n '__fish_seen_subcommand_from update-checksum upc' -f -l help -s h -d 'show help'
complete -r -c aqua -n __fish_aqua_no_subcommand -a 'update-checksum upc' -d 'Create or Update aqua-checksums.json'
complete -c aqua -n '__fish_seen_subcommand_from update-checksum upc' -f -l all -s a -d 'Create or Update all aqua-checksums.json including global configuration'
complete -c aqua -n '__fish_seen_subcommand_from update-checksum upc' -f -l deep -d 'This flag was deprecated and had no meaning from aqua v2.0.0. This flag will be removed in aqua v3.0.0. https://github.com/aquaproj/aqua/issues/1769'
complete -c aqua -n '__fish_seen_subcommand_from update-checksum upc' -f -l prune -d 'Remove unused checksums'
complete -c aqua -n '__fish_seen_subcommand_from update up' -f -l help -s h -d 'show help'
complete -r -c aqua -n __fish_aqua_no_subcommand -a 'update up' -d 'Update registries and packages'
complete -c aqua -n '__fish_seen_subcommand_from update up' -f -l i -d 'Select packages with fuzzy finder'
complete -c aqua -n '__fish_seen_subcommand_from update up' -f -l select-version -s s -d 'Select the version with fuzzy finder. Default to display 30 versions, use --limit/-l to change it.'
complete -c aqua -n '__fish_seen_subcommand_from update up' -f -l only-registry -s r -d 'Update only registries'
complete -c aqua -n '__fish_seen_subcommand_from update up' -f -l only-package -s p -d 'Update only packages'
complete -c aqua -n '__fish_seen_subcommand_from update up' -f -l limit -s l -r -d 'The maximum number of versions. Non-positive number refers to no limit.'
complete -c aqua -n '__fish_seen_subcommand_from update up' -f -l tags -s t -r -d 'filter installed packages with tags'
complete -c aqua -n '__fish_seen_subcommand_from update up' -f -l exclude-tags -r -d 'exclude installed packages with tags'
complete -c aqua -n '__fish_seen_subcommand_from completion' -f -l help -s h -d 'show help'
complete -r -c aqua -n __fish_aqua_no_subcommand -a completion -d 'Output shell completion script for bash, zsh, or fish'
complete -c aqua -n '__fish_seen_subcommand_from completion' -f -l help -s h -d 'show help'
complete -c aqua -n '__fish_seen_subcommand_from bash' -f -l help -s h -d 'show help'
complete -r -c aqua -n '__fish_seen_subcommand_from completion' -a bash -d 'Output shell completion script for bash'
complete -c aqua -n '__fish_seen_subcommand_from zsh' -f -l help -s h -d 'show help'
complete -r -c aqua -n '__fish_seen_subcommand_from completion' -a zsh -d 'Output shell completion script for zsh'
complete -c aqua -n '__fish_seen_subcommand_from fish' -f -l help -s h -d 'show help'
complete -r -c aqua -n '__fish_seen_subcommand_from completion' -a fish -d 'Output shell completion script for fish'
complete -c aqua -n '__fish_seen_subcommand_from fish' -f -l help -s h -d 'show help'
complete -c aqua -n '__fish_seen_subcommand_from help h' -f -l help -s h -d 'show help'
complete -r -c aqua -n '__fish_seen_subcommand_from fish' -a 'help h' -d 'Shows a list of commands or help for one command'
complete -c aqua -n '__fish_seen_subcommand_from help h' -f -l help -s h -d 'show help'
complete -r -c aqua -n '__fish_seen_subcommand_from completion' -a 'help h' -d 'Shows a list of commands or help for one command'
complete -c aqua -n '__fish_seen_subcommand_from which' -f -l help -s h -d 'show help'
complete -r -c aqua -n __fish_aqua_no_subcommand -a which -d 'Output the absolute file path of the given command'
complete -c aqua -n '__fish_seen_subcommand_from which' -f -l version -s v -d 'Output the given package version'
complete -c aqua -n '__fish_seen_subcommand_from info' -f -l help -s h -d 'show help'
complete -r -c aqua -n __fish_aqua_no_subcommand -a info -d 'Show information'
complete -c aqua -n '__fish_seen_subcommand_from remove rm' -f -l help -s h -d 'show help'
complete -r -c aqua -n __fish_aqua_no_subcommand -a 'remove rm' -d 'Uninstall packages'
complete -c aqua -n '__fish_seen_subcommand_from remove rm' -f -l all -s a -d 'uninstall all packages'
complete -c aqua -n '__fish_seen_subcommand_from remove rm' -f -l mode -s m -r -d 'Removed target modes. l: link, p: package'
complete -c aqua -n '__fish_seen_subcommand_from remove rm' -f -l i -d 'Select packages with a Fuzzy Finder'
complete -c aqua -n '__fish_seen_subcommand_from vacuum' -f -l help -s h -d 'show help'
complete -r -c aqua -n __fish_aqua_no_subcommand -a vacuum -d 'Remove unused installed packages'
complete -c aqua -n '__fish_seen_subcommand_from vacuum' -f -l init -d 'Create timestamp files.'
complete -c aqua -n '__fish_seen_subcommand_from vacuum' -f -l days -s d -r -d 'Expiration days'
complete -c aqua -n '__fish_seen_subcommand_from cp' -f -l help -s h -d 'show help'
complete -r -c aqua -n __fish_aqua_no_subcommand -a cp -d 'Copy executable files in a directory'
complete -c aqua -n '__fish_seen_subcommand_from cp' -f -l o -r -d 'destination directory'
complete -c aqua -n '__fish_seen_subcommand_from cp' -f -l all -s a -d 'install all aqua configuration packages'
complete -c aqua -n '__fish_seen_subcommand_from cp' -f -l tags -s t -r -d 'filter installed packages with tags'
complete -c aqua -n '__fish_seen_subcommand_from cp' -f -l exclude-tags -r -d 'exclude installed packages with tags'
complete -c aqua -n '__fish_seen_subcommand_from policy' -f -l help -s h -d 'show help'
complete -r -c aqua -n __fish_aqua_no_subcommand -a policy -d 'Manage Policy'
complete -c aqua -n '__fish_seen_subcommand_from allow' -f -l help -s h -d 'show help'
complete -r -c aqua -n '__fish_seen_subcommand_from policy' -a allow -d 'Allow a policy file'
complete -c aqua -n '__fish_seen_subcommand_from deny' -f -l help -s h -d 'show help'
complete -r -c aqua -n '__fish_seen_subcommand_from policy' -a deny -d 'Deny a policy file'
complete -c aqua -n '__fish_seen_subcommand_from init' -f -l help -s h -d 'show help'
complete -r -c aqua -n '__fish_seen_subcommand_from policy' -a init -d 'Create a policy file if it doesn\'t exist'
complete -c aqua -n '__fish_seen_subcommand_from init-policy' -f -l help -s h -d 'show help'
complete -r -c aqua -n __fish_aqua_no_subcommand -a init-policy -d '[Deprecated] Create a policy file if it doesn\'t exist'
complete -c aqua -n '__fish_seen_subcommand_from exec' -f -l help -s h -d 'show help'
complete -r -c aqua -n __fish_aqua_no_subcommand -a exec -d 'Execute tool'
complete -c aqua -n '__fish_seen_subcommand_from list' -f -l help -s h -d 'show help'
complete -r -c aqua -n __fish_aqua_no_subcommand -a list -d 'List packages in Registries'
complete -c aqua -n '__fish_seen_subcommand_from list' -f -l installed -s i -d 'List installed packages'
complete -c aqua -n '__fish_seen_subcommand_from list' -f -l all -s a -d 'List global configuration packages too'
complete -c aqua -n '__fish_seen_subcommand_from generate-registry gr' -f -l help -s h -d 'show help'
complete -r -c aqua -n __fish_aqua_no_subcommand -a 'generate-registry gr' -d 'Generate a registry\'s package configuration'
complete -c aqua -n '__fish_seen_subcommand_from generate-registry gr' -f -l out-testdata -r -d 'A file path where the testdata is outputted'
complete -c aqua -n '__fish_seen_subcommand_from generate-registry gr' -f -l cmd -r -d 'A list of commands joined with commas \',\''
complete -c aqua -n '__fish_seen_subcommand_from generate-registry gr' -f -l generate-config -s c -r -d 'A configuration file path'
complete -c aqua -n '__fish_seen_subcommand_from generate-registry gr' -f -l limit -s l -r -d 'the maximum number of versions'
complete -c aqua -n '__fish_seen_subcommand_from generate-registry gr' -f -l deep -d 'This flag was deprecated and had no meaning from aqua v2.15.0. This flag will be removed in aqua v3.0.0. https://github.com/aquaproj/aqua/issues/2351'
complete -c aqua -n '__fish_seen_subcommand_from generate-registry gr' -f -l init -d 'Generate a configuration file'
complete -c aqua -n '__fish_seen_subcommand_from version' -f -l help -s h -d 'show help'
complete -r -c aqua -n __fish_aqua_no_subcommand -a version -d 'Show version'
complete -c aqua -n '__fish_seen_subcommand_from root-dir' -f -l help -s h -d 'show help'
complete -r -c aqua -n __fish_aqua_no_subcommand -a root-dir -d 'Output the aqua root directory (AQUA_ROOT_DIR)'
complete -c aqua -n '__fish_seen_subcommand_from help h' -f -l help -s h -d 'show help'
complete -r -c aqua -n __fish_aqua_no_subcommand -a 'help h' -d 'Shows a list of commands or help for one command'

View File

@@ -1,71 +0,0 @@
# Print an optspec for argparse to handle cmd's options that are independent of any subcommand.
function __fish_bob_global_optspecs
string join \n h/help V/version
end
function __fish_bob_needs_command
# Figure out if the current invocation already has a command.
set -l cmd (commandline -opc)
set -e cmd[1]
argparse -s (__fish_bob_global_optspecs) -- $cmd 2>/dev/null
or return
if set -q argv[1]
# Also print the command, so this can be used to figure out what it is.
echo $argv[1]
return 1
end
return 0
end
function __fish_bob_using_subcommand
set -l cmd (__fish_bob_needs_command)
test -z "$cmd"
and return 1
contains -- $cmd[1] $argv
end
complete -c bob -n __fish_bob_needs_command -s h -l help -d 'Print help'
complete -c bob -n __fish_bob_needs_command -s V -l version -d 'Print version'
complete -c bob -n __fish_bob_needs_command -f -a use -d 'Switch to the specified version, by default will auto-invoke install command if the version is not installed already'
complete -c bob -n __fish_bob_needs_command -f -a install -d 'Install the specified version, can also be used to update out-of-date nightly version'
complete -c bob -n __fish_bob_needs_command -f -a sync -d 'If Config::version_sync_file_location is set, the version in that file will be parsed and installed'
complete -c bob -n __fish_bob_needs_command -f -a uninstall -d 'Uninstall the specified version'
complete -c bob -n __fish_bob_needs_command -f -a rm -d 'Uninstall the specified version'
complete -c bob -n __fish_bob_needs_command -f -a rollback -d 'Rollback to an existing nightly rollback'
complete -c bob -n __fish_bob_needs_command -f -a erase -d 'Erase any change bob ever made, including neovim installation, neovim version downloads and registry changes'
complete -c bob -n __fish_bob_needs_command -f -a list -d 'List all installed and used versions'
complete -c bob -n __fish_bob_needs_command -f -a ls -d 'List all installed and used versions'
complete -c bob -n __fish_bob_needs_command -f -a list-remote
complete -c bob -n __fish_bob_needs_command -f -a ls-remote
complete -c bob -n __fish_bob_needs_command -f -a complete -d 'Generate shell completion'
complete -c bob -n __fish_bob_needs_command -f -a update -d 'Update existing version |nightly|stable|--all|'
complete -c bob -n __fish_bob_needs_command -f -a run
complete -c bob -n __fish_bob_needs_command -f -a help -d 'Print this message or the help of the given subcommand(s)'
complete -c bob -n "__fish_bob_using_subcommand use" -s n -l no-install -d 'Whether not to auto-invoke install command'
complete -c bob -n "__fish_bob_using_subcommand use" -s h -l help -d 'Print help (see more with \'--help\')'
complete -c bob -n "__fish_bob_using_subcommand install" -s h -l help -d 'Print help (see more with \'--help\')'
complete -c bob -n "__fish_bob_using_subcommand sync" -s h -l help -d 'Print help'
complete -c bob -n "__fish_bob_using_subcommand uninstall" -s h -l help -d 'Print help (see more with \'--help\')'
complete -c bob -n "__fish_bob_using_subcommand rm" -s h -l help -d 'Print help (see more with \'--help\')'
complete -c bob -n "__fish_bob_using_subcommand rollback" -s h -l help -d 'Print help'
complete -c bob -n "__fish_bob_using_subcommand erase" -s h -l help -d 'Print help'
complete -c bob -n "__fish_bob_using_subcommand list" -s h -l help -d 'Print help'
complete -c bob -n "__fish_bob_using_subcommand ls" -s h -l help -d 'Print help'
complete -c bob -n "__fish_bob_using_subcommand list-remote" -s h -l help -d 'Print help'
complete -c bob -n "__fish_bob_using_subcommand ls-remote" -s h -l help -d 'Print help'
complete -c bob -n "__fish_bob_using_subcommand complete" -s h -l help -d 'Print help'
complete -c bob -n "__fish_bob_using_subcommand update" -s a -l all -d 'Apply the update to all versions'
complete -c bob -n "__fish_bob_using_subcommand update" -s h -l help -d 'Print help'
complete -c bob -n "__fish_bob_using_subcommand run" -s h -l help -d 'Print help'
complete -c bob -n "__fish_bob_using_subcommand help; and not __fish_seen_subcommand_from use install sync uninstall rollback erase list list-remote complete update run help" -f -a use -d 'Switch to the specified version, by default will auto-invoke install command if the version is not installed already'
complete -c bob -n "__fish_bob_using_subcommand help; and not __fish_seen_subcommand_from use install sync uninstall rollback erase list list-remote complete update run help" -f -a install -d 'Install the specified version, can also be used to update out-of-date nightly version'
complete -c bob -n "__fish_bob_using_subcommand help; and not __fish_seen_subcommand_from use install sync uninstall rollback erase list list-remote complete update run help" -f -a sync -d 'If Config::version_sync_file_location is set, the version in that file will be parsed and installed'
complete -c bob -n "__fish_bob_using_subcommand help; and not __fish_seen_subcommand_from use install sync uninstall rollback erase list list-remote complete update run help" -f -a uninstall -d 'Uninstall the specified version'
complete -c bob -n "__fish_bob_using_subcommand help; and not __fish_seen_subcommand_from use install sync uninstall rollback erase list list-remote complete update run help" -f -a rollback -d 'Rollback to an existing nightly rollback'
complete -c bob -n "__fish_bob_using_subcommand help; and not __fish_seen_subcommand_from use install sync uninstall rollback erase list list-remote complete update run help" -f -a erase -d 'Erase any change bob ever made, including neovim installation, neovim version downloads and registry changes'
complete -c bob -n "__fish_bob_using_subcommand help; and not __fish_seen_subcommand_from use install sync uninstall rollback erase list list-remote complete update run help" -f -a list -d 'List all installed and used versions'
complete -c bob -n "__fish_bob_using_subcommand help; and not __fish_seen_subcommand_from use install sync uninstall rollback erase list list-remote complete update run help" -f -a list-remote
complete -c bob -n "__fish_bob_using_subcommand help; and not __fish_seen_subcommand_from use install sync uninstall rollback erase list list-remote complete update run help" -f -a complete -d 'Generate shell completion'
complete -c bob -n "__fish_bob_using_subcommand help; and not __fish_seen_subcommand_from use install sync uninstall rollback erase list list-remote complete update run help" -f -a update -d 'Update existing version |nightly|stable|--all|'
complete -c bob -n "__fish_bob_using_subcommand help; and not __fish_seen_subcommand_from use install sync uninstall rollback erase list list-remote complete update run help" -f -a run
complete -c bob -n "__fish_bob_using_subcommand help; and not __fish_seen_subcommand_from use install sync uninstall rollback erase list list-remote complete update run help" -f -a help -d 'Print this message or the help of the given subcommand(s)'

View File

@@ -1,234 +0,0 @@
# fish completion for docker -*- shell-script -*-
function __docker_debug
set -l file "$BASH_COMP_DEBUG_FILE"
if test -n "$file"
echo "$argv" >>$file
end
end
function __docker_perform_completion
__docker_debug "Starting __docker_perform_completion"
# Extract all args except the last one
set -l args (commandline -opc)
# Extract the last arg and escape it in case it is a space
set -l lastArg (string escape -- (commandline -ct))
__docker_debug "args: $args"
__docker_debug "last arg: $lastArg"
# Disable ActiveHelp which is not supported for fish shell
set -l requestComp "DOCKER_ACTIVE_HELP=0 $args[1] __complete $args[2..-1] $lastArg"
__docker_debug "Calling $requestComp"
set -l results (eval $requestComp 2> /dev/null)
# Some programs may output extra empty lines after the directive.
# Let's ignore them or else it will break completion.
# Ref: https://github.com/spf13/cobra/issues/1279
for line in $results[-1..1]
if test (string trim -- $line) = ""
# Found an empty line, remove it
set results $results[1..-2]
else
# Found non-empty line, we have our proper output
break
end
end
set -l comps $results[1..-2]
set -l directiveLine $results[-1]
# For Fish, when completing a flag with an = (e.g., <program> -n=<TAB>)
# completions must be prefixed with the flag
set -l flagPrefix (string match -r -- '-.*=' "$lastArg")
__docker_debug "Comps: $comps"
__docker_debug "DirectiveLine: $directiveLine"
__docker_debug "flagPrefix: $flagPrefix"
for comp in $comps
printf "%s%s\n" "$flagPrefix" "$comp"
end
printf "%s\n" "$directiveLine"
end
# this function limits calls to __docker_perform_completion, by caching the result behind $__docker_perform_completion_once_result
function __docker_perform_completion_once
__docker_debug "Starting __docker_perform_completion_once"
if test -n "$__docker_perform_completion_once_result"
__docker_debug "Seems like a valid result already exists, skipping __docker_perform_completion"
return 0
end
set --global __docker_perform_completion_once_result (__docker_perform_completion)
if test -z "$__docker_perform_completion_once_result"
__docker_debug "No completions, probably due to a failure"
return 1
end
__docker_debug "Performed completions and set __docker_perform_completion_once_result"
return 0
end
# this function is used to clear the $__docker_perform_completion_once_result variable after completions are run
function __docker_clear_perform_completion_once_result
__docker_debug ""
__docker_debug "========= clearing previously set __docker_perform_completion_once_result variable =========="
set --erase __docker_perform_completion_once_result
__docker_debug "Successfully erased the variable __docker_perform_completion_once_result"
end
function __docker_requires_order_preservation
__docker_debug ""
__docker_debug "========= checking if order preservation is required =========="
__docker_perform_completion_once
if test -z "$__docker_perform_completion_once_result"
__docker_debug "Error determining if order preservation is required"
return 1
end
set -l directive (string sub --start 2 $__docker_perform_completion_once_result[-1])
__docker_debug "Directive is: $directive"
set -l shellCompDirectiveKeepOrder 32
set -l keeporder (math (math --scale 0 $directive / $shellCompDirectiveKeepOrder) % 2)
__docker_debug "Keeporder is: $keeporder"
if test $keeporder -ne 0
__docker_debug "This does require order preservation"
return 0
end
__docker_debug "This doesn't require order preservation"
return 1
end
# This function does two things:
# - Obtain the completions and store them in the global __docker_comp_results
# - Return false if file completion should be performed
function __docker_prepare_completions
__docker_debug ""
__docker_debug "========= starting completion logic =========="
# Start fresh
set --erase __docker_comp_results
__docker_perform_completion_once
__docker_debug "Completion results: $__docker_perform_completion_once_result"
if test -z "$__docker_perform_completion_once_result"
__docker_debug "No completion, probably due to a failure"
# Might as well do file completion, in case it helps
return 1
end
set -l directive (string sub --start 2 $__docker_perform_completion_once_result[-1])
set --global __docker_comp_results $__docker_perform_completion_once_result[1..-2]
__docker_debug "Completions are: $__docker_comp_results"
__docker_debug "Directive is: $directive"
set -l shellCompDirectiveError 1
set -l shellCompDirectiveNoSpace 2
set -l shellCompDirectiveNoFileComp 4
set -l shellCompDirectiveFilterFileExt 8
set -l shellCompDirectiveFilterDirs 16
if test -z "$directive"
set directive 0
end
set -l compErr (math (math --scale 0 $directive / $shellCompDirectiveError) % 2)
if test $compErr -eq 1
__docker_debug "Received error directive: aborting."
# Might as well do file completion, in case it helps
return 1
end
set -l filefilter (math (math --scale 0 $directive / $shellCompDirectiveFilterFileExt) % 2)
set -l dirfilter (math (math --scale 0 $directive / $shellCompDirectiveFilterDirs) % 2)
if test $filefilter -eq 1; or test $dirfilter -eq 1
__docker_debug "File extension filtering or directory filtering not supported"
# Do full file completion instead
return 1
end
set -l nospace (math (math --scale 0 $directive / $shellCompDirectiveNoSpace) % 2)
set -l nofiles (math (math --scale 0 $directive / $shellCompDirectiveNoFileComp) % 2)
__docker_debug "nospace: $nospace, nofiles: $nofiles"
# If we want to prevent a space, or if file completion is NOT disabled,
# we need to count the number of valid completions.
# To do so, we will filter on prefix as the completions we have received
# may not already be filtered so as to allow fish to match on different
# criteria than the prefix.
if test $nospace -ne 0; or test $nofiles -eq 0
set -l prefix (commandline -t | string escape --style=regex)
__docker_debug "prefix: $prefix"
set -l completions (string match -r -- "^$prefix.*" $__docker_comp_results)
set --global __docker_comp_results $completions
__docker_debug "Filtered completions are: $__docker_comp_results"
# Important not to quote the variable for count to work
set -l numComps (count $__docker_comp_results)
__docker_debug "numComps: $numComps"
if test $numComps -eq 1; and test $nospace -ne 0
# We must first split on \t to get rid of the descriptions to be
# able to check what the actual completion will be.
# We don't need descriptions anyway since there is only a single
# real completion which the shell will expand immediately.
set -l split (string split --max 1 \t $__docker_comp_results[1])
# Fish won't add a space if the completion ends with any
# of the following characters: @=/:.,
set -l lastChar (string sub -s -1 -- $split)
if not string match -r -q "[@=/:.,]" -- "$lastChar"
# In other cases, to support the "nospace" directive we trick the shell
# by outputting an extra, longer completion.
__docker_debug "Adding second completion to perform nospace directive"
set --global __docker_comp_results $split[1] $split[1].
__docker_debug "Completions are now: $__docker_comp_results"
end
end
if test $numComps -eq 0; and test $nofiles -eq 0
# To be consistent with bash and zsh, we only trigger file
# completion when there are no other completions
__docker_debug "Requesting file completion"
return 1
end
end
return 0
end
# Since Fish completions are only loaded once the user triggers them, we trigger them ourselves
# so we can properly delete any completions provided by another script.
# Only do this if the program can be found, or else fish may print some errors; besides,
# the existing completions will only be loaded if the program can be found.
if type -q docker
# The space after the program name is essential to trigger completion for the program
# and not completion of the program name itself.
# Also, we use '> /dev/null 2>&1' since '&>' is not supported in older versions of fish.
complete --do-complete "docker " >/dev/null 2>&1
end
# Remove any pre-existing completions for the program since we will be handling all of them.
complete -c docker -e
# this will get called after the two calls below and clear the $__docker_perform_completion_once_result global
complete -c docker -n __docker_clear_perform_completion_once_result
# The call to __docker_prepare_completions will setup __docker_comp_results
# which provides the program's completion choices.
# If this doesn't require order preservation, we don't use the -k flag
complete -c docker -n 'not __docker_requires_order_preservation && __docker_prepare_completions' -f -a '$__docker_comp_results'
# otherwise we use the -k flag
complete -k -c docker -n '__docker_requires_order_preservation && __docker_prepare_completions' -f -a '$__docker_comp_results'

View File

@@ -0,0 +1,70 @@
# @halostatue/fish-macos/completions/finder.fish:v7.0.0
complete --command finder --erase
complete --command finder --arguments track \
--exclusive --condition __fish_use_subcommand \
--description 'Enables Finder PWD tracking'
complete --command finder --arguments untrack \
--exclusive --condition __fish_use_subcommand \
--description 'Disables Finder PWD tracking'
complete --command finder --arguments pwd \
--exclusive --condition __fish_use_subcommand \
--description 'Prints the path of the Finder window'
complete --command finder --arguments cd \
--exclusive --condition __fish_use_subcommand \
--description 'Changes to the path of the Finder window'
complete --command finder --arguments pushd \
--exclusive --condition __fish_use_subcommand \
--description 'Pushes to the path of the Finder window'
complete --command finder --arguments update \
--exclusive --condition __fish_use_subcommand \
--description 'Updates the Finder to PWD'
complete --command finder --arguments list \
--exclusive --condition __fish_use_subcommand \
--description 'Sets Finder to list view with PWD'
complete --command finder --arguments icon \
--exclusive --condition __fish_use_subcommand \
--description 'Sets Finder to icon view with PWD'
complete --command finder --arguments column \
--exclusive --condition __fish_use_subcommand \
--description 'Sets Finder to column view with PWD'
complete --command finder --arguments hidden \
--exclusive --condition __fish_use_subcommand \
--description 'Shows or hides `hidden` files'
complete --command finder --arguments desktop-icons \
--exclusive --condition __fish_use_subcommand \
--description 'Shows or hides desktop icons'
complete --command finder --arguments clean \
--exclusive --condition __fish_use_subcommand \
--description 'Cleans .DS_Store files'
complete --command finder --arguments quarantine \
--exclusive --condition __fish_use_subcommand \
--description 'Works with file quarantine data'
complete --command finder --arguments selected \
--exclusive --condition __fish_use_subcommand \
--description 'Print Finder selected files'
for subcommand in cd clean column desktop-icons hidden icon list pushd pwd quarantine selected track untrack update
complete --command finder --condition '__fish_seen_subcommand_from '$subcommand \
--short-option h --long-option help --description 'Help for finder '$subcommand
end
for subcommand in hidden desktop-icons
complete --command finder --condition '__fish_seen_subcommand_from '$subcommand \
--arguments off --description 'Turns '$subcommand' off'
complete --command finder --condition '__fish_seen_subcommand_from '$subcommand \
--arguments on --description 'Turns '$subcommand' on'
complete --command finder --condition '__fish_seen_subcommand_from '$subcommand \
--arguments toggle --description 'Toggles '$subcommand
complete --command finder --condition '__fish_seen_subcommand_from '$subcommand \
--arguments status --description 'Shows the status of '$subcommand
end
complete --command finder --condition '__fish_seen_subcommand_from 'quarantine \
--arguments show --description 'Shows quarantine events'
complete --command finder --condition '__fish_seen_subcommand_from 'quarantine \
--arguments clear --description 'Clears all quarantine events'
complete --command finder --condition '__fish_seen_subcommand_from 'quarantine \
--arguments clean --description 'Removes 'quarantine' attributes from files' \
--require-parameter --force-files

View File

@@ -1,175 +0,0 @@
# fish completion for git-profile -*- shell-script -*-
function __git_profile_debug
set -l file "$BASH_COMP_DEBUG_FILE"
if test -n "$file"
echo "$argv" >>$file
end
end
function __git_profile_perform_completion
__git_profile_debug "Starting __git_profile_perform_completion"
# Extract all args except the last one
set -l args (commandline -opc)
# Extract the last arg and escape it in case it is a space
set -l lastArg (string escape -- (commandline -ct))
__git_profile_debug "args: $args"
__git_profile_debug "last arg: $lastArg"
set -l requestComp "$args[1] __complete $args[2..-1] $lastArg"
__git_profile_debug "Calling $requestComp"
set -l results (eval $requestComp 2> /dev/null)
# Some programs may output extra empty lines after the directive.
# Let's ignore them or else it will break completion.
# Ref: https://github.com/spf13/cobra/issues/1279
for line in $results[-1..1]
if test (string trim -- $line) = ""
# Found an empty line, remove it
set results $results[1..-2]
else
# Found non-empty line, we have our proper output
break
end
end
set -l comps $results[1..-2]
set -l directiveLine $results[-1]
# For Fish, when completing a flag with an = (e.g., <program> -n=<TAB>)
# completions must be prefixed with the flag
set -l flagPrefix (string match -r -- '-.*=' "$lastArg")
__git_profile_debug "Comps: $comps"
__git_profile_debug "DirectiveLine: $directiveLine"
__git_profile_debug "flagPrefix: $flagPrefix"
for comp in $comps
printf "%s%s\n" "$flagPrefix" "$comp"
end
printf "%s\n" "$directiveLine"
end
# This function does two things:
# - Obtain the completions and store them in the global __git_profile_comp_results
# - Return false if file completion should be performed
function __git_profile_prepare_completions
__git_profile_debug ""
__git_profile_debug "========= starting completion logic =========="
# Start fresh
set --erase __git_profile_comp_results
set -l results (__git_profile_perform_completion)
__git_profile_debug "Completion results: $results"
if test -z "$results"
__git_profile_debug "No completion, probably due to a failure"
# Might as well do file completion, in case it helps
return 1
end
set -l directive (string sub --start 2 $results[-1])
set --global __git_profile_comp_results $results[1..-2]
__git_profile_debug "Completions are: $__git_profile_comp_results"
__git_profile_debug "Directive is: $directive"
set -l shellCompDirectiveError 1
set -l shellCompDirectiveNoSpace 2
set -l shellCompDirectiveNoFileComp 4
set -l shellCompDirectiveFilterFileExt 8
set -l shellCompDirectiveFilterDirs 16
if test -z "$directive"
set directive 0
end
set -l compErr (math (math --scale 0 $directive / $shellCompDirectiveError) % 2)
if test $compErr -eq 1
__git_profile_debug "Received error directive: aborting."
# Might as well do file completion, in case it helps
return 1
end
set -l filefilter (math (math --scale 0 $directive / $shellCompDirectiveFilterFileExt) % 2)
set -l dirfilter (math (math --scale 0 $directive / $shellCompDirectiveFilterDirs) % 2)
if test $filefilter -eq 1; or test $dirfilter -eq 1
__git_profile_debug "File extension filtering or directory filtering not supported"
# Do full file completion instead
return 1
end
set -l nospace (math (math --scale 0 $directive / $shellCompDirectiveNoSpace) % 2)
set -l nofiles (math (math --scale 0 $directive / $shellCompDirectiveNoFileComp) % 2)
__git_profile_debug "nospace: $nospace, nofiles: $nofiles"
# If we want to prevent a space, or if file completion is NOT disabled,
# we need to count the number of valid completions.
# To do so, we will filter on prefix as the completions we have received
# may not already be filtered so as to allow fish to match on different
# criteria than the prefix.
if test $nospace -ne 0; or test $nofiles -eq 0
set -l prefix (commandline -t | string escape --style=regex)
__git_profile_debug "prefix: $prefix"
set -l completions (string match -r -- "^$prefix.*" $__git_profile_comp_results)
set --global __git_profile_comp_results $completions
__git_profile_debug "Filtered completions are: $__git_profile_comp_results"
# Important not to quote the variable for count to work
set -l numComps (count $__git_profile_comp_results)
__git_profile_debug "numComps: $numComps"
if test $numComps -eq 1; and test $nospace -ne 0
# We must first split on \t to get rid of the descriptions to be
# able to check what the actual completion will be.
# We don't need descriptions anyway since there is only a single
# real completion which the shell will expand immediately.
set -l split (string split --max 1 \t $__git_profile_comp_results[1])
# Fish won't add a space if the completion ends with any
# of the following characters: @=/:.,
set -l lastChar (string sub -s -1 -- $split)
if not string match -r -q "[@=/:.,]" -- "$lastChar"
# In other cases, to support the "nospace" directive we trick the shell
# by outputting an extra, longer completion.
__git_profile_debug "Adding second completion to perform nospace directive"
set --global __git_profile_comp_results $split[1] $split[1].
__git_profile_debug "Completions are now: $__git_profile_comp_results"
end
end
if test $numComps -eq 0; and test $nofiles -eq 0
# To be consistent with bash and zsh, we only trigger file
# completion when there are no other completions
__git_profile_debug "Requesting file completion"
return 1
end
end
return 0
end
# Since Fish completions are only loaded once the user triggers them, we trigger them ourselves
# so we can properly delete any completions provided by another script.
# Only do this if the program can be found, or else fish may print some errors; besides,
# the existing completions will only be loaded if the program can be found.
if type -q git-profile
# The space after the program name is essential to trigger completion for the program
# and not completion of the program name itself.
# Also, we use '> /dev/null 2>&1' since '&>' is not supported in older versions of fish.
complete --do-complete "git-profile " >/dev/null 2>&1
end
# Remove any pre-existing completions for the program since we will be handling all of them.
complete -c git-profile -e
# The call to __git_profile_prepare_completions will setup __git_profile_comp_results
# which provides the program's completion choices.
complete -c git-profile -n __git_profile_prepare_completions -f -a '$__git_profile_comp_results'

View File

@@ -1,234 +0,0 @@
# fish completion for golangci-lint -*- shell-script -*-
function __golangci_lint_debug
set -l file "$BASH_COMP_DEBUG_FILE"
if test -n "$file"
echo "$argv" >>$file
end
end
function __golangci_lint_perform_completion
__golangci_lint_debug "Starting __golangci_lint_perform_completion"
# Extract all args except the last one
set -l args (commandline -opc)
# Extract the last arg and escape it in case it is a space
set -l lastArg (string escape -- (commandline -ct))
__golangci_lint_debug "args: $args"
__golangci_lint_debug "last arg: $lastArg"
# Disable ActiveHelp which is not supported for fish shell
set -l requestComp "GOLANGCI_LINT_ACTIVE_HELP=0 $args[1] __complete $args[2..-1] $lastArg"
__golangci_lint_debug "Calling $requestComp"
set -l results (eval $requestComp 2> /dev/null)
# Some programs may output extra empty lines after the directive.
# Let's ignore them or else it will break completion.
# Ref: https://github.com/spf13/cobra/issues/1279
for line in $results[-1..1]
if test (string trim -- $line) = ""
# Found an empty line, remove it
set results $results[1..-2]
else
# Found non-empty line, we have our proper output
break
end
end
set -l comps $results[1..-2]
set -l directiveLine $results[-1]
# For Fish, when completing a flag with an = (e.g., <program> -n=<TAB>)
# completions must be prefixed with the flag
set -l flagPrefix (string match -r -- '-.*=' "$lastArg")
__golangci_lint_debug "Comps: $comps"
__golangci_lint_debug "DirectiveLine: $directiveLine"
__golangci_lint_debug "flagPrefix: $flagPrefix"
for comp in $comps
printf "%s%s\n" "$flagPrefix" "$comp"
end
printf "%s\n" "$directiveLine"
end
# this function limits calls to __golangci_lint_perform_completion, by caching the result behind $__golangci_lint_perform_completion_once_result
function __golangci_lint_perform_completion_once
__golangci_lint_debug "Starting __golangci_lint_perform_completion_once"
if test -n "$__golangci_lint_perform_completion_once_result"
__golangci_lint_debug "Seems like a valid result already exists, skipping __golangci_lint_perform_completion"
return 0
end
set --global __golangci_lint_perform_completion_once_result (__golangci_lint_perform_completion)
if test -z "$__golangci_lint_perform_completion_once_result"
__golangci_lint_debug "No completions, probably due to a failure"
return 1
end
__golangci_lint_debug "Performed completions and set __golangci_lint_perform_completion_once_result"
return 0
end
# this function is used to clear the $__golangci_lint_perform_completion_once_result variable after completions are run
function __golangci_lint_clear_perform_completion_once_result
__golangci_lint_debug ""
__golangci_lint_debug "========= clearing previously set __golangci_lint_perform_completion_once_result variable =========="
set --erase __golangci_lint_perform_completion_once_result
__golangci_lint_debug "Successfully erased the variable __golangci_lint_perform_completion_once_result"
end
function __golangci_lint_requires_order_preservation
__golangci_lint_debug ""
__golangci_lint_debug "========= checking if order preservation is required =========="
__golangci_lint_perform_completion_once
if test -z "$__golangci_lint_perform_completion_once_result"
__golangci_lint_debug "Error determining if order preservation is required"
return 1
end
set -l directive (string sub --start 2 $__golangci_lint_perform_completion_once_result[-1])
__golangci_lint_debug "Directive is: $directive"
set -l shellCompDirectiveKeepOrder 32
set -l keeporder (math (math --scale 0 $directive / $shellCompDirectiveKeepOrder) % 2)
__golangci_lint_debug "Keeporder is: $keeporder"
if test $keeporder -ne 0
__golangci_lint_debug "This does require order preservation"
return 0
end
__golangci_lint_debug "This doesn't require order preservation"
return 1
end
# This function does two things:
# - Obtain the completions and store them in the global __golangci_lint_comp_results
# - Return false if file completion should be performed
function __golangci_lint_prepare_completions
__golangci_lint_debug ""
__golangci_lint_debug "========= starting completion logic =========="
# Start fresh
set --erase __golangci_lint_comp_results
__golangci_lint_perform_completion_once
__golangci_lint_debug "Completion results: $__golangci_lint_perform_completion_once_result"
if test -z "$__golangci_lint_perform_completion_once_result"
__golangci_lint_debug "No completion, probably due to a failure"
# Might as well do file completion, in case it helps
return 1
end
set -l directive (string sub --start 2 $__golangci_lint_perform_completion_once_result[-1])
set --global __golangci_lint_comp_results $__golangci_lint_perform_completion_once_result[1..-2]
__golangci_lint_debug "Completions are: $__golangci_lint_comp_results"
__golangci_lint_debug "Directive is: $directive"
set -l shellCompDirectiveError 1
set -l shellCompDirectiveNoSpace 2
set -l shellCompDirectiveNoFileComp 4
set -l shellCompDirectiveFilterFileExt 8
set -l shellCompDirectiveFilterDirs 16
if test -z "$directive"
set directive 0
end
set -l compErr (math (math --scale 0 $directive / $shellCompDirectiveError) % 2)
if test $compErr -eq 1
__golangci_lint_debug "Received error directive: aborting."
# Might as well do file completion, in case it helps
return 1
end
set -l filefilter (math (math --scale 0 $directive / $shellCompDirectiveFilterFileExt) % 2)
set -l dirfilter (math (math --scale 0 $directive / $shellCompDirectiveFilterDirs) % 2)
if test $filefilter -eq 1; or test $dirfilter -eq 1
__golangci_lint_debug "File extension filtering or directory filtering not supported"
# Do full file completion instead
return 1
end
set -l nospace (math (math --scale 0 $directive / $shellCompDirectiveNoSpace) % 2)
set -l nofiles (math (math --scale 0 $directive / $shellCompDirectiveNoFileComp) % 2)
__golangci_lint_debug "nospace: $nospace, nofiles: $nofiles"
# If we want to prevent a space, or if file completion is NOT disabled,
# we need to count the number of valid completions.
# To do so, we will filter on prefix as the completions we have received
# may not already be filtered so as to allow fish to match on different
# criteria than the prefix.
if test $nospace -ne 0; or test $nofiles -eq 0
set -l prefix (commandline -t | string escape --style=regex)
__golangci_lint_debug "prefix: $prefix"
set -l completions (string match -r -- "^$prefix.*" $__golangci_lint_comp_results)
set --global __golangci_lint_comp_results $completions
__golangci_lint_debug "Filtered completions are: $__golangci_lint_comp_results"
# Important not to quote the variable for count to work
set -l numComps (count $__golangci_lint_comp_results)
__golangci_lint_debug "numComps: $numComps"
if test $numComps -eq 1; and test $nospace -ne 0
# We must first split on \t to get rid of the descriptions to be
# able to check what the actual completion will be.
# We don't need descriptions anyway since there is only a single
# real completion which the shell will expand immediately.
set -l split (string split --max 1 \t $__golangci_lint_comp_results[1])
# Fish won't add a space if the completion ends with any
# of the following characters: @=/:.,
set -l lastChar (string sub -s -1 -- $split)
if not string match -r -q "[@=/:.,]" -- "$lastChar"
# In other cases, to support the "nospace" directive we trick the shell
# by outputting an extra, longer completion.
__golangci_lint_debug "Adding second completion to perform nospace directive"
set --global __golangci_lint_comp_results $split[1] $split[1].
__golangci_lint_debug "Completions are now: $__golangci_lint_comp_results"
end
end
if test $numComps -eq 0; and test $nofiles -eq 0
# To be consistent with bash and zsh, we only trigger file
# completion when there are no other completions
__golangci_lint_debug "Requesting file completion"
return 1
end
end
return 0
end
# Since Fish completions are only loaded once the user triggers them, we trigger them ourselves
# so we can properly delete any completions provided by another script.
# Only do this if the program can be found, or else fish may print some errors; besides,
# the existing completions will only be loaded if the program can be found.
if type -q golangci-lint
# The space after the program name is essential to trigger completion for the program
# and not completion of the program name itself.
# Also, we use '> /dev/null 2>&1' since '&>' is not supported in older versions of fish.
complete --do-complete "golangci-lint " >/dev/null 2>&1
end
# Remove any pre-existing completions for the program since we will be handling all of them.
complete -c golangci-lint -e
# this will get called after the two calls below and clear the $__golangci_lint_perform_completion_once_result global
complete -c golangci-lint -n __golangci_lint_clear_perform_completion_once_result
# The call to __golangci_lint_prepare_completions will setup __golangci_lint_comp_results
# which provides the program's completion choices.
# If this doesn't require order preservation, we don't use the -k flag
complete -c golangci-lint -n 'not __golangci_lint_requires_order_preservation && __golangci_lint_prepare_completions' -f -a '$__golangci_lint_comp_results'
# otherwise we use the -k flag
complete -k -c golangci-lint -n '__golangci_lint_requires_order_preservation && __golangci_lint_prepare_completions' -f -a '$__golangci_lint_comp_results'

View File

@@ -1,234 +0,0 @@
# fish completion for grype -*- shell-script -*-
function __grype_debug
set -l file "$BASH_COMP_DEBUG_FILE"
if test -n "$file"
echo "$argv" >>$file
end
end
function __grype_perform_completion
__grype_debug "Starting __grype_perform_completion"
# Extract all args except the last one
set -l args (commandline -opc)
# Extract the last arg and escape it in case it is a space
set -l lastArg (string escape -- (commandline -ct))
__grype_debug "args: $args"
__grype_debug "last arg: $lastArg"
# Disable ActiveHelp which is not supported for fish shell
set -l requestComp "GRYPE_ACTIVE_HELP=0 $args[1] __complete $args[2..-1] $lastArg"
__grype_debug "Calling $requestComp"
set -l results (eval $requestComp 2> /dev/null)
# Some programs may output extra empty lines after the directive.
# Let's ignore them or else it will break completion.
# Ref: https://github.com/spf13/cobra/issues/1279
for line in $results[-1..1]
if test (string trim -- $line) = ""
# Found an empty line, remove it
set results $results[1..-2]
else
# Found non-empty line, we have our proper output
break
end
end
set -l comps $results[1..-2]
set -l directiveLine $results[-1]
# For Fish, when completing a flag with an = (e.g., <program> -n=<TAB>)
# completions must be prefixed with the flag
set -l flagPrefix (string match -r -- '-.*=' "$lastArg")
__grype_debug "Comps: $comps"
__grype_debug "DirectiveLine: $directiveLine"
__grype_debug "flagPrefix: $flagPrefix"
for comp in $comps
printf "%s%s\n" "$flagPrefix" "$comp"
end
printf "%s\n" "$directiveLine"
end
# this function limits calls to __grype_perform_completion, by caching the result behind $__grype_perform_completion_once_result
function __grype_perform_completion_once
__grype_debug "Starting __grype_perform_completion_once"
if test -n "$__grype_perform_completion_once_result"
__grype_debug "Seems like a valid result already exists, skipping __grype_perform_completion"
return 0
end
set --global __grype_perform_completion_once_result (__grype_perform_completion)
if test -z "$__grype_perform_completion_once_result"
__grype_debug "No completions, probably due to a failure"
return 1
end
__grype_debug "Performed completions and set __grype_perform_completion_once_result"
return 0
end
# this function is used to clear the $__grype_perform_completion_once_result variable after completions are run
function __grype_clear_perform_completion_once_result
__grype_debug ""
__grype_debug "========= clearing previously set __grype_perform_completion_once_result variable =========="
set --erase __grype_perform_completion_once_result
__grype_debug "Successfully erased the variable __grype_perform_completion_once_result"
end
function __grype_requires_order_preservation
__grype_debug ""
__grype_debug "========= checking if order preservation is required =========="
__grype_perform_completion_once
if test -z "$__grype_perform_completion_once_result"
__grype_debug "Error determining if order preservation is required"
return 1
end
set -l directive (string sub --start 2 $__grype_perform_completion_once_result[-1])
__grype_debug "Directive is: $directive"
set -l shellCompDirectiveKeepOrder 32
set -l keeporder (math (math --scale 0 $directive / $shellCompDirectiveKeepOrder) % 2)
__grype_debug "Keeporder is: $keeporder"
if test $keeporder -ne 0
__grype_debug "This does require order preservation"
return 0
end
__grype_debug "This doesn't require order preservation"
return 1
end
# This function does two things:
# - Obtain the completions and store them in the global __grype_comp_results
# - Return false if file completion should be performed
function __grype_prepare_completions
__grype_debug ""
__grype_debug "========= starting completion logic =========="
# Start fresh
set --erase __grype_comp_results
__grype_perform_completion_once
__grype_debug "Completion results: $__grype_perform_completion_once_result"
if test -z "$__grype_perform_completion_once_result"
__grype_debug "No completion, probably due to a failure"
# Might as well do file completion, in case it helps
return 1
end
set -l directive (string sub --start 2 $__grype_perform_completion_once_result[-1])
set --global __grype_comp_results $__grype_perform_completion_once_result[1..-2]
__grype_debug "Completions are: $__grype_comp_results"
__grype_debug "Directive is: $directive"
set -l shellCompDirectiveError 1
set -l shellCompDirectiveNoSpace 2
set -l shellCompDirectiveNoFileComp 4
set -l shellCompDirectiveFilterFileExt 8
set -l shellCompDirectiveFilterDirs 16
if test -z "$directive"
set directive 0
end
set -l compErr (math (math --scale 0 $directive / $shellCompDirectiveError) % 2)
if test $compErr -eq 1
__grype_debug "Received error directive: aborting."
# Might as well do file completion, in case it helps
return 1
end
set -l filefilter (math (math --scale 0 $directive / $shellCompDirectiveFilterFileExt) % 2)
set -l dirfilter (math (math --scale 0 $directive / $shellCompDirectiveFilterDirs) % 2)
if test $filefilter -eq 1; or test $dirfilter -eq 1
__grype_debug "File extension filtering or directory filtering not supported"
# Do full file completion instead
return 1
end
set -l nospace (math (math --scale 0 $directive / $shellCompDirectiveNoSpace) % 2)
set -l nofiles (math (math --scale 0 $directive / $shellCompDirectiveNoFileComp) % 2)
__grype_debug "nospace: $nospace, nofiles: $nofiles"
# If we want to prevent a space, or if file completion is NOT disabled,
# we need to count the number of valid completions.
# To do so, we will filter on prefix as the completions we have received
# may not already be filtered so as to allow fish to match on different
# criteria than the prefix.
if test $nospace -ne 0; or test $nofiles -eq 0
set -l prefix (commandline -t | string escape --style=regex)
__grype_debug "prefix: $prefix"
set -l completions (string match -r -- "^$prefix.*" $__grype_comp_results)
set --global __grype_comp_results $completions
__grype_debug "Filtered completions are: $__grype_comp_results"
# Important not to quote the variable for count to work
set -l numComps (count $__grype_comp_results)
__grype_debug "numComps: $numComps"
if test $numComps -eq 1; and test $nospace -ne 0
# We must first split on \t to get rid of the descriptions to be
# able to check what the actual completion will be.
# We don't need descriptions anyway since there is only a single
# real completion which the shell will expand immediately.
set -l split (string split --max 1 \t $__grype_comp_results[1])
# Fish won't add a space if the completion ends with any
# of the following characters: @=/:.,
set -l lastChar (string sub -s -1 -- $split)
if not string match -r -q "[@=/:.,]" -- "$lastChar"
# In other cases, to support the "nospace" directive we trick the shell
# by outputting an extra, longer completion.
__grype_debug "Adding second completion to perform nospace directive"
set --global __grype_comp_results $split[1] $split[1].
__grype_debug "Completions are now: $__grype_comp_results"
end
end
if test $numComps -eq 0; and test $nofiles -eq 0
# To be consistent with bash and zsh, we only trigger file
# completion when there are no other completions
__grype_debug "Requesting file completion"
return 1
end
end
return 0
end
# Since Fish completions are only loaded once the user triggers them, we trigger them ourselves
# so we can properly delete any completions provided by another script.
# Only do this if the program can be found, or else fish may print some errors; besides,
# the existing completions will only be loaded if the program can be found.
if type -q grype
# The space after the program name is essential to trigger completion for the program
# and not completion of the program name itself.
# Also, we use '> /dev/null 2>&1' since '&>' is not supported in older versions of fish.
complete --do-complete "grype " >/dev/null 2>&1
end
# Remove any pre-existing completions for the program since we will be handling all of them.
complete -c grype -e
# this will get called after the two calls below and clear the $__grype_perform_completion_once_result global
complete -c grype -n __grype_clear_perform_completion_once_result
# The call to __grype_prepare_completions will setup __grype_comp_results
# which provides the program's completion choices.
# If this doesn't require order preservation, we don't use the -k flag
complete -c grype -n 'not __grype_requires_order_preservation && __grype_prepare_completions' -f -a '$__grype_comp_results'
# otherwise we use the -k flag
complete -k -c grype -n '__grype_requires_order_preservation && __grype_prepare_completions' -f -a '$__grype_comp_results'

View File

@@ -0,0 +1,119 @@
# @halostatue/fish-macos/completions/mac.fish:v7.0.0
complete --command mac --erase
complete --command mac --arguments airdrop \
--exclusive --condition __fish_use_subcommand \
--description 'Changes AirDrop settings'
complete --command mac --arguments airport \
--exclusive --condition __fish_use_subcommand \
--description 'Work with AirPort (WiFi) settings'
complete --command mac --arguments brightness \
--exclusive --condition __fish_use_subcommand \
--description 'Adjust the screen brightness level'
complete --command mac --arguments flushdns \
--exclusive --condition __fish_use_subcommand \
--description 'Flushes DNS'
complete --command mac --arguments font-smoothing \
--exclusive --condition __fish_use_subcommand \
--description 'Manages font smoothing settings'
complete --command mac --arguments lsclean \
--exclusive --condition __fish_use_subcommand \
--description 'Cleans LaunchServices to remove duplicate Open with... entries'
complete --command mac --arguments mail \
--exclusive --condition __fish_use_subcommand \
--description 'Manage various operations of Mail.app'
complete --command mac --arguments proxy-icon \
--exclusive --condition __fish_use_subcommand \
--description 'Manage proxy icon appearance delay'
complete --command mac --arguments transparency \
--exclusive --condition __fish_use_subcommand \
--description 'Manage UI transparency'
complete --command mac --arguments vol \
--exclusive --condition __fish_use_subcommand \
--description 'Changes Mac volume; accepts 0100 volume percentage'
for subcommand in airdrop airport brightness flushdns font-smoothing lsclean mail proxy-icon transparency version vol
complete --command mac --condition '__fish_seen_subcommand_from '$subcommand \
--short-option h --long-option help --description 'Help for mac '$subcommand
end
complete --command mac --condition '__fish_seen_subcommand_from brightness' \
--arguments up --description 'Increases screen brightness'
complete --command mac --condition '__fish_seen_subcommand_from brightness' \
--arguments down --description 'Decreases screen brightness'
for subcommand in airdrop proxy-icon transparency
complete --command mac --condition '__fish_seen_subcommand_from '$subcommand \
--arguments on --description 'Enables '$subcommand
complete --command mac --condition '__fish_seen_subcommand_from '$subcommand \
--arguments off --description 'Disables '$subcommand
complete --command mac --condition '__fish_seen_subcommand_from '$subcommand \
--arguments toggle --description 'Toggles '$subcommand
complete --command mac --condition '__fish_seen_subcommand_from '$subcommand \
--arguments status --description 'Shows the status of '$subcommand
end
complete --command mac --condition '__fish_seen_subcommand_from 'airport \
--arguments scan --description 'Shows available networks'
complete --command mac --condition '__fish_seen_subcommand_from 'airport \
--arguments ssid --description 'Shows the SSID'
complete --command mac --condition '__fish_seen_subcommand_from 'airport \
--arguments password --description 'Gets the current WiFi network password'
complete --command mac --condition '__fish_seen_subcommand_from 'font-smoothing \
--arguments on --description 'Enables font smoothing; app IDs can be provided to limit control'
complete --command mac --condition '__fish_seen_subcommand_from 'font-smoothing \
--arguments off --description 'Disables font smoothing; app IDs can be provided to limit control'
complete --command mac --condition '__fish_seen_subcommand_from 'mail \
--arguments vacuum --description 'Vacuums the Mail.app envelope index'
complete --command mac --condition '__fish_seen_subcommand_from 'mail \
--arguments attachments --description 'Sets Mail.app attachment handling' \
--require-parameter --no-files
complete --command mac --condition '__fish_seen_subcommand_from 'attachments \
--arguments inline \
--description 'Sets Mail.app attachment handling so that they are inline to the message'
complete --command mac --condition '__fish_seen_subcommand_from 'attachments \
--arguments icon \
--description 'Sets Mail.app attachment handling so that they are icons on the message'
complete --command mac --condition '__fish_seen_subcommand_from 'version \
--short-option s --long-option simple --description 'Simple mac version name'
complete --command mac --condition '__fish_seen_subcommand_from 'version \
--short-option l --long-option lowercase --description 'Lowercase mac version name'
complete --command mac --condition '__fish_seen_subcommand_from 'version \
--short-option f --long-option version --description 'Full version number'
complete --command mac --condition '__fish_seen_subcommand_from 'version \
--short-option c --long-option comparable --description 'Simplified comparable version value'
complete --command mac --condition '__fish_seen_subcommand_from 'version \
--short-option h --long-option help --description 'Help for mac 'version
complete --command mac --condition '__fish_seen_subcommand_from 'vol \
--arguments mute --description 'Mutes volume'
complete --command mac --condition '__fish_seen_subcommand_from 'vol \
--arguments unmute --description 'Unmutes volume'
complete --command mac --condition '__fish_seen_subcommand_from 'vol \
--arguments show --description 'Shows the current volume'
complete --command mac --condition '__fish_seen_subcommand_from 'vol \
--arguments 10 --description 'Sets the volume to 10%'
complete --command mac --condition '__fish_seen_subcommand_from 'vol \
--arguments 20 --description 'Sets the volume to 20%'
complete --command mac --condition '__fish_seen_subcommand_from 'vol \
--arguments 30 --description 'Sets the volume to 30%'
complete --command mac --condition '__fish_seen_subcommand_from 'vol \
--arguments 40 --description 'Sets the volume to 40%'
complete --command mac --condition '__fish_seen_subcommand_from 'vol \
--arguments 50 --description 'Sets the volume to 50%'
complete --command mac --condition '__fish_seen_subcommand_from 'vol \
--arguments 60 --description 'Sets the volume to 60%'
complete --command mac --condition '__fish_seen_subcommand_from 'vol \
--arguments 70 --description 'Sets the volume to 70%'
complete --command mac --condition '__fish_seen_subcommand_from 'vol \
--arguments 80 --description 'Sets the volume to 80%'
complete --command mac --condition '__fish_seen_subcommand_from 'vol \
--arguments 90 --description 'Sets the volume to 90%'
complete --command mac --condition '__fish_seen_subcommand_from 'vol \
--arguments 100 --description 'Sets the volume to 100%'

View File

@@ -0,0 +1,8 @@
# @halostatue/fish-macos/completions/manp.fish:v7.0.0
complete --command manp --erase
complete --command manp --wraps man
complete --command manp --exclusive --condition __fish_no_arguments \
--short-option h --long-option help --description 'Show help for manp'
complete --command manp --exclusive --condition __fish_no_arguments \
--long-option clear-cache --description 'Clear the man page PDF cache'

View File

@@ -0,0 +1,21 @@
complete --command nvm --exclusive
complete --command nvm --exclusive --long version --description "Print version"
complete --command nvm --exclusive --long help --description "Print help"
complete --command nvm --long silent --description "Suppress standard output"
complete --command nvm --exclusive --condition __fish_use_subcommand --arguments install --description "Download and activate the specified Node version"
complete --command nvm --exclusive --condition __fish_use_subcommand --arguments use --description "Activate the specified Node version in the current shell"
complete --command nvm --exclusive --condition __fish_use_subcommand --arguments list --description "List installed Node versions"
complete --command nvm --exclusive --condition __fish_use_subcommand --arguments list-remote --description "List available Node versions to install"
complete --command nvm --exclusive --condition __fish_use_subcommand --arguments current --description "Print the currently-active Node version"
complete --command nvm --exclusive --condition "__fish_seen_subcommand_from install" --arguments "(
test -e $nvm_data && string split ' ' <$nvm_data/.index
)"
complete --command nvm --exclusive --condition "__fish_seen_subcommand_from use" --arguments "(_nvm_list | string split ' ')"
complete --command nvm --exclusive --condition __fish_use_subcommand --arguments uninstall --description "Uninstall the specified Node version"
complete --command nvm --exclusive --condition "__fish_seen_subcommand_from uninstall" --arguments "(
_nvm_list | string split ' ' | string replace system ''
)"
complete --command nvm --exclusive --condition "__fish_seen_subcommand_from use uninstall" --arguments "(
set --query nvm_default_version && echo default
)"

View File

@@ -1,122 +0,0 @@
# Completions for phpenv command
# Place in ~/.config/fish/completions/phpenv.fish
# 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 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 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 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 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 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 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 ext -d "Manage PHP extensions"
complete -c phpenv -f -n __fish_use_subcommand -a help -d "Show help"
# Helper functions for completions
function __phpenv_complete_installed_versions
phpenv list 2>/dev/null | sed 's/^[* ]*//'
end
function __phpenv_complete_available_versions
# Try to get dynamic versions first
if command -q curl -a command -q jq; and functions -q __phpenv_parse_version_field
echo latest
echo nightly
echo "5.x"
echo "7.x"
echo "8.x"
__phpenv_parse_version_field latest "8.4"
__phpenv_parse_version_field nightly "8.5"
__phpenv_parse_version_field "5.x" "5.6"
__phpenv_parse_version_field "7.x" "7.4"
__phpenv_parse_version_field "8.x" "8.4"
end
# Fallback to common versions
printf "5.6\n7.0\n7.1\n7.2\n7.3\n7.4\n8.0\n8.1\n8.2\n8.3\n8.4\n8.5\n"
end
function __phpenv_complete_config_keys
printf "global-version\nauto-install\nauto-install-extensions\nauto-switch\ndefault-extensions\n"
end
function __phpenv_complete_extensions
printf "xdebug\nredis\nimagick\nmongodb\nmemcached\npcov\nast\ngrpc\n"
printf "protobuf\nyaml\nzip\ncurl\ngd\nintl\nmbstring\nmysql\nopcache\npdo\nsockets\nxml\n"
end
function __phpenv_complete_binaries
printf "php\nphp-config\nphpize\ncomposer\npecl\npear\n"
end
# Complete versions for install command
complete -c phpenv -f -n "__fish_seen_subcommand_from install" \
-a "(__phpenv_complete_available_versions)" -d "PHP version"
# Complete installed versions for uninstall, use commands
complete -c phpenv -f -n "__fish_seen_subcommand_from uninstall use local global" \
-a "(__phpenv_complete_installed_versions)" -d "Installed PHP version"
# Add system option for use command
complete -c phpenv -f -n "__fish_seen_subcommand_from use" -a system -d "Use system PHP"
# Complete binaries for which command
complete -c phpenv -f -n "__fish_seen_subcommand_from which" -a "(__phpenv_complete_binaries)" -d "PHP binary"
# Complete config subcommands
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"
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"
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"
# Complete config keys
complete -c phpenv -f -n "__fish_seen_subcommand_from config; and __fish_seen_subcommand_from get set" \
-a "(__phpenv_complete_config_keys)" -d "Configuration key"
# Complete config values for boolean settings
complete -c phpenv -f \
-n "__fish_seen_subcommand_from config; and __fish_seen_subcommand_from set" \
-n "contains -- (commandline -opc)[-1] auto-install auto-install-extensions auto-switch" \
-a "true false" -d "Boolean value"
# Complete extensions subcommands
complete -c phpenv -f \
-n "__fish_seen_subcommand_from extensions ext" \
-n "not __fish_seen_subcommand_from install uninstall remove list ls available" \
-a install -d "Install PHP extension"
complete -c phpenv -f \
-n "__fish_seen_subcommand_from extensions ext" \
-n "not __fish_seen_subcommand_from install uninstall remove list ls available" \
-a uninstall -d "Uninstall PHP extension"
complete -c phpenv -f \
-n "__fish_seen_subcommand_from extensions ext" \
-n "not __fish_seen_subcommand_from install uninstall remove list ls available" \
-a remove -d "Remove PHP extension"
complete -c phpenv -f \
-n "__fish_seen_subcommand_from extensions ext" \
-n "not __fish_seen_subcommand_from install uninstall remove list ls available" \
-a list -d "List installed extensions"
complete -c phpenv -f \
-n "__fish_seen_subcommand_from extensions ext" \
-n "not __fish_seen_subcommand_from install uninstall remove list ls available" \
-a ls -d "List installed extensions"
complete -c phpenv -f \
-n "__fish_seen_subcommand_from extensions ext" \
-n "not __fish_seen_subcommand_from install uninstall remove list ls available" \
-a available -d "Show available extensions"
# Complete extension names
complete -c phpenv -f \
-n "__fish_seen_subcommand_from extensions ext; and __fish_seen_subcommand_from install" \
-a "(__phpenv_complete_extensions)" -d "PHP extension"
# Complete help options
complete -c phpenv -f -s h -l help -d "Show help"

View File

@@ -1,54 +0,0 @@
# pinact fish shell completion
function __fish_pinact_no_subcommand --description 'Test if there has been any subcommand yet'
for i in (commandline -opc)
if contains -- $i init run migrate token version help-all help h completion
return 1
end
end
return 0
end
complete -c pinact -n __fish_pinact_no_subcommand -f -l log-level -r -d 'log level'
complete -c pinact -n __fish_pinact_no_subcommand -f -l config -s c -r -d 'configuration file path'
complete -c pinact -n __fish_pinact_no_subcommand -f -l help -s h -d 'show help'
complete -c pinact -n __fish_pinact_no_subcommand -f -l version -s v -d 'print the version'
complete -x -c pinact -n __fish_pinact_no_subcommand -a init -d 'Create .pinact.yaml if it doesn\'t exist'
complete -c pinact -n '__fish_seen_subcommand_from init' -f -l help -s h -d 'show help'
complete -x -c pinact -n '__fish_seen_subcommand_from init; and not __fish_seen_subcommand_from help h' -a help -d 'Shows a list of commands or help for one command'
complete -x -c pinact -n __fish_pinact_no_subcommand -a run -d 'Pin GitHub Actions versions'
complete -c pinact -n '__fish_seen_subcommand_from run' -f -l verify -s v -d 'Verify if pairs of commit SHA and version are correct'
complete -c pinact -n '__fish_seen_subcommand_from run' -f -l check -d 'Exit with a non-zero status code if actions are not pinned. If this is true, files aren\'t updated'
complete -c pinact -n '__fish_seen_subcommand_from run' -f -l update -s u -d 'Update actions to latest versions'
complete -c pinact -n '__fish_seen_subcommand_from run' -f -l review -d 'Create reviews'
complete -c pinact -n '__fish_seen_subcommand_from run' -f -l fix -d 'Fix code. By default, this is true. If -check or -diff is true, this is false by default'
complete -c pinact -n '__fish_seen_subcommand_from run' -f -l diff -d 'Output diff. By default, this is false'
complete -c pinact -n '__fish_seen_subcommand_from run' -f -l repo-owner -r -d 'GitHub repository owner'
complete -c pinact -n '__fish_seen_subcommand_from run' -f -l repo-name -r -d 'GitHub repository name'
complete -c pinact -n '__fish_seen_subcommand_from run' -f -l sha -r -d 'Commit SHA to be reviewed'
complete -c pinact -n '__fish_seen_subcommand_from run' -f -l pr -r -d 'GitHub pull request number'
complete -c pinact -n '__fish_seen_subcommand_from run' -f -l help -s h -d 'show help'
complete -x -c pinact -n '__fish_seen_subcommand_from run; and not __fish_seen_subcommand_from help h' -a help -d 'Shows a list of commands or help for one command'
complete -x -c pinact -n __fish_pinact_no_subcommand -a migrate -d 'Migrate .pinact.yaml'
complete -c pinact -n '__fish_seen_subcommand_from migrate' -f -l help -s h -d 'show help'
complete -x -c pinact -n '__fish_seen_subcommand_from migrate; and not __fish_seen_subcommand_from help h' -a help -d 'Shows a list of commands or help for one command'
complete -x -c pinact -n __fish_pinact_no_subcommand -a token -d 'Manage GitHub Access token'
complete -c pinact -n '__fish_seen_subcommand_from token' -f -l help -s h -d 'show help'
complete -x -c pinact -n '__fish_seen_subcommand_from token; and not __fish_seen_subcommand_from set remove rm help h' -a set -d 'Set GitHub Access token'
complete -c pinact -n '__fish_seen_subcommand_from token; and __fish_seen_subcommand_from set' -f -l stdin -d 'Read GitHub Access token from stdin'
complete -c pinact -n '__fish_seen_subcommand_from token; and __fish_seen_subcommand_from set' -f -l help -s h -d 'show help'
complete -x -c pinact -n '__fish_seen_subcommand_from token; and __fish_seen_subcommand_from set; and not __fish_seen_subcommand_from help h' -a help -d 'Shows a list of commands or help for one command'
complete -x -c pinact -n '__fish_seen_subcommand_from token; and not __fish_seen_subcommand_from set remove rm help h' -a remove -d 'Remove GitHub Access token'
complete -c pinact -n '__fish_seen_subcommand_from token; and __fish_seen_subcommand_from remove rm' -f -l help -s h -d 'show help'
complete -x -c pinact -n '__fish_seen_subcommand_from token; and __fish_seen_subcommand_from remove rm; and not __fish_seen_subcommand_from help h' -a help -d 'Shows a list of commands or help for one command'
complete -x -c pinact -n '__fish_seen_subcommand_from token; and not __fish_seen_subcommand_from set remove rm help h' -a help -d 'Shows a list of commands or help for one command'
complete -x -c pinact -n __fish_pinact_no_subcommand -a version -d 'Show version'
complete -c pinact -n '__fish_seen_subcommand_from version' -f -l json -s j -d 'Output version in JSON format'
complete -c pinact -n '__fish_seen_subcommand_from version' -f -l help -s h -d 'show help'
complete -x -c pinact -n '__fish_seen_subcommand_from version; and not __fish_seen_subcommand_from help h' -a help -d 'Shows a list of commands or help for one command'
complete -c pinact -n '__fish_seen_subcommand_from help-all' -f -l help -s h -d 'show help'
complete -x -c pinact -n '__fish_seen_subcommand_from help-all; and not __fish_seen_subcommand_from help h' -a help -d 'Shows a list of commands or help for one command'
complete -x -c pinact -n __fish_pinact_no_subcommand -a help -d 'Shows a list of commands or help for one command'
complete -x -c pinact -n __fish_pinact_no_subcommand -a completion -d 'Output shell completion script for bash, zsh, fish, or Powershell'
complete -c pinact -n '__fish_seen_subcommand_from completion' -f -l help -s h -d 'show help'
complete -x -c pinact -n '__fish_seen_subcommand_from completion; and not __fish_seen_subcommand_from help h' -a help -d 'Shows a list of commands or help for one command'

View File

@@ -0,0 +1,4 @@
# @halostatue/fish-macos/completions/ql.fish:v7.0.0
complete --erase --command ql
complete --command ql --wraps qlmanage

View File

@@ -1,234 +0,0 @@
# fish completion for sesh -*- shell-script -*-
function __sesh_debug
set -l file "$BASH_COMP_DEBUG_FILE"
if test -n "$file"
echo "$argv" >>$file
end
end
function __sesh_perform_completion
__sesh_debug "Starting __sesh_perform_completion"
# Extract all args except the last one
set -l args (commandline -opc)
# Extract the last arg and escape it in case it is a space
set -l lastArg (string escape -- (commandline -ct))
__sesh_debug "args: $args"
__sesh_debug "last arg: $lastArg"
# Disable ActiveHelp which is not supported for fish shell
set -l requestComp "SESH_ACTIVE_HELP=0 $args[1] __complete $args[2..-1] $lastArg"
__sesh_debug "Calling $requestComp"
set -l results (eval $requestComp 2> /dev/null)
# Some programs may output extra empty lines after the directive.
# Let's ignore them or else it will break completion.
# Ref: https://github.com/spf13/cobra/issues/1279
for line in $results[-1..1]
if test (string trim -- $line) = ""
# Found an empty line, remove it
set results $results[1..-2]
else
# Found non-empty line, we have our proper output
break
end
end
set -l comps $results[1..-2]
set -l directiveLine $results[-1]
# For Fish, when completing a flag with an = (e.g., <program> -n=<TAB>)
# completions must be prefixed with the flag
set -l flagPrefix (string match -r -- '-.*=' "$lastArg")
__sesh_debug "Comps: $comps"
__sesh_debug "DirectiveLine: $directiveLine"
__sesh_debug "flagPrefix: $flagPrefix"
for comp in $comps
printf "%s%s\n" "$flagPrefix" "$comp"
end
printf "%s\n" "$directiveLine"
end
# this function limits calls to __sesh_perform_completion, by caching the result behind $__sesh_perform_completion_once_result
function __sesh_perform_completion_once
__sesh_debug "Starting __sesh_perform_completion_once"
if test -n "$__sesh_perform_completion_once_result"
__sesh_debug "Seems like a valid result already exists, skipping __sesh_perform_completion"
return 0
end
set --global __sesh_perform_completion_once_result (__sesh_perform_completion)
if test -z "$__sesh_perform_completion_once_result"
__sesh_debug "No completions, probably due to a failure"
return 1
end
__sesh_debug "Performed completions and set __sesh_perform_completion_once_result"
return 0
end
# this function is used to clear the $__sesh_perform_completion_once_result variable after completions are run
function __sesh_clear_perform_completion_once_result
__sesh_debug ""
__sesh_debug "========= clearing previously set __sesh_perform_completion_once_result variable =========="
set --erase __sesh_perform_completion_once_result
__sesh_debug "Successfully erased the variable __sesh_perform_completion_once_result"
end
function __sesh_requires_order_preservation
__sesh_debug ""
__sesh_debug "========= checking if order preservation is required =========="
__sesh_perform_completion_once
if test -z "$__sesh_perform_completion_once_result"
__sesh_debug "Error determining if order preservation is required"
return 1
end
set -l directive (string sub --start 2 $__sesh_perform_completion_once_result[-1])
__sesh_debug "Directive is: $directive"
set -l shellCompDirectiveKeepOrder 32
set -l keeporder (math (math --scale 0 $directive / $shellCompDirectiveKeepOrder) % 2)
__sesh_debug "Keeporder is: $keeporder"
if test $keeporder -ne 0
__sesh_debug "This does require order preservation"
return 0
end
__sesh_debug "This doesn't require order preservation"
return 1
end
# This function does two things:
# - Obtain the completions and store them in the global __sesh_comp_results
# - Return false if file completion should be performed
function __sesh_prepare_completions
__sesh_debug ""
__sesh_debug "========= starting completion logic =========="
# Start fresh
set --erase __sesh_comp_results
__sesh_perform_completion_once
__sesh_debug "Completion results: $__sesh_perform_completion_once_result"
if test -z "$__sesh_perform_completion_once_result"
__sesh_debug "No completion, probably due to a failure"
# Might as well do file completion, in case it helps
return 1
end
set -l directive (string sub --start 2 $__sesh_perform_completion_once_result[-1])
set --global __sesh_comp_results $__sesh_perform_completion_once_result[1..-2]
__sesh_debug "Completions are: $__sesh_comp_results"
__sesh_debug "Directive is: $directive"
set -l shellCompDirectiveError 1
set -l shellCompDirectiveNoSpace 2
set -l shellCompDirectiveNoFileComp 4
set -l shellCompDirectiveFilterFileExt 8
set -l shellCompDirectiveFilterDirs 16
if test -z "$directive"
set directive 0
end
set -l compErr (math (math --scale 0 $directive / $shellCompDirectiveError) % 2)
if test $compErr -eq 1
__sesh_debug "Received error directive: aborting."
# Might as well do file completion, in case it helps
return 1
end
set -l filefilter (math (math --scale 0 $directive / $shellCompDirectiveFilterFileExt) % 2)
set -l dirfilter (math (math --scale 0 $directive / $shellCompDirectiveFilterDirs) % 2)
if test $filefilter -eq 1; or test $dirfilter -eq 1
__sesh_debug "File extension filtering or directory filtering not supported"
# Do full file completion instead
return 1
end
set -l nospace (math (math --scale 0 $directive / $shellCompDirectiveNoSpace) % 2)
set -l nofiles (math (math --scale 0 $directive / $shellCompDirectiveNoFileComp) % 2)
__sesh_debug "nospace: $nospace, nofiles: $nofiles"
# If we want to prevent a space, or if file completion is NOT disabled,
# we need to count the number of valid completions.
# To do so, we will filter on prefix as the completions we have received
# may not already be filtered so as to allow fish to match on different
# criteria than the prefix.
if test $nospace -ne 0; or test $nofiles -eq 0
set -l prefix (commandline -t | string escape --style=regex)
__sesh_debug "prefix: $prefix"
set -l completions (string match -r -- "^$prefix.*" $__sesh_comp_results)
set --global __sesh_comp_results $completions
__sesh_debug "Filtered completions are: $__sesh_comp_results"
# Important not to quote the variable for count to work
set -l numComps (count $__sesh_comp_results)
__sesh_debug "numComps: $numComps"
if test $numComps -eq 1; and test $nospace -ne 0
# We must first split on \t to get rid of the descriptions to be
# able to check what the actual completion will be.
# We don't need descriptions anyway since there is only a single
# real completion which the shell will expand immediately.
set -l split (string split --max 1 \t $__sesh_comp_results[1])
# Fish won't add a space if the completion ends with any
# of the following characters: @=/:.,
set -l lastChar (string sub -s -1 -- $split)
if not string match -r -q "[@=/:.,]" -- "$lastChar"
# In other cases, to support the "nospace" directive we trick the shell
# by outputting an extra, longer completion.
__sesh_debug "Adding second completion to perform nospace directive"
set --global __sesh_comp_results $split[1] $split[1].
__sesh_debug "Completions are now: $__sesh_comp_results"
end
end
if test $numComps -eq 0; and test $nofiles -eq 0
# To be consistent with bash and zsh, we only trigger file
# completion when there are no other completions
__sesh_debug "Requesting file completion"
return 1
end
end
return 0
end
# Since Fish completions are only loaded once the user triggers them, we trigger them ourselves
# so we can properly delete any completions provided by another script.
# Only do this if the program can be found, or else fish may print some errors; besides,
# the existing completions will only be loaded if the program can be found.
if type -q sesh
# The space after the program name is essential to trigger completion for the program
# and not completion of the program name itself.
# Also, we use '> /dev/null 2>&1' since '&>' is not supported in older versions of fish.
complete --do-complete "sesh " >/dev/null 2>&1
end
# Remove any pre-existing completions for the program since we will be handling all of them.
complete -c sesh -e
# this will get called after the two calls below and clear the $__sesh_perform_completion_once_result global
complete -c sesh -n __sesh_clear_perform_completion_once_result
# The call to __sesh_prepare_completions will setup __sesh_comp_results
# which provides the program's completion choices.
# If this doesn't require order preservation, we don't use the -k flag
complete -c sesh -n 'not __sesh_requires_order_preservation && __sesh_prepare_completions' -f -a '$__sesh_comp_results'
# otherwise we use the -k flag
complete -k -c sesh -n '__sesh_requires_order_preservation && __sesh_prepare_completions' -f -a '$__sesh_comp_results'

Some files were not shown because too many files have changed in this diff Show More