mirror of
https://github.com/ivuorinen/dotfiles.git
synced 2026-02-02 22:48:14 +00:00
Compare commits
47 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a2a99445ff | ||
|
|
678466b898 | ||
| bd5eff8bce | |||
| 2979cc6cfc | |||
|
|
5630200d95 | ||
| 961efec364 | |||
| 4b0e38ffd2 | |||
|
|
c6ba0e4036 | ||
|
|
7b1ed2f596 | ||
|
|
82d48c8989 | ||
|
|
48f61fa917 | ||
|
|
abc3408609 | ||
|
|
8bef11095e | ||
| 7d427d29bb | |||
|
|
fd71a1ad32 | ||
|
|
277d47098f | ||
|
|
d35014ed2e | ||
|
|
8e7af8ddc7 | ||
| 099e6672c8 | |||
| e578e52aff | |||
|
|
0b5f80cb03 | ||
|
|
72f42835ff | ||
|
|
a949f0d4cf | ||
|
|
8b1e4462b3 | ||
|
|
055cf7ef2e | ||
|
|
8c2b3fb475 | ||
| 3fa1efe88d | |||
| 9cc81c4cbf | |||
| bba76843db | |||
| 9018d1a038 | |||
|
|
a8595e2e07 | ||
|
|
beb89e9490 | ||
|
|
cb381fe57d | ||
|
|
7be770a2af | ||
|
|
d16ce9ad0f | ||
| ab67f6be5a | |||
| efadbb4248 | |||
| ded4bf3bb3 | |||
|
|
62eb417935 | ||
| d22f9ece7d | |||
| 79be2d41bc | |||
|
|
743ebb0e9f | ||
|
|
8fcab21a67 | ||
|
|
43a714513f | ||
|
|
044298af74 | ||
|
|
6604f7a2ca | ||
|
|
065eb2f9c0 |
@@ -9,7 +9,7 @@ insert_final_newline = true
|
|||||||
trim_trailing_whitespace = true
|
trim_trailing_whitespace = true
|
||||||
|
|
||||||
[*.fish]
|
[*.fish]
|
||||||
max_line_length = 80
|
max_line_length = 120
|
||||||
|
|
||||||
[*.md]
|
[*.md]
|
||||||
max_line_length = 120
|
max_line_length = 120
|
||||||
@@ -49,3 +49,6 @@ ignore = true
|
|||||||
[plan]
|
[plan]
|
||||||
trim_trailing_whitespace = false
|
trim_trailing_whitespace = false
|
||||||
max_line_length = off
|
max_line_length = off
|
||||||
|
|
||||||
|
[base/hammerspoon/hammerspoon.types.lua]
|
||||||
|
max_line_length = off
|
||||||
|
|||||||
@@ -1,3 +0,0 @@
|
|||||||
{
|
|
||||||
"extends": ["@ivuorinen"]
|
|
||||||
}
|
|
||||||
8
.github/dependabot.yml
vendored
8
.github/dependabot.yml
vendored
@@ -1,8 +0,0 @@
|
|||||||
---
|
|
||||||
version: 2
|
|
||||||
updates:
|
|
||||||
# Maintain dependencies for GitHub Actions
|
|
||||||
- package-ecosystem: 'github-actions'
|
|
||||||
directory: '/'
|
|
||||||
schedule:
|
|
||||||
interval: 'weekly'
|
|
||||||
8
.github/tag-changelog-config.js
vendored
8
.github/tag-changelog-config.js
vendored
@@ -16,10 +16,10 @@ module.exports = {
|
|||||||
|
|
||||||
excludeTypes: [],
|
excludeTypes: [],
|
||||||
|
|
||||||
renderTypeSection: function (label, commits) {
|
renderTypeSection: (label, commits) => {
|
||||||
let text = `\n## ${label}\n\n`
|
let text = `\n## ${label}\n\n`
|
||||||
|
|
||||||
commits.forEach(commit => {
|
commits.forEach((commit) => {
|
||||||
const scope = commit.scope ? `**${commit.scope}:** ` : ''
|
const scope = commit.scope ? `**${commit.scope}:** ` : ''
|
||||||
text += `- ${scope}${commit.subject}\n`
|
text += `- ${scope}${commit.subject}\n`
|
||||||
})
|
})
|
||||||
@@ -27,10 +27,10 @@ module.exports = {
|
|||||||
return text
|
return text
|
||||||
},
|
},
|
||||||
|
|
||||||
renderChangelog: function (release, changes) {
|
renderChangelog: (release, changes) => {
|
||||||
const now = new Date()
|
const now = new Date()
|
||||||
const d = now.toISOString().substring(0, 10)
|
const d = now.toISOString().substring(0, 10)
|
||||||
const header = `# ${release} - ${d}\n`
|
const header = `# ${release} - ${d}\n`
|
||||||
return header + changes + '\n\n'
|
return `${header}${changes}\n\n`
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|||||||
2
.github/workflows/changelog.yml
vendored
2
.github/workflows/changelog.yml
vendored
@@ -18,7 +18,7 @@ jobs:
|
|||||||
permissions: write-all
|
permissions: write-all
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
|
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
|
||||||
|
|
||||||
- name: Create changelog text
|
- name: Create changelog text
|
||||||
id: changelog
|
id: changelog
|
||||||
|
|||||||
4
.github/workflows/linters.yml
vendored
4
.github/workflows/linters.yml
vendored
@@ -27,7 +27,7 @@ jobs:
|
|||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
|
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
|
||||||
|
|
||||||
- name: Yarn Lock Changes
|
- name: Yarn Lock Changes
|
||||||
uses: Simek/yarn-lock-changes@61d1a0595070b79c1abdc8e1e5a5f5d98b18918c # v0.12.2
|
uses: Simek/yarn-lock-changes@61d1a0595070b79c1abdc8e1e5a5f5d98b18918c # v0.12.2
|
||||||
@@ -35,4 +35,4 @@ jobs:
|
|||||||
token: ${{ secrets.GITHUB_TOKEN }}
|
token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
- name: Run PR Lint
|
- name: Run PR Lint
|
||||||
uses: ivuorinen/actions/pr-lint@ff0ca4bc920c518b2ce2dc20c5e5a6e95f76dee0 # v2025.11.02
|
uses: ivuorinen/actions/pr-lint@fb25736f7e7a438979c11764e9fe6a100278b4c5 # v2026.01.01
|
||||||
|
|||||||
4
.github/workflows/new-release.yml
vendored
4
.github/workflows/new-release.yml
vendored
@@ -24,7 +24,7 @@ jobs:
|
|||||||
version: ${{ steps.daily-version.outputs.version }}
|
version: ${{ steps.daily-version.outputs.version }}
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
|
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
|
||||||
|
|
||||||
- name: Create tag if necessary
|
- name: Create tag if necessary
|
||||||
uses: fregante/daily-version-action@fb1a60b7c4daf1410cd755e360ebec3901e58588 # v2.1.3
|
uses: fregante/daily-version-action@fb1a60b7c4daf1410cd755e360ebec3901e58588 # v2.1.3
|
||||||
@@ -40,7 +40,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Create release
|
- name: Create release
|
||||||
if: steps.daily-version.outputs.created
|
if: steps.daily-version.outputs.created
|
||||||
uses: softprops/action-gh-release@6da8fa9354ddfdc4aeace5fc48d7f679b5214090 # v2.4.1
|
uses: softprops/action-gh-release@a06a81a03ee405af7f2048a818ed3f03bbf83c7b # v2.5.0
|
||||||
with:
|
with:
|
||||||
token: ${{ secrets.GITHUB_TOKEN }}
|
token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
tag_name: ${{ steps.daily-version.outputs.version }}
|
tag_name: ${{ steps.daily-version.outputs.version }}
|
||||||
|
|||||||
6
.github/workflows/pre-commit-autoupdate.yml
vendored
6
.github/workflows/pre-commit-autoupdate.yml
vendored
@@ -23,13 +23,13 @@ jobs:
|
|||||||
pull-requests: write
|
pull-requests: write
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
|
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
|
||||||
|
|
||||||
- uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v6.0.0
|
- uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548 # v6.1.0
|
||||||
|
|
||||||
- run: pip install pre-commit && pre-commit autoupdate
|
- run: pip install pre-commit && pre-commit autoupdate
|
||||||
|
|
||||||
- uses: peter-evans/create-pull-request@271a8d0340265f705b14b6d32b9829c1cb33d45e # v7.0.8
|
- uses: peter-evans/create-pull-request@98357b18bf14b5342f975ff684046ec3b2a07725 # v8.0.0
|
||||||
with:
|
with:
|
||||||
token: ${{ secrets.GITHUB_TOKEN }}
|
token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
branch: update/pre-commit-hooks
|
branch: update/pre-commit-hooks
|
||||||
|
|||||||
2
.github/workflows/sync-labels.yml
vendored
2
.github/workflows/sync-labels.yml
vendored
@@ -29,4 +29,4 @@ jobs:
|
|||||||
issues: write
|
issues: write
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: ivuorinen/actions/sync-labels@ff0ca4bc920c518b2ce2dc20c5e5a6e95f76dee0 # v2025.11.02
|
- uses: ivuorinen/actions/sync-labels@fb25736f7e7a438979c11764e9fe6a100278b4c5 # v2026.01.01
|
||||||
|
|||||||
2
.github/workflows/update-submodules.yml
vendored
2
.github/workflows/update-submodules.yml
vendored
@@ -22,7 +22,7 @@ jobs:
|
|||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
|
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
|
||||||
with:
|
with:
|
||||||
submodules: true
|
submodules: true
|
||||||
fetch-depth: 2
|
fetch-depth: 2
|
||||||
|
|||||||
44
.gitignore
vendored
44
.gitignore
vendored
@@ -11,47 +11,49 @@
|
|||||||
.nfs*
|
.nfs*
|
||||||
.scannerwork
|
.scannerwork
|
||||||
.vscode
|
.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
|
Brewfile.lock.json
|
||||||
antidote_plugins.zsh
|
antidote_plugins.zsh
|
||||||
config/alacritty/theme-active.toml
|
config/alacritty/theme-active.toml
|
||||||
config/cheat/cheatsheets/pure-bash-bible/*
|
config/cheat/cheatsheets/pure-bash-bible/*
|
||||||
config/cheat/cheatsheets/tldr/*
|
config/cheat/cheatsheets/tldr/*
|
||||||
|
config/fish/completions/asdf.fish
|
||||||
|
config/fish/fish_variables
|
||||||
|
config/fish/fish_variables.*
|
||||||
|
config/gh/hosts.yml
|
||||||
config/git/credentials
|
config/git/credentials
|
||||||
|
config/git/local.d/*
|
||||||
config/gnupg/S.*
|
config/gnupg/S.*
|
||||||
config/gnupg/private-keys-v1.d
|
config/gnupg/private-keys-v1.d
|
||||||
config/gnupg/s
|
config/gnupg/s
|
||||||
config/iterm2/AppSupport
|
config/iterm2/AppSupport
|
||||||
|
config/karabiner/automatic_backups
|
||||||
config/npm/npmrc
|
config/npm/npmrc
|
||||||
config/nvim/lazy-lock.json
|
config/nvim/lazy-lock.json
|
||||||
config/nvim/spell/*
|
config/nvim/spell/*
|
||||||
!config/nvim/spell/.gitkeep
|
config/op/plugins/gh.json
|
||||||
config/git/local.d/*
|
config/op/plugins/used_items/gh.json
|
||||||
!config/git/local.d/.gitkeep
|
config/vim/.netrwhist
|
||||||
|
config/vim/extra/*
|
||||||
config/vim/fzf
|
config/vim/fzf
|
||||||
config/vim/plugged/*
|
config/vim/plugged/*
|
||||||
config/zed/*
|
config/zed/*
|
||||||
!config/zed/settings.json
|
config/zed/settings.json
|
||||||
config/zsh/.zcompdump
|
config/zsh/.zcompdump
|
||||||
|
dependency-check-report.html
|
||||||
iTermServer-*
|
iTermServer-*
|
||||||
lazy-lock.json
|
lazy-lock.json
|
||||||
local/share/fonts/*
|
|
||||||
local/bin/asdf/plugins/*
|
local/bin/asdf/plugins/*
|
||||||
|
local/bin/yabai
|
||||||
|
local/man/yabai.1
|
||||||
|
local/share/fonts/*
|
||||||
lock
|
lock
|
||||||
node_modules
|
node_modules
|
||||||
ssh/local.d/*
|
ssh/local.d/*
|
||||||
!ssh/local.d/.gitkeep
|
|
||||||
config/fish/fish_variables
|
|
||||||
**/exports.secret.fish
|
|
||||||
**/exports-secret.fish
|
|
||||||
config/fish/completions/asdf.fish
|
|
||||||
config/vim/.netrwhist
|
|
||||||
config/vim/extra/*
|
|
||||||
config/gh/hosts.yml
|
|
||||||
dependency-check-report.html
|
|
||||||
local/bin/yabai
|
|
||||||
local/man/yabai.1
|
|
||||||
config/op/plugins/used_items/gh.json
|
|
||||||
config/zed/settings.json
|
|
||||||
*.tmp.*
|
|
||||||
config/op/plugins/gh.json
|
|
||||||
config/fish/fish_variables.*
|
|
||||||
|
|||||||
3
.gitmodules
vendored
3
.gitmodules
vendored
@@ -83,3 +83,6 @@
|
|||||||
[submodule "tmux/tmux-resurrect"]
|
[submodule "tmux/tmux-resurrect"]
|
||||||
path = config/tmux/plugins/tmux-resurrect
|
path = config/tmux/plugins/tmux-resurrect
|
||||||
url = https://github.com/tmux-plugins/tmux-resurrect.git
|
url = https://github.com/tmux-plugins/tmux-resurrect.git
|
||||||
|
[submodule "tmux/catppuccin"]
|
||||||
|
path = config/tmux/plugins/catppuccin
|
||||||
|
url = https://github.com/catppuccin/tmux.git
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
1.25.3
|
1.25.5
|
||||||
|
|||||||
@@ -1,19 +0,0 @@
|
|||||||
{
|
|
||||||
"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,
|
|
||||||
"ul-style": {
|
|
||||||
"style": "dash"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -16,12 +16,9 @@ SHOW_SKIPPED_LINTERS: false # Show skipped linters in MegaLinter log
|
|||||||
TYPESCRIPT_DEFAULT_STYLE: prettier # Default style for TypeScript
|
TYPESCRIPT_DEFAULT_STYLE: prettier # Default style for TypeScript
|
||||||
DISABLE_LINTERS:
|
DISABLE_LINTERS:
|
||||||
- REPOSITORY_DEVSKIM
|
- REPOSITORY_DEVSKIM
|
||||||
- JAVASCRIPT_ES
|
- JAVASCRIPT_ES # using biome
|
||||||
|
- JAVASCRIPT_PRETTIER # using biome
|
||||||
YAML_YAMLLINT_CONFIG_FILE: .yamllint.yml
|
YAML_YAMLLINT_CONFIG_FILE: .yamllint.yml
|
||||||
MARKDOWN_MARKDOWNLINT_CONFIG_FILE: .markdownlint.json
|
|
||||||
JAVASCRIPT_ES_CONFIG_FILE: .eslintrc.json
|
|
||||||
TYPESCRIPT_ES_CONFIG_FILE: .eslintrc.json
|
|
||||||
REPOSITORY_GIT_DIFF_DISABLE_ERRORS: true
|
REPOSITORY_GIT_DIFF_DISABLE_ERRORS: true
|
||||||
FILTER_REGEX_EXCLUDE: >
|
FILTER_REGEX_EXCLUDE: >
|
||||||
(node_modules|tools|config/cheat/cheatsheets/community|config/cheat/cheatsheets/tldr|config/fzf|config/zsh|config/tmux/plugins)
|
(node_modules|tools|config/cheat/cheatsheets/community|config/cheat/cheatsheets/tldr|config/fzf|config/zsh|config/tmux/plugins)
|
||||||
|
|
||||||
|
|||||||
@@ -20,22 +20,22 @@ repos:
|
|||||||
- id: end-of-file-fixer
|
- id: end-of-file-fixer
|
||||||
- id: mixed-line-ending
|
- id: mixed-line-ending
|
||||||
args: [--fix=auto]
|
args: [--fix=auto]
|
||||||
- id: pretty-format-json
|
|
||||||
args: [--autofix, --no-sort-keys]
|
|
||||||
|
|
||||||
- repo: https://github.com/igorshubovych/markdownlint-cli
|
- repo: local
|
||||||
rev: v0.45.0
|
|
||||||
hooks:
|
hooks:
|
||||||
- id: markdownlint
|
- id: biome-check
|
||||||
args: [-c, .markdownlint.json, --fix]
|
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)$
|
||||||
|
|
||||||
- repo: https://github.com/adrienverge/yamllint
|
- repo: https://github.com/adrienverge/yamllint
|
||||||
rev: v1.37.1
|
rev: v1.37.1
|
||||||
hooks:
|
hooks:
|
||||||
- id: yamllint
|
- id: yamllint
|
||||||
|
|
||||||
- repo: https://github.com/koalaman/shellcheck-precommit
|
- repo: https://github.com/shellcheck-py/shellcheck-py
|
||||||
rev: v0.11.0
|
rev: v0.11.0.1
|
||||||
hooks:
|
hooks:
|
||||||
- id: shellcheck
|
- id: shellcheck
|
||||||
|
|
||||||
@@ -45,19 +45,15 @@ repos:
|
|||||||
- id: shfmt
|
- id: shfmt
|
||||||
|
|
||||||
- repo: https://github.com/rhysd/actionlint
|
- repo: https://github.com/rhysd/actionlint
|
||||||
rev: v1.7.8
|
rev: v1.7.10
|
||||||
hooks:
|
hooks:
|
||||||
- id: actionlint
|
- id: actionlint
|
||||||
|
|
||||||
- repo: https://github.com/renovatebot/pre-commit-hooks
|
|
||||||
rev: 41.168.5
|
|
||||||
hooks:
|
|
||||||
- id: renovate-config-validator
|
|
||||||
|
|
||||||
- repo: https://github.com/JohnnyMorganz/StyLua
|
- repo: https://github.com/JohnnyMorganz/StyLua
|
||||||
rev: v2.3.0
|
rev: v2.3.1
|
||||||
hooks:
|
hooks:
|
||||||
- id: stylua # or stylua-system / stylua-github
|
- id: stylua # or stylua-system / stylua-github
|
||||||
|
exclude: hammerspoon\.types\.lua$
|
||||||
|
|
||||||
- repo: https://github.com/hugoh/pre-commit-fish.git
|
- repo: https://github.com/hugoh/pre-commit-fish.git
|
||||||
rev: v1.2
|
rev: v1.2
|
||||||
|
|||||||
@@ -1,16 +0,0 @@
|
|||||||
# vim: ft=gitignore
|
|
||||||
.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/*
|
|
||||||
lazy-lock.json
|
|
||||||
local/bin/antigen.zsh
|
|
||||||
local/bin/asdf
|
|
||||||
tools/antidote/*
|
|
||||||
tools/dotbot*
|
|
||||||
@@ -1,15 +0,0 @@
|
|||||||
module.exports = {
|
|
||||||
...require('@ivuorinen/prettier-config'),
|
|
||||||
trailingComma: 'all',
|
|
||||||
// Add custom options below:
|
|
||||||
overrides: [
|
|
||||||
{
|
|
||||||
files: '*.md',
|
|
||||||
options: {
|
|
||||||
printWidth: 120,
|
|
||||||
proseWrap: 'preserve',
|
|
||||||
tabWidth: 2,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
],
|
|
||||||
}
|
|
||||||
@@ -1 +1 @@
|
|||||||
3.14.0
|
3.14.2
|
||||||
|
|||||||
5
.sonarlint/connectedMode.json
Normal file
5
.sonarlint/connectedMode.json
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
{
|
||||||
|
"sonarCloudOrganization": "ivuorinen",
|
||||||
|
"projectKey": "ivuorinen_dotfiles",
|
||||||
|
"region": "EU"
|
||||||
|
}
|
||||||
1
.yarnrc.yml
Normal file
1
.yarnrc.yml
Normal file
@@ -0,0 +1 @@
|
|||||||
|
nodeLinker: node-modules
|
||||||
@@ -42,6 +42,8 @@ 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
|
-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 \
|
git submodule add --name tmux/tmux-dark-notify \
|
||||||
-f https://github.com/ivuorinen/tmux-dark-notify.git config/tmux/plugins/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
|
||||||
|
|
||||||
# Takes submodules and sets them to ignore all changes
|
# Takes submodules and sets them to ignore all changes
|
||||||
for MODULE in $(git config --file .gitmodules --get-regexp path | awk '{ print $2 }'); do
|
for MODULE in $(git config --file .gitmodules --get-regexp path | awk '{ print $2 }'); do
|
||||||
|
|||||||
15
base/hammerspoon/.luacheckrc
Normal file
15
base/hammerspoon/.luacheckrc
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
--
|
||||||
|
-- These globals can be set and accessed:
|
||||||
|
--
|
||||||
|
globals = {
|
||||||
|
"rawrequire",
|
||||||
|
}
|
||||||
|
|
||||||
|
--
|
||||||
|
-- These globals can only be accessed:
|
||||||
|
--
|
||||||
|
read_globals = {
|
||||||
|
"hs",
|
||||||
|
"ls",
|
||||||
|
"spoon",
|
||||||
|
}
|
||||||
1010
base/hammerspoon/generate-hammerspoon-types.py
Executable file
1010
base/hammerspoon/generate-hammerspoon-types.py
Executable file
File diff suppressed because it is too large
Load Diff
17863
base/hammerspoon/hammerspoon.types.lua
Normal file
17863
base/hammerspoon/hammerspoon.types.lua
Normal file
File diff suppressed because it is too large
Load Diff
205
base/hammerspoon/init.lua
Normal file
205
base/hammerspoon/init.lua
Normal file
@@ -0,0 +1,205 @@
|
|||||||
|
-- ╭─────────────────────────────────────────────────────────╮
|
||||||
|
-- │ Hammerspoon config file │
|
||||||
|
-- ╰─────────────────────────────────────────────────────────╯
|
||||||
|
-- init.lua — Pure Hammerspoon window controls
|
||||||
|
-- Converted from skhdrc logic; expanded with per‑display grids,
|
||||||
|
-- app rules with groups, wrap‑around focus, cross‑display 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'
|
||||||
103
biome.json
Normal file
103
biome.json
Normal file
@@ -0,0 +1,103 @@
|
|||||||
|
{
|
||||||
|
"$schema": "https://biomejs.dev/schemas/2.3.1/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
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
@@ -6,21 +6,19 @@
|
|||||||
*
|
*
|
||||||
* @param {Object} windows - All windows in the current space.
|
* @param {Object} windows - All windows in the current space.
|
||||||
* @param {Object} screenFrame - The frame of the current screen.
|
* @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.
|
* @return {Object} - The frames for the windows in the current space.
|
||||||
*/
|
*/
|
||||||
function layout() {
|
function layout() {
|
||||||
return {
|
return {
|
||||||
name: 'Almost Maximize',
|
name: 'Almost Maximize',
|
||||||
getFrameAssignments: (windows, screenFrame, state, extendedFrames) => {
|
getFrameAssignments: (windows, screenFrame) => {
|
||||||
const width = screenFrame.width * 0.95
|
const width = screenFrame.width * 0.95
|
||||||
const height = screenFrame.height * 0.95
|
const height = screenFrame.height * 0.95
|
||||||
const x = (screenFrame.width - width) / 2
|
const x = (screenFrame.width - width) / 2
|
||||||
const y = (screenFrame.height - height) / 2
|
const y = (screenFrame.height - height) / 2
|
||||||
const windowFrames = {}
|
const windowFrames = {}
|
||||||
|
|
||||||
windows.forEach(window => {
|
windows.forEach((window) => {
|
||||||
windowFrames[window.id] = {
|
windowFrames[window.id] = {
|
||||||
Y: screenFrame.y + y,
|
Y: screenFrame.y + y,
|
||||||
x: screenFrame.x + x,
|
x: screenFrame.x + x,
|
||||||
@@ -33,3 +31,5 @@ function layout() {
|
|||||||
},
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
module.exports = layout()
|
||||||
|
|||||||
@@ -23,5 +23,7 @@ github.com/junegunn/fzf@latest
|
|||||||
golang.org/x/tools/gopls@latest
|
golang.org/x/tools/gopls@latest
|
||||||
// A language for writing HTML user interfaces in Go.
|
// A language for writing HTML user interfaces in Go.
|
||||||
github.com/a-h/templ/cmd/templ@latest
|
github.com/a-h/templ/cmd/templ@latest
|
||||||
|
// A tool for glamorous shell scripts 🎀
|
||||||
|
github.com/charmbracelet/gum@latest
|
||||||
// A terminal session manager
|
// A terminal session manager
|
||||||
github.com/joshmedeski/sesh/v2@latest
|
github.com/joshmedeski/sesh/v2@latest
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
#
|
|
||||||
# This file is secret and wont be added to the git repo.
|
# This file is secret and wont be added to the git repo.
|
||||||
|
|
||||||
export GITLAB_API_TOKEN=""
|
export GITLAB_API_TOKEN=""
|
||||||
|
|||||||
0
config/fish/completions/docker.fish
Executable file → Normal file
0
config/fish/completions/docker.fish
Executable file → Normal file
@@ -26,7 +26,7 @@ if status is-interactive
|
|||||||
# type -q fnm; and fnm env --use-on-cd --shell fish | source
|
# type -q fnm; and fnm env --use-on-cd --shell fish | source
|
||||||
type -q load_nvm; and load_nvm >/dev/stderr
|
type -q load_nvm; and load_nvm >/dev/stderr
|
||||||
|
|
||||||
# Intialize other tools if available
|
# Initialize other tools if available
|
||||||
type -q zoxide; and zoxide init fish | source
|
type -q zoxide; and zoxide init fish | source
|
||||||
|
|
||||||
# Start tmux if not already running and not in SSH
|
# Start tmux if not already running and not in SSH
|
||||||
@@ -40,7 +40,7 @@ set -gx PATH $PATH $HOME/.lmstudio/bin
|
|||||||
# vim: ft=fish ts=4 sw=4 et:
|
# vim: ft=fish ts=4 sw=4 et:
|
||||||
|
|
||||||
# opencode
|
# opencode
|
||||||
fish_add_path /Users/ivuorinen/.opencode/bin
|
fish_add_path $HOME/.opencode/bin
|
||||||
|
|
||||||
# Added by OrbStack: command-line tools and integration
|
# Added by OrbStack: command-line tools and integration
|
||||||
# This won't be added again if you remove it.
|
# This won't be added again if you remove it.
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
#!/usr/bin/env fish
|
|
||||||
|
|
||||||
# XDG Base Directory Specification
|
# XDG Base Directory Specification
|
||||||
set -q XDG_CONFIG_HOME; or set -x XDG_CONFIG_HOME "$HOME/.config"
|
set -q XDG_CONFIG_HOME; or set -x XDG_CONFIG_HOME "$HOME/.config"
|
||||||
set -q XDG_DATA_HOME; or set -x XDG_DATA_HOME "$HOME/.local/share"
|
set -q XDG_DATA_HOME; or set -x XDG_DATA_HOME "$HOME/.local/share"
|
||||||
|
|||||||
@@ -26,7 +26,6 @@ Options:
|
|||||||
return 1
|
return 1
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
if set --query _flag_exact
|
if set --query _flag_exact
|
||||||
set --function apps (__macos_app_find --exact $argv)
|
set --function apps (__macos_app_find --exact $argv)
|
||||||
or return 1
|
or return 1
|
||||||
|
|||||||
@@ -139,7 +139,6 @@ Options:
|
|||||||
return 0
|
return 0
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
__macos_mac_touchid_sudo::check_supported
|
__macos_mac_touchid_sudo::check_supported
|
||||||
or return
|
or return
|
||||||
|
|
||||||
|
|||||||
@@ -1,23 +1,25 @@
|
|||||||
function __ssh_agent_is_started -d "check if ssh agent is already started"
|
function __ssh_agent_is_started -d "check if ssh agent is already started"
|
||||||
if test -n "$SSH_CONNECTION"
|
if test -n "$SSH_CONNECTION"
|
||||||
# This is an SSH session
|
# This is an SSH session
|
||||||
ssh-add -l > /dev/null 2>&1
|
ssh-add -l >/dev/null 2>&1
|
||||||
if test $status -eq 0 -o $status -eq 1
|
if test $status -eq 0 -o $status -eq 1
|
||||||
# An SSH agent was forwarded
|
# An SSH agent was forwarded
|
||||||
return 0
|
return 0
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
if begin; test -f "$SSH_ENV"; and test -z "$SSH_AGENT_PID"; end
|
if begin
|
||||||
source $SSH_ENV > /dev/null
|
test -f "$SSH_ENV"; and test -z "$SSH_AGENT_PID"
|
||||||
end
|
end
|
||||||
|
source $SSH_ENV >/dev/null
|
||||||
|
end
|
||||||
|
|
||||||
if test -z "$SSH_AGENT_PID"
|
if test -z "$SSH_AGENT_PID"
|
||||||
return 1
|
return 1
|
||||||
end
|
end
|
||||||
|
|
||||||
ssh-add -l > /dev/null 2>&1
|
ssh-add -l >/dev/null 2>&1
|
||||||
if test $status -eq 2
|
if test $status -eq 2
|
||||||
return 1
|
return 1
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
function __ssh_agent_start -d "start a new ssh agent"
|
function __ssh_agent_start -d "start a new ssh agent"
|
||||||
ssh-agent -c | sed 's/^echo/#echo/' > $SSH_ENV
|
ssh-agent -c | sed 's/^echo/#echo/' >$SSH_ENV
|
||||||
chmod 600 $SSH_ENV
|
chmod 600 $SSH_ENV
|
||||||
source $SSH_ENV > /dev/null
|
source $SSH_ENV >/dev/null
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -3,10 +3,8 @@ function _fzf_extract_var_info --argument-names variable_name set_show_output --
|
|||||||
# Extract only the lines about the variable, all of which begin with either
|
# Extract only the lines about the variable, all of which begin with either
|
||||||
# $variable_name: ...or... $variable_name[
|
# $variable_name: ...or... $variable_name[
|
||||||
string match --regex "^\\\$$variable_name(?::|\[).*" <$set_show_output |
|
string match --regex "^\\\$$variable_name(?::|\[).*" <$set_show_output |
|
||||||
|
|
||||||
# Strip the variable name prefix, including ": " for scope info lines
|
# Strip the variable name prefix, including ": " for scope info lines
|
||||||
string replace --regex "^\\\$$variable_name(?:: )?" '' |
|
string replace --regex "^\\\$$variable_name(?:: )?" '' |
|
||||||
|
|
||||||
# Distill the lines of values, replacing...
|
# Distill the lines of values, replacing...
|
||||||
# [1]: |value|
|
# [1]: |value|
|
||||||
# ...with...
|
# ...with...
|
||||||
|
|||||||
@@ -24,7 +24,6 @@ function _fzf_search_directory --description "Search the current directory. Repl
|
|||||||
set -f file_paths_selected ($fd_cmd 2>/dev/null | _fzf_wrapper $fzf_arguments)
|
set -f file_paths_selected ($fd_cmd 2>/dev/null | _fzf_wrapper $fzf_arguments)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
if test $status -eq 0
|
if test $status -eq 0
|
||||||
commandline --current-token --replace -- (string escape -- $file_paths_selected | string join ' ')
|
commandline --current-token --replace -- (string escape -- $file_paths_selected | string join ' ')
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
function _puffer_fish_expand_bang
|
function _puffer_fish_expand_bang
|
||||||
switch (commandline -t)
|
switch (commandline -t)
|
||||||
case '!'
|
case '!'
|
||||||
commandline -t $history[1]
|
commandline -t $history[1]
|
||||||
case '*'
|
case '*'
|
||||||
commandline -i '!'
|
commandline -i '!'
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
function _puffer_fish_expand_lastarg
|
function _puffer_fish_expand_lastarg
|
||||||
switch (commandline -t)
|
switch (commandline -t)
|
||||||
case '!'
|
case '!'
|
||||||
commandline -t ""
|
commandline -t ""
|
||||||
commandline -f history-token-search-backward
|
commandline -f history-token-search-backward
|
||||||
case '*'
|
case '*'
|
||||||
commandline -i '$'
|
commandline -i '$'
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
function _sponge_clear_state
|
function _sponge_clear_state
|
||||||
set --erase --global _sponge_current_command
|
set --erase --global _sponge_current_command
|
||||||
set --erase --global _sponge_current_command_exit_code
|
set --erase --global _sponge_current_command_exit_code
|
||||||
set --erase --global _sponge_current_command_previously_in_history
|
set --erase --global _sponge_current_command_previously_in_history
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
function _sponge_on_exit --on-event fish_exit
|
function _sponge_on_exit --on-event fish_exit
|
||||||
sponge_delay=0 _sponge_remove_from_history
|
sponge_delay=0 _sponge_remove_from_history
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -1,24 +1,24 @@
|
|||||||
function _sponge_on_postexec --on-event fish_postexec
|
function _sponge_on_postexec --on-event fish_postexec
|
||||||
set --global _sponge_current_command_exit_code $status
|
set --global _sponge_current_command_exit_code $status
|
||||||
|
|
||||||
# Remove command from the queue if it's been added previously
|
# Remove command from the queue if it's been added previously
|
||||||
if set --local index (contains --index -- $_sponge_current_command $_sponge_queue)
|
if set --local index (contains --index -- $_sponge_current_command $_sponge_queue)
|
||||||
set --erase _sponge_queue[$index]
|
set --erase _sponge_queue[$index]
|
||||||
end
|
end
|
||||||
|
|
||||||
# Ignore empty commands
|
# Ignore empty commands
|
||||||
if test -n $_sponge_current_command
|
if test -n $_sponge_current_command
|
||||||
set --local command ''
|
set --local command ''
|
||||||
# Run filters
|
# Run filters
|
||||||
for filter in $sponge_filters
|
for filter in $sponge_filters
|
||||||
if $filter \
|
if $filter \
|
||||||
$_sponge_current_command \
|
$_sponge_current_command \
|
||||||
$_sponge_current_command_exit_code \
|
$_sponge_current_command_exit_code \
|
||||||
$_sponge_current_command_previously_in_history
|
$_sponge_current_command_previously_in_history
|
||||||
set command $_sponge_current_command
|
set command $_sponge_current_command
|
||||||
break
|
break
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
set --prepend --global _sponge_queue $command
|
||||||
end
|
end
|
||||||
set --prepend --global _sponge_queue $command
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -1,16 +1,16 @@
|
|||||||
function _sponge_on_preexec --on-event fish_preexec \
|
function _sponge_on_preexec --on-event fish_preexec \
|
||||||
--argument-names command
|
--argument-names command
|
||||||
_sponge_clear_state
|
_sponge_clear_state
|
||||||
|
|
||||||
set --global _sponge_current_command $command
|
set --global _sponge_current_command $command
|
||||||
|
|
||||||
builtin history search --case-sensitive --exact --max=1 --null $command \
|
builtin history search --case-sensitive --exact --max=1 --null $command \
|
||||||
| read --local --null found_entries
|
| read --local --null found_entries
|
||||||
|
|
||||||
# If a command is in the history and in the queue, ignore it, like if it wasn’t in the history
|
# If a command is in the history and in the queue, ignore it, like if it wasn’t in the history
|
||||||
if test (count $found_entries) -ne 0; and not contains $command $_sponge_queue
|
if test (count $found_entries) -ne 0; and not contains $command $_sponge_queue
|
||||||
set --global _sponge_current_command_previously_in_history true
|
set --global _sponge_current_command_previously_in_history true
|
||||||
else
|
else
|
||||||
set --global _sponge_current_command_previously_in_history false
|
set --global _sponge_current_command_previously_in_history false
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
function _sponge_on_prompt --on-event fish_prompt
|
function _sponge_on_prompt --on-event fish_prompt
|
||||||
if test $sponge_purge_only_on_exit = false
|
if test $sponge_purge_only_on_exit = false
|
||||||
_sponge_remove_from_history
|
_sponge_remove_from_history
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
function _sponge_remove_from_history
|
function _sponge_remove_from_history
|
||||||
|
|
||||||
while test (count $_sponge_queue) -gt $sponge_delay
|
while test (count $_sponge_queue) -gt $sponge_delay
|
||||||
builtin history delete --case-sensitive --exact -- $_sponge_queue[-1]
|
builtin history delete --case-sensitive --exact -- $_sponge_queue[-1]
|
||||||
set --erase _sponge_queue[-1]
|
set --erase _sponge_queue[-1]
|
||||||
end
|
end
|
||||||
|
|
||||||
builtin history save
|
builtin history save
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -1,29 +1,29 @@
|
|||||||
function bass
|
function bass
|
||||||
set -l bash_args $argv
|
set -l bash_args $argv
|
||||||
set -l bass_debug
|
set -l bass_debug
|
||||||
if test "$bash_args[1]_" = '-d_'
|
if test "$bash_args[1]_" = -d_
|
||||||
set bass_debug true
|
set bass_debug true
|
||||||
set -e bash_args[1]
|
set -e bash_args[1]
|
||||||
end
|
end
|
||||||
|
|
||||||
set -l script_file (mktemp)
|
set -l script_file (mktemp)
|
||||||
if command -v python3 >/dev/null 2>&1
|
if command -v python3 >/dev/null 2>&1
|
||||||
command python3 -sS (dirname (status -f))/__bass.py $bash_args 3>$script_file
|
command python3 -sS (dirname (status -f))/__bass.py $bash_args 3>$script_file
|
||||||
else
|
else
|
||||||
command python -sS (dirname (status -f))/__bass.py $bash_args 3>$script_file
|
command python -sS (dirname (status -f))/__bass.py $bash_args 3>$script_file
|
||||||
end
|
end
|
||||||
set -l bass_status $status
|
set -l bass_status $status
|
||||||
if test $bass_status -ne 0
|
if test $bass_status -ne 0
|
||||||
return $bass_status
|
return $bass_status
|
||||||
end
|
end
|
||||||
|
|
||||||
if test -n "$bass_debug"
|
if test -n "$bass_debug"
|
||||||
cat $script_file
|
cat $script_file
|
||||||
end
|
end
|
||||||
source $script_file
|
source $script_file
|
||||||
command rm $script_file
|
command rm $script_file
|
||||||
end
|
end
|
||||||
|
|
||||||
function __bass_usage
|
function __bass_usage
|
||||||
echo "Usage: bass [-d] <bash-command>"
|
echo "Usage: bass [-d] <bash-command>"
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -1,16 +1,16 @@
|
|||||||
function load_nvm --on-variable="PWD"
|
function load_nvm --on-variable="PWD"
|
||||||
set -l default_node_version (nvm version default)
|
set -l default_node_version (nvm version default)
|
||||||
set -l node_version (nvm version)
|
set -l node_version (nvm version)
|
||||||
set -l nvmrc_path (nvm_find_nvmrc)
|
set -l nvmrc_path (nvm_find_nvmrc)
|
||||||
if test -n "$nvmrc_path"
|
if test -n "$nvmrc_path"
|
||||||
set -l nvmrc_node_version (nvm version (cat $nvmrc_path))
|
set -l nvmrc_node_version (nvm version (cat $nvmrc_path))
|
||||||
if test "$nvmrc_node_version" = "N/A"
|
if test "$nvmrc_node_version" = N/A
|
||||||
nvm install (cat $nvmrc_path)
|
nvm install (cat $nvmrc_path)
|
||||||
else if test "$nvmrc_node_version" != "$node_version"
|
else if test "$nvmrc_node_version" != "$node_version"
|
||||||
nvm use $nvmrc_node_version
|
nvm use $nvmrc_node_version
|
||||||
|
end
|
||||||
|
else if test "$node_version" != "$default_node_version"
|
||||||
|
echo "Reverting to default Node version"
|
||||||
|
nvm use default
|
||||||
end
|
end
|
||||||
else if test "$node_version" != "$default_node_version"
|
|
||||||
echo "Reverting to default Node version"
|
|
||||||
nvm use default
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
function nvm_find_nvmrc
|
function nvm_find_nvmrc
|
||||||
bass source $NVM_DIR/nvm.sh --no-use ';' nvm_find_nvmrc
|
bass source $NVM_DIR/nvm.sh --no-use ';' nvm_find_nvmrc
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -158,7 +158,7 @@ function paths --description "Reveal the executable matches in shell paths or fi
|
|||||||
# check
|
# check
|
||||||
set -l built (type --type $input 12&>/dev/null)
|
set -l built (type --type $input 12&>/dev/null)
|
||||||
if test -n "$built"
|
if test -n "$built"
|
||||||
and test "$built" = 'builtin'
|
and test "$built" = builtin
|
||||||
set $foundStatus 0
|
set $foundStatus 0
|
||||||
if not set -q _flag_c
|
if not set -q _flag_c
|
||||||
echo -e -n "builtin\n"
|
echo -e -n "builtin\n"
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
function sponge_filter_failed \
|
function sponge_filter_failed \
|
||||||
--argument-names command exit_code previously_in_history
|
--argument-names command exit_code previously_in_history
|
||||||
|
|
||||||
if test $previously_in_history = true -a $sponge_allow_previously_successful = true
|
if test $previously_in_history = true -a $sponge_allow_previously_successful = true
|
||||||
return 1
|
return 1
|
||||||
end
|
end
|
||||||
|
|
||||||
if contains $exit_code $sponge_successful_exit_codes
|
if contains $exit_code $sponge_successful_exit_codes
|
||||||
return 1
|
return 1
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
function sponge_filter_matched \
|
function sponge_filter_matched \
|
||||||
--argument-names command
|
--argument-names command
|
||||||
|
|
||||||
for pattern in $sponge_regex_patterns
|
for pattern in $sponge_regex_patterns
|
||||||
if string match --regex --quiet $pattern -- $command
|
if string match --regex --quiet $pattern -- $command
|
||||||
return
|
return
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
|
||||||
|
|
||||||
return 1
|
return 1
|
||||||
end
|
end
|
||||||
|
|||||||
30
config/fish/themes/Catppuccin Latte.theme
Normal file
30
config/fish/themes/Catppuccin Latte.theme
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
# name: 'Catppuccin Latte'
|
||||||
|
# url: 'https://github.com/catppuccin/fish'
|
||||||
|
# preferred_background: eff1f5
|
||||||
|
|
||||||
|
fish_color_normal 4c4f69
|
||||||
|
fish_color_command 1e66f5
|
||||||
|
fish_color_param dd7878
|
||||||
|
fish_color_keyword d20f39
|
||||||
|
fish_color_quote 40a02b
|
||||||
|
fish_color_redirection ea76cb
|
||||||
|
fish_color_end fe640b
|
||||||
|
fish_color_comment 8c8fa1
|
||||||
|
fish_color_error d20f39
|
||||||
|
fish_color_gray 9ca0b0
|
||||||
|
fish_color_selection --background=ccd0da
|
||||||
|
fish_color_search_match --background=ccd0da
|
||||||
|
fish_color_option 40a02b
|
||||||
|
fish_color_operator ea76cb
|
||||||
|
fish_color_escape e64553
|
||||||
|
fish_color_autosuggestion 9ca0b0
|
||||||
|
fish_color_cancel d20f39
|
||||||
|
fish_color_cwd df8e1d
|
||||||
|
fish_color_user 179299
|
||||||
|
fish_color_host 1e66f5
|
||||||
|
fish_color_host_remote 40a02b
|
||||||
|
fish_color_status d20f39
|
||||||
|
fish_pager_color_progress 9ca0b0
|
||||||
|
fish_pager_color_prefix ea76cb
|
||||||
|
fish_pager_color_completion 4c4f69
|
||||||
|
fish_pager_color_description 9ca0b0
|
||||||
30
config/fish/themes/Catppuccin Mocha.theme
Normal file
30
config/fish/themes/Catppuccin Mocha.theme
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
# name: 'Catppuccin Mocha'
|
||||||
|
# url: 'https://github.com/catppuccin/fish'
|
||||||
|
# preferred_background: 1e1e2e
|
||||||
|
|
||||||
|
fish_color_normal cdd6f4
|
||||||
|
fish_color_command 89b4fa
|
||||||
|
fish_color_param f2cdcd
|
||||||
|
fish_color_keyword f38ba8
|
||||||
|
fish_color_quote a6e3a1
|
||||||
|
fish_color_redirection f5c2e7
|
||||||
|
fish_color_end fab387
|
||||||
|
fish_color_comment 7f849c
|
||||||
|
fish_color_error f38ba8
|
||||||
|
fish_color_gray 6c7086
|
||||||
|
fish_color_selection --background=313244
|
||||||
|
fish_color_search_match --background=313244
|
||||||
|
fish_color_option a6e3a1
|
||||||
|
fish_color_operator f5c2e7
|
||||||
|
fish_color_escape eba0ac
|
||||||
|
fish_color_autosuggestion 6c7086
|
||||||
|
fish_color_cancel f38ba8
|
||||||
|
fish_color_cwd f9e2af
|
||||||
|
fish_color_user 94e2d5
|
||||||
|
fish_color_host 89b4fa
|
||||||
|
fish_color_host_remote a6e3a1
|
||||||
|
fish_color_status f38ba8
|
||||||
|
fish_pager_color_progress 6c7086
|
||||||
|
fish_pager_color_prefix f5c2e7
|
||||||
|
fish_pager_color_completion cdd6f4
|
||||||
|
fish_pager_color_description 6c7086
|
||||||
1
config/fzf/completion.bash
Executable file → Normal file
1
config/fzf/completion.bash
Executable file → Normal file
@@ -1,3 +1,4 @@
|
|||||||
|
# shellcheck disable=all
|
||||||
# ____ ____
|
# ____ ____
|
||||||
# / __/___ / __/
|
# / __/___ / __/
|
||||||
# / /_/_ / / /_
|
# / /_/_ / / /_
|
||||||
|
|||||||
1
config/fzf/completion.zsh
Executable file → Normal file
1
config/fzf/completion.zsh
Executable file → Normal file
@@ -1,3 +1,4 @@
|
|||||||
|
# shellcheck disable=all
|
||||||
# ____ ____
|
# ____ ____
|
||||||
# / __/___ / __/
|
# / __/___ / __/
|
||||||
# / /_/_ / / /_
|
# / /_/_ / / /_
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
# shellcheck shell=bash
|
||||||
# Everforest theme for fzf
|
# Everforest theme for fzf
|
||||||
# Generated from template - do not edit manually
|
# Generated from template - do not edit manually
|
||||||
|
|
||||||
|
|||||||
0
config/fzf/fzf.bash
Executable file → Normal file
0
config/fzf/fzf.bash
Executable file → Normal file
@@ -1,3 +1,5 @@
|
|||||||
|
#!/usr/bin/env zsh
|
||||||
|
# shellcheck disable=SC1071
|
||||||
# Setup fzf
|
# Setup fzf
|
||||||
# ---------
|
# ---------
|
||||||
|
|
||||||
|
|||||||
9
config/fzf/key-bindings.bash
Executable file → Normal file
9
config/fzf/key-bindings.bash
Executable file → Normal file
@@ -20,8 +20,8 @@ __fzf_select__() {
|
|||||||
-o -type d -print \
|
-o -type d -print \
|
||||||
-o -type l -print 2> /dev/null | cut -b3-"}"
|
-o -type l -print 2> /dev/null | cut -b3-"}"
|
||||||
opts="--height ${FZF_TMUX_HEIGHT:-40%} --bind=ctrl-z:ignore --reverse ${FZF_DEFAULT_OPTS-} ${FZF_CTRL_T_OPTS-} -m"
|
opts="--height ${FZF_TMUX_HEIGHT:-40%} --bind=ctrl-z:ignore --reverse ${FZF_DEFAULT_OPTS-} ${FZF_CTRL_T_OPTS-} -m"
|
||||||
eval "$cmd" |
|
# shellcheck disable=SC2091 # Intentionally execute output of __fzfcmd
|
||||||
FZF_DEFAULT_OPTS="$opts" $(__fzfcmd) "$@" |
|
eval "$cmd" | FZF_DEFAULT_OPTS="$opts" $(__fzfcmd) "$@" |
|
||||||
while read -r item; do
|
while read -r item; do
|
||||||
printf '%q ' "$item" # escape special chars
|
printf '%q ' "$item" # escape special chars
|
||||||
done
|
done
|
||||||
@@ -35,7 +35,8 @@ if [[ $- =~ i ]]; then
|
|||||||
}
|
}
|
||||||
|
|
||||||
fzf-file-widget() {
|
fzf-file-widget() {
|
||||||
local selected="$(__fzf_select__ "$@")"
|
local selected
|
||||||
|
selected="$(__fzf_select__ "$@")"
|
||||||
READLINE_LINE="${READLINE_LINE:0:$READLINE_POINT}$selected${READLINE_LINE:$READLINE_POINT}"
|
READLINE_LINE="${READLINE_LINE:0:$READLINE_POINT}$selected${READLINE_LINE:$READLINE_POINT}"
|
||||||
READLINE_POINT=$((READLINE_POINT + ${#selected}))
|
READLINE_POINT=$((READLINE_POINT + ${#selected}))
|
||||||
}
|
}
|
||||||
@@ -45,6 +46,7 @@ if [[ $- =~ i ]]; then
|
|||||||
cmd="${FZF_ALT_C_COMMAND:-"command find -L . -mindepth 1 \\( -path '*/\\.*' -o -fstype 'sysfs' -o -fstype 'devfs' -o -fstype 'devtmpfs' -o -fstype 'proc' \\) -prune \
|
cmd="${FZF_ALT_C_COMMAND:-"command find -L . -mindepth 1 \\( -path '*/\\.*' -o -fstype 'sysfs' -o -fstype 'devfs' -o -fstype 'devtmpfs' -o -fstype 'proc' \\) -prune \
|
||||||
-o -type d -print 2> /dev/null | cut -b3-"}"
|
-o -type d -print 2> /dev/null | cut -b3-"}"
|
||||||
opts="--height ${FZF_TMUX_HEIGHT:-40%} --bind=ctrl-z:ignore --reverse ${FZF_DEFAULT_OPTS-} ${FZF_ALT_C_OPTS-} +m"
|
opts="--height ${FZF_TMUX_HEIGHT:-40%} --bind=ctrl-z:ignore --reverse ${FZF_DEFAULT_OPTS-} ${FZF_ALT_C_OPTS-} +m"
|
||||||
|
# shellcheck disable=SC2091 # Intentionally execute output of __fzfcmd
|
||||||
dir=$(
|
dir=$(
|
||||||
set +o pipefail
|
set +o pipefail
|
||||||
eval "$cmd" | FZF_DEFAULT_OPTS="$opts" $(__fzfcmd)
|
eval "$cmd" | FZF_DEFAULT_OPTS="$opts" $(__fzfcmd)
|
||||||
@@ -55,6 +57,7 @@ if [[ $- =~ i ]]; then
|
|||||||
local output opts script
|
local output opts script
|
||||||
opts="--height ${FZF_TMUX_HEIGHT:-40%} --bind=ctrl-z:ignore ${FZF_DEFAULT_OPTS-} -n2..,.. --scheme=history --bind=ctrl-r:toggle-sort ${FZF_CTRL_R_OPTS-} +m --read0"
|
opts="--height ${FZF_TMUX_HEIGHT:-40%} --bind=ctrl-z:ignore ${FZF_DEFAULT_OPTS-} -n2..,.. --scheme=history --bind=ctrl-r:toggle-sort ${FZF_CTRL_R_OPTS-} +m --read0"
|
||||||
script='BEGIN { getc; $/ = "\n\t"; $HISTCOUNT = $ENV{last_hist} + 1 } s/^[ *]//; print $HISTCOUNT - $. . "\t$_" if !$seen{$_}++'
|
script='BEGIN { getc; $/ = "\n\t"; $HISTCOUNT = $ENV{last_hist} + 1 } s/^[ *]//; print $HISTCOUNT - $. . "\t$_" if !$seen{$_}++'
|
||||||
|
# shellcheck disable=SC2091 # Intentionally execute output of __fzfcmd
|
||||||
output=$(
|
output=$(
|
||||||
set +o pipefail
|
set +o pipefail
|
||||||
builtin fc -lnr -2147483648 |
|
builtin fc -lnr -2147483648 |
|
||||||
|
|||||||
263
config/fzf/key-bindings.fish
Executable file → Normal file
263
config/fzf/key-bindings.fish
Executable file → Normal file
@@ -15,158 +15,161 @@
|
|||||||
# ------------
|
# ------------
|
||||||
function fzf_key_bindings
|
function fzf_key_bindings
|
||||||
|
|
||||||
# Store current token in $dir as root for the 'find' command
|
# Store current token in $dir as root for the 'find' command
|
||||||
function fzf-file-widget -d "List files and folders"
|
function fzf-file-widget -d "List files and folders"
|
||||||
set -l commandline (__fzf_parse_commandline)
|
set -l commandline (__fzf_parse_commandline)
|
||||||
set -l dir $commandline[1]
|
set -l dir $commandline[1]
|
||||||
set -l fzf_query $commandline[2]
|
set -l fzf_query $commandline[2]
|
||||||
set -l prefix $commandline[3]
|
set -l prefix $commandline[3]
|
||||||
|
|
||||||
# "-path \$dir'*/\\.*'" matches hidden files/folders inside $dir but not
|
# "-path \$dir'*/\\.*'" matches hidden files/folders inside $dir but not
|
||||||
# $dir itself, even if hidden.
|
# $dir itself, even if hidden.
|
||||||
test -n "$FZF_CTRL_T_COMMAND"; or set -l FZF_CTRL_T_COMMAND "
|
test -n "$FZF_CTRL_T_COMMAND"; or set -l FZF_CTRL_T_COMMAND "
|
||||||
command find -L \$dir -mindepth 1 \\( -path \$dir'*/\\.*' -o -fstype 'sysfs' -o -fstype 'devfs' -o -fstype 'devtmpfs' \\) -prune \
|
command find -L \$dir -mindepth 1 \\( -path \$dir'*/\\.*' -o -fstype 'sysfs' -o -fstype 'devfs' -o -fstype 'devtmpfs' \\) -prune \
|
||||||
-o -type f -print \
|
-o -type f -print \
|
||||||
-o -type d -print \
|
-o -type d -print \
|
||||||
-o -type l -print 2> /dev/null | sed 's@^\./@@'"
|
-o -type l -print 2> /dev/null | sed 's@^\./@@'"
|
||||||
|
|
||||||
test -n "$FZF_TMUX_HEIGHT"; or set FZF_TMUX_HEIGHT 40%
|
test -n "$FZF_TMUX_HEIGHT"; or set FZF_TMUX_HEIGHT 40%
|
||||||
begin
|
begin
|
||||||
set -lx FZF_DEFAULT_OPTS "--height $FZF_TMUX_HEIGHT --reverse --bind=ctrl-z:ignore $FZF_DEFAULT_OPTS $FZF_CTRL_T_OPTS"
|
set -lx FZF_DEFAULT_OPTS "--height $FZF_TMUX_HEIGHT --reverse --bind=ctrl-z:ignore $FZF_DEFAULT_OPTS $FZF_CTRL_T_OPTS"
|
||||||
eval "$FZF_CTRL_T_COMMAND | "(__fzfcmd)' -m --query "'$fzf_query'"' | while read -l r; set result $result $r; end
|
eval "$FZF_CTRL_T_COMMAND | "(__fzfcmd)' -m --query "'$fzf_query'"' | while read -l r
|
||||||
|
set result $result $r
|
||||||
|
end
|
||||||
|
end
|
||||||
|
if [ -z "$result" ]
|
||||||
|
commandline -f repaint
|
||||||
|
return
|
||||||
|
else
|
||||||
|
# Remove last token from commandline.
|
||||||
|
commandline -t ""
|
||||||
|
end
|
||||||
|
for i in $result
|
||||||
|
commandline -it -- $prefix
|
||||||
|
commandline -it -- (string escape $i)
|
||||||
|
commandline -it -- ' '
|
||||||
|
end
|
||||||
|
commandline -f repaint
|
||||||
end
|
end
|
||||||
if [ -z "$result" ]
|
|
||||||
commandline -f repaint
|
function fzf-history-widget -d "Show command history"
|
||||||
return
|
test -n "$FZF_TMUX_HEIGHT"; or set FZF_TMUX_HEIGHT 40%
|
||||||
else
|
begin
|
||||||
# Remove last token from commandline.
|
set -lx FZF_DEFAULT_OPTS "--height $FZF_TMUX_HEIGHT $FZF_DEFAULT_OPTS --scheme=history --bind=ctrl-r:toggle-sort,ctrl-z:ignore $FZF_CTRL_R_OPTS +m"
|
||||||
commandline -t ""
|
|
||||||
|
set -l FISH_MAJOR (echo $version | cut -f1 -d.)
|
||||||
|
set -l FISH_MINOR (echo $version | cut -f2 -d.)
|
||||||
|
|
||||||
|
# history's -z flag is needed for multi-line support.
|
||||||
|
# history's -z flag was added in fish 2.4.0, so don't use it for versions
|
||||||
|
# before 2.4.0.
|
||||||
|
if [ "$FISH_MAJOR" -gt 2 -o \( "$FISH_MAJOR" -eq 2 -a "$FISH_MINOR" -ge 4 \) ]
|
||||||
|
|
||||||
|
history -z | eval (__fzfcmd) --read0 --print0 -q '(commandline)' | read -lz result
|
||||||
|
and commandline -- $result
|
||||||
|
else
|
||||||
|
history | eval (__fzfcmd) -q '(commandline)' | read -l result
|
||||||
|
and commandline -- $result
|
||||||
|
end
|
||||||
|
end
|
||||||
|
commandline -f repaint
|
||||||
end
|
end
|
||||||
for i in $result
|
|
||||||
commandline -it -- $prefix
|
|
||||||
commandline -it -- (string escape $i)
|
|
||||||
commandline -it -- ' '
|
|
||||||
end
|
|
||||||
commandline -f repaint
|
|
||||||
end
|
|
||||||
|
|
||||||
function fzf-history-widget -d "Show command history"
|
function fzf-cd-widget -d "Change directory"
|
||||||
test -n "$FZF_TMUX_HEIGHT"; or set FZF_TMUX_HEIGHT 40%
|
set -l commandline (__fzf_parse_commandline)
|
||||||
begin
|
set -l dir $commandline[1]
|
||||||
set -lx FZF_DEFAULT_OPTS "--height $FZF_TMUX_HEIGHT $FZF_DEFAULT_OPTS --scheme=history --bind=ctrl-r:toggle-sort,ctrl-z:ignore $FZF_CTRL_R_OPTS +m"
|
set -l fzf_query $commandline[2]
|
||||||
|
set -l prefix $commandline[3]
|
||||||
|
|
||||||
set -l FISH_MAJOR (echo $version | cut -f1 -d.)
|
test -n "$FZF_ALT_C_COMMAND"; or set -l FZF_ALT_C_COMMAND "
|
||||||
set -l FISH_MINOR (echo $version | cut -f2 -d.)
|
|
||||||
|
|
||||||
# history's -z flag is needed for multi-line support.
|
|
||||||
# history's -z flag was added in fish 2.4.0, so don't use it for versions
|
|
||||||
# before 2.4.0.
|
|
||||||
if [ "$FISH_MAJOR" -gt 2 -o \( "$FISH_MAJOR" -eq 2 -a "$FISH_MINOR" -ge 4 \) ];
|
|
||||||
history -z | eval (__fzfcmd) --read0 --print0 -q '(commandline)' | read -lz result
|
|
||||||
and commandline -- $result
|
|
||||||
else
|
|
||||||
history | eval (__fzfcmd) -q '(commandline)' | read -l result
|
|
||||||
and commandline -- $result
|
|
||||||
end
|
|
||||||
end
|
|
||||||
commandline -f repaint
|
|
||||||
end
|
|
||||||
|
|
||||||
function fzf-cd-widget -d "Change directory"
|
|
||||||
set -l commandline (__fzf_parse_commandline)
|
|
||||||
set -l dir $commandline[1]
|
|
||||||
set -l fzf_query $commandline[2]
|
|
||||||
set -l prefix $commandline[3]
|
|
||||||
|
|
||||||
test -n "$FZF_ALT_C_COMMAND"; or set -l FZF_ALT_C_COMMAND "
|
|
||||||
command find -L \$dir -mindepth 1 \\( -path \$dir'*/\\.*' -o -fstype 'sysfs' -o -fstype 'devfs' -o -fstype 'devtmpfs' \\) -prune \
|
command find -L \$dir -mindepth 1 \\( -path \$dir'*/\\.*' -o -fstype 'sysfs' -o -fstype 'devfs' -o -fstype 'devtmpfs' \\) -prune \
|
||||||
-o -type d -print 2> /dev/null | sed 's@^\./@@'"
|
-o -type d -print 2> /dev/null | sed 's@^\./@@'"
|
||||||
test -n "$FZF_TMUX_HEIGHT"; or set FZF_TMUX_HEIGHT 40%
|
test -n "$FZF_TMUX_HEIGHT"; or set FZF_TMUX_HEIGHT 40%
|
||||||
begin
|
begin
|
||||||
set -lx FZF_DEFAULT_OPTS "--height $FZF_TMUX_HEIGHT --reverse --bind=ctrl-z:ignore $FZF_DEFAULT_OPTS $FZF_ALT_C_OPTS"
|
set -lx FZF_DEFAULT_OPTS "--height $FZF_TMUX_HEIGHT --reverse --bind=ctrl-z:ignore $FZF_DEFAULT_OPTS $FZF_ALT_C_OPTS"
|
||||||
eval "$FZF_ALT_C_COMMAND | "(__fzfcmd)' +m --query "'$fzf_query'"' | read -l result
|
eval "$FZF_ALT_C_COMMAND | "(__fzfcmd)' +m --query "'$fzf_query'"' | read -l result
|
||||||
|
|
||||||
if [ -n "$result" ]
|
if [ -n "$result" ]
|
||||||
cd -- $result
|
cd -- $result
|
||||||
|
|
||||||
# Remove last token from commandline.
|
# Remove last token from commandline.
|
||||||
commandline -t ""
|
commandline -t ""
|
||||||
commandline -it -- $prefix
|
commandline -it -- $prefix
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
commandline -f repaint
|
||||||
end
|
end
|
||||||
|
|
||||||
commandline -f repaint
|
function __fzfcmd
|
||||||
end
|
test -n "$FZF_TMUX"; or set FZF_TMUX 0
|
||||||
|
test -n "$FZF_TMUX_HEIGHT"; or set FZF_TMUX_HEIGHT 40%
|
||||||
function __fzfcmd
|
if [ -n "$FZF_TMUX_OPTS" ]
|
||||||
test -n "$FZF_TMUX"; or set FZF_TMUX 0
|
echo "fzf-tmux $FZF_TMUX_OPTS -- "
|
||||||
test -n "$FZF_TMUX_HEIGHT"; or set FZF_TMUX_HEIGHT 40%
|
else if [ $FZF_TMUX -eq 1 ]
|
||||||
if [ -n "$FZF_TMUX_OPTS" ]
|
echo "fzf-tmux -d$FZF_TMUX_HEIGHT -- "
|
||||||
echo "fzf-tmux $FZF_TMUX_OPTS -- "
|
else
|
||||||
else if [ $FZF_TMUX -eq 1 ]
|
echo fzf
|
||||||
echo "fzf-tmux -d$FZF_TMUX_HEIGHT -- "
|
end
|
||||||
else
|
|
||||||
echo "fzf"
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
bind \ct fzf-file-widget
|
|
||||||
bind \cr fzf-history-widget
|
|
||||||
bind \ec fzf-cd-widget
|
|
||||||
|
|
||||||
if bind -M insert > /dev/null 2>&1
|
|
||||||
bind -M insert \ct fzf-file-widget
|
|
||||||
bind -M insert \cr fzf-history-widget
|
|
||||||
bind -M insert \ec fzf-cd-widget
|
|
||||||
end
|
|
||||||
|
|
||||||
function __fzf_parse_commandline -d 'Parse the current command line token and return split of existing filepath, fzf query, and optional -option= prefix'
|
|
||||||
set -l commandline (commandline -t)
|
|
||||||
|
|
||||||
# strip -option= from token if present
|
|
||||||
set -l prefix (string match -r -- '^-[^\s=]+=' $commandline)
|
|
||||||
set commandline (string replace -- "$prefix" '' $commandline)
|
|
||||||
|
|
||||||
# eval is used to do shell expansion on paths
|
|
||||||
eval set commandline $commandline
|
|
||||||
|
|
||||||
if [ -z $commandline ]
|
|
||||||
# Default to current directory with no --query
|
|
||||||
set dir '.'
|
|
||||||
set fzf_query ''
|
|
||||||
else
|
|
||||||
set dir (__fzf_get_dir $commandline)
|
|
||||||
|
|
||||||
if [ "$dir" = "." -a (string sub -l 1 -- $commandline) != '.' ]
|
|
||||||
# if $dir is "." but commandline is not a relative path, this means no file path found
|
|
||||||
set fzf_query $commandline
|
|
||||||
else
|
|
||||||
# Also remove trailing slash after dir, to "split" input properly
|
|
||||||
set fzf_query (string replace -r "^$dir/?" -- '' "$commandline")
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
echo $dir
|
bind \ct fzf-file-widget
|
||||||
echo $fzf_query
|
bind \cr fzf-history-widget
|
||||||
echo $prefix
|
bind \ec fzf-cd-widget
|
||||||
end
|
|
||||||
|
|
||||||
function __fzf_get_dir -d 'Find the longest existing filepath from input string'
|
if bind -M insert >/dev/null 2>&1
|
||||||
set dir $argv
|
bind -M insert \ct fzf-file-widget
|
||||||
|
bind -M insert \cr fzf-history-widget
|
||||||
# Strip all trailing slashes. Ignore if $dir is root dir (/)
|
bind -M insert \ec fzf-cd-widget
|
||||||
if [ (string length -- $dir) -gt 1 ]
|
|
||||||
set dir (string replace -r '/*$' -- '' $dir)
|
|
||||||
end
|
end
|
||||||
|
|
||||||
# Iteratively check if dir exists and strip tail end of path
|
function __fzf_parse_commandline -d 'Parse the current command line token and return split of existing filepath, fzf query, and optional -option= prefix'
|
||||||
while [ ! -d "$dir" ]
|
set -l commandline (commandline -t)
|
||||||
# If path is absolute, this can keep going until ends up at /
|
|
||||||
# If path is relative, this can keep going until entire input is consumed, dirname returns "."
|
# strip -option= from token if present
|
||||||
set dir (dirname -- "$dir")
|
set -l prefix (string match -r -- '^-[^\s=]+=' $commandline)
|
||||||
|
set commandline (string replace -- "$prefix" '' $commandline)
|
||||||
|
|
||||||
|
# eval is used to do shell expansion on paths
|
||||||
|
eval set commandline $commandline
|
||||||
|
|
||||||
|
if [ -z $commandline ]
|
||||||
|
# Default to current directory with no --query
|
||||||
|
set dir '.'
|
||||||
|
set fzf_query ''
|
||||||
|
else
|
||||||
|
set dir (__fzf_get_dir $commandline)
|
||||||
|
|
||||||
|
if [ "$dir" = "." -a (string sub -l 1 -- $commandline) != '.' ]
|
||||||
|
# if $dir is "." but commandline is not a relative path, this means no file path found
|
||||||
|
set fzf_query $commandline
|
||||||
|
else
|
||||||
|
# Also remove trailing slash after dir, to "split" input properly
|
||||||
|
set fzf_query (string replace -r "^$dir/?" -- '' "$commandline")
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
echo $dir
|
||||||
|
echo $fzf_query
|
||||||
|
echo $prefix
|
||||||
end
|
end
|
||||||
|
|
||||||
echo $dir
|
function __fzf_get_dir -d 'Find the longest existing filepath from input string'
|
||||||
end
|
set dir $argv
|
||||||
|
|
||||||
|
# Strip all trailing slashes. Ignore if $dir is root dir (/)
|
||||||
|
if [ (string length -- $dir) -gt 1 ]
|
||||||
|
set dir (string replace -r '/*$' -- '' $dir)
|
||||||
|
end
|
||||||
|
|
||||||
|
# Iteratively check if dir exists and strip tail end of path
|
||||||
|
while [ ! -d "$dir" ]
|
||||||
|
# If path is absolute, this can keep going until ends up at /
|
||||||
|
# If path is relative, this can keep going until entire input is consumed, dirname returns "."
|
||||||
|
set dir (dirname -- "$dir")
|
||||||
|
end
|
||||||
|
|
||||||
|
echo $dir
|
||||||
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|||||||
1
config/fzf/key-bindings.zsh
Executable file → Normal file
1
config/fzf/key-bindings.zsh
Executable file → Normal file
@@ -1,3 +1,4 @@
|
|||||||
|
# shellcheck disable=all
|
||||||
# ____ ____
|
# ____ ____
|
||||||
# / __/___ / __/
|
# / __/___ / __/
|
||||||
# / /_/_ / / /_
|
# / /_/_ / / /_
|
||||||
|
|||||||
@@ -38,6 +38,8 @@ brew "openssl@3"
|
|||||||
brew "cryptography"
|
brew "cryptography"
|
||||||
# YAML Parser
|
# YAML Parser
|
||||||
brew "libyaml"
|
brew "libyaml"
|
||||||
|
# Display directories as trees (with optional color/HTML output)
|
||||||
|
brew "tree"
|
||||||
# Automate deployment, configuration, and upgrading
|
# Automate deployment, configuration, and upgrading
|
||||||
brew "ansible"
|
brew "ansible"
|
||||||
# Checks ansible playbooks for practices and behaviour
|
# Checks ansible playbooks for practices and behaviour
|
||||||
@@ -104,7 +106,7 @@ brew "glib"
|
|||||||
brew "cargo-binstall"
|
brew "cargo-binstall"
|
||||||
# Multi-platform support library with a focus on asynchronous I/O
|
# Multi-platform support library with a focus on asynchronous I/O
|
||||||
brew "libuv"
|
brew "libuv"
|
||||||
# Platform built on V8 to build network applications
|
# Open-source, cross-platform JavaScript runtime environment
|
||||||
brew "node", link: false
|
brew "node", link: false
|
||||||
# CLI tool for analyzing Claude Code usage from local JSONL files
|
# CLI tool for analyzing Claude Code usage from local JSONL files
|
||||||
brew "ccusage"
|
brew "ccusage"
|
||||||
@@ -230,6 +232,8 @@ brew "luarocks"
|
|||||||
brew "lzip"
|
brew "lzip"
|
||||||
# Swiss Army Knife for macOS
|
# Swiss Army Knife for macOS
|
||||||
brew "m-cli"
|
brew "m-cli"
|
||||||
|
# Cross platform, open source .NET development framework
|
||||||
|
brew "mono"
|
||||||
# Collection of tools that nobody wrote when UNIX was young
|
# Collection of tools that nobody wrote when UNIX was young
|
||||||
brew "moreutils"
|
brew "moreutils"
|
||||||
# NCurses Disk Usage
|
# NCurses Disk Usage
|
||||||
@@ -290,8 +294,8 @@ brew "tflint"
|
|||||||
brew "tfsec"
|
brew "tfsec"
|
||||||
# Terminal multiplexer
|
# Terminal multiplexer
|
||||||
brew "tmux"
|
brew "tmux"
|
||||||
# Display directories as trees (with optional color/HTML output)
|
# Extremely fast Python package installer and resolver, written in Rust
|
||||||
brew "tree"
|
brew "uv"
|
||||||
# Tool for creating isolated virtual python environments
|
# Tool for creating isolated virtual python environments
|
||||||
brew "virtualenv"
|
brew "virtualenv"
|
||||||
# Command-line interface to the WakaTime api
|
# Command-line interface to the WakaTime api
|
||||||
@@ -349,13 +353,18 @@ cask "fantastical"
|
|||||||
cask "font-jetbrains-mono"
|
cask "font-jetbrains-mono"
|
||||||
cask "font-jetbrains-mono-nerd-font"
|
cask "font-jetbrains-mono-nerd-font"
|
||||||
cask "font-monaspace"
|
cask "font-monaspace"
|
||||||
|
cask "font-monaspace-nf"
|
||||||
cask "font-open-sans"
|
cask "font-open-sans"
|
||||||
# GIT client
|
# GIT client
|
||||||
cask "fork"
|
cask "fork"
|
||||||
|
# Desktop automation application
|
||||||
|
cask "hammerspoon"
|
||||||
# HTTP and GraphQL Client
|
# HTTP and GraphQL Client
|
||||||
cask "insomnia"
|
cask "insomnia"
|
||||||
# JetBrains tools manager
|
# JetBrains tools manager
|
||||||
cask "jetbrains-toolbox"
|
cask "jetbrains-toolbox"
|
||||||
|
# Keyboard customiser
|
||||||
|
cask "karabiner-elements"
|
||||||
# End-to-end encryption software
|
# End-to-end encryption software
|
||||||
cask "keybase"
|
cask "keybase"
|
||||||
# Kubernetes IDE
|
# Kubernetes IDE
|
||||||
|
|||||||
68
config/karabiner/karabiner.json
Normal file
68
config/karabiner/karabiner.json
Normal file
@@ -0,0 +1,68 @@
|
|||||||
|
{
|
||||||
|
"profiles": [
|
||||||
|
{
|
||||||
|
"complex_modifications": {
|
||||||
|
"rules": [
|
||||||
|
{
|
||||||
|
"description": "Change right_command+hjkl to arrow keys",
|
||||||
|
"manipulators": [
|
||||||
|
{
|
||||||
|
"from": {
|
||||||
|
"key_code": "h",
|
||||||
|
"modifiers": {
|
||||||
|
"mandatory": ["right_command"],
|
||||||
|
"optional": ["any"]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"to": [{ "key_code": "left_arrow" }],
|
||||||
|
"type": "basic"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"from": {
|
||||||
|
"key_code": "j",
|
||||||
|
"modifiers": {
|
||||||
|
"mandatory": ["right_command"],
|
||||||
|
"optional": ["any"]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"to": [{ "key_code": "down_arrow" }],
|
||||||
|
"type": "basic"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"from": {
|
||||||
|
"key_code": "k",
|
||||||
|
"modifiers": {
|
||||||
|
"mandatory": ["right_command"],
|
||||||
|
"optional": ["any"]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"to": [{ "key_code": "up_arrow" }],
|
||||||
|
"type": "basic"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"from": {
|
||||||
|
"key_code": "l",
|
||||||
|
"modifiers": {
|
||||||
|
"mandatory": ["right_command"],
|
||||||
|
"optional": ["any"]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"to": [{ "key_code": "right_arrow" }],
|
||||||
|
"type": "basic"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"name": "Default profile",
|
||||||
|
"selected": true,
|
||||||
|
"simple_modifications": [
|
||||||
|
{
|
||||||
|
"from": { "key_code": "caps_lock" },
|
||||||
|
"to": [{ "key_code": "f18" }]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"virtual_hid_keyboard": { "keyboard_type_v2": "iso" }
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
@@ -1,114 +0,0 @@
|
|||||||
-- Everforest theme for Neovim
|
|
||||||
-- Generated from template - do not edit manually
|
|
||||||
|
|
||||||
local M = {}
|
|
||||||
|
|
||||||
M.colors = {
|
|
||||||
bg = '#2f383e',
|
|
||||||
bg1 = '#374247',
|
|
||||||
bg2 = '#404c51',
|
|
||||||
fg = '#d3c6aa',
|
|
||||||
red = '#e67e80',
|
|
||||||
orange = '#e69875',
|
|
||||||
yellow = '#dbbc7f',
|
|
||||||
green = '#a7c080',
|
|
||||||
aqua = '#83c092',
|
|
||||||
blue = '#7fbbb3',
|
|
||||||
purple = '#d699b6',
|
|
||||||
gray1 = '#7a8478',
|
|
||||||
gray2 = '#859289',
|
|
||||||
gray3 = '#9da9a0',
|
|
||||||
}
|
|
||||||
|
|
||||||
M.highlights = {
|
|
||||||
-- Editor highlights
|
|
||||||
Normal = { fg = M.colors.fg, bg = M.colors.bg },
|
|
||||||
NormalFloat = { fg = M.colors.fg, bg = M.colors.bg1 },
|
|
||||||
ColorColumn = { bg = M.colors.bg1 },
|
|
||||||
Conceal = { fg = M.colors.gray2 },
|
|
||||||
Cursor = { fg = M.colors.bg, bg = M.colors.fg },
|
|
||||||
lCursor = { fg = M.colors.bg, bg = M.colors.fg },
|
|
||||||
CursorIM = { fg = M.colors.bg, bg = M.colors.fg },
|
|
||||||
CursorColumn = { bg = M.colors.bg1 },
|
|
||||||
CursorLine = { bg = M.colors.bg1 },
|
|
||||||
Directory = { fg = M.colors.blue, bold = true },
|
|
||||||
DiffAdd = { fg = M.colors.green, bg = M.colors.bg },
|
|
||||||
DiffChange = { fg = M.colors.blue, bg = M.colors.bg },
|
|
||||||
DiffDelete = { fg = M.colors.red, bg = M.colors.bg },
|
|
||||||
DiffText = { fg = M.colors.yellow, bg = M.colors.bg },
|
|
||||||
EndOfBuffer = { fg = M.colors.gray2 },
|
|
||||||
ErrorMsg = { fg = M.colors.red, bold = true },
|
|
||||||
VertSplit = { fg = M.colors.gray2 },
|
|
||||||
Folded = { fg = M.colors.gray2, bg = M.colors.bg1 },
|
|
||||||
FoldColumn = { fg = M.colors.gray2, bg = M.colors.bg },
|
|
||||||
SignColumn = { fg = M.colors.fg, bg = M.colors.bg },
|
|
||||||
IncSearch = { fg = M.colors.bg, bg = M.colors.orange },
|
|
||||||
LineNr = { fg = M.colors.gray2 },
|
|
||||||
CursorLineNr = { fg = M.colors.yellow, bold = true },
|
|
||||||
MatchParen = { fg = M.colors.orange, bold = true },
|
|
||||||
ModeMsg = { fg = M.colors.fg, bold = true },
|
|
||||||
MoreMsg = { fg = M.colors.blue, bold = true },
|
|
||||||
NonText = { fg = M.colors.gray2 },
|
|
||||||
Pmenu = { fg = M.colors.fg, bg = M.colors.bg1 },
|
|
||||||
PmenuSel = { fg = M.colors.bg, bg = M.colors.blue },
|
|
||||||
PmenuSbar = { bg = M.colors.bg2 },
|
|
||||||
PmenuThumb = { bg = M.colors.gray2 },
|
|
||||||
Question = { fg = M.colors.yellow, bold = true },
|
|
||||||
QuickFixLine = { fg = M.colors.bg, bg = M.colors.yellow },
|
|
||||||
Search = { fg = M.colors.bg, bg = M.colors.yellow },
|
|
||||||
SpecialKey = { fg = M.colors.gray2 },
|
|
||||||
SpellBad = { fg = M.colors.red, undercurl = true },
|
|
||||||
SpellCap = { fg = M.colors.blue, undercurl = true },
|
|
||||||
SpellLocal = { fg = M.colors.aqua, undercurl = true },
|
|
||||||
SpellRare = { fg = M.colors.purple, undercurl = true },
|
|
||||||
StatusLine = { fg = M.colors.fg, bg = M.colors.bg1 },
|
|
||||||
StatusLineNC = { fg = M.colors.gray2, bg = M.colors.bg1 },
|
|
||||||
TabLine = { fg = M.colors.gray2, bg = M.colors.bg1 },
|
|
||||||
TabLineFill = { fg = M.colors.gray2, bg = M.colors.bg1 },
|
|
||||||
TabLineSel = { fg = M.colors.fg, bg = M.colors.bg },
|
|
||||||
Title = { fg = M.colors.orange, bold = true },
|
|
||||||
Visual = { bg = M.colors.bg2 },
|
|
||||||
VisualNOS = { fg = M.colors.gray2 },
|
|
||||||
WarningMsg = { fg = M.colors.yellow, bold = true },
|
|
||||||
Whitespace = { fg = M.colors.gray2 },
|
|
||||||
WildMenu = { fg = M.colors.bg, bg = M.colors.blue },
|
|
||||||
|
|
||||||
-- Syntax highlighting
|
|
||||||
Comment = { fg = M.colors.gray2 },
|
|
||||||
Constant = { fg = M.colors.purple },
|
|
||||||
String = { fg = M.colors.green },
|
|
||||||
Character = { fg = M.colors.green },
|
|
||||||
Number = { fg = M.colors.purple },
|
|
||||||
Boolean = { fg = M.colors.purple },
|
|
||||||
Float = { fg = M.colors.purple },
|
|
||||||
Identifier = { fg = M.colors.blue },
|
|
||||||
Function = { fg = M.colors.green },
|
|
||||||
Statement = { fg = M.colors.red },
|
|
||||||
Conditional = { fg = M.colors.red },
|
|
||||||
Repeat = { fg = M.colors.red },
|
|
||||||
Label = { fg = M.colors.orange },
|
|
||||||
Operator = { fg = M.colors.orange },
|
|
||||||
Keyword = { fg = M.colors.red },
|
|
||||||
Exception = { fg = M.colors.red },
|
|
||||||
PreProc = { fg = M.colors.aqua },
|
|
||||||
Include = { fg = M.colors.blue },
|
|
||||||
Define = { fg = M.colors.purple },
|
|
||||||
Macro = { fg = M.colors.purple },
|
|
||||||
PreCondit = { fg = M.colors.aqua },
|
|
||||||
Type = { fg = M.colors.yellow },
|
|
||||||
StorageClass = { fg = M.colors.orange },
|
|
||||||
Structure = { fg = M.colors.aqua },
|
|
||||||
Typedef = { fg = M.colors.yellow },
|
|
||||||
Special = { fg = M.colors.orange },
|
|
||||||
SpecialChar = { fg = M.colors.red },
|
|
||||||
Tag = { fg = M.colors.orange },
|
|
||||||
Delimiter = { fg = M.colors.gray2 },
|
|
||||||
SpecialComment = { fg = M.colors.aqua },
|
|
||||||
Debug = { fg = M.colors.red },
|
|
||||||
Underlined = { fg = M.colors.blue, underline = true },
|
|
||||||
Ignore = { fg = M.colors.gray2 },
|
|
||||||
Error = { fg = M.colors.red, bold = true },
|
|
||||||
Todo = { fg = M.colors.yellow, bold = true },
|
|
||||||
}
|
|
||||||
|
|
||||||
return M
|
|
||||||
@@ -1,114 +0,0 @@
|
|||||||
-- Everforest theme for Neovim
|
|
||||||
-- Generated from template - do not edit manually
|
|
||||||
|
|
||||||
local M = {}
|
|
||||||
|
|
||||||
M.colors = {
|
|
||||||
bg = '#f3ead3',
|
|
||||||
bg1 = '#ede6cf',
|
|
||||||
bg2 = '#e8e3cc',
|
|
||||||
fg = '#5c6a72',
|
|
||||||
red = '#e67e80',
|
|
||||||
orange = '#e69875',
|
|
||||||
yellow = '#dbbc7f',
|
|
||||||
green = '#a7c080',
|
|
||||||
aqua = '#83c092',
|
|
||||||
blue = '#7fbbb3',
|
|
||||||
purple = '#d699b6',
|
|
||||||
gray1 = '#a6b0a0',
|
|
||||||
gray2 = '#b3c0b0',
|
|
||||||
gray3 = '#c0cdb8',
|
|
||||||
}
|
|
||||||
|
|
||||||
M.highlights = {
|
|
||||||
-- Editor highlights
|
|
||||||
Normal = { fg = M.colors.fg, bg = M.colors.bg },
|
|
||||||
NormalFloat = { fg = M.colors.fg, bg = M.colors.bg1 },
|
|
||||||
ColorColumn = { bg = M.colors.bg1 },
|
|
||||||
Conceal = { fg = M.colors.gray2 },
|
|
||||||
Cursor = { fg = M.colors.bg, bg = M.colors.fg },
|
|
||||||
lCursor = { fg = M.colors.bg, bg = M.colors.fg },
|
|
||||||
CursorIM = { fg = M.colors.bg, bg = M.colors.fg },
|
|
||||||
CursorColumn = { bg = M.colors.bg1 },
|
|
||||||
CursorLine = { bg = M.colors.bg1 },
|
|
||||||
Directory = { fg = M.colors.blue, bold = true },
|
|
||||||
DiffAdd = { fg = M.colors.green, bg = M.colors.bg },
|
|
||||||
DiffChange = { fg = M.colors.blue, bg = M.colors.bg },
|
|
||||||
DiffDelete = { fg = M.colors.red, bg = M.colors.bg },
|
|
||||||
DiffText = { fg = M.colors.yellow, bg = M.colors.bg },
|
|
||||||
EndOfBuffer = { fg = M.colors.gray2 },
|
|
||||||
ErrorMsg = { fg = M.colors.red, bold = true },
|
|
||||||
VertSplit = { fg = M.colors.gray2 },
|
|
||||||
Folded = { fg = M.colors.gray2, bg = M.colors.bg1 },
|
|
||||||
FoldColumn = { fg = M.colors.gray2, bg = M.colors.bg },
|
|
||||||
SignColumn = { fg = M.colors.fg, bg = M.colors.bg },
|
|
||||||
IncSearch = { fg = M.colors.bg, bg = M.colors.orange },
|
|
||||||
LineNr = { fg = M.colors.gray2 },
|
|
||||||
CursorLineNr = { fg = M.colors.yellow, bold = true },
|
|
||||||
MatchParen = { fg = M.colors.orange, bold = true },
|
|
||||||
ModeMsg = { fg = M.colors.fg, bold = true },
|
|
||||||
MoreMsg = { fg = M.colors.blue, bold = true },
|
|
||||||
NonText = { fg = M.colors.gray2 },
|
|
||||||
Pmenu = { fg = M.colors.fg, bg = M.colors.bg1 },
|
|
||||||
PmenuSel = { fg = M.colors.bg, bg = M.colors.blue },
|
|
||||||
PmenuSbar = { bg = M.colors.bg2 },
|
|
||||||
PmenuThumb = { bg = M.colors.gray2 },
|
|
||||||
Question = { fg = M.colors.yellow, bold = true },
|
|
||||||
QuickFixLine = { fg = M.colors.bg, bg = M.colors.yellow },
|
|
||||||
Search = { fg = M.colors.bg, bg = M.colors.yellow },
|
|
||||||
SpecialKey = { fg = M.colors.gray2 },
|
|
||||||
SpellBad = { fg = M.colors.red, undercurl = true },
|
|
||||||
SpellCap = { fg = M.colors.blue, undercurl = true },
|
|
||||||
SpellLocal = { fg = M.colors.aqua, undercurl = true },
|
|
||||||
SpellRare = { fg = M.colors.purple, undercurl = true },
|
|
||||||
StatusLine = { fg = M.colors.fg, bg = M.colors.bg1 },
|
|
||||||
StatusLineNC = { fg = M.colors.gray2, bg = M.colors.bg1 },
|
|
||||||
TabLine = { fg = M.colors.gray2, bg = M.colors.bg1 },
|
|
||||||
TabLineFill = { fg = M.colors.gray2, bg = M.colors.bg1 },
|
|
||||||
TabLineSel = { fg = M.colors.fg, bg = M.colors.bg },
|
|
||||||
Title = { fg = M.colors.orange, bold = true },
|
|
||||||
Visual = { bg = M.colors.bg2 },
|
|
||||||
VisualNOS = { fg = M.colors.gray2 },
|
|
||||||
WarningMsg = { fg = M.colors.yellow, bold = true },
|
|
||||||
Whitespace = { fg = M.colors.gray2 },
|
|
||||||
WildMenu = { fg = M.colors.bg, bg = M.colors.blue },
|
|
||||||
|
|
||||||
-- Syntax highlighting
|
|
||||||
Comment = { fg = M.colors.gray2 },
|
|
||||||
Constant = { fg = M.colors.purple },
|
|
||||||
String = { fg = M.colors.green },
|
|
||||||
Character = { fg = M.colors.green },
|
|
||||||
Number = { fg = M.colors.purple },
|
|
||||||
Boolean = { fg = M.colors.purple },
|
|
||||||
Float = { fg = M.colors.purple },
|
|
||||||
Identifier = { fg = M.colors.blue },
|
|
||||||
Function = { fg = M.colors.green },
|
|
||||||
Statement = { fg = M.colors.red },
|
|
||||||
Conditional = { fg = M.colors.red },
|
|
||||||
Repeat = { fg = M.colors.red },
|
|
||||||
Label = { fg = M.colors.orange },
|
|
||||||
Operator = { fg = M.colors.orange },
|
|
||||||
Keyword = { fg = M.colors.red },
|
|
||||||
Exception = { fg = M.colors.red },
|
|
||||||
PreProc = { fg = M.colors.aqua },
|
|
||||||
Include = { fg = M.colors.blue },
|
|
||||||
Define = { fg = M.colors.purple },
|
|
||||||
Macro = { fg = M.colors.purple },
|
|
||||||
PreCondit = { fg = M.colors.aqua },
|
|
||||||
Type = { fg = M.colors.yellow },
|
|
||||||
StorageClass = { fg = M.colors.orange },
|
|
||||||
Structure = { fg = M.colors.aqua },
|
|
||||||
Typedef = { fg = M.colors.yellow },
|
|
||||||
Special = { fg = M.colors.orange },
|
|
||||||
SpecialChar = { fg = M.colors.red },
|
|
||||||
Tag = { fg = M.colors.orange },
|
|
||||||
Delimiter = { fg = M.colors.gray2 },
|
|
||||||
SpecialComment = { fg = M.colors.aqua },
|
|
||||||
Debug = { fg = M.colors.red },
|
|
||||||
Underlined = { fg = M.colors.blue, underline = true },
|
|
||||||
Ignore = { fg = M.colors.gray2 },
|
|
||||||
Error = { fg = M.colors.red, bold = true },
|
|
||||||
Todo = { fg = M.colors.yellow, bold = true },
|
|
||||||
}
|
|
||||||
|
|
||||||
return M
|
|
||||||
@@ -32,24 +32,6 @@ K.nl('o', function() require('snacks').gitbrowse() end, 'Open repo in browser')
|
|||||||
K.n('<C-s>', ':w!<cr>', { desc = 'Save', noremap = true })
|
K.n('<C-s>', ':w!<cr>', { desc = 'Save', noremap = true })
|
||||||
K.n('<esc><esc>', ':nohlsearch<cr>', { desc = 'Clear Search Highlighting' })
|
K.n('<esc><esc>', ':nohlsearch<cr>', { desc = 'Clear Search Highlighting' })
|
||||||
|
|
||||||
-- ── ToggleTerm ──────────────────────────────────────────────────────
|
|
||||||
K.d('<F1>', 'n', ':FloatermToggle<CR>', 'Toggle Floaterm')
|
|
||||||
K.d('<F1>', 'i', '<Esc>:FloatermToggle<CR>', 'Toggle Floaterm')
|
|
||||||
K.d('<F1>', 't', '<C-\\><C-n>:FloatermToggle<CR>', 'Toggle Floaterm')
|
|
||||||
|
|
||||||
-- ── Test operations ─────────────────────────────────────────────────
|
|
||||||
K.nl('an', ':silent TestNearest<CR>', 'Test Nearest')
|
|
||||||
K.nl('af', ':silent TestFile<CR>', 'Test File')
|
|
||||||
K.nl('as', ':silent TestSuite<CR>', 'Test Suite')
|
|
||||||
K.nl('al', ':silent TestLast<CR>', 'Test Last')
|
|
||||||
K.nl('av', ':silent TestVisit<CR>', 'Test Visit')
|
|
||||||
|
|
||||||
-- ── PHPActor Operations ─────────────────────────────────────────────
|
|
||||||
K.nl('apm', ':PhpactorContextMenu<cr>', 'PHPactor: Context Menu')
|
|
||||||
K.nl('apn', ':PhpactorClassNew<cr>', 'PHPactor: Class New')
|
|
||||||
K.nl('aps', ':PhpactorClassSearch<cr>', 'PHPactor: Class Search')
|
|
||||||
K.nl('apt', ':PhpactorTransform<cr>', 'PHPactor: Transform')
|
|
||||||
|
|
||||||
-- ── Buffer operations ───────────────────────────────────────────────
|
-- ── Buffer operations ───────────────────────────────────────────────
|
||||||
-- Mappings for buffer management operations like switching, deleting, etc.
|
-- Mappings for buffer management operations like switching, deleting, etc.
|
||||||
-- Convention: All mappings start with 'b' followed by the operation
|
-- Convention: All mappings start with 'b' followed by the operation
|
||||||
@@ -100,32 +82,21 @@ K.nl('cbt', '<Cmd>CBllline<CR>', 'CB: Titled Line')
|
|||||||
-- Convention: All mappings start with 's' followed by the operation
|
-- Convention: All mappings start with 's' followed by the operation
|
||||||
-- unless it's a generic operation like searching or finding buffers
|
-- unless it's a generic operation like searching or finding buffers
|
||||||
|
|
||||||
local fuzzy_search = function()
|
|
||||||
require('telescope.builtin').find_files(require('telescope.themes').get_dropdown {
|
|
||||||
winblend = 20,
|
|
||||||
previewer = true,
|
|
||||||
})
|
|
||||||
end
|
|
||||||
|
|
||||||
local lazy_plugins = function()
|
local lazy_plugins = function()
|
||||||
return require('telescope').extensions.lazy_plugins.lazy_plugins()
|
return require('telescope').extensions.lazy_plugins.lazy_plugins()
|
||||||
end
|
end
|
||||||
|
|
||||||
K.nl('f', ':Telescope find_files<cr>', 'Find Files')
|
K.nl('f', function() require('fff').find_files() end, 'Find Files')
|
||||||
K.nl(',', ':Telescope buffers<cr>', 'Find existing buffers')
|
K.nl(',', ':Telescope buffers<cr>', 'Find existing buffers')
|
||||||
K.nl('/', function() fuzzy_search() end, 'Fuzzily search in current buffer')
|
|
||||||
|
|
||||||
K.nl('sc', ':Telescope commands<cr>', 'Commands')
|
|
||||||
K.nl('sd', ':Telescope diagnostics<cr>', 'Search Diagnostics')
|
K.nl('sd', ':Telescope diagnostics<cr>', 'Search Diagnostics')
|
||||||
K.nl('sg', ':Telescope live_grep<cr>', 'Search by Grep')
|
K.nl('sf', ':Telescope grep_string<cr>', 'Grep String')
|
||||||
K.nl('sh', ':Telescope help_tags<cr>', 'Help tags')
|
K.nl('sh', ':Telescope help_tags<cr>', 'Help tags')
|
||||||
K.nl('sk', ':Telescope keymaps<cr>', 'Search Keymaps')
|
K.nl('sk', ':Telescope keymaps<cr>', 'Search Keymaps')
|
||||||
K.nl('sl', ':Telescope luasnip<CR>', 'Search LuaSnip')
|
|
||||||
K.nl('so', ':Telescope oldfiles<CR>', 'Old Files')
|
K.nl('so', ':Telescope oldfiles<CR>', 'Old Files')
|
||||||
K.nl('sp', function() lazy_plugins() end, 'Lazy Plugins')
|
K.nl('sp', function() lazy_plugins() end, 'Lazy Plugins')
|
||||||
K.nl('sq', ':Telescope quickfix<cr>', 'Quickfix')
|
K.nl('sq', ':Telescope quickfix<cr>', 'Quickfix')
|
||||||
K.nl('ss', ':Telescope treesitter<cr>', 'Treesitter')
|
K.nl('ss', ':Telescope treesitter<cr>', 'Treesitter')
|
||||||
K.nl('sw', ':Telescope grep_string<cr>', 'Grep String')
|
|
||||||
K.nl('sx', ':Telescope import<cr>', 'Telescope: Import')
|
K.nl('sx', ':Telescope import<cr>', 'Telescope: Import')
|
||||||
|
|
||||||
-- ── Trouble operations ──────────────────────────────────────────────
|
-- ── Trouble operations ──────────────────────────────────────────────
|
||||||
@@ -156,13 +127,4 @@ K.nl('qQ', function()
|
|||||||
end
|
end
|
||||||
end, 'Force quit without saving')
|
end, 'Force quit without saving')
|
||||||
|
|
||||||
-- ── Flash.nvim keymaps ──────────────────────────────────────────────
|
|
||||||
local nxo = { 'n', 'x', 'o' }
|
|
||||||
local fj = function() return require('flash').jump() end
|
|
||||||
local ft = function() return require('flash').treesitter() end
|
|
||||||
local fx = function() return require('flash').toggle() end
|
|
||||||
K.d('zk', nxo, fj, { desc = 'Flash' })
|
|
||||||
K.d('Zk', nxo, ft, { desc = 'Flash Treesitter' })
|
|
||||||
K.d('<m-s>', 'c', fx, { desc = 'Toggle Flash Search' })
|
|
||||||
|
|
||||||
-- That concludes the keymaps section of the config.
|
-- That concludes the keymaps section of the config.
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ return {
|
|||||||
-- https:/github.com/saghen/blink.cmp
|
-- https:/github.com/saghen/blink.cmp
|
||||||
{
|
{
|
||||||
'saghen/blink.cmp',
|
'saghen/blink.cmp',
|
||||||
version = '1.*',
|
version = '*',
|
||||||
lazy = false, -- lazy loading handled internally
|
lazy = false, -- lazy loading handled internally
|
||||||
dependencies = {
|
dependencies = {
|
||||||
-- Compatibility layer for using nvim-cmp sources on blink.cmp
|
-- Compatibility layer for using nvim-cmp sources on blink.cmp
|
||||||
@@ -18,15 +18,6 @@ return {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
{ 'L3MON4D3/LuaSnip', version = 'v2.*', build = 'make install_jsregexp' },
|
|
||||||
|
|
||||||
-- Set of preconfigured snippets for different languages.
|
|
||||||
-- https://github.com/rafamadriz/friendly-snippets
|
|
||||||
{
|
|
||||||
'rafamadriz/friendly-snippets',
|
|
||||||
config = function() require('luasnip.loaders.from_vscode').lazy_load() end,
|
|
||||||
},
|
|
||||||
|
|
||||||
-- Lua plugin to turn github copilot into a cmp source
|
-- Lua plugin to turn github copilot into a cmp source
|
||||||
-- https://github.com/giuxtaposition/blink-cmp-copilot
|
-- https://github.com/giuxtaposition/blink-cmp-copilot
|
||||||
{
|
{
|
||||||
@@ -54,7 +45,6 @@ return {
|
|||||||
},
|
},
|
||||||
---@module 'blink.cmp'
|
---@module 'blink.cmp'
|
||||||
opts = {
|
opts = {
|
||||||
snippets = { preset = 'luasnip' },
|
|
||||||
-- 'default' for mappings similar to built-in completion
|
-- 'default' for mappings similar to built-in completion
|
||||||
-- 'super-tab' for mappings similar to vscode (tab to accept,
|
-- 'super-tab' for mappings similar to vscode (tab to accept,
|
||||||
-- arrow keys to navigate)
|
-- arrow keys to navigate)
|
||||||
|
|||||||
@@ -1,16 +1,4 @@
|
|||||||
return {
|
return {
|
||||||
-- Terminal manager for (neo)vim
|
|
||||||
-- https://github.com/voldikss/vim-floaterm
|
|
||||||
{
|
|
||||||
'voldikss/vim-floaterm',
|
|
||||||
lazy = true,
|
|
||||||
cmd = { 'FloatermToggle' },
|
|
||||||
init = function()
|
|
||||||
vim.g.floaterm_width = 0.8
|
|
||||||
vim.g.floaterm_height = 0.8
|
|
||||||
end,
|
|
||||||
},
|
|
||||||
|
|
||||||
{
|
{
|
||||||
'ivuorinen/nvim-shellspec',
|
'ivuorinen/nvim-shellspec',
|
||||||
ft = 'shellspec',
|
ft = 'shellspec',
|
||||||
@@ -39,112 +27,6 @@ return {
|
|||||||
config = function() end,
|
config = function() end,
|
||||||
},
|
},
|
||||||
|
|
||||||
-- Run your tests at the speed of thought
|
|
||||||
-- https://github.com/vim-test/vim-test
|
|
||||||
{
|
|
||||||
'vim-test/vim-test',
|
|
||||||
dependencies = { 'voldikss/vim-floaterm' },
|
|
||||||
config = function()
|
|
||||||
vim.cmd [[
|
|
||||||
function! PhpUnitTransform(cmd) abort
|
|
||||||
return join(map(split(a:cmd), 'v:val == "--colors" ? "--colors=always" : v:val'))
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
let g:test#custom_transformations = {'phpunit': function('PhpUnitTransform')}
|
|
||||||
let g:test#transformation = 'phpunit'
|
|
||||||
|
|
||||||
" let test#php#phpunit#options = '--colors=always'
|
|
||||||
let test#php#pest#options = '-v'
|
|
||||||
let test#javascript#jest#options = '--color'
|
|
||||||
|
|
||||||
function! FloatermStrategy(cmd)
|
|
||||||
execute 'silent FloatermSend q'
|
|
||||||
execute 'silent FloatermKill'
|
|
||||||
execute 'FloatermNew! '.a:cmd.' | less -X'
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
let g:test#custom_strategies = {'floaterm': function('FloatermStrategy')}
|
|
||||||
let g:test#strategy = 'floaterm'
|
|
||||||
]]
|
|
||||||
end,
|
|
||||||
},
|
|
||||||
|
|
||||||
-- projectionist.vim: Granular project configuration
|
|
||||||
-- https://github.com/tpope/vim-projectionist
|
|
||||||
{
|
|
||||||
'tpope/vim-projectionist',
|
|
||||||
dependencies = 'tpope/vim-dispatch',
|
|
||||||
config = function()
|
|
||||||
vim.g.projectionist_heuristics = {
|
|
||||||
artisan = {
|
|
||||||
['*'] = {
|
|
||||||
start = 'php artisan serve',
|
|
||||||
console = 'php artisan tinker',
|
|
||||||
},
|
|
||||||
['app/*.php'] = {
|
|
||||||
type = 'source',
|
|
||||||
alternate = {
|
|
||||||
'tests/Unit/{}Test.php',
|
|
||||||
'tests/Feature/{}Test.php',
|
|
||||||
},
|
|
||||||
},
|
|
||||||
['tests/Feature/*Test.php'] = {
|
|
||||||
type = 'test',
|
|
||||||
alternate = 'app/{}.php',
|
|
||||||
},
|
|
||||||
['tests/Unit/*Test.php'] = {
|
|
||||||
type = 'test',
|
|
||||||
alternate = 'app/{}.php',
|
|
||||||
},
|
|
||||||
['app/Models/*.php'] = {
|
|
||||||
type = 'model',
|
|
||||||
},
|
|
||||||
['app/Http/Controllers/*.php'] = {
|
|
||||||
type = 'controller',
|
|
||||||
},
|
|
||||||
['routes/*.php'] = {
|
|
||||||
type = 'route',
|
|
||||||
},
|
|
||||||
['database/migrations/*.php'] = {
|
|
||||||
type = 'migration',
|
|
||||||
},
|
|
||||||
},
|
|
||||||
['src/&composer.json'] = {
|
|
||||||
['src/*.php'] = {
|
|
||||||
type = 'source',
|
|
||||||
alternate = {
|
|
||||||
'tests/{}Test.php',
|
|
||||||
},
|
|
||||||
},
|
|
||||||
['tests/*Test.php'] = {
|
|
||||||
type = 'test',
|
|
||||||
alternate = 'src/{}.php',
|
|
||||||
},
|
|
||||||
},
|
|
||||||
['app/&composer.json'] = {
|
|
||||||
['app/*.php'] = {
|
|
||||||
type = 'source',
|
|
||||||
alternate = {
|
|
||||||
'tests/{}Test.php',
|
|
||||||
},
|
|
||||||
},
|
|
||||||
['tests/*Test.php'] = {
|
|
||||||
type = 'test',
|
|
||||||
alternate = 'app/{}.php',
|
|
||||||
},
|
|
||||||
},
|
|
||||||
}
|
|
||||||
end,
|
|
||||||
},
|
|
||||||
|
|
||||||
-- A vim text object for XML/HTML attributes.
|
|
||||||
-- https://github.com/whatyouhide/vim-textobj-xmlattr
|
|
||||||
{
|
|
||||||
'whatyouhide/vim-textobj-xmlattr',
|
|
||||||
dependencies = { 'kana/vim-textobj-user' },
|
|
||||||
ft = { 'html', 'xml', 'javascriptreact', 'typescriptreact', 'vue' },
|
|
||||||
},
|
|
||||||
|
|
||||||
-- Clarify and beautify your comments using boxes and lines.
|
-- Clarify and beautify your comments using boxes and lines.
|
||||||
-- https://github.com/LudoPinelli/comment-box.nvim
|
-- https://github.com/LudoPinelli/comment-box.nvim
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -55,7 +55,8 @@ return {
|
|||||||
{
|
{
|
||||||
event = 'file_opened',
|
event = 'file_opened',
|
||||||
handler = function(_)
|
handler = function(_)
|
||||||
require('neo-tree.command').execute { action = 'close' }
|
local c = require 'neo-tree.command'
|
||||||
|
c.execute { action = 'close' }
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -7,41 +7,19 @@ return {
|
|||||||
cmd = 'Telescope',
|
cmd = 'Telescope',
|
||||||
dependencies = {
|
dependencies = {
|
||||||
{ 'nvim-lua/plenary.nvim' },
|
{ 'nvim-lua/plenary.nvim' },
|
||||||
{ 'nvim-telescope/telescope-symbols.nvim' },
|
|
||||||
|
|
||||||
-- Telescope plugin for file browsing
|
|
||||||
{ 'nvim-telescope/telescope-file-browser.nvim' },
|
|
||||||
|
|
||||||
-- A Telescope picker to quickly access configurations
|
-- A Telescope picker to quickly access configurations
|
||||||
-- of plugins managed by lazy.nvim.
|
-- of plugins managed by lazy.nvim.
|
||||||
-- https://github.com/polirritmico/telescope-lazy-plugins.nvim
|
-- https://github.com/polirritmico/telescope-lazy-plugins.nvim
|
||||||
{ 'polirritmico/telescope-lazy-plugins.nvim' },
|
{ 'polirritmico/telescope-lazy-plugins.nvim' },
|
||||||
|
|
||||||
-- Fuzzy Finder Algorithm which requires local dependencies to be built.
|
|
||||||
-- Only load if `make` is available
|
|
||||||
{
|
|
||||||
'nvim-telescope/telescope-fzf-native.nvim',
|
|
||||||
build = 'make',
|
|
||||||
cond = vim.fn.executable 'make' == 1,
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
config = function()
|
config = function()
|
||||||
local t = require 'telescope'
|
local t = require 'telescope'
|
||||||
local a = require 'telescope.actions'
|
local a = require 'telescope.actions'
|
||||||
local c = require 'telescope.config'
|
|
||||||
|
|
||||||
local open_with_trouble = require('trouble.sources.telescope').open
|
local open_with_trouble = require('trouble.sources.telescope').open
|
||||||
local add_to_trouble = require('trouble.sources.telescope').add
|
local add_to_trouble = require('trouble.sources.telescope').add
|
||||||
|
|
||||||
-- Clone the default Telescope configuration
|
|
||||||
local vimgrep_arguments = { unpack(c.values.vimgrep_arguments) }
|
|
||||||
|
|
||||||
-- I want to search in hidden/dot files.
|
|
||||||
table.insert(vimgrep_arguments, '--hidden=true')
|
|
||||||
table.insert(vimgrep_arguments, '--glob')
|
|
||||||
-- I don't want to search in the `.git` directory.
|
|
||||||
table.insert(vimgrep_arguments, '!**/.git/*')
|
|
||||||
|
|
||||||
-- [[ Configure Telescope ]]
|
-- [[ Configure Telescope ]]
|
||||||
-- See `:help telescope` and `:help telescope.setup()`
|
-- See `:help telescope` and `:help telescope.setup()`
|
||||||
t.setup {
|
t.setup {
|
||||||
@@ -49,17 +27,8 @@ return {
|
|||||||
preview = {
|
preview = {
|
||||||
filesize_limit = 0.1, -- MB
|
filesize_limit = 0.1, -- MB
|
||||||
},
|
},
|
||||||
-- `hidden = true` is not supported in text grep commands.
|
|
||||||
vimgrep_arguments = vimgrep_arguments,
|
|
||||||
|
|
||||||
layout_strategy = 'horizontal',
|
layout_strategy = 'horizontal',
|
||||||
pickers = {
|
pickers = {
|
||||||
find_files = {
|
|
||||||
-- `hidden = true` will still show the inside of `.git/` as
|
|
||||||
-- it's not `.gitignore`d.
|
|
||||||
find_command = { 'rg', '--files', '--hidden', '--glob', '!**/.git/*' },
|
|
||||||
theme = 'dropdown',
|
|
||||||
},
|
|
||||||
mappings = {
|
mappings = {
|
||||||
i = {
|
i = {
|
||||||
['<C-s>'] = a.cycle_previewers_next,
|
['<C-s>'] = a.cycle_previewers_next,
|
||||||
@@ -86,19 +55,6 @@ return {
|
|||||||
enable = true,
|
enable = true,
|
||||||
additional_vim_regex_highlighting = false,
|
additional_vim_regex_highlighting = false,
|
||||||
},
|
},
|
||||||
incremental_selection = {
|
|
||||||
enable = true,
|
|
||||||
keymaps = {
|
|
||||||
init_selection = '<CR>',
|
|
||||||
node_incremental = '<CR>',
|
|
||||||
scope_incremental = '<TAB>',
|
|
||||||
node_decremental = '<S-TAB>',
|
|
||||||
},
|
|
||||||
},
|
|
||||||
context_commentstring = {
|
|
||||||
enable = true,
|
|
||||||
enable_autocmd = false,
|
|
||||||
},
|
|
||||||
extensions = {
|
extensions = {
|
||||||
lazy_plugins = {
|
lazy_plugins = {
|
||||||
-- Must be a valid path to the file containing the lazy spec and setup() call.
|
-- Must be a valid path to the file containing the lazy spec and setup() call.
|
||||||
@@ -108,16 +64,7 @@ return {
|
|||||||
}
|
}
|
||||||
|
|
||||||
-- Load extensions
|
-- Load extensions
|
||||||
pcall(t.load_extension, 'git_worktree')
|
|
||||||
pcall(t.load_extension, 'lazy_plugins')
|
pcall(t.load_extension, 'lazy_plugins')
|
||||||
pcall(t.load_extension, 'luasnip')
|
|
||||||
pcall(t.load_extension, 'import')
|
pcall(t.load_extension, 'import')
|
||||||
|
|
||||||
-- Enable telescope fzf native, if installed
|
|
||||||
pcall(t.load_extension, 'fzf')
|
|
||||||
|
|
||||||
-- [[ Telescope Keymaps ]]
|
|
||||||
-- See `:help telescope.builtin`
|
|
||||||
-- See `:help telescope.keymap`
|
|
||||||
end,
|
end,
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,17 +18,11 @@ return {
|
|||||||
|
|
||||||
-- Add languages to be installed here that you want installed for treesitter
|
-- Add languages to be installed here that you want installed for treesitter
|
||||||
ensure_installed = {
|
ensure_installed = {
|
||||||
'bash',
|
|
||||||
'json',
|
|
||||||
'jsonc',
|
|
||||||
'lua',
|
'lua',
|
||||||
'luadoc',
|
'luadoc',
|
||||||
'markdown',
|
'markdown',
|
||||||
'markdown_inline',
|
'markdown_inline',
|
||||||
'query',
|
|
||||||
'regex',
|
'regex',
|
||||||
'vim',
|
|
||||||
'vimdoc',
|
|
||||||
'yaml',
|
'yaml',
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -54,9 +48,6 @@ return {
|
|||||||
if require('nvim-treesitter.parsers').has_parser() then
|
if require('nvim-treesitter.parsers').has_parser() then
|
||||||
vim.opt.foldmethod = 'expr'
|
vim.opt.foldmethod = 'expr'
|
||||||
vim.opt.foldexpr = 'nvim_treesitter#foldexpr()'
|
vim.opt.foldexpr = 'nvim_treesitter#foldexpr()'
|
||||||
else
|
|
||||||
-- Otherwise, set foldmethod to syntax
|
|
||||||
vim.opt.foldmethod = 'syntax'
|
|
||||||
end
|
end
|
||||||
|
|
||||||
vim.opt.foldlevel = 9 -- Open all folds by default
|
vim.opt.foldlevel = 9 -- Open all folds by default
|
||||||
|
|||||||
@@ -1,29 +1,83 @@
|
|||||||
return {
|
return {
|
||||||
{
|
{
|
||||||
'neanias/everforest-nvim',
|
'catppuccin/nvim',
|
||||||
version = false,
|
name = 'catppuccin',
|
||||||
lazy = false,
|
priority = 1000,
|
||||||
priority = 1000, -- make sure to load this before all the other start plugins
|
|
||||||
config = function()
|
config = function()
|
||||||
require('everforest').setup {
|
require('catppuccin').setup {
|
||||||
background = 'medium', -- hard, medium, soft
|
flavour = 'auto', -- latte, frappe, macchiato, mocha
|
||||||
transparent_background_level = 2, -- 0, 1, 2
|
background = { -- :h background
|
||||||
sign_column_background = 'grey', -- none, grey
|
light = 'latte',
|
||||||
disable_italic_comments = false,
|
dark = 'mocha',
|
||||||
diagnostic_virtual_text = 'coloured', -- coloured, gray, underline, none
|
},
|
||||||
diagnostic_line_highlight = true,
|
transparent_background = false,
|
||||||
diagnostic_line_highlight_background = 'dimmed', -- dimmed, normal
|
float = {
|
||||||
diagnostic_text_highlight = true,
|
transparent = true, -- enable transparent floating windows
|
||||||
ui_contrast = 'low', -- high, low
|
solid = false, -- use solid styling for floating windows, see |winborder|
|
||||||
italics = true,
|
},
|
||||||
spell_foreground = true,
|
show_end_of_buffer = false, -- shows the '~' characters after the end of buffers
|
||||||
show_eob = true,
|
term_colors = false, -- sets terminal colors (e.g. `g:terminal_color_0`)
|
||||||
colours_override = function() end,
|
dim_inactive = {
|
||||||
float_style = 'dim',
|
enabled = true, -- dims the background color of inactive window
|
||||||
on_highlights = function(_, _) end,
|
shade = 'dark',
|
||||||
dim_inactive_windows = true,
|
percentage = 0.15, -- percentage of the shade to apply to the inactive window
|
||||||
inlay_hints_background = 'dimmed',
|
},
|
||||||
|
no_italic = false, -- Force no italic
|
||||||
|
no_bold = false, -- Force no bold
|
||||||
|
no_underline = false, -- Force no underline
|
||||||
|
styles = { -- Handles the styles of general hi groups (see `:h highlight-args`):
|
||||||
|
comments = { 'italic' }, -- Change the style of comments
|
||||||
|
conditionals = { 'italic' },
|
||||||
|
loops = {},
|
||||||
|
functions = {},
|
||||||
|
keywords = {},
|
||||||
|
strings = {},
|
||||||
|
variables = {},
|
||||||
|
numbers = {},
|
||||||
|
booleans = {},
|
||||||
|
properties = {},
|
||||||
|
types = {},
|
||||||
|
operators = {},
|
||||||
|
-- miscs = {}, -- Uncomment to turn off hard-coded styles
|
||||||
|
},
|
||||||
|
lsp_styles = { -- Handles the style of specific lsp hl groups (see `:h lsp-highlight`).
|
||||||
|
virtual_text = {
|
||||||
|
errors = { 'italic' },
|
||||||
|
hints = { 'italic' },
|
||||||
|
warnings = { 'italic' },
|
||||||
|
information = { 'italic' },
|
||||||
|
ok = { 'italic' },
|
||||||
|
},
|
||||||
|
underlines = {
|
||||||
|
errors = { 'underline' },
|
||||||
|
hints = { 'underline' },
|
||||||
|
warnings = { 'underline' },
|
||||||
|
information = { 'underline' },
|
||||||
|
ok = { 'underline' },
|
||||||
|
},
|
||||||
|
inlay_hints = {
|
||||||
|
background = true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
color_overrides = {},
|
||||||
|
custom_highlights = {},
|
||||||
|
default_integrations = true,
|
||||||
|
auto_integrations = false,
|
||||||
|
integrations = {
|
||||||
|
cmp = true,
|
||||||
|
gitsigns = true,
|
||||||
|
nvimtree = true,
|
||||||
|
notify = false,
|
||||||
|
mini = {
|
||||||
|
enabled = true,
|
||||||
|
indentscope_color = '',
|
||||||
|
},
|
||||||
|
-- For more plugins integrations please scroll down (https://github.com/catppuccin/nvim#integrations)
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
-- setup must be called before loading
|
||||||
|
vim.cmd.colorscheme 'catppuccin'
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -58,38 +112,31 @@ return {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
-- Remove all background colors to make nvim transparent
|
|
||||||
-- https://github.com/xiyaowong/nvim-transparent
|
|
||||||
{
|
{
|
||||||
'xiyaowong/nvim-transparent',
|
'dmtrKovalenko/fff.nvim',
|
||||||
lazy = false,
|
build = function()
|
||||||
enabled = true,
|
-- this will download prebuild binary or try to use existing rustup toolchain to build from source
|
||||||
config = function()
|
-- (if you are using lazy you can use gb for rebuilding a plugin if needed)
|
||||||
local t = require 'transparent'
|
require('fff.download').download_or_build_binary()
|
||||||
t.setup {
|
|
||||||
extra_groups = {
|
|
||||||
'NormalNC',
|
|
||||||
'NormalFloat',
|
|
||||||
'EndOfBuffer',
|
|
||||||
'FloatTitle',
|
|
||||||
'FloatBorder',
|
|
||||||
'NotifyDEBUGBorder',
|
|
||||||
'NotifyERRORBorder',
|
|
||||||
'NotifyINFOBorder',
|
|
||||||
'NotifyINFOBorder73',
|
|
||||||
'NotifyINFOBorder75',
|
|
||||||
'NotifyINFOBorder101',
|
|
||||||
'NotifyTRACEBorder',
|
|
||||||
'NotifyWARNBorder',
|
|
||||||
'NotifyBackground',
|
|
||||||
'TelescopeBorder',
|
|
||||||
'TelescopePromptBorder',
|
|
||||||
'TelescopeResultsBorder',
|
|
||||||
'TelescopePreviewBorder',
|
|
||||||
},
|
|
||||||
}
|
|
||||||
t.clear_prefix 'NeoTree'
|
|
||||||
end,
|
end,
|
||||||
|
-- if you are using nixos
|
||||||
|
-- build = "nix run .#release",
|
||||||
|
opts = { -- (optional)
|
||||||
|
debug = {
|
||||||
|
enabled = true, -- we expect your collaboration at least during the beta
|
||||||
|
show_scores = true, -- to help us optimize the scoring system, feel free to share your scores!
|
||||||
|
},
|
||||||
|
},
|
||||||
|
-- No need to lazy-load with lazy.nvim.
|
||||||
|
-- This plugin initializes itself lazily.
|
||||||
|
lazy = false,
|
||||||
|
keys = {
|
||||||
|
{
|
||||||
|
'ff', -- try it if you didn't it is a banger keybinding for a picker
|
||||||
|
function() require('fff').find_files() end,
|
||||||
|
desc = 'FFFind files',
|
||||||
|
},
|
||||||
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
-- Display a character as the colorcolumn
|
-- Display a character as the colorcolumn
|
||||||
|
|||||||
@@ -1,462 +0,0 @@
|
|||||||
{
|
|
||||||
"While ..": {
|
|
||||||
"body": [
|
|
||||||
"while (${1:condition}) {",
|
|
||||||
"\t$0",
|
|
||||||
"}"
|
|
||||||
],
|
|
||||||
"prefix": "while .."
|
|
||||||
},
|
|
||||||
"argv (node)": {
|
|
||||||
"body": "const argv = process.argv.slice(2);",
|
|
||||||
"description": "Arguments from the command line. [0] is the node executable path, [1] the path of the file being executed, making [2] the first positional argument.",
|
|
||||||
"prefix": "argv (node)"
|
|
||||||
},
|
|
||||||
"cast (JSDoc)": {
|
|
||||||
"body": "/** @type {${1:string}} */ (${2:bracketedVar})",
|
|
||||||
"prefix": "cast (JSDoc)"
|
|
||||||
},
|
|
||||||
"class (JSDoc) + typedef (JSDoc)": {
|
|
||||||
"body": [
|
|
||||||
"/** @typedef {Object} ${1:name}",
|
|
||||||
" * @property {${2:string}} ${3:prop1}",
|
|
||||||
" */"
|
|
||||||
],
|
|
||||||
"description": "https://www.typescriptlang.org/docs/handbook/jsdoc-supported-types.html#typedef-callback-and-param",
|
|
||||||
"prefix": [
|
|
||||||
"class (JSDoc)",
|
|
||||||
"typedef (JSDoc)"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"do .. while ..": {
|
|
||||||
"body": [
|
|
||||||
"do {",
|
|
||||||
"\t$0",
|
|
||||||
"} while (${1:condition});"
|
|
||||||
],
|
|
||||||
"prefix": [
|
|
||||||
"do .. while",
|
|
||||||
"repeat until"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"ec (export const)": {
|
|
||||||
"body": "export const ${1:CONSTANT}",
|
|
||||||
"prefix": "ec (export const)"
|
|
||||||
},
|
|
||||||
"ef (export function)": {
|
|
||||||
"body": [
|
|
||||||
"export function ${1:name}($2) {",
|
|
||||||
"\t$0",
|
|
||||||
"}"
|
|
||||||
],
|
|
||||||
"prefix": "ef (export function)"
|
|
||||||
},
|
|
||||||
"filter ( => )": {
|
|
||||||
"body": "filter(${1:item} => ${1:item}$0)",
|
|
||||||
"prefix": "filter ( => )"
|
|
||||||
},
|
|
||||||
"for (i++)": {
|
|
||||||
"body": [
|
|
||||||
"for (let i = 0; i < ${1:array}.length; i++) {",
|
|
||||||
"\tconst ${2:element} = ${1:array}[i];",
|
|
||||||
"\t$0",
|
|
||||||
"}"
|
|
||||||
],
|
|
||||||
"prefix": "for (i++)"
|
|
||||||
},
|
|
||||||
"for (i--)": {
|
|
||||||
"body": [
|
|
||||||
"for (let i = ${1:array}.length - 1; i >= 0; i--) {",
|
|
||||||
"\tconst ${2:element} = ${1:array}[i];",
|
|
||||||
"\t$0",
|
|
||||||
"}"
|
|
||||||
],
|
|
||||||
"prefix": "for (i--)"
|
|
||||||
},
|
|
||||||
"for (key, value)": {
|
|
||||||
"body": [
|
|
||||||
"for (const [key, value] of Object.entries(${1:dict})) {",
|
|
||||||
"\t$0",
|
|
||||||
"}"
|
|
||||||
],
|
|
||||||
"prefix": "for (key, value)"
|
|
||||||
},
|
|
||||||
"for .. in (key)": {
|
|
||||||
"body": [
|
|
||||||
"for (const ${1:key} in ${2:object}) {",
|
|
||||||
"\t$0",
|
|
||||||
"}"
|
|
||||||
],
|
|
||||||
"prefix": "for .. in (key)"
|
|
||||||
},
|
|
||||||
"for .. of (array)": {
|
|
||||||
"body": [
|
|
||||||
"for (const ${1:iterator} of ${2:array}) {",
|
|
||||||
"\t$0",
|
|
||||||
"}"
|
|
||||||
],
|
|
||||||
"prefix": "for .. of (array)"
|
|
||||||
},
|
|
||||||
"forEach": {
|
|
||||||
"body": [
|
|
||||||
"forEach(${1:item} => {",
|
|
||||||
"\t$0",
|
|
||||||
"});"
|
|
||||||
],
|
|
||||||
"prefix": "forEach =>"
|
|
||||||
},
|
|
||||||
"function_trad": {
|
|
||||||
"body": [
|
|
||||||
"function ${1:name}() {",
|
|
||||||
"\t$0",
|
|
||||||
"}"
|
|
||||||
],
|
|
||||||
"prefix": "function"
|
|
||||||
},
|
|
||||||
"if ..": {
|
|
||||||
"body": [
|
|
||||||
"if (${1:condition}) {",
|
|
||||||
"\t$0",
|
|
||||||
"}"
|
|
||||||
],
|
|
||||||
"prefix": "if"
|
|
||||||
},
|
|
||||||
"if .. else": {
|
|
||||||
"body": [
|
|
||||||
"if (${1:condition}) {",
|
|
||||||
"\t$0",
|
|
||||||
"} else {",
|
|
||||||
"\t",
|
|
||||||
"}"
|
|
||||||
],
|
|
||||||
"prefix": "if .. else"
|
|
||||||
},
|
|
||||||
"ignore (biome formatter)": {
|
|
||||||
"body": "// biome-ignore format: ${1:explanation}",
|
|
||||||
"description": "Ignores the next block of code.",
|
|
||||||
"prefix": "ignore (biome formatter)"
|
|
||||||
},
|
|
||||||
"ignore file (TypeScript) + nocheck (TypeScript)": {
|
|
||||||
"body": "// @ts-nocheck",
|
|
||||||
"prefix": [
|
|
||||||
"ignore file (TypeScript)",
|
|
||||||
"nocheck (TypeScript)"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"map ( () => {} )": {
|
|
||||||
"body": [
|
|
||||||
"map(${1:item} => {",
|
|
||||||
"\t$0",
|
|
||||||
"\treturn;",
|
|
||||||
"})"
|
|
||||||
],
|
|
||||||
"prefix": "map ( () => {} )"
|
|
||||||
},
|
|
||||||
"map ( => )": {
|
|
||||||
"body": "map(${1:item} => ${1:item}$0)",
|
|
||||||
"prefix": "map ( => )"
|
|
||||||
},
|
|
||||||
"reduce()": {
|
|
||||||
"body": [
|
|
||||||
".reduce((acc, ${1:item}) => {",
|
|
||||||
"\t$0",
|
|
||||||
"\treturn acc;",
|
|
||||||
"}, ${2:initialValue})"
|
|
||||||
],
|
|
||||||
"prefix": "reduce()"
|
|
||||||
},
|
|
||||||
"relative date": {
|
|
||||||
"body": [
|
|
||||||
"/**",
|
|
||||||
" * @param {string} absoluteDate string to be converted to a date",
|
|
||||||
" * @return {string} relative date",
|
|
||||||
" */",
|
|
||||||
"function relativeDate(absoluteDate) {",
|
|
||||||
"\tconst deltaSecs = (+new Date() - +new Date(absoluteDate)) / 1000;",
|
|
||||||
"\t/** @type {\"year\"|\"month\"|\"week\"|\"day\"|\"hour\"|\"minute\"|\"second\"} */",
|
|
||||||
"\tlet unit;",
|
|
||||||
"\tlet delta;",
|
|
||||||
"\tif (deltaSecs < 60) {",
|
|
||||||
"\t\tunit = \"second\";",
|
|
||||||
"\t\tdelta = deltaSecs;",
|
|
||||||
"\t} else if (deltaSecs < 60 * 60) {",
|
|
||||||
"\t\tunit = \"minute\";",
|
|
||||||
"\t\tdelta = Math.ceil(deltaSecs / 60);",
|
|
||||||
"\t} else if (deltaSecs < 60 * 60 * 24) {",
|
|
||||||
"\t\tunit = \"hour\";",
|
|
||||||
"\t\tdelta = Math.ceil(deltaSecs / 60 / 60);",
|
|
||||||
"\t} else if (deltaSecs < 60 * 60 * 24 * 7) {",
|
|
||||||
"\t\tunit = \"day\";",
|
|
||||||
"\t\tdelta = Math.ceil(deltaSecs / 60 / 60 / 24);",
|
|
||||||
"\t} else if (deltaSecs < 60 * 60 * 24 * 7 * 4) {",
|
|
||||||
"\t\tunit = \"week\";",
|
|
||||||
"\t\tdelta = Math.ceil(deltaSecs / 60 / 60 / 24 / 7);",
|
|
||||||
"\t} else if (deltaSecs < 60 * 60 * 24 * 7 * 4 * 12) {",
|
|
||||||
"\t\tunit = \"month\";",
|
|
||||||
"\t\tdelta = Math.ceil(deltaSecs / 60 / 60 / 24 / 7 / 4);",
|
|
||||||
"\t} else {",
|
|
||||||
"\t\tunit = \"year\";",
|
|
||||||
"\t\tdelta = Math.ceil(deltaSecs / 60 / 60 / 24 / 7 / 4 / 12);",
|
|
||||||
"\t}",
|
|
||||||
"\tconst formatter = new Intl.RelativeTimeFormat(\"en\", { style: \"long\", numeric: \"auto\" });",
|
|
||||||
"\treturn formatter.format(-delta, unit);",
|
|
||||||
"}"
|
|
||||||
],
|
|
||||||
"prefix": "relative date"
|
|
||||||
},
|
|
||||||
"replace": {
|
|
||||||
"body": "replace(/${1:regexp}/, \"$2\")",
|
|
||||||
"prefix": "replace"
|
|
||||||
},
|
|
||||||
"sort ( () => {} )": {
|
|
||||||
"body": [
|
|
||||||
"sort((a, b) => {",
|
|
||||||
"\treturn ${1:b - a};",
|
|
||||||
"})"
|
|
||||||
],
|
|
||||||
"description": "Sort Array with basic a-b-comparator function",
|
|
||||||
"prefix": "sort ( () => {} )"
|
|
||||||
},
|
|
||||||
"split by \\n": {
|
|
||||||
"body": ".split(\"\\n\")",
|
|
||||||
"prefix": ".split by \\n"
|
|
||||||
},
|
|
||||||
"split by \\r": {
|
|
||||||
"body": ".split(\"\\r\")",
|
|
||||||
"description": "required for output from app.doShellScript()",
|
|
||||||
"prefix": ".split by \\r"
|
|
||||||
},
|
|
||||||
"switch .. case": {
|
|
||||||
"body": [
|
|
||||||
"switch (${1:key}) {",
|
|
||||||
"\tcase ${2:value}:",
|
|
||||||
"\t\t$0",
|
|
||||||
"\t\tbreak;",
|
|
||||||
"\tdefault:",
|
|
||||||
"}"
|
|
||||||
],
|
|
||||||
"prefix": "switch .. case"
|
|
||||||
},
|
|
||||||
"ternary": {
|
|
||||||
"body": "${1:condition} ? ${2:value1} : ${3:value2}",
|
|
||||||
"prefix": "ternary"
|
|
||||||
},
|
|
||||||
"thousand separator": {
|
|
||||||
"body": ".toLocaleString(\"de-DE\")",
|
|
||||||
"description": "insert thousand separator into a digit string",
|
|
||||||
"prefix": "thousand separator"
|
|
||||||
},
|
|
||||||
"timeout + delay": {
|
|
||||||
"body": [
|
|
||||||
"setTimeout(() => {",
|
|
||||||
"\t$0",
|
|
||||||
"}, ${1:timeoutMs});"
|
|
||||||
],
|
|
||||||
"prefix": [
|
|
||||||
"timeout",
|
|
||||||
"delay"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"today as ISO 8601 string": {
|
|
||||||
"body": "new Date().toISOString().slice(0, 10);",
|
|
||||||
"prefix": "ISO date"
|
|
||||||
},
|
|
||||||
"today's date": {
|
|
||||||
"body": "const today = new Date();",
|
|
||||||
"prefix": [
|
|
||||||
"today",
|
|
||||||
"date"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"tomorrow's date": {
|
|
||||||
"body": [
|
|
||||||
"const tomorrow = new Date();",
|
|
||||||
"tomorrow.setDate(tomorrow.getDate() + 1);"
|
|
||||||
],
|
|
||||||
"prefix": [
|
|
||||||
"tomorrow",
|
|
||||||
"date"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"try .. catch": {
|
|
||||||
"body": [
|
|
||||||
"try {",
|
|
||||||
"\t$0",
|
|
||||||
"} catch (_error) {",
|
|
||||||
"\t",
|
|
||||||
"}"
|
|
||||||
],
|
|
||||||
"description": "leading underscore so the variable is ignored by biome when not used.",
|
|
||||||
"prefix": "try .. catch"
|
|
||||||
},
|
|
||||||
"type (JSDoc)": {
|
|
||||||
"body": "/** @type {${1:string}} */",
|
|
||||||
"prefix": "type (JSDoc)"
|
|
||||||
},
|
|
||||||
"type: Record (JSDoc)": {
|
|
||||||
"body": "/** @type {Record<string, string>} */",
|
|
||||||
"prefix": "type: Record (JSDoc)"
|
|
||||||
},
|
|
||||||
"unique items": {
|
|
||||||
"body": "${1:arr} = [...new Set(${2:arr})];",
|
|
||||||
"prefix": "unique items"
|
|
||||||
},
|
|
||||||
"Class": {
|
|
||||||
"prefix": [
|
|
||||||
"clax"
|
|
||||||
],
|
|
||||||
"body": [
|
|
||||||
"export class $1 ${2:extends ${3:Parent} }{",
|
|
||||||
"\tconstructor(${4:props}) {",
|
|
||||||
"\t\tthis.$4 = $4;",
|
|
||||||
"\t}",
|
|
||||||
"",
|
|
||||||
"\t$0",
|
|
||||||
"}"
|
|
||||||
],
|
|
||||||
"description": "Class definition template."
|
|
||||||
},
|
|
||||||
"test": {
|
|
||||||
"prefix": [
|
|
||||||
"it"
|
|
||||||
],
|
|
||||||
"body": [
|
|
||||||
"it('${1:should ${2}}', async () => {",
|
|
||||||
"\t$0",
|
|
||||||
"});"
|
|
||||||
],
|
|
||||||
"description": "Test template"
|
|
||||||
},
|
|
||||||
"method": {
|
|
||||||
"prefix": [
|
|
||||||
"mtd"
|
|
||||||
],
|
|
||||||
"body": [
|
|
||||||
"${1:async ${2:method}}(${3:params}) {",
|
|
||||||
"\t$0",
|
|
||||||
"}"
|
|
||||||
],
|
|
||||||
"description": "method"
|
|
||||||
},
|
|
||||||
"function": {
|
|
||||||
"prefix": [
|
|
||||||
"fun"
|
|
||||||
],
|
|
||||||
"body": [
|
|
||||||
"${1:async }${2:(${3:params})} => {$0}"
|
|
||||||
],
|
|
||||||
"description": "function"
|
|
||||||
},
|
|
||||||
"const": {
|
|
||||||
"prefix": [
|
|
||||||
"const"
|
|
||||||
],
|
|
||||||
"body": [
|
|
||||||
"const $1 = $0;"
|
|
||||||
],
|
|
||||||
"description": "const"
|
|
||||||
},
|
|
||||||
"let": {
|
|
||||||
"prefix": [
|
|
||||||
"let"
|
|
||||||
],
|
|
||||||
"body": [
|
|
||||||
"let $1 = $0;"
|
|
||||||
],
|
|
||||||
"description": "let"
|
|
||||||
},
|
|
||||||
"Console log": {
|
|
||||||
"prefix": [
|
|
||||||
"cl"
|
|
||||||
],
|
|
||||||
"body": [
|
|
||||||
"console.log($0);"
|
|
||||||
],
|
|
||||||
"description": "Console log"
|
|
||||||
},
|
|
||||||
"Console debug": {
|
|
||||||
"prefix": [
|
|
||||||
"cd"
|
|
||||||
],
|
|
||||||
"body": [
|
|
||||||
"console.debug($0);"
|
|
||||||
],
|
|
||||||
"description": "Console debug"
|
|
||||||
},
|
|
||||||
"Console log all": {
|
|
||||||
"prefix": [
|
|
||||||
"clj"
|
|
||||||
],
|
|
||||||
"body": [
|
|
||||||
"console.log(JSON.stringify($0, null, 2));"
|
|
||||||
],
|
|
||||||
"description": "Console log whole object"
|
|
||||||
},
|
|
||||||
"Console debug all": {
|
|
||||||
"prefix": [
|
|
||||||
"cdj"
|
|
||||||
],
|
|
||||||
"body": [
|
|
||||||
"console.debug(JSON.stringify($0, null, 2));"
|
|
||||||
],
|
|
||||||
"description": "Console debug whole object"
|
|
||||||
},
|
|
||||||
"If": {
|
|
||||||
"prefix": [
|
|
||||||
"if"
|
|
||||||
],
|
|
||||||
"body": [
|
|
||||||
"if (${1:condition}) {",
|
|
||||||
"\t$0",
|
|
||||||
"}"
|
|
||||||
],
|
|
||||||
"description": "Console debug whole object"
|
|
||||||
},
|
|
||||||
"If-else": {
|
|
||||||
"prefix": [
|
|
||||||
"ifelse"
|
|
||||||
],
|
|
||||||
"body": [
|
|
||||||
"if (${1:condition}) {",
|
|
||||||
"\t$2",
|
|
||||||
"} else {",
|
|
||||||
"\t$0",
|
|
||||||
"}"
|
|
||||||
],
|
|
||||||
"description": "Console debug whole object"
|
|
||||||
},
|
|
||||||
"docblock": {
|
|
||||||
"prefix": [
|
|
||||||
"/**"
|
|
||||||
],
|
|
||||||
"body": [
|
|
||||||
"/**",
|
|
||||||
" * $0",
|
|
||||||
" */"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"trycatch": {
|
|
||||||
"prefix": [
|
|
||||||
"tc"
|
|
||||||
],
|
|
||||||
"body": [
|
|
||||||
"try {",
|
|
||||||
"\t$0",
|
|
||||||
"} catch (e) {",
|
|
||||||
"\tthrow e;",
|
|
||||||
"}"
|
|
||||||
],
|
|
||||||
"description": "Try catch block"
|
|
||||||
},
|
|
||||||
"Describe test": {
|
|
||||||
"prefix": [
|
|
||||||
"desc"
|
|
||||||
],
|
|
||||||
"body": [
|
|
||||||
"describe('${1}', () => {",
|
|
||||||
"\t$0",
|
|
||||||
"})"
|
|
||||||
],
|
|
||||||
"description": "Describe test"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,262 +0,0 @@
|
|||||||
{
|
|
||||||
"@class (LuaDoc)": {
|
|
||||||
"body": [
|
|
||||||
"---@class (exact) ${1:class_name}",
|
|
||||||
"---@field ${2:field_name} string"
|
|
||||||
],
|
|
||||||
"description": "https://github.com/LuaLS/lua-language-server/wiki/Annotations#class",
|
|
||||||
"prefix": "@class (LuaDoc)"
|
|
||||||
},
|
|
||||||
"@type (LuaDoc)": {
|
|
||||||
"body": "---@type ${1:string}",
|
|
||||||
"prefix": "@type (LuaDoc)"
|
|
||||||
},
|
|
||||||
"Record (type)": {
|
|
||||||
"body": "---@type table<string, string>",
|
|
||||||
"prefix": "Record (type)"
|
|
||||||
},
|
|
||||||
"count occurrences in string": {
|
|
||||||
"body": "local _, count = ${1:str}:gsub(\"${2:find}\", \"\")",
|
|
||||||
"prefix": "count occurrences in string"
|
|
||||||
},
|
|
||||||
"export module": {
|
|
||||||
"body": [
|
|
||||||
"local M = {}",
|
|
||||||
"--------------------------------------------------------------------------------",
|
|
||||||
"",
|
|
||||||
"$0--------------------------------------------------------------------------------",
|
|
||||||
"return M"
|
|
||||||
],
|
|
||||||
"prefix": "export module"
|
|
||||||
},
|
|
||||||
"find all in string": {
|
|
||||||
"body": [
|
|
||||||
"local ${1:matches} = {}",
|
|
||||||
"for match in ${2:str}:gmatch(${3:pattern}) do",
|
|
||||||
"\ttable.insert(${1:matches}, match)",
|
|
||||||
"end"
|
|
||||||
],
|
|
||||||
"prefix": "find all in string"
|
|
||||||
},
|
|
||||||
"for each (list)": {
|
|
||||||
"body": [
|
|
||||||
"for _, ${1:v} in pairs(${2:table}) do",
|
|
||||||
"\t$0",
|
|
||||||
"end"
|
|
||||||
],
|
|
||||||
"prefix": "for each (list)"
|
|
||||||
},
|
|
||||||
"for each line (of file)": {
|
|
||||||
"body": [
|
|
||||||
"for line in io.lines(${1:filepath}) do",
|
|
||||||
"\t$0",
|
|
||||||
"end"
|
|
||||||
],
|
|
||||||
"prefix": [
|
|
||||||
"for each line (file)",
|
|
||||||
"read file (as lines)"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"home": {
|
|
||||||
"body": "os.getenv(\"HOME\")",
|
|
||||||
"prefix": "home"
|
|
||||||
},
|
|
||||||
"if .. then .. else": {
|
|
||||||
"body": [
|
|
||||||
"if ${1:true} then",
|
|
||||||
"\t$2",
|
|
||||||
"else",
|
|
||||||
"\t$0",
|
|
||||||
"end"
|
|
||||||
],
|
|
||||||
"filetype": "lua",
|
|
||||||
"prefix": "if .. then .. else"
|
|
||||||
},
|
|
||||||
"nodiscard": {
|
|
||||||
"body": "---@nodiscard",
|
|
||||||
"description": "Luadoc Annotation that a function's return value should not be discarded. https://github.com/LuaLS/lua-language-server/wiki/Annotations#nodiscard",
|
|
||||||
"prefix": "nodiscard"
|
|
||||||
},
|
|
||||||
"path of this file": {
|
|
||||||
"body": "local pathOfThisFile = debug.getinfo(1).source:sub(2)",
|
|
||||||
"prefix": "path of this file"
|
|
||||||
},
|
|
||||||
"path separator (os-independent)": {
|
|
||||||
"body": "local osPathSep = package.config:sub(1, 1)",
|
|
||||||
"prefix": "path separator (os-independent)"
|
|
||||||
},
|
|
||||||
"pcall": {
|
|
||||||
"body": [
|
|
||||||
"local success = pcall(${1:func})",
|
|
||||||
"if not success then",
|
|
||||||
"\t$0",
|
|
||||||
"\treturn",
|
|
||||||
"end"
|
|
||||||
],
|
|
||||||
"prefix": [
|
|
||||||
"try",
|
|
||||||
"pcall"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"read file": {
|
|
||||||
"body": [
|
|
||||||
"---@param filePath string",
|
|
||||||
"---@return string? -- content or error message",
|
|
||||||
"---@return boolean success",
|
|
||||||
"local function readFile(filePath)",
|
|
||||||
"\tlocal file, err = io.open(filePath, \"r\")",
|
|
||||||
"\tif not file then return err, false end",
|
|
||||||
"\tlocal content = file:read(\"*a\")",
|
|
||||||
"\tfile:close()",
|
|
||||||
"\treturn content, true",
|
|
||||||
"end"
|
|
||||||
],
|
|
||||||
"prefix": "read file"
|
|
||||||
},
|
|
||||||
"redirect (metatable __index)": {
|
|
||||||
"body": [
|
|
||||||
"setmetatable(M, {",
|
|
||||||
"\t__index = function(_, key)",
|
|
||||||
"\t\treturn function(...)",
|
|
||||||
"\t\t\trequire(${1:moduleToRedirectTo})[key](...)",
|
|
||||||
"\t\tend",
|
|
||||||
"\tend,",
|
|
||||||
"})"
|
|
||||||
],
|
|
||||||
"prefix": "redirect (metatable __index)"
|
|
||||||
},
|
|
||||||
"round number": {
|
|
||||||
"body": "local roundedNum = tonumber(string.format(\"%.${1:decimals}f\", exactNum))",
|
|
||||||
"prefix": "round number"
|
|
||||||
},
|
|
||||||
"safe require": {
|
|
||||||
"body": [
|
|
||||||
"local ok, ${1:module} = require(\"${1:module}\")",
|
|
||||||
"if not (ok and ${1:module}) then return end",
|
|
||||||
"${1:module}.$0"
|
|
||||||
],
|
|
||||||
"prefix": "safe require"
|
|
||||||
},
|
|
||||||
"sort (table)": {
|
|
||||||
"body": "table.sort(${1:table}, function(a, b) return ${2:a} > ${3:b} end)",
|
|
||||||
"prefix": "sort (table)"
|
|
||||||
},
|
|
||||||
"split (gmatch)": {
|
|
||||||
"body": [
|
|
||||||
"local acc = {}",
|
|
||||||
"for part in ${1:str}:gmatch(\"(.-)\" .. ${2:delimiter}) do",
|
|
||||||
"\ttable.insert(acc, part)",
|
|
||||||
"end"
|
|
||||||
],
|
|
||||||
"filetype": "lua",
|
|
||||||
"prefix": "split (gmatch)"
|
|
||||||
},
|
|
||||||
"ternary": {
|
|
||||||
"body": "${1:condition} and ${2:value1} or ${3:value2}",
|
|
||||||
"prefix": "ternary"
|
|
||||||
},
|
|
||||||
"trim trailing line break": {
|
|
||||||
"body": ":gsub(\"\\n$\", \"\")",
|
|
||||||
"prefix": "trim"
|
|
||||||
},
|
|
||||||
"write file": {
|
|
||||||
"body": [
|
|
||||||
"---@param str string",
|
|
||||||
"---@param filePath string",
|
|
||||||
"---@return string|nil -- error message",
|
|
||||||
"local function overwriteFile(filePath, str)",
|
|
||||||
"\tlocal file, _ = io.open(filePath, \"w\")",
|
|
||||||
"\tif not file then return end",
|
|
||||||
"\tfile:write(str)",
|
|
||||||
"\tfile:close()",
|
|
||||||
"end"
|
|
||||||
],
|
|
||||||
"description": "Overwriting file, for appending use `a` instead of `w`.",
|
|
||||||
"prefix": "write file"
|
|
||||||
},
|
|
||||||
"Create Auto Command": {
|
|
||||||
"prefix": "autocmd",
|
|
||||||
"body": [
|
|
||||||
"vim.api.nvim_create_autocmd(\"${1:event}\", {",
|
|
||||||
" group = vim.api.nvim_create_augroup(\"${2:group}\", { clear = true }),",
|
|
||||||
" callback = function(ev)",
|
|
||||||
" ${0}",
|
|
||||||
" end",
|
|
||||||
"})"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"Create Auto Command Group": {
|
|
||||||
"prefix": "augroup",
|
|
||||||
"body": [
|
|
||||||
"vim.api.nvim_create_augroup(\"${1:group}\", { clear = true })$0"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"Current Win": {
|
|
||||||
"prefix": "win",
|
|
||||||
"body": "local win = vim.api.nvim_get_current_win()\n$0"
|
|
||||||
},
|
|
||||||
"Current Buf": {
|
|
||||||
"prefix": "buf",
|
|
||||||
"body": "local buf = vim.api.nvim_get_current_buf()\n$0"
|
|
||||||
},
|
|
||||||
"Buf Valid": {
|
|
||||||
"prefix": "bufvalid",
|
|
||||||
"body": "vim.api.nvim_buf_is_valid(${1:buf})"
|
|
||||||
},
|
|
||||||
"Win Valid": {
|
|
||||||
"prefix": "winvalid",
|
|
||||||
"body": "vim.api.nvim_win_is_valid(${1:win})"
|
|
||||||
},
|
|
||||||
"Win Call": {
|
|
||||||
"prefix": "wincall",
|
|
||||||
"body": [
|
|
||||||
"vim.api.nvim_win_call(${1:win}, function(win)",
|
|
||||||
" ${0}",
|
|
||||||
"end)"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"Buf Call": {
|
|
||||||
"prefix": "bufcall",
|
|
||||||
"body": [
|
|
||||||
"vim.api.nvim_buf_call(${1:buf}, function(buf)",
|
|
||||||
" ${0}",
|
|
||||||
"end)"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"Schedule": {
|
|
||||||
"prefix": "schedule",
|
|
||||||
"body": [
|
|
||||||
"vim.schedule(function()",
|
|
||||||
" ${0}",
|
|
||||||
"end)"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"Table Deep Extend": {
|
|
||||||
"prefix": "deepextend",
|
|
||||||
"body": "vim.tbl_deep_extend(\"force\", ${1:table}, ${2:table})$0"
|
|
||||||
},
|
|
||||||
"Table Filter": {
|
|
||||||
"prefix": "filter",
|
|
||||||
"body": [
|
|
||||||
"vim.tbl_filter(function()",
|
|
||||||
" $0",
|
|
||||||
"end, ${1:table})"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"Table Map": {
|
|
||||||
"prefix": "map",
|
|
||||||
"body": [
|
|
||||||
"vim.tbl_map(function()",
|
|
||||||
" $0",
|
|
||||||
"end, ${1:table})"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"Table Values": {
|
|
||||||
"prefix": "values",
|
|
||||||
"body": "vim.tbl_values(${1:table})"
|
|
||||||
},
|
|
||||||
"Table Keys": {
|
|
||||||
"prefix": "keys",
|
|
||||||
"body": "vim.tbl_keys(${1:table})"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,133 +0,0 @@
|
|||||||
{
|
|
||||||
"Misc": {
|
|
||||||
"body": "Miscellaneous",
|
|
||||||
"prefix": "Misc"
|
|
||||||
},
|
|
||||||
"bash (Codeblock)": {
|
|
||||||
"body": [
|
|
||||||
"```bash",
|
|
||||||
"$CLIPBOARD$0",
|
|
||||||
"```"
|
|
||||||
],
|
|
||||||
"prefix": "bash (Codeblock)"
|
|
||||||
},
|
|
||||||
"caution (callout)": {
|
|
||||||
"body": [
|
|
||||||
"> [!CAUTION]",
|
|
||||||
"> $0"
|
|
||||||
],
|
|
||||||
"description": "https://docs.github.com/en/get-started/writing-on-github/getting-started-with-writing-and-formatting-on-github/basic-writing-and-formatting-syntax#alerts",
|
|
||||||
"prefix": "caution (callout)"
|
|
||||||
},
|
|
||||||
"details & summary": {
|
|
||||||
"body": [
|
|
||||||
"<details>",
|
|
||||||
"<summary>${1:Text}</summary>",
|
|
||||||
"$0",
|
|
||||||
"</details>"
|
|
||||||
],
|
|
||||||
"description": "https://developer.mozilla.org/en-US/docs/Web/HTML/Element/details",
|
|
||||||
"prefix": [
|
|
||||||
"toggle / fold",
|
|
||||||
"details & summary"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"ignore file (ltex)": {
|
|
||||||
"body": "<!-- LTeX: enabled=false -->",
|
|
||||||
"prefix": "ignore file (ltex)"
|
|
||||||
},
|
|
||||||
"image": {
|
|
||||||
"body": "<img src=\"${1:image_path}\" alt=\"${2:alt text}\" width=\"${3:50%}\">",
|
|
||||||
"description": "HTML syntax for images used to display images with reduced size",
|
|
||||||
"prefix": "image"
|
|
||||||
},
|
|
||||||
"important (callout)": {
|
|
||||||
"body": [
|
|
||||||
"> [!IMPORTANT]",
|
|
||||||
"> $0"
|
|
||||||
],
|
|
||||||
"description": "https://docs.github.com/en/get-started/writing-on-github/getting-started-with-writing-and-formatting-on-github/basic-writing-and-formatting-syntax#alerts",
|
|
||||||
"prefix": "important (callout)"
|
|
||||||
},
|
|
||||||
"insert table 2x2": {
|
|
||||||
"body": [
|
|
||||||
"| ${1:Column1} | ${2:Column2} |",
|
|
||||||
"|--------------- | -------------- |",
|
|
||||||
"| ${3:Item1.1} | ${4:Item2.1} |"
|
|
||||||
],
|
|
||||||
"prefix": "table (2x2)"
|
|
||||||
},
|
|
||||||
"insert toc": {
|
|
||||||
"body": [
|
|
||||||
"## Table of Content",
|
|
||||||
"",
|
|
||||||
"<!-- toc -->"
|
|
||||||
],
|
|
||||||
"description": "https://github.com/jonschlinkert/markdown-toc#tocinsert",
|
|
||||||
"prefix": "insert toc"
|
|
||||||
},
|
|
||||||
"js (Codeblock)": {
|
|
||||||
"body": [
|
|
||||||
"```js",
|
|
||||||
"$CLIPBOARD$0",
|
|
||||||
"```"
|
|
||||||
],
|
|
||||||
"prefix": "js (Codeblock)"
|
|
||||||
},
|
|
||||||
"kbd": {
|
|
||||||
"body": "<kbd>$0</kbd>",
|
|
||||||
"description": "HTML tag for keys",
|
|
||||||
"prefix": "kbd"
|
|
||||||
},
|
|
||||||
"lua (Codeblock)": {
|
|
||||||
"body": [
|
|
||||||
"```lua",
|
|
||||||
"$CLIPBOARD$0",
|
|
||||||
"```"
|
|
||||||
],
|
|
||||||
"prefix": "lua (Codeblock)"
|
|
||||||
},
|
|
||||||
"note (GitHub callout)": {
|
|
||||||
"body": [
|
|
||||||
"> [!NOTE]",
|
|
||||||
"> $0"
|
|
||||||
],
|
|
||||||
"description": "https://docs.github.com/en/get-started/writing-on-github/getting-started-with-writing-and-formatting-on-github/basic-writing-and-formatting-syntax#alerts",
|
|
||||||
"prefix": [
|
|
||||||
"info (callout)",
|
|
||||||
"note (callout)"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"py (Codeblock)": {
|
|
||||||
"body": [
|
|
||||||
"```py",
|
|
||||||
"$CLIPBOARD$0",
|
|
||||||
"```"
|
|
||||||
],
|
|
||||||
"prefix": "py (Codeblock)"
|
|
||||||
},
|
|
||||||
"tip (callout)": {
|
|
||||||
"body": [
|
|
||||||
"> [!TIP]",
|
|
||||||
"> $0"
|
|
||||||
],
|
|
||||||
"description": "https://docs.github.com/en/get-started/writing-on-github/getting-started-with-writing-and-formatting-on-github/basic-writing-and-formatting-syntax#alerts",
|
|
||||||
"prefix": "tip (callout)"
|
|
||||||
},
|
|
||||||
"ts (Codeblock)": {
|
|
||||||
"body": [
|
|
||||||
"```ts",
|
|
||||||
"$CLIPBOARD$0",
|
|
||||||
"```"
|
|
||||||
],
|
|
||||||
"prefix": "ts (Codeblock)"
|
|
||||||
},
|
|
||||||
"warning (callout)": {
|
|
||||||
"body": [
|
|
||||||
"> [!WARNING]",
|
|
||||||
"> $0"
|
|
||||||
],
|
|
||||||
"description": "https://docs.github.com/en/get-started/writing-on-github/getting-started-with-writing-and-formatting-on-github/basic-writing-and-formatting-syntax#alerts",
|
|
||||||
"prefix": "warning (callout)"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,334 +0,0 @@
|
|||||||
{
|
|
||||||
"PATH (export)": {
|
|
||||||
"body": "export PATH=/usr/local/lib:/usr/local/bin:/opt/homebrew/bin/:\\$PATH",
|
|
||||||
"description": "Extends PATH in a way that homebrew installed CLIs are recognized in ARM and Intel Macs.",
|
|
||||||
"prefix": "PATH (export)"
|
|
||||||
},
|
|
||||||
"awk (get field)": {
|
|
||||||
"body": "awk '{ print $${1:1} }'",
|
|
||||||
"description": "Retrieve a field from the piped in string, with whitespace as the default field delimiter. `$n` means that the nth field will be used.",
|
|
||||||
"prefix": "awk (field)"
|
|
||||||
},
|
|
||||||
"check device name": {
|
|
||||||
"body": "scutil --get ComputerName | grep -q \"$0\"",
|
|
||||||
"prefix": "device name"
|
|
||||||
},
|
|
||||||
"check if dark mode (macOS)": {
|
|
||||||
"body": "defaults read -g AppleInterfaceStyle &>/dev/null; && echo 'isDark'",
|
|
||||||
"prefix": "check if dark mode (macOS)"
|
|
||||||
},
|
|
||||||
"check if in git repo": {
|
|
||||||
"body": "if ! git rev-parse --is-inside-work-tree &>/dev/null ; then print \"\\e[0;33mfile is not ins a git repository.\\e[0m\" && return 1 ; fi",
|
|
||||||
"prefix": "check if in git repo"
|
|
||||||
},
|
|
||||||
"check if installed": {
|
|
||||||
"body": [
|
|
||||||
"if [[ ! -x \"\\$(command -v ${1:cli})\" ]]; then print \"\\e[0;33m${1:cli} not installed.\\e[0m\" && return 1; fi",
|
|
||||||
"$0"
|
|
||||||
],
|
|
||||||
"description": "https://stackoverflow.com/a/26759734/22114136",
|
|
||||||
"prefix": "check if installed"
|
|
||||||
},
|
|
||||||
"check if on macOS": {
|
|
||||||
"body": "[[ \"\\$OSTYPE\" =~ \"darwin\" ]]",
|
|
||||||
"prefix": "check if on macOS"
|
|
||||||
},
|
|
||||||
"check if process is running": {
|
|
||||||
"body": "pgrep -xq \"${1:process}\" && $0",
|
|
||||||
"prefix": "check if process is running"
|
|
||||||
},
|
|
||||||
"check if sudo user": {
|
|
||||||
"body": "sudo -nv && ${1:some_sudo_action}",
|
|
||||||
"prefix": "check if sudo user"
|
|
||||||
},
|
|
||||||
"confirmation prompt": {
|
|
||||||
"body": [
|
|
||||||
"# confirmation prompt",
|
|
||||||
"print \"\\e[1;34m$0Proceed? (y/n)\\e[0m\"",
|
|
||||||
"read -rk pressed",
|
|
||||||
"echo",
|
|
||||||
"if [[ \"\\$pressed\" != \"y\" ]]; then",
|
|
||||||
"\techo \"Aborted.\"",
|
|
||||||
"\treturn 1",
|
|
||||||
"fi",
|
|
||||||
"echo"
|
|
||||||
],
|
|
||||||
"prefix": "confirmation prompt"
|
|
||||||
},
|
|
||||||
"default value": {
|
|
||||||
"body": "\\${${1:var}:-${2:default_value}}",
|
|
||||||
"prefix": "default value"
|
|
||||||
},
|
|
||||||
"directory of script": {
|
|
||||||
"body": "\"$(dirname \"$(readlink -f \"\\$0\")\")\"",
|
|
||||||
"prefix": "directory of this script"
|
|
||||||
},
|
|
||||||
"elseif": {
|
|
||||||
"body": "elif [[ ${1:condition} ]]; then\n\t${0}",
|
|
||||||
"description": "Add an elseif to an if statement.",
|
|
||||||
"prefix": "elseif"
|
|
||||||
},
|
|
||||||
"extension": {
|
|
||||||
"body": "ext=${${1:file_name}##*.}",
|
|
||||||
"prefix": "get extension"
|
|
||||||
},
|
|
||||||
"filename": {
|
|
||||||
"body": "file_name=$(basename \"$${1:file_path}\")",
|
|
||||||
"prefix": "filename"
|
|
||||||
},
|
|
||||||
"filename w/o ext": {
|
|
||||||
"body": "${1:file_name}=${${1:file_name}%.*}",
|
|
||||||
"prefix": "filename w/o ext"
|
|
||||||
},
|
|
||||||
"find & xargs": {
|
|
||||||
"body": "find . -print0 | xargs -0 -I '{}'",
|
|
||||||
"prefix": "find & xargs"
|
|
||||||
},
|
|
||||||
"find -exec": {
|
|
||||||
"body": "find . $0 -exec open '{}' \\;",
|
|
||||||
"prefix": "find -exec"
|
|
||||||
},
|
|
||||||
"for each file": {
|
|
||||||
"body": [
|
|
||||||
"for filename in *.txt; do",
|
|
||||||
"\techo \"\\$filename\"",
|
|
||||||
"done"
|
|
||||||
],
|
|
||||||
"prefix": "for each file"
|
|
||||||
},
|
|
||||||
"for each line (read)": {
|
|
||||||
"body": [
|
|
||||||
"while read -r line; do",
|
|
||||||
"\techo \"\\$line\"$0",
|
|
||||||
"done < \"\\$${1:input_file}\""
|
|
||||||
],
|
|
||||||
"prefix": "for each line (read)"
|
|
||||||
},
|
|
||||||
"for each line (variable)": {
|
|
||||||
"body": [
|
|
||||||
"echo \"\\$lines\" | while read -r line; do",
|
|
||||||
"\techo \"\\$line\"",
|
|
||||||
"done"
|
|
||||||
],
|
|
||||||
"prefix": "for each line (variable)"
|
|
||||||
},
|
|
||||||
"for i ..": {
|
|
||||||
"body": [
|
|
||||||
"for ((i = 0; i <= ${1:length}; i++)); do",
|
|
||||||
" echo \\$i$0",
|
|
||||||
"done"
|
|
||||||
],
|
|
||||||
"prefix": "for i .."
|
|
||||||
},
|
|
||||||
"function": {
|
|
||||||
"body": "function ${1:name} {\n\t${0}\n}",
|
|
||||||
"prefix": "function"
|
|
||||||
},
|
|
||||||
"get nth line from string": {
|
|
||||||
"body": "line=$(echo \"\\$${1:str}\" | sed -n \"${2:n}p\")",
|
|
||||||
"prefix": "get nth line from string"
|
|
||||||
},
|
|
||||||
"i++": {
|
|
||||||
"body": "((${1:i}++))",
|
|
||||||
"prefix": "i++"
|
|
||||||
},
|
|
||||||
"i--": {
|
|
||||||
"body": "((${1:i}--))",
|
|
||||||
"prefix": "i--"
|
|
||||||
},
|
|
||||||
"if (short)": {
|
|
||||||
"body": "[[ \"\\$${1:var}\" ]] && $0",
|
|
||||||
"prefix": "if (short)"
|
|
||||||
},
|
|
||||||
"if .. then": {
|
|
||||||
"body": [
|
|
||||||
"if [[ \"\\$${1:var}\" ]]; then",
|
|
||||||
"\t$0",
|
|
||||||
"fi"
|
|
||||||
],
|
|
||||||
"prefix": "if .. then"
|
|
||||||
},
|
|
||||||
"if .. then .. else": {
|
|
||||||
"body": [
|
|
||||||
"if [[ \"$${1:cond}\" ]]; then",
|
|
||||||
"\t$0",
|
|
||||||
"else",
|
|
||||||
"\t",
|
|
||||||
"fi"
|
|
||||||
],
|
|
||||||
"prefix": "if .. then .. else"
|
|
||||||
},
|
|
||||||
"input (stdin or $1)": {
|
|
||||||
"body": [
|
|
||||||
"if [[ $# -eq 0 ]]; then",
|
|
||||||
"\tinput=$(< /dev/stdin)",
|
|
||||||
"else",
|
|
||||||
"\tinput=\"$1\"",
|
|
||||||
"fi"
|
|
||||||
],
|
|
||||||
"description": "reads either from STDIN or $1. stdin may have unescaped newlines, which have to be removed, e.g. via `tr -d '\n'`.",
|
|
||||||
"prefix": "input (stdin or $1)"
|
|
||||||
},
|
|
||||||
"notify (msg)": {
|
|
||||||
"body": "osascript -e 'display notification \"\" with title \"${1:msg}\"'",
|
|
||||||
"prefix": "notify (msg)"
|
|
||||||
},
|
|
||||||
"notify (var)": {
|
|
||||||
"body": "osascript -e \"display notification \\\"\\\" with title \\\"$${1:var}\\\"\"",
|
|
||||||
"prefix": "notify (var)"
|
|
||||||
},
|
|
||||||
"null (pipe)": {
|
|
||||||
"body": "&> /dev/null",
|
|
||||||
"prefix": "null (pipe)"
|
|
||||||
},
|
|
||||||
"osascript jxa (run script)": {
|
|
||||||
"body": "osascript -l JavaScript \"${1:file}\"",
|
|
||||||
"prefix": [
|
|
||||||
"jxa (run script)",
|
|
||||||
"osascript -l JavaScript"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"plist: extract key": {
|
|
||||||
"body": "plutil -extract name.childkey xml1 -o - example.plist | sed -n 4p | cut -d'>' -f2 | cut -d'<' -f1",
|
|
||||||
"prefix": "plist: extract key"
|
|
||||||
},
|
|
||||||
"print in blue": {
|
|
||||||
"body": "print \"\\e[1;34m$0\\e[0m\"",
|
|
||||||
"prefix": "print in blue"
|
|
||||||
},
|
|
||||||
"progress bar": {
|
|
||||||
"body": [
|
|
||||||
"for _ in {1..100}; do",
|
|
||||||
"\tprintf \"\ud83e\udf0b\"",
|
|
||||||
"\tsleep 0.5",
|
|
||||||
"done"
|
|
||||||
],
|
|
||||||
"prefix": "progress bar"
|
|
||||||
},
|
|
||||||
"quicklook": {
|
|
||||||
"body": "qlmanage -p \"${1:filepath}\"",
|
|
||||||
"description": "QuickLook the file. MacOS only.",
|
|
||||||
"prefix": "quicklook"
|
|
||||||
},
|
|
||||||
"redirect to stderr": {
|
|
||||||
"body": ">&2",
|
|
||||||
"prefix": "redirect to stderr"
|
|
||||||
},
|
|
||||||
"resolve home": {
|
|
||||||
"body": "${1:path}=\"\\${${1:path}/#\\~/\\$HOME}\"",
|
|
||||||
"prefix": "resolve home"
|
|
||||||
},
|
|
||||||
"restart app": {
|
|
||||||
"body": [
|
|
||||||
"killall \"${1:app_name}\"",
|
|
||||||
"while pgrep -xq \"${1:app_name}\"; do sleep 0.1; done",
|
|
||||||
"open -a \"${1:app_name}\""
|
|
||||||
],
|
|
||||||
"description": "safely restart app, avoiding race condition",
|
|
||||||
"prefix": "restart app"
|
|
||||||
},
|
|
||||||
"sed substitution": {
|
|
||||||
"body": "sed 's/$0//'",
|
|
||||||
"prefix": "sed substitution"
|
|
||||||
},
|
|
||||||
"shebang": {
|
|
||||||
"body": "#!/usr/bin/env zsh",
|
|
||||||
"prefix": "shebang"
|
|
||||||
},
|
|
||||||
"slice": {
|
|
||||||
"body": "${1:var}=\"${${1:var}:${2:from}:${3:to}}\"",
|
|
||||||
"prefix": "slice"
|
|
||||||
},
|
|
||||||
"spinner": {
|
|
||||||
"body": [
|
|
||||||
"# spinner with 20s timeout",
|
|
||||||
"spinner=\"\u280b\u2819\u2839\u2838\u283c\u2834\u2826\u2827\u2807\u280f\"",
|
|
||||||
"for i in {1..100}; do",
|
|
||||||
"\tpos=\\$((i % \\${#spinner}))",
|
|
||||||
"\tprintf \"\\r%s\" \"\\${spinner:\\$pos:1}\"",
|
|
||||||
"\tsleep 0.2",
|
|
||||||
"done",
|
|
||||||
"printf \"\\r\" # remove spinner"
|
|
||||||
],
|
|
||||||
"prefix": "spinner"
|
|
||||||
},
|
|
||||||
"stderr (merge with stdout)": {
|
|
||||||
"body": "2>&1",
|
|
||||||
"prefix": "stderr (merge with stdout)"
|
|
||||||
},
|
|
||||||
"stdin": {
|
|
||||||
"body": "stdin=\\$(< /dev/stdin)",
|
|
||||||
"description": "$(cat) also works. See https://stackoverflow.com/questions/32363887/in-a-bash-function-how-do-i-get-stdin-into-a-variable",
|
|
||||||
"prefix": "stdin"
|
|
||||||
},
|
|
||||||
"stdout is to a terminal": {
|
|
||||||
"body": "[[ -t true ]]",
|
|
||||||
"prefix": "stdout is to a terminal"
|
|
||||||
},
|
|
||||||
"substitute": {
|
|
||||||
"body": "\\${${1:var}//${2:search}/${3:replace}}",
|
|
||||||
"description": "one slash for single substitution, two for global",
|
|
||||||
"prefix": "substitute (expansion)"
|
|
||||||
},
|
|
||||||
"suppress stderr": {
|
|
||||||
"body": "2>/dev/null",
|
|
||||||
"prefix": "suppress stderr"
|
|
||||||
},
|
|
||||||
"switch case": {
|
|
||||||
"body": [
|
|
||||||
"case $${1:var} in",
|
|
||||||
"\"one\" | \"two\")",
|
|
||||||
"\techo \"foo\"",
|
|
||||||
"\t;;",
|
|
||||||
"\"three\")",
|
|
||||||
"\techo \"bar\"",
|
|
||||||
"\t;;",
|
|
||||||
"*)",
|
|
||||||
"\techo \"default\"",
|
|
||||||
"\t;;",
|
|
||||||
"esac"
|
|
||||||
],
|
|
||||||
"description": "A case command first expands word, and tries to match it against each pattern in turn.",
|
|
||||||
"prefix": "switch case"
|
|
||||||
},
|
|
||||||
"ternary": {
|
|
||||||
"body": "\\$([[ \"${1:cond}\" ]] && echo \"${2:value1}\" || echo \"${3:value2}\")",
|
|
||||||
"prefix": "ternary"
|
|
||||||
},
|
|
||||||
"then": {
|
|
||||||
"body": "then\n\t$0\nfi",
|
|
||||||
"prefix": "then .. fi"
|
|
||||||
},
|
|
||||||
"today (ISO date) + now": {
|
|
||||||
"body": "${1:now}=\\$(date +\"%Y-%m-%d %H:%M:%S\")",
|
|
||||||
"prefix": [
|
|
||||||
"today (ISO date)",
|
|
||||||
"now"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"trim whitespace": {
|
|
||||||
"body": "${1:text}=$(echo -n \"$${1:text}\" | sed -e 's/^ *//' -e 's/ *$//')",
|
|
||||||
"prefix": "trim whitespace"
|
|
||||||
},
|
|
||||||
"urlEncode": {
|
|
||||||
"body": "osascript -l JavaScript -e \"encodeURIComponent('${1:text}')\"",
|
|
||||||
"prefix": "urlEncode"
|
|
||||||
},
|
|
||||||
"wait until app running": {
|
|
||||||
"body": "while ! pgrep -xq \"${1:app_name}\"; do sleep 0.1; done",
|
|
||||||
"prefix": "wait until app running"
|
|
||||||
},
|
|
||||||
"wait until app terminated": {
|
|
||||||
"body": "while pgrep -xq \"${1:app_name}\"; do sleep 0.1; done",
|
|
||||||
"prefix": "wait until app terminated"
|
|
||||||
},
|
|
||||||
"while": {
|
|
||||||
"body": "while [[ ${1:condition} ]]; do\n\t${0}\ndone\n",
|
|
||||||
"description": "A while loop by condition.",
|
|
||||||
"prefix": "while"
|
|
||||||
},
|
|
||||||
"xargs (for each line)": {
|
|
||||||
"body": "xargs -I {} ${1:some_cmd} '{}'",
|
|
||||||
"prefix": "xargs (for each line)"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
{
|
|
||||||
"schema (modeline)": {
|
|
||||||
"body": "# yaml-language-server: $$schema=${1:url}",
|
|
||||||
"description": "https://github.com/redhat-developer/yaml-language-server#using-inlined-schema",
|
|
||||||
"prefix": "schema (modeline)"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -56,4 +56,3 @@ disable_startup_command = true
|
|||||||
name = "Downloads"
|
name = "Downloads"
|
||||||
path = "~/Downloads"
|
path = "~/Downloads"
|
||||||
startup_command = "lsa"
|
startup_command = "lsa"
|
||||||
|
|
||||||
|
|||||||
1
config/tmux/plugins/catppuccin
Submodule
1
config/tmux/plugins/catppuccin
Submodule
Submodule config/tmux/plugins/catppuccin added at 38932bddfc
18
config/tmux/sesh-gum.sh
Executable file
18
config/tmux/sesh-gum.sh
Executable file
@@ -0,0 +1,18 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
# Get session list and pipe it to gum for selection
|
||||||
|
SESH_LIST=$(
|
||||||
|
sesh list -i \
|
||||||
|
| gum filter \
|
||||||
|
--limit 1 \
|
||||||
|
--no-sort \
|
||||||
|
--fuzzy \
|
||||||
|
--placeholder 'Pick a sesh' \
|
||||||
|
--height 50 \
|
||||||
|
--prompt='⚡'
|
||||||
|
)
|
||||||
|
|
||||||
|
# If a session was selected, connect to it
|
||||||
|
if [ "$SESH_LIST" != "" ]; then
|
||||||
|
sesh connect "$SESH_LIST"
|
||||||
|
fi
|
||||||
18
config/tmux/sesh-tmux.fish
Executable file
18
config/tmux/sesh-tmux.fish
Executable file
@@ -0,0 +1,18 @@
|
|||||||
|
#!/usr/bin/env fish
|
||||||
|
|
||||||
|
set selection (sesh list --icons | fzf-tmux -p 80%,70% \
|
||||||
|
--no-sort --ansi --border-label ' sesh ' --prompt '⚡ ' \
|
||||||
|
--header ' ^a all ^t tmux ^g configs ^x zoxide ^d tmux kill ^f find' \
|
||||||
|
--bind 'tab:down,btab:up' \
|
||||||
|
--bind 'ctrl-a:change-prompt(⚡ )+reload(sesh list --icons)' \
|
||||||
|
--bind 'ctrl-t:change-prompt(🪟 )+reload(sesh list -t --icons)' \
|
||||||
|
--bind 'ctrl-g:change-prompt(⚙️ )+reload(sesh list -c --icons)' \
|
||||||
|
--bind 'ctrl-x:change-prompt(📁 )+reload(sesh list -z --icons)' \
|
||||||
|
--bind 'ctrl-f:change-prompt(🔎 )+reload(fd -H -d 2 -t d -E .Trash . ~)' \
|
||||||
|
--bind 'ctrl-d:execute(tmux kill-session -t {2..})+change-prompt(⚡ )+reload(sesh list --icons)' \
|
||||||
|
--preview-window 'right:55%' \
|
||||||
|
--preview 'sesh preview {}')
|
||||||
|
|
||||||
|
if test -n "$selection"
|
||||||
|
sesh connect "$selection"
|
||||||
|
end
|
||||||
@@ -1,46 +1 @@
|
|||||||
# Everforest dark theme for tmux
|
set -g @catppuccin_flavor "mocha"
|
||||||
# Generated from template - do not edit manually
|
|
||||||
|
|
||||||
# Enable proper color support
|
|
||||||
set -g default-terminal "tmux-256color"
|
|
||||||
set -as terminal-features ",*:RGB"
|
|
||||||
|
|
||||||
set -g pane-border-style "bg=default,fg=#859289"
|
|
||||||
set -g pane-active-border-style "bg=default,fg=#a7c080"
|
|
||||||
|
|
||||||
# Window tabs
|
|
||||||
set -g window-style "bg=default,fg=default,dim"
|
|
||||||
set -g window-status-style "bg=default,fg=default,dim"
|
|
||||||
set -g window-status-current-style "bg=default,fg=#d3c6aa"
|
|
||||||
set -g window-status-activity-style "bg=default,fg=#dbbc7f,nodim"
|
|
||||||
set -g window-status-bell-style "bg=default,fg=yellow,nodim"
|
|
||||||
set -g window-status-last-style "bg=default,fg=#a7c080"
|
|
||||||
set -g window-status-format " #I:#W "
|
|
||||||
|
|
||||||
# Messages
|
|
||||||
set -g message-style "bg=default,fg=#d3c6aa"
|
|
||||||
set -g message-command-style "bg=default,fg=#d3c6aa"
|
|
||||||
|
|
||||||
# Status bar
|
|
||||||
set -g status-style "bg=default,fg=default"
|
|
||||||
set -g status-left " #[default]"
|
|
||||||
set -g status-right " #[fg=#a7c080]#S@#[fg=#859289]#h #[fg=#7fbbb3]%H:%M #[fg=#dbbc7f]%d.%m "
|
|
||||||
set -g status-left-style "bg=default,fg=white"
|
|
||||||
set -g status-right-style "bg=default,fg=white"
|
|
||||||
|
|
||||||
set -g menu-style "bg=default,fg=white"
|
|
||||||
set -g menu-selected-style "bg=default,fg=#a7c080"
|
|
||||||
set -g menu-border-style "fg=#a7c080"
|
|
||||||
set -g menu-border-lines "single"
|
|
||||||
|
|
||||||
set -g popup-style "bg=default,fg=white"
|
|
||||||
set -g popup-border-style "fg=#a7c080"
|
|
||||||
set -g popup-border-lines "single"
|
|
||||||
|
|
||||||
set -g display-panes-colour "blue"
|
|
||||||
set -g display-panes-active-colour "red"
|
|
||||||
set -g display-panes-time 1000 # milliseconds
|
|
||||||
|
|
||||||
set -g pane-border-indicators "arrows"
|
|
||||||
set -g pane-border-lines "single"
|
|
||||||
set -g clock-mode-style "24"
|
|
||||||
|
|||||||
@@ -1,6 +1 @@
|
|||||||
set-option -g status-style 'fg=#4c4f69,bg=default'
|
set -g @catppuccin_flavor "latte"
|
||||||
set-window-option -g window-status-style 'fg=#4c4f69,bg=default dim'
|
|
||||||
set-window-option -g window-status-current-style 'fg=#8839ef,bg=default'
|
|
||||||
set-window-option -g window-status-activity-style 'fg=#4c4f69,bg=default nodim'
|
|
||||||
set-window-option -g window-status-bell-style 'fg=#4c4f69,bg=default'
|
|
||||||
set -g message-style 'fg=#8839ef bg=#e6e9ef bold' # fg magenta, bg black
|
|
||||||
|
|||||||
@@ -16,7 +16,9 @@
|
|||||||
# -u : Unset the specified option.
|
# -u : Unset the specified option.
|
||||||
|
|
||||||
set -ag terminal-overrides ",xterm-256color:RGB"
|
set -ag terminal-overrides ",xterm-256color:RGB"
|
||||||
set -ag terminal-features 'xterm-256color:RGB'
|
|
||||||
|
# Enable proper color support
|
||||||
|
set -as terminal-features ",*:RGB"
|
||||||
|
|
||||||
set -g default-terminal "tmux-256color" # Set default terminal to 256 colors
|
set -g default-terminal "tmux-256color" # Set default terminal to 256 colors
|
||||||
set -g detach-on-destroy off # don't detach tmux when killing a session
|
set -g detach-on-destroy off # don't detach tmux when killing a session
|
||||||
@@ -26,15 +28,6 @@ set -g mouse on # Mouse support
|
|||||||
set -g set-titles on # Allow tmux to set the terminal title
|
set -g set-titles on # Allow tmux to set the terminal title
|
||||||
set -g status on # Setting status on
|
set -g status on # Setting status on
|
||||||
set -g status-keys vi # vi keys to move between panes
|
set -g status-keys vi # vi keys to move between panes
|
||||||
set -g history-limit 3000 # Scrollback history limit
|
|
||||||
|
|
||||||
# Activity Monitoring (for when something happens in another pain)
|
|
||||||
set -g monitor-activity on
|
|
||||||
set -g visual-activity off
|
|
||||||
set -g visual-bell off
|
|
||||||
|
|
||||||
# A bell in another window should cause a bell in the current window
|
|
||||||
set -g bell-action any
|
|
||||||
|
|
||||||
# Keep Tmux alive when the initial command is finished
|
# Keep Tmux alive when the initial command is finished
|
||||||
set -g remain-on-exit off
|
set -g remain-on-exit off
|
||||||
@@ -44,24 +37,23 @@ set -g base-index 1
|
|||||||
set -g pane-base-index 1
|
set -g pane-base-index 1
|
||||||
set -g renumber-windows on
|
set -g renumber-windows on
|
||||||
|
|
||||||
# Activate with `DEBUG=1 tmux -vv`
|
|
||||||
if-shell '[ "$DEBUG" = "1" ]' 'set -g debug-file ~/.cache/tmux-debug.log'
|
|
||||||
|
|
||||||
# ╭──────────────────────────────────────────────────────────╮
|
# ╭──────────────────────────────────────────────────────────╮
|
||||||
# │ Theme │
|
# │ Theme │
|
||||||
# ╰──────────────────────────────────────────────────────────╯
|
# ╰──────────────────────────────────────────────────────────╯
|
||||||
|
|
||||||
set -g pane-active-border-style "bg=default,fg=#7aa2f7"
|
set -g status-bg default
|
||||||
set -g pane-border-style "bg=default,fg=#31748f"
|
set -g status-justify left
|
||||||
set -g status-style "bg=default"
|
|
||||||
set -g status-justify "left"
|
|
||||||
set -g status-left ''
|
set -g status-left ''
|
||||||
set -g status-left-length "0"
|
set -g status-left-length "0"
|
||||||
set -g status-position "bottom"
|
set -g status-position "bottom"
|
||||||
set -g status-right "#S@#h #{tmux_mode_indicator}"
|
#set -g status-right "#S@#h #{tmux_mode_indicator}"
|
||||||
set -g status-right-length "30"
|
set -g status-right-length "50"
|
||||||
set -g window-status-current-format ' #I:#W#{?window_zoomed_flag, ◈ ,} '
|
#set -g window-status-current-format ' #I:#W#{?window_zoomed_flag, ◈ ,} '
|
||||||
set -g window-status-format ' #I:#W '
|
#set -g window-status-format ' #I:#W '
|
||||||
|
set -g @catppuccin_status_background 'none'
|
||||||
|
set -g @catppuccin_window_flags 'icon'
|
||||||
|
set -g @catppuccin_window_text "#T"
|
||||||
|
set -g @catppuccin_window_current_text "#T"
|
||||||
|
|
||||||
# ╭──────────────────────────────────────────────────────────╮
|
# ╭──────────────────────────────────────────────────────────╮
|
||||||
# │ Bindings │
|
# │ Bindings │
|
||||||
@@ -83,11 +75,6 @@ bind -n M-Right select-pane -R
|
|||||||
bind -n M-Up select-pane -U
|
bind -n M-Up select-pane -U
|
||||||
bind -n M-Down select-pane -D
|
bind -n M-Down select-pane -D
|
||||||
|
|
||||||
# Easier switching between window
|
|
||||||
bind C-n next-window
|
|
||||||
bind C-p previous-window
|
|
||||||
bind C-a last-window
|
|
||||||
|
|
||||||
# Reload tmux config with <prefix> + r
|
# Reload tmux config with <prefix> + r
|
||||||
unbind r
|
unbind r
|
||||||
bind r "source-file ~/.dotfiles/config/tmux/tmux.conf; display 'tmux cfg reloaded!'"
|
bind r "source-file ~/.dotfiles/config/tmux/tmux.conf; display 'tmux cfg reloaded!'"
|
||||||
@@ -100,33 +87,10 @@ bind Escape copy-mode
|
|||||||
unbind p
|
unbind p
|
||||||
bind p paste-buffer
|
bind p paste-buffer
|
||||||
|
|
||||||
# tms bindings
|
|
||||||
bind -N "tms" t display-popup -E "tms"
|
|
||||||
bind -N "tms windows" C-w display-popup -E "tms windows"
|
|
||||||
bind -N "tms switch" C-s display-popup -E "tms switch"
|
|
||||||
bind -N "tms refresh" C-r display-popup -E "tms refresh"
|
|
||||||
|
|
||||||
# global sessions
|
# global sessions
|
||||||
# bind-key "K" display-popup -h 90% -w 50% -E "sesh ui"
|
bind -N "sesh selection" t display-popup -E "$HOME/.dotfiles/config/tmux/sesh-gum.sh"
|
||||||
bind-key "K" run-shell "sesh connect \"$(
|
bind -N "last-session (via sesh) " L run-shell "sesh last"
|
||||||
sesh list --icons --hide-duplicates | fzf-tmux -p 100%,100% --no-border \
|
bind -N "sesh ui" N display-popup -E "sesh ui"
|
||||||
--list-border \
|
|
||||||
--no-sort --prompt '⚡ ' \
|
|
||||||
--input-border \
|
|
||||||
--header-border \
|
|
||||||
--bind 'tab:down,btab:up' \
|
|
||||||
--bind 'ctrl-b:abort' \
|
|
||||||
--bind 'ctrl-a:change-prompt(⚡ )+reload(sesh list --icons)' \
|
|
||||||
--bind 'ctrl-t:change-prompt( )+reload(sesh list -t --icons)' \
|
|
||||||
--bind 'ctrl-g:change-prompt(⚙️ )+reload(sesh list -c --icons)' \
|
|
||||||
--bind 'ctrl-x:change-prompt(📁 )+reload(sesh list -z --icons)' \
|
|
||||||
--bind 'ctrl-f:change-prompt(🔎 )+reload(fd -H -d 2 -t d -E .Trash . ~)' \
|
|
||||||
--bind 'ctrl-d:execute(tmux kill-session -t {2..})+change-prompt(⚡ )+reload(sesh list --icons)' \
|
|
||||||
--preview-window 'right:70%' \
|
|
||||||
--preview 'sesh preview {}' \
|
|
||||||
)\""
|
|
||||||
|
|
||||||
bind-key "N" display-popup -E "sesh ui"
|
|
||||||
|
|
||||||
# ╭──────────────────────────────────────────────────────────╮
|
# ╭──────────────────────────────────────────────────────────╮
|
||||||
# │ Plugins │
|
# │ Plugins │
|
||||||
@@ -142,7 +106,7 @@ bind-key "N" display-popup -E "sesh ui"
|
|||||||
## A plugin to name your tmux windows smartly.
|
## A plugin to name your tmux windows smartly.
|
||||||
## https://github.com/ofirgall/tmux-window-name
|
## https://github.com/ofirgall/tmux-window-name
|
||||||
### Maximum name length of a window
|
### Maximum name length of a window
|
||||||
set -g @tmux_window_name_max_name_len "20"
|
set -g @tmux_window_name_max_name_len "25"
|
||||||
### Replace $HOME with ~ in window names
|
### Replace $HOME with ~ in window names
|
||||||
set -g @tmux_window_dir_programs "['nvim', 'vim', 'vi', 'git']"
|
set -g @tmux_window_dir_programs "['nvim', 'vim', 'vi', 'git']"
|
||||||
set -g @tmux_window_name_ignored_programs "['sqlite3', 'antidote', 'direnv', 'md5']" # Default is []
|
set -g @tmux_window_name_ignored_programs "['sqlite3', 'antidote', 'direnv', 'md5']" # Default is []
|
||||||
@@ -189,5 +153,6 @@ run-shell "$HOME/.dotfiles/config/tmux/plugins/tmux-current-pane-hostname/curren
|
|||||||
run-shell "$HOME/.dotfiles/config/tmux/plugins/tmux-fzf-url/fzf-url.tmux"
|
run-shell "$HOME/.dotfiles/config/tmux/plugins/tmux-fzf-url/fzf-url.tmux"
|
||||||
run-shell "$HOME/.dotfiles/config/tmux/plugins/tmux-resurrect/resurrect.tmux"
|
run-shell "$HOME/.dotfiles/config/tmux/plugins/tmux-resurrect/resurrect.tmux"
|
||||||
run-shell "$HOME/.dotfiles/config/tmux/plugins/tmux-continuum/continuum.tmux"
|
run-shell "$HOME/.dotfiles/config/tmux/plugins/tmux-continuum/continuum.tmux"
|
||||||
|
run-shell "$HOME/.dotfiles/config/tmux/plugins/catppuccin/catppuccin.tmux"
|
||||||
|
|
||||||
run-shell "$HOME/.dotfiles/config/tmux/plugins/tmux-dark-notify/main.tmux"
|
run-shell "$HOME/.dotfiles/config/tmux/plugins/tmux-dark-notify/main.tmux"
|
||||||
|
|||||||
@@ -66,9 +66,11 @@ config.scrollback_lines = 3000
|
|||||||
-- Function to detect the theme based on appearance
|
-- Function to detect the theme based on appearance
|
||||||
function Scheme_for_appearance(appearance)
|
function Scheme_for_appearance(appearance)
|
||||||
if appearance:find 'Dark' then
|
if appearance:find 'Dark' then
|
||||||
return 'Everforest Dark (Medium)'
|
return 'Catppuccin Mocha'
|
||||||
|
-- return 'Everforest Dark (Medium)'
|
||||||
else
|
else
|
||||||
return 'Everforest Light (Medium)'
|
return 'Catppuccin Latte'
|
||||||
|
-- return 'Everforest Light (Medium)'
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
# shellcheck shell=zsh
|
# shellcheck disable=SC1071,SC1103,SC2148
|
||||||
# Source: https://github.com/nvm-sh/nvm#zsh
|
# Source: https://github.com/nvm-sh/nvm#zsh
|
||||||
# place this after nvm initialization!
|
# place this after nvm initialization!
|
||||||
autoload -U add-zsh-hook
|
autoload -U add-zsh-hook
|
||||||
|
|||||||
52
cspell.config.yaml
Normal file
52
cspell.config.yaml
Normal file
@@ -0,0 +1,52 @@
|
|||||||
|
version: "0.2"
|
||||||
|
ignorePaths: []
|
||||||
|
dictionaryDefinitions: []
|
||||||
|
dictionaries: []
|
||||||
|
words:
|
||||||
|
- aquasec
|
||||||
|
- cdgr
|
||||||
|
- cheatsheets
|
||||||
|
- CODEQUALITY
|
||||||
|
- DEVSKIM
|
||||||
|
- dscacheutil
|
||||||
|
- emptytrash
|
||||||
|
- flushcache
|
||||||
|
- getifaddr
|
||||||
|
- goenv
|
||||||
|
- irssi
|
||||||
|
- Ismo
|
||||||
|
- isodate
|
||||||
|
- KEYSFILE
|
||||||
|
- KEYSSOURCE
|
||||||
|
- killall
|
||||||
|
- lakka
|
||||||
|
- libexec
|
||||||
|
- Licence
|
||||||
|
- lmstudio
|
||||||
|
- localip
|
||||||
|
- locatedb
|
||||||
|
- LOGFILE
|
||||||
|
- luarocks
|
||||||
|
- mvdan
|
||||||
|
- myip
|
||||||
|
- onnimonni
|
||||||
|
- opencode
|
||||||
|
- optstring
|
||||||
|
- orbstack
|
||||||
|
- osascript
|
||||||
|
- phpenv
|
||||||
|
- psub
|
||||||
|
- pyenv
|
||||||
|
- SARIF
|
||||||
|
- shellcheck
|
||||||
|
- shfmt
|
||||||
|
- shivammathur
|
||||||
|
- spelllang
|
||||||
|
- updatedb
|
||||||
|
- vendordirs
|
||||||
|
- vimrc
|
||||||
|
- virtualenv
|
||||||
|
- Vuorinen
|
||||||
|
- zedit
|
||||||
|
ignoreWords: []
|
||||||
|
import: []
|
||||||
@@ -33,8 +33,10 @@ Leader: `<ctrl><space>`
|
|||||||
? List key bindings
|
? List key bindings
|
||||||
D Choose and detach a client from a list
|
D Choose and detach a client from a list
|
||||||
E Spread panes out evenly
|
E Spread panes out evenly
|
||||||
L Switch to the last client
|
L last-session (via sesh)
|
||||||
M Clear the marked pane
|
M Clear the marked pane
|
||||||
|
N sesh ui
|
||||||
|
T tms
|
||||||
] Paste the most recent paste buffer
|
] Paste the most recent paste buffer
|
||||||
c Create a new window
|
c Create a new window
|
||||||
d Detach the current client
|
d Detach the current client
|
||||||
@@ -46,7 +48,7 @@ Leader: `<ctrl><space>`
|
|||||||
o Select the next pane
|
o Select the next pane
|
||||||
q Display pane numbers
|
q Display pane numbers
|
||||||
s Choose a session from a list
|
s Choose a session from a list
|
||||||
t tms
|
t sesh selection
|
||||||
w Choose a window from a list
|
w Choose a window from a list
|
||||||
x Kill the active pane
|
x Kill the active pane
|
||||||
z Zoom the active pane
|
z Zoom the active pane
|
||||||
@@ -74,8 +76,6 @@ Leader: `<ctrl><space>`
|
|||||||
M-Left Resize the pane left by 5
|
M-Left Resize the pane left by 5
|
||||||
M-Right Resize the pane right by 5
|
M-Right Resize the pane right by 5
|
||||||
C-o Rotate through the panes
|
C-o Rotate through the panes
|
||||||
C-r tms refresh
|
|
||||||
C-s tms switch
|
|
||||||
C-w tms windows
|
C-w tms windows
|
||||||
C-z Suspend the current client
|
C-z Suspend the current client
|
||||||
C-Up Resize the pane up
|
C-Up Resize the pane up
|
||||||
|
|||||||
16
local/bin/a
16
local/bin/a
@@ -103,9 +103,9 @@ fetch_keys_if_missing()
|
|||||||
if [[ ! -f "$KEYS_FILE" ]]; then
|
if [[ ! -f "$KEYS_FILE" ]]; then
|
||||||
log_message "Keys file '$KEYS_FILE' not found. Attempting to fetch from $KEYS_SOURCE..."
|
log_message "Keys file '$KEYS_FILE' not found. Attempting to fetch from $KEYS_SOURCE..."
|
||||||
mkdir -p "$(dirname "$KEYS_FILE")"
|
mkdir -p "$(dirname "$KEYS_FILE")"
|
||||||
curl -s "$KEYS_SOURCE" -o "$KEYS_FILE"
|
|
||||||
|
|
||||||
if [[ $? -ne 0 || ! -s "$KEYS_FILE" ]]; then
|
if ! curl -s "$KEYS_SOURCE" -o "$KEYS_FILE" || [[ ! -s "$KEYS_FILE" ]]; then
|
||||||
|
rm -f "$KEYS_FILE" 2> /dev/null || true
|
||||||
log_message "Error: Failed to fetch keys from $KEYS_SOURCE"
|
log_message "Error: Failed to fetch keys from $KEYS_SOURCE"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
@@ -126,10 +126,12 @@ encrypt_file_or_directory()
|
|||||||
elif [[ -f "$file" ]]; then
|
elif [[ -f "$file" ]]; then
|
||||||
fetch_keys_if_missing
|
fetch_keys_if_missing
|
||||||
local output_file="${file}.age"
|
local output_file="${file}.age"
|
||||||
age -R "$KEYS_FILE" "$file" > "$output_file"
|
local temp_file
|
||||||
if [[ $? -eq 0 ]]; then
|
temp_file="$(mktemp -p "$(dirname "$file")")"
|
||||||
|
if age -R "$KEYS_FILE" "$file" > "$temp_file" && mv "$temp_file" "$output_file"; then
|
||||||
log_message "File encrypted successfully: $output_file"
|
log_message "File encrypted successfully: $output_file"
|
||||||
else
|
else
|
||||||
|
rm -f "$temp_file"
|
||||||
log_message "Error: Failed to encrypt file '$file'."
|
log_message "Error: Failed to encrypt file '$file'."
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
@@ -147,10 +149,12 @@ decrypt_file_or_directory()
|
|||||||
elif [[ -f "$file" ]]; then
|
elif [[ -f "$file" ]]; then
|
||||||
fetch_keys_if_missing
|
fetch_keys_if_missing
|
||||||
local output_file="${file%.age}"
|
local output_file="${file%.age}"
|
||||||
age -d -i "$KEYS_FILE" "$file" > "$output_file"
|
local temp_file
|
||||||
if [[ $? -eq 0 ]]; then
|
temp_file="$(mktemp -p "$(dirname "$file")")"
|
||||||
|
if age -d -i "$KEYS_FILE" "$file" > "$temp_file" && mv "$temp_file" "$output_file"; then
|
||||||
log_message "File decrypted successfully: $output_file"
|
log_message "File decrypted successfully: $output_file"
|
||||||
else
|
else
|
||||||
|
rm -f "$temp_file"
|
||||||
log_message "Error: Failed to decrypt file '$file'."
|
log_message "Error: Failed to decrypt file '$file'."
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|||||||
11
local/bin/ad
11
local/bin/ad
@@ -36,9 +36,8 @@ if [[ ! -f "$KEYS_FILE" ]]; then
|
|||||||
mkdir -p "$(dirname "$KEYS_FILE")"
|
mkdir -p "$(dirname "$KEYS_FILE")"
|
||||||
|
|
||||||
# Fetch the keys and save to the file
|
# Fetch the keys and save to the file
|
||||||
curl -s "$KEYS_SOURCE" -o "$KEYS_FILE"
|
if ! curl -s "$KEYS_SOURCE" -o "$KEYS_FILE" || [[ ! -s "$KEYS_FILE" ]]; then
|
||||||
|
rm -f "$KEYS_FILE" 2> /dev/null || true
|
||||||
if [[ $? -ne 0 || ! -s "$KEYS_FILE" ]]; then
|
|
||||||
echo "Error: Failed to fetch keys from $KEYS_SOURCE"
|
echo "Error: Failed to fetch keys from $KEYS_SOURCE"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
@@ -50,11 +49,11 @@ fi
|
|||||||
|
|
||||||
# Decrypt the file
|
# Decrypt the file
|
||||||
OUTPUT_FILE="${FILE%.age}"
|
OUTPUT_FILE="${FILE%.age}"
|
||||||
age -d -i "$KEYS_FILE" "$FILE" > "$OUTPUT_FILE"
|
TEMP_FILE="$(mktemp -p "$(dirname "$OUTPUT_FILE")")"
|
||||||
|
if age -d -i "$KEYS_FILE" "$FILE" > "$TEMP_FILE" && mv "$TEMP_FILE" "$OUTPUT_FILE"; then
|
||||||
if [[ $? -eq 0 ]]; then
|
|
||||||
echo "File decrypted successfully: $OUTPUT_FILE"
|
echo "File decrypted successfully: $OUTPUT_FILE"
|
||||||
else
|
else
|
||||||
|
rm -f "$TEMP_FILE"
|
||||||
echo "Error: Failed to decrypt file."
|
echo "Error: Failed to decrypt file."
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|||||||
@@ -37,9 +37,7 @@ if [[ ! -f "$KEYS_FILE" ]]; then
|
|||||||
mkdir -p "$(dirname "$KEYS_FILE")"
|
mkdir -p "$(dirname "$KEYS_FILE")"
|
||||||
|
|
||||||
# Fetch the keys and save to the file
|
# Fetch the keys and save to the file
|
||||||
curl -s "$KEYS_SOURCE" -o "$KEYS_FILE"
|
if ! curl -s "$KEYS_SOURCE" -o "$KEYS_FILE" || [[ ! -s "$KEYS_FILE" ]]; then
|
||||||
|
|
||||||
if [[ $? -ne 0 || ! -s "$KEYS_FILE" ]]; then
|
|
||||||
echo "Error: Failed to fetch keys from $KEYS_SOURCE"
|
echo "Error: Failed to fetch keys from $KEYS_SOURCE"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
@@ -51,9 +49,7 @@ fi
|
|||||||
|
|
||||||
# Encrypt the file
|
# Encrypt the file
|
||||||
OUTPUT_FILE="${FILE}.age"
|
OUTPUT_FILE="${FILE}.age"
|
||||||
age -R "$KEYS_FILE" "$FILE" > "$OUTPUT_FILE"
|
if age -R "$KEYS_FILE" "$FILE" > "$OUTPUT_FILE"; then
|
||||||
|
|
||||||
if [[ $? -eq 0 ]]; then
|
|
||||||
echo "File encrypted successfully: $OUTPUT_FILE"
|
echo "File encrypted successfully: $OUTPUT_FILE"
|
||||||
else
|
else
|
||||||
echo "Error: Failed to encrypt file."
|
echo "Error: Failed to encrypt file."
|
||||||
|
|||||||
@@ -25,6 +25,7 @@ source_file()
|
|||||||
case "$CURRENT_SHELL" in
|
case "$CURRENT_SHELL" in
|
||||||
fish)
|
fish)
|
||||||
if [[ -f "$file.fish" ]]; then
|
if [[ -f "$file.fish" ]]; then
|
||||||
|
# shellcheck disable=SC1090
|
||||||
source "$file.fish"
|
source "$file.fish"
|
||||||
else
|
else
|
||||||
echo "Fish shell file not found: $file.fish"
|
echo "Fish shell file not found: $file.fish"
|
||||||
@@ -32,6 +33,7 @@ source_file()
|
|||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
sh | bash | zsh)
|
sh | bash | zsh)
|
||||||
|
# shellcheck disable=SC1090
|
||||||
source "$file"
|
source "$file"
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
|
|||||||
@@ -142,7 +142,7 @@ if [[ ! "$opt" =~ "-E" ]] && tmux list-panes -F '#F' | grep -q Z; then
|
|||||||
zoomed_without_popup=1
|
zoomed_without_popup=1
|
||||||
original_window=$(tmux display-message -p "#{window_id}")
|
original_window=$(tmux display-message -p "#{window_id}")
|
||||||
tmp_window=$(tmux new-window -d -P -F "#{window_id}" "bash -c 'while :; do for c in \\| / - '\\;' do sleep 0.2; printf \"\\r\$c fzf-tmux is running\\r\"; done; done'")
|
tmp_window=$(tmux new-window -d -P -F "#{window_id}" "bash -c 'while :; do for c in \\| / - '\\;' do sleep 0.2; printf \"\\r\$c fzf-tmux is running\\r\"; done; done'")
|
||||||
tmux swap-pane -t $tmp_window \; select-window -t $tmp_window
|
tmux swap-pane -t "$tmp_window" \; select-window -t "$tmp_window"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
set -e
|
set -e
|
||||||
@@ -154,15 +154,16 @@ fifo1="${TMPDIR:-/tmp}/fzf-fifo1-$id"
|
|||||||
fifo2="${TMPDIR:-/tmp}/fzf-fifo2-$id"
|
fifo2="${TMPDIR:-/tmp}/fzf-fifo2-$id"
|
||||||
fifo3="${TMPDIR:-/tmp}/fzf-fifo3-$id"
|
fifo3="${TMPDIR:-/tmp}/fzf-fifo3-$id"
|
||||||
if tmux_win_opts=$(tmux show-options -p remain-on-exit \; show-options -p synchronize-panes 2> /dev/null); then
|
if tmux_win_opts=$(tmux show-options -p remain-on-exit \; show-options -p synchronize-panes 2> /dev/null); then
|
||||||
tmux_win_opts=($(sed '/ off/d; s/synchronize-panes/set-option -p synchronize-panes/; s/remain-on-exit/set-option -p remain-on-exit/; s/$/ \\;/' <<< "$tmux_win_opts"))
|
mapfile -t tmux_win_opts < <(sed '/ off/d; s/synchronize-panes/set-option -p synchronize-panes/; s/remain-on-exit/set-option -p remain-on-exit/; s/$/ \\;/' <<< "$tmux_win_opts")
|
||||||
tmux_off_opts='; set-option -p synchronize-panes off ; set-option -p remain-on-exit off'
|
tmux_off_opts='; set-option -p synchronize-panes off ; set-option -p remain-on-exit off'
|
||||||
else
|
else
|
||||||
tmux_win_opts=($(tmux show-window-options remain-on-exit \; show-window-options synchronize-panes | sed '/ off/d; s/^/set-window-option /; s/$/ \\;/'))
|
mapfile -t tmux_win_opts < <(tmux show-window-options remain-on-exit \; show-window-options synchronize-panes | sed '/ off/d; s/^/set-window-option /; s/$/ \\;/')
|
||||||
tmux_off_opts='; set-window-option synchronize-panes off ; set-window-option remain-on-exit off'
|
tmux_off_opts='; set-window-option synchronize-panes off ; set-window-option remain-on-exit off'
|
||||||
fi
|
fi
|
||||||
|
# shellcheck disable=SC2329
|
||||||
cleanup()
|
cleanup()
|
||||||
{
|
{
|
||||||
\rm -f $argsf $fifo1 $fifo2 $fifo3
|
\rm -f "$argsf" "$fifo1" "$fifo2" "$fifo3"
|
||||||
|
|
||||||
# Restore tmux window options
|
# Restore tmux window options
|
||||||
if [[ "${#tmux_win_opts[@]}" -gt 0 ]]; then
|
if [[ "${#tmux_win_opts[@]}" -gt 0 ]]; then
|
||||||
@@ -172,9 +173,9 @@ cleanup()
|
|||||||
# Remove temp window if we were zoomed without popup options
|
# Remove temp window if we were zoomed without popup options
|
||||||
if [[ -n "$zoomed_without_popup" ]]; then
|
if [[ -n "$zoomed_without_popup" ]]; then
|
||||||
tmux display-message -p "#{window_id}" > /dev/null
|
tmux display-message -p "#{window_id}" > /dev/null
|
||||||
tmux swap-pane -t $original_window \; \
|
tmux swap-pane -t "$original_window" \; \
|
||||||
select-window -t $original_window \; \
|
select-window -t "$original_window" \; \
|
||||||
kill-window -t $tmp_window \; \
|
kill-window -t "$tmp_window" \; \
|
||||||
resize-pane -Z
|
resize-pane -Z
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@@ -209,39 +210,40 @@ echo "$envs;" > "$argsf"
|
|||||||
opts=$(printf "%q " "${args[@]}")
|
opts=$(printf "%q " "${args[@]}")
|
||||||
|
|
||||||
pppid=$$
|
pppid=$$
|
||||||
echo -n "trap 'kill -SIGUSR1 -$pppid' EXIT SIGINT SIGTERM;" >> $argsf
|
echo -n "trap 'kill -SIGUSR1 -$pppid' EXIT SIGINT SIGTERM;" >> "$argsf"
|
||||||
close="; trap - EXIT SIGINT SIGTERM $close"
|
close="; trap - EXIT SIGINT SIGTERM $close"
|
||||||
|
|
||||||
export TMUX=$(cut -d , -f 1,2 <<< "$TMUX")
|
export TMUX
|
||||||
mkfifo -m o+w $fifo2
|
TMUX=$(cut -d , -f 1,2 <<< "$TMUX")
|
||||||
|
mkfifo -m o+w "$fifo2"
|
||||||
if [[ "$opt" =~ "-E" ]]; then
|
if [[ "$opt" =~ "-E" ]]; then
|
||||||
cat $fifo2 &
|
cat "$fifo2" &
|
||||||
if [[ -n "$term" ]] || [[ -t 0 ]]; then
|
if [[ -n "$term" ]] || [[ -t 0 ]]; then
|
||||||
cat <<< "\"$fzf\" $opts > $fifo2; out=\$? $close; exit \$out" >> $argsf
|
cat <<< "\"$fzf\" $opts > $fifo2; out=\$? $close; exit \$out" >> "$argsf"
|
||||||
else
|
else
|
||||||
mkfifo $fifo1
|
mkfifo "$fifo1"
|
||||||
cat <<< "\"$fzf\" $opts < $fifo1 > $fifo2; out=\$? $close; exit \$out" >> $argsf
|
cat <<< "\"$fzf\" $opts < $fifo1 > $fifo2; out=\$? $close; exit \$out" >> "$argsf"
|
||||||
cat <&0 > $fifo1 &
|
cat <&0 > "$fifo1" &
|
||||||
fi
|
fi
|
||||||
|
|
||||||
tmux popup -d "$PWD" $opt "bash $argsf" > /dev/null 2>&1
|
tmux popup -d "$PWD" "$opt" "bash $argsf" > /dev/null 2>&1
|
||||||
exit $?
|
exit $?
|
||||||
fi
|
fi
|
||||||
|
|
||||||
mkfifo -m o+w $fifo3
|
mkfifo -m o+w "$fifo3"
|
||||||
if [[ -n "$term" ]] || [[ -t 0 ]]; then
|
if [[ -n "$term" ]] || [[ -t 0 ]]; then
|
||||||
cat <<< "\"$fzf\" $opts > $fifo2; echo \$? > $fifo3 $close" >> $argsf
|
cat <<< "\"$fzf\" $opts > $fifo2; echo \$? > $fifo3 $close" >> "$argsf"
|
||||||
else
|
else
|
||||||
mkfifo $fifo1
|
mkfifo "$fifo1"
|
||||||
cat <<< "\"$fzf\" $opts < $fifo1 > $fifo2; echo \$? > $fifo3 $close" >> $argsf
|
cat <<< "\"$fzf\" $opts < $fifo1 > $fifo2; echo \$? > $fifo3 $close" >> "$argsf"
|
||||||
cat <&0 > $fifo1 &
|
cat <&0 > "$fifo1" &
|
||||||
fi
|
fi
|
||||||
tmux \
|
tmux \
|
||||||
split-window -c "$PWD" $opt "bash -c 'exec -a fzf bash $argsf'" $swap \
|
split-window -c "$PWD" "$opt" "bash -c 'exec -a fzf bash $argsf'" "$swap" \
|
||||||
$tmux_off_opts \
|
"$tmux_off_opts" \
|
||||||
> /dev/null 2>&1 || {
|
> /dev/null 2>&1 || {
|
||||||
"$fzf" "${args[@]}"
|
"$fzf" "${args[@]}"
|
||||||
exit $?
|
exit $?
|
||||||
}
|
}
|
||||||
cat $fifo2
|
cat "$fifo2"
|
||||||
exit "$(cat $fifo3)"
|
exit "$(cat "$fifo3")"
|
||||||
|
|||||||
@@ -25,27 +25,27 @@ fi
|
|||||||
# Output functions
|
# Output functions
|
||||||
msg_err()
|
msg_err()
|
||||||
{
|
{
|
||||||
echo -e "\e[31m$@\e[0m" >&2
|
echo -e "\e[31m$*\e[0m" >&2
|
||||||
}
|
}
|
||||||
|
|
||||||
msg_success()
|
msg_success()
|
||||||
{
|
{
|
||||||
echo -e "\e[32m$@\e[0m"
|
echo -e "\e[32m$*\e[0m"
|
||||||
}
|
}
|
||||||
|
|
||||||
msg_warn()
|
msg_warn()
|
||||||
{
|
{
|
||||||
echo -e "\e[33m$@\e[0m" >&2
|
echo -e "\e[33m$*\e[0m" >&2
|
||||||
}
|
}
|
||||||
|
|
||||||
msg_info()
|
msg_info()
|
||||||
{
|
{
|
||||||
echo -e "\e[36m$@\e[0m"
|
echo -e "\e[36m$*\e[0m"
|
||||||
}
|
}
|
||||||
|
|
||||||
msg_debug()
|
msg_debug()
|
||||||
{
|
{
|
||||||
[[ $VERBOSE -eq 1 ]] && echo -e "\e[35m$@\e[0m"
|
[[ $VERBOSE -eq 1 ]] && echo -e "\e[35m$*\e[0m"
|
||||||
}
|
}
|
||||||
|
|
||||||
show_help()
|
show_help()
|
||||||
@@ -180,7 +180,8 @@ format_rule()
|
|||||||
get_file_extension()
|
get_file_extension()
|
||||||
{
|
{
|
||||||
local file="$1"
|
local file="$1"
|
||||||
local basename=$(basename "$file")
|
local basename
|
||||||
|
basename=$(basename "$file")
|
||||||
local extension=""
|
local extension=""
|
||||||
|
|
||||||
# Check if file has no extension or is a dotfile
|
# Check if file has no extension or is a dotfile
|
||||||
@@ -231,8 +232,8 @@ suggest_rule()
|
|||||||
# If file path contains .d/ pattern, we need special handling
|
# If file path contains .d/ pattern, we need special handling
|
||||||
if [[ "$file" =~ \.d/ ]]; then
|
if [[ "$file" =~ \.d/ ]]; then
|
||||||
# Extract the pattern part that includes the .d/ directory
|
# Extract the pattern part that includes the .d/ directory
|
||||||
local dir_part=$(dirname "$file")
|
local dir_part
|
||||||
local base_name=$(basename "$file")
|
dir_part=$(dirname "$file")
|
||||||
|
|
||||||
# Check if it's a config directory pattern worth capturing
|
# Check if it's a config directory pattern worth capturing
|
||||||
if [[ "$dir_part" =~ /(\.d|[^/]+\.d)$ ]]; then
|
if [[ "$dir_part" =~ /(\.d|[^/]+\.d)$ ]]; then
|
||||||
@@ -430,7 +431,8 @@ detect_shell_scripts()
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# Skip if file extension already covered
|
# Skip if file extension already covered
|
||||||
local extension=$(get_file_extension "$rel_path")
|
local extension
|
||||||
|
extension=$(get_file_extension "$rel_path")
|
||||||
if [[ "$extension" != "$rel_path" ]] && grep -q "^\*\.$extension " <<< "$existing_rules"; then
|
if [[ "$extension" != "$rel_path" ]] && grep -q "^\*\.$extension " <<< "$existing_rules"; then
|
||||||
msg_debug "Script covered by extension rule: $rel_path (*.$extension)"
|
msg_debug "Script covered by extension rule: $rel_path (*.$extension)"
|
||||||
continue
|
continue
|
||||||
@@ -458,7 +460,8 @@ detect_shell_scripts()
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# Group by directory
|
# Group by directory
|
||||||
local dir=$(dirname "$rel_path")
|
local dir
|
||||||
|
dir=$(dirname "$rel_path")
|
||||||
if [[ "$dir" == "." ]]; then
|
if [[ "$dir" == "." ]]; then
|
||||||
dir="root"
|
dir="root"
|
||||||
fi
|
fi
|
||||||
@@ -480,7 +483,8 @@ detect_shell_scripts()
|
|||||||
|
|
||||||
# Check if we can use directory-based rules instead of individual files
|
# Check if we can use directory-based rules instead of individual files
|
||||||
for dir in "${!scripts_by_dir[@]}"; do
|
for dir in "${!scripts_by_dir[@]}"; do
|
||||||
local files_in_dir=$(echo -e "${scripts_by_dir[$dir]}" | wc -l)
|
local files_in_dir
|
||||||
|
files_in_dir=$(echo -e "${scripts_by_dir[$dir]}" | wc -l)
|
||||||
local dir_path="$dir"
|
local dir_path="$dir"
|
||||||
|
|
||||||
if [[ "$dir" == "root" ]]; then
|
if [[ "$dir" == "root" ]]; then
|
||||||
@@ -575,7 +579,8 @@ suggest_gitattributes()
|
|||||||
declare -A seen_patterns=()
|
declare -A seen_patterns=()
|
||||||
|
|
||||||
while IFS= read -r file; do
|
while IFS= read -r file; do
|
||||||
local suggestion=$(suggest_rule "$file")
|
local suggestion
|
||||||
|
suggestion=$(suggest_rule "$file")
|
||||||
if [[ -n "$suggestion" ]]; then
|
if [[ -n "$suggestion" ]]; then
|
||||||
IFS=':' read -r pattern attributes <<< "$suggestion"
|
IFS=':' read -r pattern attributes <<< "$suggestion"
|
||||||
|
|
||||||
@@ -639,7 +644,8 @@ suggest_gitattributes()
|
|||||||
formatted_suggestions+="$pattern\n"
|
formatted_suggestions+="$pattern\n"
|
||||||
echo "$pattern"
|
echo "$pattern"
|
||||||
else
|
else
|
||||||
local formatted_rule=$(printf "%-${format_width}s %s\n" "$pattern" "$attributes")
|
local formatted_rule
|
||||||
|
formatted_rule=$(printf "%-${format_width}s %s\n" "$pattern" "$attributes")
|
||||||
formatted_suggestions+="$formatted_rule\n"
|
formatted_suggestions+="$formatted_rule\n"
|
||||||
echo "$formatted_rule"
|
echo "$formatted_rule"
|
||||||
fi
|
fi
|
||||||
|
|||||||
1
local/bin/iterm2_shell_integration.zsh
Executable file → Normal file
1
local/bin/iterm2_shell_integration.zsh
Executable file → Normal file
@@ -1,3 +1,4 @@
|
|||||||
|
# shellcheck disable=all
|
||||||
# This program is free software; you can redistribute it and/or
|
# This program is free software; you can redistribute it and/or
|
||||||
# modify it under the terms of the GNU General Public License
|
# modify it under the terms of the GNU General Public License
|
||||||
# as published by the Free Software Foundation; either version 2
|
# as published by the Free Software Foundation; either version 2
|
||||||
|
|||||||
@@ -142,7 +142,7 @@ if [ ! -x "${CURL}" ]; then
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
devices="$(printf "${devices}" | xargs -n1 | sort -u | uniq)\n"
|
devices="$(printf "%s" "${devices}" | xargs -n1 | sort -u)"
|
||||||
|
|
||||||
if [ -z "${devices}" ]; then
|
if [ -z "${devices}" ]; then
|
||||||
__pushover_send_message
|
__pushover_send_message
|
||||||
|
|||||||
@@ -126,11 +126,11 @@ if [[ -f "$CONFIG_FILE" ]]; then
|
|||||||
PROTECTED_KEYS+=("$key")
|
PROTECTED_KEYS+=("$key")
|
||||||
done <<< "$CUSTOM_KEYS"
|
done <<< "$CUSTOM_KEYS"
|
||||||
|
|
||||||
SKIPPED+=("$(yq '.skipped_keys[]' "$CONFIG_FILE")")
|
mapfile -t SKIPPED < <(yq '.skipped_keys[]' "$CONFIG_FILE")
|
||||||
while IFS= read -r key; do
|
for key in "${SKIPPED[@]}"; do
|
||||||
# Add to default_skipped_keys
|
# Add to default_skipped_keys
|
||||||
SKIPPED_KEYS+=("$key")
|
SKIPPED_KEYS+=("$key")
|
||||||
done <<< "$SKIPPED"
|
done
|
||||||
|
|
||||||
CUSTOM_GROUPS=$(yq '.custom_grouping[]' "$CONFIG_FILE")
|
CUSTOM_GROUPS=$(yq '.custom_grouping[]' "$CONFIG_FILE")
|
||||||
while IFS= read -r group; do
|
while IFS= read -r group; do
|
||||||
@@ -159,6 +159,7 @@ is_protected()
|
|||||||
return 0
|
return 0
|
||||||
fi
|
fi
|
||||||
# Wildcard match (protected_key contains '*')
|
# Wildcard match (protected_key contains '*')
|
||||||
|
# shellcheck disable=SC2053 # Intentional glob matching - protected_key contains wildcard patterns
|
||||||
if [[ "$protected_key" == *"*"* ]] && [[ "$key" == $protected_key ]]; then
|
if [[ "$protected_key" == *"*"* ]] && [[ "$key" == $protected_key ]]; then
|
||||||
return 0
|
return 0
|
||||||
fi
|
fi
|
||||||
@@ -198,6 +199,7 @@ is_skipped()
|
|||||||
return 0
|
return 0
|
||||||
fi
|
fi
|
||||||
# Wildcard match (skipped_key contains '*')
|
# Wildcard match (skipped_key contains '*')
|
||||||
|
# shellcheck disable=SC2053 # Intentional glob matching - skipped_key contains wildcard patterns
|
||||||
if [[ "$skipped_key" == *"*"* ]] && [[ "$key" == $skipped_key ]]; then
|
if [[ "$skipped_key" == *"*"* ]] && [[ "$key" == $skipped_key ]]; then
|
||||||
return 0
|
return 0
|
||||||
fi
|
fi
|
||||||
@@ -244,8 +246,15 @@ while IFS='=' read -r key value; do
|
|||||||
value="[protected value]"
|
value="[protected value]"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Update group data
|
# Update group data - check if group already exists
|
||||||
if [[ ! " ${all_groups[*]} " =~ " $group " ]]; then
|
group_exists=false
|
||||||
|
for existing_group in "${all_groups[@]}"; do
|
||||||
|
if [[ "$existing_group" == "$group" ]]; then
|
||||||
|
group_exists=true
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
if [[ "$group_exists" == false ]]; then
|
||||||
all_groups+=("$group")
|
all_groups+=("$group")
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user