Compare commits

...

61 Commits

Author SHA1 Message Date
5e00422a28 feat(zsh): Updated nvm-auto-use
Source: https://github.com/nvm-sh/nvm#zsh
2023-05-24 14:22:08 +03:00
ivuorinen
44eacf9261 chore(git): Update submodules (automated)
config/nvim v3.15.11
2023-05-24 03:04:45 +00:00
4f2c1f0b9b fix(github): Fix changelog config locations 2023-05-22 17:55:07 +03:00
0fdc9fd08a feat(github): Update changelog workflow and config 2023-05-22 17:52:43 +03:00
65aaa4bec2 chore(config): Update ssh/allowed_signers file 2023-05-22 16:13:45 +03:00
a8835daede chore(config): Update iterm2 configuration 2023-05-22 16:12:03 +03:00
39ddc2ae00 feat(dfm): Add dfm docs tmux
This command will update docs/tmux-keybindings.md file that contains
all configured tmux keybindings.
2023-05-22 16:11:31 +03:00
06c2686815 feat(github): Add changelog workflow config 2023-05-22 16:09:16 +03:00
b259e4b992 chore(codestyle): Code style fixes, configs 2023-05-22 15:59:58 +03:00
ivuorinen
47703cd182 chore(git): Update submodules (automated)
tmux/tpm v3.0.0
2023-05-22 03:04:40 +00:00
6d31371af4 chore(actions): Submodule update action tweaks 2023-05-22 00:40:20 +03:00
c2250ee80c chore(tmux): Update tpm 2023-05-21 14:04:03 +03:00
a1d075fc0d fix(shell): Fix LC_ALL locale 2023-05-21 13:44:39 +03:00
a3cc12aae1 feat(config): git user profile for github 2023-05-21 13:30:43 +03:00
808748a050 fix(shell): Fix tool paths from append to prepend 2023-05-21 13:30:05 +03:00
ivuorinen
e29507ee61 Update submodules (automated)
config/nvim v3.15.10
2023-05-20 15:14:36 +00:00
bd6408b024 fix(config): git user home profile config typo 2023-05-17 17:07:31 +03:00
45cf9ef2a5 Fix(github): Changelog generator fixes 2023-05-17 16:23:24 +03:00
5cc78e14e4 Fix(github): Changelog generator fixes 2023-05-17 16:15:41 +03:00
5683809e18 Feat(github): Debug changelog generation 2023-05-17 16:05:11 +03:00
723d40a704 Chore(nvim): Cleanup of nvim lsp settings
Dropped lsp configs

mason (ensure installed):
- ansiblels
- bashls
- clangd
- codeqlls
- cssls

null-ls:
- null_ls.builtins.formatting.prettierd
2023-05-17 09:28:45 +03:00
renovate[bot]
55ce79d9d1 chore(deps): update actions/github-script action to v6 (#7) 2023-05-16 07:51:55 +03:00
renovate[bot]
fdd3845cf5 chore(deps): update actions/github-script action to v5.2.0 (#6)
Signed-off-by: Renovate Bot <bot@renovateapp.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-05-16 00:07:54 +03:00
3e911755d2 Feat(github): Daily version for archiving purposes 2023-05-15 20:22:46 +03:00
f3dff521f7 Feat(npm): Removed prettier from global install
prettier was being detected by nvim and run with default configuration
in projects that it shouldn't have run in. Because of that the package
should be installed only project by project basis.
2023-05-15 19:25:13 +03:00
cf1ccd6f39 Feat(cheat): personal/git-alias 2023-05-15 15:49:55 +03:00
2e963fa29e Feat(config): Deduplicate git config, add special 2023-05-15 15:49:10 +03:00
ivuorinen
f595d437c9 Update submodules (automated)
tmux/tpm v3.0.0
dotbot v1.19.1
2023-05-15 11:09:57 +00:00
e7d0b4167a fix(github): Drop GPG -S from submodule commit 2023-05-15 14:09:15 +03:00
f20fe04ed8 Feat(github): git submodule update workflow 2023-05-15 13:58:59 +03:00
2b78d648c2 Chore(git): Update gitmodules to follow tags 2023-05-15 13:40:34 +03:00
ae2deef5fa fix(github): Fix dependabot configuration 2023-05-15 13:29:38 +03:00
8fc60ade75 Feat(github): GitHub Actions Update workflow 2023-05-15 13:26:35 +03:00
34160d34dc Feat(config): Taskwarrior configuration 2023-05-15 13:24:45 +03:00
5fab8e1cab Feat(github): Submodule update workflow 2023-05-15 13:23:54 +03:00
1a612fef62 Chore(nvim): Cleanup of nvim plugins 2023-05-15 13:22:50 +03:00
ce5e9681fd Chore(packages): Removal of standardjs 2023-05-15 11:04:33 +03:00
cab855380f feat(nvim): Update astronvim to v3.15.6 2023-05-11 17:31:07 +03:00
e7578e4905 Chore(scripts): Simplification and documentation 2023-05-10 02:07:27 +03:00
3fce0ac4dc fix(scripts): Fix x-backup-folder error prone code 2023-05-10 00:30:33 +03:00
b89213ffb5 Chore(lint): markdownlint config changes, tweak 2023-05-08 20:44:45 +03:00
823e9cc381 Feat(tools): nb 2023-05-08 20:43:59 +03:00
8be55a7c76 Chore(lint): markdownlint config 2023-05-08 14:14:46 +03:00
f4fb53abaa Chore(lint): Change name for Codacy 2023-05-08 13:24:47 +03:00
66c31c3d3f Chore(tools): Added phpcs & fixed x-quota-usage 2023-05-08 13:01:28 +03:00
1a8c32bf4c Chore(iterm2): Config update 2023-05-08 12:18:33 +03:00
864fbc18da feat(dfm): Install cheat databases with dfm 2023-05-08 12:18:10 +03:00
b688ee7503 Chore(tools): Moved dotbot under tools 2023-05-08 12:16:45 +03:00
9dfb7a3c4a Chore: Added .gitkeep files to cheatsheet folders 2023-05-08 11:30:18 +03:00
192ca6d26c Chore(cheat): use fzf with cheat 2023-05-08 09:10:21 +03:00
b5dd8c3eab feat(tmux): New plugins and configurations 2023-05-07 23:50:57 +03:00
d2a84e6d20 feat(nvim): Update astronvim to v3.15.2 2023-05-07 23:00:56 +03:00
e29bd04c7d Chore(cheat): tldr pages tweaks 2023-05-07 22:58:28 +03:00
2b6fa42f17 Chore: Lots of little tweaks 2023-05-05 23:03:42 +03:00
8de487250d Feat: Pure Bash Bible and TLDR in cheat 2023-05-05 23:02:31 +03:00
e5fe49834d Fix: Changes to have command usage 2023-05-05 22:59:14 +03:00
edd56c80eb feat(nvim): Update astronvim and tweak null-ls 2023-05-03 16:22:32 +03:00
eaedd40e06 feat(tmux): Plugins and configurations 2023-05-03 16:22:02 +03:00
06a53759ac chore(astronvim): Plugins reshuffle 2023-05-03 09:17:01 +03:00
3c98117c05 Chore: Update astronvim, tweak gitmodules 2023-05-02 14:47:49 +03:00
c3aa6b77e5 Chore: Fixes, repo dotfiles 2023-04-30 14:56:30 +03:00
70 changed files with 1474 additions and 386 deletions

3
.actrc Normal file
View File

@@ -0,0 +1,3 @@
--container-architecture linux/amd64
--env-file .env
--secret-file .env

19
.ecrc Normal file
View File

@@ -0,0 +1,19 @@
{
"Version": "2.7.0",
"Verbose": false,
"Debug": false,
"IgnoreDefaults": false,
"SpacesAftertabs": false,
"NoColor": false,
"Exclude": [],
"AllowedContentTypes": [],
"PassedFiles": [],
"Disable": {
"EndOfLine": false,
"Indentation": false,
"InsertFinalNewline": false,
"TrimTrailingWhitespace": false,
"IndentSize": false,
"MaxLineLength": false
}
}

View File

@@ -8,6 +8,22 @@ indent_style = space
insert_final_newline = true
trim_trailing_whitespace = true
[*.php]
indent_size = 4
[.git{ignore,modules}]
indent_style = tab
indent_size = 1
[*.plist]
indent_size = 1
indent_style = tab
[local/bin/*]
shell_variant = bash # --language-variant
binary_next_line = true
switch_case_indent = true # --case-indent
space_redirects = true
keep_padding = true
function_next_line = true # --func-next-line

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

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

35
.github/tag-changelog-config.js vendored Normal file
View File

@@ -0,0 +1,35 @@
module.exports = {
types: [
{ types: ['feat', 'feature', 'Feat'], label: '🎉 New Features' },
{ types: ['fix', 'bugfix', 'Fix'], label: '🐛 Bugfixes' },
{ types: ['improvements', 'enhancement'], label: '🔨 Improvements' },
{ types: ['perf'], label: '🏎️ Performance Improvements' },
{ types: ['build', 'ci'], label: '🏗️ Build System' },
{ types: ['refactor'], label: '🪚 Refactors' },
{ types: ['doc', 'docs'], label: '📚 Documentation Changes' },
{ types: ['test', 'tests'], label: '🔍 Tests' },
{ types: ['style', 'codestyle'], label: '💅 Code Style Changes' },
{ types: ['chore', 'Chore'], label: '🧹 Chores' },
{ types: ['other', 'Other'], label: 'Other Changes' },
],
excludeTypes: [],
renderTypeSection: function (label, commits) {
let text = `\n## ${ label }\n\n`
commits.forEach((commit) => {
const scope = commit.scope ? `**${ commit.scope }:** ` : ''
text += `- ${ scope }${ commit.subject }\n`
})
return text
},
renderChangelog: function (release, changes) {
const now = new Date()
const d = now.toISOString().substring(0, 10);
const header = `# ${ release } - ${ d }\n`;
return header + changes + '\n\n'
},
}

23
.github/workflows/changelog.yml vendored Normal file
View File

@@ -0,0 +1,23 @@
---
name: Debug Changelog # Workflow name displayed on GitHub
on:
workflow_dispatch: # Trigger manually
jobs:
debug-changelog:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Create changelog text
id: changelog
uses: loopwerk/tag-changelog@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
config_file: .github/tag-changelog-config.js
- name: "Echo results"
id: output-changelog
run: |
echo "${{ steps.changelog.outputs.changes }}"

40
.github/workflows/new-release.yml vendored Normal file
View File

@@ -0,0 +1,40 @@
---
name: Release Daily State # Workflow name displayed on GitHub
on:
workflow_dispatch: # Trigger manually
schedule:
- cron: "59 23 * * *"
permissions:
contents: write
jobs:
new-daily-release:
runs-on: ubuntu-latest
outputs:
created: ${{ steps.daily-version.outputs.created }}
version: ${{ steps.daily-version.outputs.version }}
steps:
- uses: actions/checkout@v3 # Checkout our working repository
- name: Create tag if necessary
uses: fregante/daily-version-action@v2
id: daily-version
- name: Create changelog text
if: steps.daily-version.outputs.created
id: changelog
uses: loopwerk/tag-changelog@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
config_file: .github/tag-changelog-config.js
- name: Create release
uses: actions/create-release@latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ steps.daily-version.outputs.version }}
release_name: Release ${{ steps.daily-version.outputs.version }}
body: ${{ steps.changelog.outputs.changes }}

40
.github/workflows/update-submodules.yml vendored Normal file
View File

@@ -0,0 +1,40 @@
name: Update submodules
on:
schedule: [cron: 0 3 * * *]
workflow_dispatch:
permissions:
contents: write
issues: write
pull-requests: write
jobs:
update-submodules:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
submodules: true
fetch-depth: 0
token: ${{secrets.GITHUB_TOKEN}}
- name: Config Git User
run: |
git config --global user.name "${{ github.actor }}"
git config --global user.email "${{ github.actor }}@users.noreply.github.com"
- name: Update submodules
run: |
if git commit -am"chore(git): Update submodules (automated)
$(git submodule --quiet foreach \
'tag="$(git describe --tags --abbrev=0 origin/HEAD)"
if [ "$(git describe --tags)" != "$tag" ]; then
git checkout --quiet "$tag"
echo "$name" "$tag"
fi')"
then
git show --raw
git push
fi

5
.gitignore vendored
View File

@@ -5,3 +5,8 @@ Brewfile.lock.json
.idea
.vscode
config/fzf
config/cheat/cheatsheets/pure-bash-bible/*
config/cheat/cheatsheets/tldr/*
!.gitkeep
.env

10
.gitmodules vendored
View File

@@ -1,16 +1,16 @@
# vim: set expandtab:
[submodule "dotbot"]
path = dotbot
path = tools/dotbot
url = https://github.com/anishathalye/dotbot.git
ignore = dirty
[submodule "dotbot-brew"]
path = dotbot-brew
path = tools/dotbot-brew
url = https://github.com/wren/dotbot-brew.git
ignore = dirty
[submodule "dotbot-include"]
path = dotbot-include
path = tools/dotbot-include
url = https://gitlab.com/gnfzdz/dotbot-include.git
ignore = dirty
@@ -18,8 +18,7 @@
path = config/nvim
url = https://github.com/AstroNvim/AstroNvim.git
ignore = dirty
branch = main
update = checkout
shallow = true
[submodule "cheat-community"]
path = config/cheat/cheatsheets/community
@@ -29,3 +28,4 @@
[submodule "tmux/tpm"]
path = config/tmux/plugins/tpm
url = https://github.com/tmux-plugins/tpm.git
ignore = dirty

19
.markdownlint.json Normal file
View File

@@ -0,0 +1,19 @@
{
"extends": "markdownlint/style/prettier",
"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"
}
}

5
.markdownlintignore Normal file
View File

@@ -0,0 +1,5 @@
config/cheat/cheatsheets/community/
config/tmux/
config/nvim/
tools/

7
.shellcheckrc Normal file
View File

@@ -0,0 +1,7 @@
# This is shellcheck configuration file.
# Set whether or not to follow arbitrary file
# paths in source statements (since 0.8.0).
external-sources=true
includeAllWorkspaceSymbols=true

View File

@@ -1,7 +1,7 @@
#!/usr/bin/env bash
git submodule add --name dotbot-brew -f https://github.com/wren/dotbot-brew.git dotbot-brew
git submodule add --name dotbot-include -f https://gitlab.com/gnfzdz/dotbot-include.git dotbot-include
git submodule add --name dotbot -f https://github.com/anishathalye/dotbot.git tools/dotbot
git submodule add --name dotbot-brew -f https://github.com/wren/dotbot-brew.git tools/dotbot-brew
git submodule add --name dotbot-include -f https://gitlab.com/gnfzdz/dotbot-include.git tools/dotbot-include
git submodule add --name cheat-community -f https://github.com/cheat/cheatsheets.git config/cheat/cheatsheets/community
git submodule add --name tmux/tpm -f https://github.com/tmux-plugins/tpm.git config/tmux/plugins/tpm

View File

@@ -4,4 +4,9 @@ email = ismo.vuorinen@vincit.fi
[home]
name = Ismo Vuorinen
email = ismo@vuorinen.net
email = ismo@ivuorinen.net
[github]
name = ivuorinen
email = ivuorinen@users.noreply.github.com

18
base/nbrc Normal file
View File

@@ -0,0 +1,18 @@
#!/usr/bin/env bash
###############################################################################
# .nbrc
#
# Configuration file for `nb`, a command line note-taking, bookmarking,
# and knowledge base application with encryption, search, Git-backed syncing,
# and more in a single portable script.
#
# Edit this file manually or manage settings using the `nb settings`
# subcommand. Configuration options are set as environment variables, eg:
# export NB_ENCRYPTION_TOOL=gpg
#
# https://github.com/xwmx/nb
###############################################################################
export NB_DIR="${NB_DIR:-$HOME/.local/state/nb}" # Set by `nb` • Mon May 8 15:25:12 EEST 2023
export NB_COLOR_THEME="${NB_COLOR_THEME:-unicorn}" # Set by `nb` • Mon May 8 15:41:22 EEST 2023

View File

@@ -3,6 +3,11 @@
autoload -U colors zsh/terminfo
colors
setopt correct
# Add completion scripts to zsh path
fpath=(~/.config/zsh/completion $fpath)
autoload -Uz compinit && compinit -i
# Defaults
export DOTFILES="$HOME/.dotfiles"
@@ -42,4 +47,6 @@ have antigen && {
# starship is present
have starship && eval "$(starship init zsh)"
[ -f "${XDG_CONFIG_HOME:-$HOME/.config}"/fzf/fzf.zsh ] && source "${XDG_CONFIG_HOME:-$HOME/.config}"/fzf/fzf.zsh
[ -f "${XDG_CONFIG_HOME:-$HOME/.config}"/fzf/fzf.zsh ] \
&& source "${XDG_CONFIG_HOME:-$HOME/.config}"/fzf/fzf.zsh

View File

@@ -6,7 +6,7 @@ return { -- Add the community repository of plugin specific
import = "astrocommunity.colorscheme.catppuccin",
opts = {
flavour = "mocha",
transparent_background = false,
transparent_background = true,
dim_inactive = {
enabled = true,
shade = "dark",
@@ -20,21 +20,30 @@ return { -- Add the community repository of plugin specific
"m4xshen/smartcolumn.nvim",
opts = {
colorcolumn = { "80", "100", "120" },
disabled_filetypes = { "help", "text", "markdown" },
disabled_filetypes = { "help", "text", "markdown", "json" },
},
},
{ import = "astrocommunity.code-runner.overseer-nvim" },
--- { import = "astrocommunity.diagnostics.lsp_lines-nvim" },
--- { import = "astrocommunity.diagnostics.trouble-nvim" },
{ import = "astrocommunity.diagnostics.trouble-nvim" },
{
"folke/trouble.nvim",
opts = {
auto_open = false,
position = "right"
}
},
{ import = "astrocommunity.editing-support.refactoring-nvim" },
{ import = "astrocommunity.editing-support.neogen" },
{ import = "astrocommunity.editing-support.nvim-regexplainer" },
{ import = "astrocommunity.editing-support.todo-comments-nvim" },
{ import = "astrocommunity.indent.mini-indentscope" },
{ import = "astrocommunity.markdown-and-latex.glow-nvim" },
{ import = "astrocommunity.motion.harpoon" },
{ import = "astrocommunity.pack.php" },
{ import = "astrocommunity.pack.typescript" },
{ import = "astrocommunity.project.neoconf-nvim" },
{ import = "astrocommunity.project.nvim-spectre" },
{ import = "astrocommunity.project.project-nvim" },
{ import = "astrocommunity.test.neotest" },
{ import = "astrocommunity.utility.neodim" },
{ import = "astrocommunity.utility.transparent-nvim" },
}

View File

@@ -5,28 +5,7 @@ return { -- use mason-lspconfig to configure LSP installations
-- overrides `require("mason-lspconfig").setup(...)`
opts = {
ensure_installed = {
"ansiblels",
"bashls",
"clangd",
"codeqlls",
"cssls",
"diagnosticls",
"docker_compose_language_service",
"dockerls",
"emmet_ls",
"eslint",
"graphql",
"html",
"intelephense",
"jsonls",
"marksman",
"psalm",
"stylelint_lsp",
"sqlls",
"tailwindcss",
"tsserver",
"vuels",
"yamlls",
},
},
}, -- use mason-null-ls to configure Formatters/Linter installation for null-ls sources

View File

@@ -12,7 +12,6 @@ return {
null_ls.builtins.code_actions.eslint,
null_ls.builtins.code_actions.refactoring,
null_ls.builtins.code_actions.shellcheck,
null_ls.builtins.code_actions.xo,
null_ls.builtins.diagnostics.actionlint,
null_ls.builtins.diagnostics.alex,
null_ls.builtins.diagnostics.ansiblelint,
@@ -21,16 +20,12 @@ return {
null_ls.builtins.diagnostics.eslint,
null_ls.builtins.diagnostics.jsonlint,
null_ls.builtins.diagnostics.luacheck,
null_ls.builtins.diagnostics.markdownlint,
null_ls.builtins.diagnostics.mypy,
null_ls.builtins.diagnostics.php,
null_ls.builtins.diagnostics.phpcs,
null_ls.builtins.diagnostics.phpstan,
null_ls.builtins.diagnostics.psalm,
null_ls.builtins.diagnostics.pydocstyle,
null_ls.builtins.diagnostics.semgrep,
null_ls.builtins.diagnostics.shellcheck,
null_ls.builtins.diagnostics.standardjs,
null_ls.builtins.diagnostics.stylelint,
null_ls.builtins.diagnostics.tfsec,
null_ls.builtins.diagnostics.trail_space,
@@ -38,26 +33,15 @@ return {
null_ls.builtins.diagnostics.vacuum,
null_ls.builtins.diagnostics.vint,
null_ls.builtins.diagnostics.vulture,
null_ls.builtins.diagnostics.xo,
null_ls.builtins.diagnostics.yamllint,
null_ls.builtins.diagnostics.zsh,
null_ls.builtins.formatting.black,
null_ls.builtins.formatting.blade_formatter,
null_ls.builtins.formatting.cbfmt,
null_ls.builtins.formatting.clang_format,
null_ls.builtins.formatting.eslint,
null_ls.builtins.formatting.fixjson,
null_ls.builtins.formatting.isort,
null_ls.builtins.formatting.jq,
null_ls.builtins.formatting.markdownlint,
null_ls.builtins.formatting.nginx_beautifier,
null_ls.builtins.formatting.pg_format,
null_ls.builtins.formatting.phpcsfixer,
null_ls.builtins.formatting.prettier_eslint,
null_ls.builtins.formatting.prettier,
null_ls.builtins.formatting.puppet_lint,
null_ls.builtins.formatting.rome,
null_ls.builtins.formatting.rustfmt,
null_ls.builtins.formatting.shfmt.with {
args = { "-i", "1", "-bn", "-ci", "-sr", "-kb", "-fn" },
},

View File

@@ -0,0 +1,43 @@
---
tags: [ vcs, alias ]
---
# git branchbydate
List repository branches by date when last updated and extra information.
# git branchcolor
List repository branches sorted by when they were last updated.
# git llog
Show log with fuller information.
# git logs
Git logs with detailed information and git tree.
# git nah
Reset all changes.
# git reset-origin
Reset to origin.
# git reset-upstream
Hard reset to upstream master.
# git rl
Colored reflog.
# git tagdate
List tags in date order and with graph.
# git undo-commit
Undoes last commit.

View File

View File

@@ -1,6 +1,6 @@
---
# The editor to use with 'cheat -e <sheet>'. Defaults to $EDITOR or $VISUAL.
editor: $EDITOR
# editor: $EDITOR
# Should 'cheat' always colorize output?
colorize: true
@@ -8,7 +8,7 @@ colorize: true
# Which 'chroma' colorscheme should be applied to the output?
# Options are available here:
# https://github.com/alecthomas/chroma/tree/master/styles
style: catppuccin-mocha
style: "catppuccin"
# Which 'chroma' "formatter" should be applied?
# One of: "terminal", "terminal256", "terminal16m"
@@ -63,14 +63,22 @@ cheatpaths:
# 'readonly': shall user-created ('cheat -e') cheatsheets be saved here?
- name: community
path: ~/.config/cheat/cheatsheets/community
tags: [community]
tags: [ community ]
readonly: true
# If you have personalized cheatsheets, list them last. They will take
# precedence over the more global cheatsheets.
- name: personal
path: ~/.config/cheat/cheatsheets/personal
tags: [personal]
path: ~/.dotfiles/config/cheat/cheatsheets/personal
tags: [ personal ]
readonly: false
- name: pure-bash-bible
path: ~/.dotfiles/config/cheat/cheatsheets/pure-bash-bible
tags: [ pure-bash-bible ]
readonly: true
- name: tldr
path: ~/.dotfiles/config/cheat/cheatsheets/tldr
tags: [ tldr ]
readonly: true
# While it requires no configuration here, it's also worth noting that
# cheat will automatically append directories named '.cheat' within the

View File

@@ -25,9 +25,9 @@ export HOMEBREW_PKG="$HOMEBREW/opt"
export HOMEBREW_NO_ENV_HINTS=1
path_append "/usr/local/bin"
path_append "$HOMEBREW_SBIN"
path_append "$HOMEBREW_BIN"
path_append "$XDG_BIN_HOME"
path_prepend "$HOMEBREW_SBIN"
path_prepend "$HOMEBREW_BIN"
path_prepend "$XDG_BIN_HOME"
# brew, https://brew.sh
have brew && {

View File

@@ -72,6 +72,12 @@ have irssi && {
x-dc "$IRSSI_CONFIG_HOME"
}
# nb, https://xwmx.github.io/nb/
have nb && {
export NB_DIR="$XDG_STATE_HOME/nb"
x-dc "$NB_DIR"
}
# nvm, the node version manager
export NVM_LAZY_LOAD=true
export NVM_COMPLETION=true
@@ -80,6 +86,12 @@ export NVM_DIR="$XDG_CONFIG_HOME/nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion
# Add npm packages to path
have node && {
NVM_NODE_BIN_DIR="$(dirname "$(which node)")"
path_append "$NVM_NODE_BIN_DIR"
}
# op (1Password cli) is present
have op && {
export OP_CACHE="$XDG_STATE_HOME/1password"
@@ -109,3 +121,6 @@ export _Z_DATA="$XDG_STATE_HOME/z"
export ANDROID_HOME="$XDG_DATA_HOME/android"
export GNUPGHOME="$XDG_DATA_HOME/gnupg"
export SCREENRC="$XDG_CONFIG_HOME/misc/screenrc"
export TMUX_CONF="$DOTFILES/config/tmux/tmux.conf"
export BAT_THEME="ansi"
export CHEAT_USE_FZF=true

View File

@@ -4,7 +4,7 @@
# vim: filetype=zsh
source "$DOTFILES/scripts/shared.sh"
export LC_ALL=fi_FI.utf8
export LC_ALL=fi_FI.UTF-8
# Bash completion file location
export BASH_COMPLETION_USER_FILE="${XDG_CONFIG_HOME}/bash-completion/bash_completion"

View File

@@ -89,7 +89,6 @@ x-default-antigen-bundles()
antigen bundle command-not-found
antigen bundle ssh-agent
antigen bundle MichaelAquilina/zsh-you-should-use
antigen bundle Sparragus/zsh-auto-nvm-use
antigen bundle jreese/zsh-titles
antigen bundle unixorn/autoupdate-antigen.zshplugin
antigen bundle zsh-users/zsh-completions
@@ -101,6 +100,7 @@ x-default-antigen-bundles()
have docker-compose && antigen bundle sroze/docker-compose-zsh-plugin
have jq && antigen bundle reegnz/jq-zsh-plugin
have nvm && antigen bundle nvm
have nvm && antigen bundle $DOTFILES/config/zsh/plugins/nvm-auto-use
have php && antigen bundle php
have python && antigen bundle MichaelAquilina/zsh-autoswitch-virtualenv
have rvm && antigen bundle unixorn/rvm-plugin

View File

@@ -1,59 +1,7 @@
[include]
path = ~/.dotfiles/config/git/shared
[user]
name = Ismo Vuorinen
email = ismo@ivuorinen.net
[credential]
helper = store --file ~/.cache/git/git-credentials
helper = cache --timeout 30000
[core]
excludesfile = ~/.config/git/gitignore
[alias]
reset-origin = !git fetch origin && git reset --hard origin/master && git clean -f -d
reset-upstream = !git fetch upstream && git reset --hard upstream/master && git clean -f -d
nah = !git reset --hard && git clean -df
undo-commit = reset HEAD~ --soft
llog = log --pretty=fuller
logs = log --graph --pretty=format:'%C(magenta)%h%Creset -%C(red)%d%Creset %s %C(dim green)(%cr) %C(cyan)<%an>%Creset' --abbrev-commit
rl = reflog --format='%C(auto)%h %<|(20)%gd %C(blue)%cr%C(reset) %gs (%s)'
tagdate = log --date-order --graph --tags --simplify-by-decoration --pretty=format:\"%ai %h %d\"
branchbydate = for-each-ref --count=30 --sort=-committerdate refs/heads/ --format='%(refname:short)'
branchcolor = "!for ref in $(git for-each-ref --sort=-committerdate --format=\"%(refname)\" refs/heads/ refs/remotes ); do git log -n1 $ref --pretty=format:\"%Cgreen%cr%Creset %C(yellow)%d%Creset %C(bold blue)<%an>%Creset%n\" | cat ; done | awk '! a[$0]++'"
[diff]
tool = difftastic
[difftool]
prompt = false
[difftool "difftastic"]
cmd = difft "$LOCAL" "$REMOTE"
[filter "lfs"]
clean = git-lfs clean -- %f
smudge = git-lfs smudge -- %f
process = git-lfs filter-process
required = true
[init]
defaultBranch = main
[pull]
rebase = true
[color]
ui = true
diff = auto
branch = auto
status = auto
[color "status"]
added = green bold
changed = yellow
deleted = red bold strike
untracked = cyan
branch = yellow black bold ul
[submodule]
recurse = true

62
config/git/shared Normal file
View File

@@ -0,0 +1,62 @@
[credential]
helper = store --file ~/.cache/git/git-credentials
helper = cache --timeout 30000
[core]
excludesfile = ~/.config/git/gitignore
[init]
defaultBranch = main
[pull]
rebase = true
[gpg]
format = ssh
[alias]
branchbydate = for-each-ref --count=30 --sort=-committerdate refs/heads/ --format='%(refname:short)'
branchcolor = "!for ref in $(git for-each-ref --sort=-committerdate --format=\"%(refname)\" refs/heads/ refs/remotes ); do git log -n1 $ref --pretty=format:\"%Cgreen%cr%Creset %C(yellow)%d%Creset %C(bold blue)<%an>%Creset%n\" | cat ; done | awk '! a[$0]++'"
llog = log --pretty=fuller
logs = log --graph --pretty=format:'%C(magenta)%h%Creset -%C(red)%d%Creset %s %C(dim green)(%cr) %C(cyan)<%an>%Creset' --abbrev-commit
nah = !git reset --hard && git clean -df
reset-origin = !git fetch origin && git reset --hard origin/master && git clean -f -d
reset-upstream = !git fetch upstream && git reset --hard upstream/master && git clean -f -d
rl = reflog --format='%C(auto)%h %<|(20)%gd %C(blue)%cr%C(reset) %gs (%s)'
tagdate = log --date-order --graph --tags --simplify-by-decoration --pretty=format:\"%ai %h %d\"
undo-commit = reset HEAD~ --soft
[filter "lfs"]
clean = git-lfs clean -- %f
smudge = git-lfs smudge -- %f
process = git-lfs filter-process
required = true
[diff]
tool = difftastic
[difftool]
prompt = false
[difftool "difftastic"]
cmd = difft "$LOCAL" "$REMOTE"
[color]
ui = true
diff = auto
branch = auto
status = auto
[color "status"]
added = green bold
changed = yellow
deleted = red bold strike
untracked = cyan
branch = yellow black bold ul
[submodule]
recurse = true
# dotfiles special config
[includeIf "hasconfig:remote.*.url:https://github.com/ivuorinen/dotfiles.git"]
path = ~/.dotfiles/config/git/special/dotfiles ;

View File

@@ -0,0 +1,2 @@
[submodule]
recurse = false

View File

@@ -10,16 +10,8 @@
<true/>
<key>AlternateMouseScroll</key>
<true/>
<key>AppleAntiAliasingThreshold</key>
<integer>1</integer>
<key>ApplePressAndHoldEnabled</key>
<false/>
<key>AppleScrollAnimationEnabled</key>
<integer>0</integer>
<key>AppleSmoothFixedFontsSizeThreshold</key>
<integer>1</integer>
<key>AppleWindowTabbingMode</key>
<string>manual</string>
<key>AutoHideTmuxClientSession</key>
<true/>
<key>Custom Color Presets</key>
<dict>
<key>catppuccin-mocha</key>
@@ -1049,13 +1041,17 @@
<key>Non-ASCII Anti Aliased</key>
<true/>
<key>Normal Font</key>
<string>JetBrainsMonoNerdFontCompleteM-Light 15</string>
<string>JetBrainsMonoNFM-Regular 13</string>
<key>Only The Default BG Color Uses Transparency</key>
<true/>
<key>Open Password Manager Automatically</key>
<true/>
<key>Option Key Sends</key>
<integer>0</integer>
<key>Prompt Before Closing 2</key>
<false/>
<key>Reduce Flicker</key>
<true/>
<key>Right Option Key Sends</key>
<integer>0</integer>
<key>Rows</key>
@@ -1092,12 +1088,77 @@
</dict>
<key>Send Code When Idle</key>
<false/>
<key>Set Local Environment Vars</key>
<true/>
<key>Shortcut</key>
<string></string>
<string>T</string>
<key>Show Status Bar</key>
<true/>
<key>Show Timestamps</key>
<integer>2</integer>
<key>Silence Bell</key>
<false/>
<key>Smart Cursor Color</key>
<true/>
<key>Status Bar Layout</key>
<dict>
<key>advanced configuration</key>
<dict>
<key>algorithm</key>
<integer>0</integer>
<key>auto-rainbow style</key>
<integer>3</integer>
<key>font</key>
<string>.AppleSystemUIFont 12</string>
<key>remove empty components</key>
<false/>
</dict>
<key>components</key>
<array>
<dict>
<key>class</key>
<string>iTermStatusBarJobComponent</string>
<key>configuration</key>
<dict>
<key>knobs</key>
<dict>
<key>base: compression resistance</key>
<integer>1</integer>
<key>base: priority</key>
<real>5</real>
<key>maxwidth</key>
<real>+infinity</real>
<key>minwidth</key>
<integer>0</integer>
<key>shared text color</key>
<dict>
<key>Alpha Component</key>
<real>1</real>
<key>Blue Component</key>
<real>0.63</real>
<key>Color Space</key>
<string>sRGB</string>
<key>Green Component</key>
<real>0.63</real>
<key>Red Component</key>
<real>0.90000000000000002</real>
</dict>
</dict>
<key>layout advanced configuration dictionary value</key>
<dict>
<key>algorithm</key>
<integer>0</integer>
<key>auto-rainbow style</key>
<integer>3</integer>
<key>font</key>
<string>.AppleSystemUIFont 12</string>
<key>remove empty components</key>
<false/>
</dict>
</dict>
</dict>
</array>
</dict>
<key>Sync Title</key>
<false/>
<key>Tags</key>
@@ -1169,6 +1230,8 @@
<string>kNextWindowPointerAction</string>
</dict>
</dict>
<key>PromptOnQuit</key>
<false/>
<key>SmartPlacement</key>
<true/>
<key>SoundForEsc</key>

View File

@@ -3,8 +3,6 @@ corepack
editorconfig-checker
github-release-notes
neovim
prettier
standardjs
stylelint-lsp
tldr

44
config/task/taskrc Normal file
View File

@@ -0,0 +1,44 @@
# [Created by task 2.6.2 5/11/2023 09:33:14]
# Taskwarrior program configuration file.
# For more documentation, see https://taskwarrior.org or try 'man task', 'man task-color',
# 'man task-sync' or 'man taskrc'
# Here is an example of entries that use the default, override and blank values
# variable=foo -- By specifying a value, this overrides the default
# variable= -- By specifying no value, this means no default
# #variable=foo -- By commenting out the line, or deleting it, this uses the default
# You can also refence environment variables:
# variable=$HOME/task
# variable=$VALUE
# Use the command 'task show' to see all defaults and overrides
# Files
data.location=$XDG_DATA_HOME/task/
# To use the default location of the XDG directories,
# move this configuration file from ~/.taskrc to ~/.config/task/taskrc and uncomment below
#data.location=$XDG_DATA_HOME/task
#hooks.location=~/.config/task/hooks
# Color theme (uncomment one to use)
#include light-16.theme
#include light-256.theme
#include dark-16.theme
#include dark-256.theme
#include dark-red-256.theme
#include dark-green-256.theme
#include dark-blue-256.theme
#include dark-violets-256.theme
#include dark-yellow-green.theme
#include dark-gray-256.theme
#include dark-gray-blue-256.theme
#include solarized-dark-256.theme
#include solarized-light-256.theme
#include no-color.theme
weekstart=monday
news.version=2.6.0

View File

@@ -51,17 +51,35 @@ bind N new-window
# Plugins related configurations
## https://github.com/jaclu/tmux-menus
set -g @menus_trigger 'm'
## https://github.com/catppuccin/tmux
set -g @catppuccin_flavour 'mocha' # latte/frappe/macchiato/mocha
set -g @catppuccin_window_tabs_enabled on # or off to disable window_tabs
## https://github.com/tmux-plugins/tmux-continuum
set -g @continuum-restore 'on'
set -g @continuum-boot 'on'
set -g @continuum-boot-options 'iterm'
## https://github.com/tmux-plugins/tmux-resurrect
set -g @resurrect-strategy-nvim 'session'
## https://github.com/sainnhe/tmux-fzf
TMUX_FZF_LAUNCH_KEY="l"
## Install plugins, starting with plugin manager
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-sensible'
set -g @plugin 'jaclu/tmux-menus'
set -g @plugin 'christoomey/vim-tmux-navigator'
set -g @plugin 'tmux-plugins/tmux-yank'
set -g @plugin 'catppuccin/tmux'
set -g @plugin 'tmux-plugins/tmux-resurrect'
set -g @plugin 'tmux-plugins/tmux-continuum'
set -g @plugin 'tmux-plugins/tmux-sessionist'
set -g @plugin 'sainnhe/tmux-fzf'
# set vi-mode
set-window-option -g mode-keys vi

174
config/zsh/completion/_nb Normal file
View File

@@ -0,0 +1,174 @@
#compdef nb
###############################################################################
# __ _
# \ \ _ __ | |__
# \ \ | '_ \| '_ \
# / / | | | | |_) |
# /_/ |_| |_|_.__/
#
# [nb] Command line and local web note-taking, bookmarking, and archiving with
# plain text data storage, encryption, filtering and search, pinning, #tagging,
# Git-backed versioning and syncing, Pandoc-backed conversion, global and local
# notebooks, customizable color themes, [[wiki-style linking]], plugins, and
# more in a single portable, user-friendly script.
#
# https://github.com/xwmx/nb
###############################################################################
_nb_subcommands() {
# _nb_cache_completions()
#
# Usage:
# _nb_cache_completions <path>
#
# Description:
# Cache completions for `nb`. Generating completions can be slow and
# native shell caching doesn't appear to help.
_nb_cache_completions() {
local _cache_path="${1:-}"
[[ -z "${_cache_path:-}" ]] && return 0
# Remove outdated cache files.
local _base_cache_path="${_cache_path%-*}"
local __suffix=
for __suffix in "zsh" "v1"
do
if [[ -e "${_base_cache_path:?}-${__suffix:?}" ]]
then
rm -f "${_base_cache_path:?}-${__suffix:?}"
fi
done
# Rebuild completion cache.
local _commands=
IFS=$'\n' _commands=($(nb subcommands))
local _notebooks=
IFS=$'\n' _notebooks=($(nb notebooks --names --no-color --unarchived))
local _completions=()
IFS=$'\n' _completions=(${_commands[@]})
local _commands_cached=
local _notebooks_cached=
if [[ -e "${_cache_path}" ]]
then
local _counter=0
local __line=
while IFS= read -r __line
do
_counter=$((_counter+1))
if [[ "${_counter}" == 1 ]]
then
_commands_cached="${__line}"
elif [[ "${_counter}" == 2 ]]
then
_notebooks_cached="${__line}"
else
break
fi
done < "${_cache_path}"
fi
if [[ "${_commands_cached}" != "${_commands[*]:-}" ]] ||
[[ "${_notebooks_cached}" != "${_notebooks[*]:-}" ]]
then
# Construct <notebook>:<subcommand> completions.
local __notebook=
for __notebook in "${_notebooks[@]}"
do
local __command=
for __command in "${_commands[@]}"
do
if [[ -n "${__notebook:-}" ]] &&
[[ -n "${__command:-}" ]]
then
_completions+=("${__notebook}:${__command}")
fi
done
done
local _directory_path=
_directory_path="$(dirname "${_cache_path}")"
mkdir -p "${_directory_path}"
if [[ -f "${_cache_path:?}" ]]
then
rm -f "${_cache_path:?}"
fi
touch "${_cache_path:?}"
{
(IFS=$' '; printf "%s\\n" "${_commands[*]}")
(IFS=$' '; printf "%s\\n" "${_notebooks[*]}")
printf "%s\\n" "${_completions[@]}"
} >> "${_cache_path}"
fi
}
local _nb_dir=
_nb_dir="$(nb env | grep 'NB_DIR' | cut -d = -f 2)"
if [[ -z "${_nb_dir:?}" ]] ||
[[ ! -e "${_nb_dir}" ]]
then
return 0
elif [[ -L "${_nb_dir}" ]]
then
if hash "realpath" 2>/dev/null
then
_nb_dir="$(realpath "${_nb_dir}")"
else
_nb_dir="$(readlink "${_nb_dir}")"
fi
fi
if [[ ! -d "${_nb_dir}" ]]
then
return 0
fi
local _cache_path="${_nb_dir:?}/.cache/nb-completion-cache-v2"
local _completions_cached=()
if [[ ! -e "${_cache_path}" ]]
then
_nb_cache_completions "${_cache_path}"
fi
if [[ -e "${_cache_path}" ]]
then
local _counter=0
local __line=
while IFS= read -r __line
do
_counter=$((_counter+1))
if [[ "${_counter}" -gt 2 ]]
then
_completions_cached+=("${__line}")
fi
done < "${_cache_path}"
(_nb_cache_completions "${_cache_path}" &)
fi
if [[ "${?}" -eq 0 ]]
then
compadd -- "${_completions_cached[@]}"
return 0
else
return 1
fi
}
_nb_subcommands "$@"

View File

@@ -0,0 +1,27 @@
# shellcheck shell=zsh
# Source: https://github.com/nvm-sh/nvm#zsh
# place this after nvm initialization!
autoload -U add-zsh-hook
load-nvmrc() {
local nvmrc_path
nvmrc_path="$(nvm_find_nvmrc)"
if [ -n "$nvmrc_path" ]; then
local nvmrc_node_version
nvmrc_node_version=$(nvm version "$(cat "${nvmrc_path}")")
if [ "$nvmrc_node_version" = "N/A" ]; then
nvm install
elif [ "$nvmrc_node_version" != "$(nvm version)" ]; then
nvm use
fi
elif [ -n "$(PWD=$OLDPWD nvm_find_nvmrc)" ] && [ "$(nvm version)" != "$(nvm version default)" ]; then
echo "Reverting to nvm default version"
nvm use default
fi
}
add-zsh-hook chpwd load-nvmrc
load-nvmrc

316
docs/tmux-keybindings.md Normal file
View File

@@ -0,0 +1,316 @@
# tmux keybindings
Leader: `<ctrl><space>`
```
bind-key -T copy-mode C-Space send-keys -X begin-selection
bind-key -T copy-mode C-a send-keys -X start-of-line
bind-key -T copy-mode C-b send-keys -X cursor-left
bind-key -T copy-mode C-c send-keys -X cancel
bind-key -T copy-mode C-e send-keys -X end-of-line
bind-key -T copy-mode C-f send-keys -X cursor-right
bind-key -T copy-mode C-g send-keys -X clear-selection
bind-key -T copy-mode C-k send-keys -X copy-pipe-end-of-line-and-cancel
bind-key -T copy-mode C-n send-keys -X cursor-down
bind-key -T copy-mode C-p send-keys -X cursor-up
bind-key -T copy-mode C-r command-prompt -i -I "#{pane_search_string}" -T search -p "(search up)" { send-keys -X search-backward-incremental "%%" }
bind-key -T copy-mode C-s command-prompt -i -I "#{pane_search_string}" -T search -p "(search down)" { send-keys -X search-forward-incremental "%%" }
bind-key -T copy-mode C-v send-keys -X page-down
bind-key -T copy-mode C-w send-keys -X copy-pipe-and-cancel
bind-key -T copy-mode Escape send-keys -X cancel
bind-key -T copy-mode Space send-keys -X page-down
bind-key -T copy-mode ! send-keys -X copy-pipe-and-cancel "tr -d '
' | pbcopy"
bind-key -T copy-mode , send-keys -X jump-reverse
bind-key -T copy-mode \; send-keys -X jump-again
bind-key -T copy-mode F command-prompt -1 -p "(jump backward)" { send-keys -X jump-backward "%%" }
bind-key -T copy-mode N send-keys -X search-reverse
bind-key -T copy-mode P send-keys -X toggle-position
bind-key -T copy-mode R send-keys -X rectangle-toggle
bind-key -T copy-mode T command-prompt -1 -p "(jump to backward)" { send-keys -X jump-to-backward "%%" }
bind-key -T copy-mode X send-keys -X set-mark
bind-key -T copy-mode Y send-keys -X copy-pipe-and-cancel "tmux paste-buffer"
bind-key -T copy-mode f command-prompt -1 -p "(jump forward)" { send-keys -X jump-forward "%%" }
bind-key -T copy-mode g command-prompt -p "(goto line)" { send-keys -X goto-line "%%" }
bind-key -T copy-mode n send-keys -X search-again
bind-key -T copy-mode q send-keys -X cancel
bind-key -T copy-mode r send-keys -X refresh-from-pane
bind-key -T copy-mode t command-prompt -1 -p "(jump to forward)" { send-keys -X jump-to-forward "%%" }
bind-key -T copy-mode y send-keys -X copy-pipe-and-cancel pbcopy
bind-key -T copy-mode MouseDown1Pane select-pane
bind-key -T copy-mode MouseDrag1Pane select-pane \; send-keys -X begin-selection
bind-key -T copy-mode MouseDragEnd1Pane send-keys -X copy-pipe-and-cancel pbcopy
bind-key -T copy-mode WheelUpPane select-pane \; send-keys -X -N 5 scroll-up
bind-key -T copy-mode WheelDownPane select-pane \; send-keys -X -N 5 scroll-down
bind-key -T copy-mode DoubleClick1Pane select-pane \; send-keys -X select-word \; run-shell -d 0.3 \; send-keys -X copy-pipe-and-cancel
bind-key -T copy-mode TripleClick1Pane select-pane \; send-keys -X select-line \; run-shell -d 0.3 \; send-keys -X copy-pipe-and-cancel
bind-key -T copy-mode Home send-keys -X start-of-line
bind-key -T copy-mode End send-keys -X end-of-line
bind-key -T copy-mode NPage send-keys -X page-down
bind-key -T copy-mode PPage send-keys -X page-up
bind-key -T copy-mode Up send-keys -X cursor-up
bind-key -T copy-mode Down send-keys -X cursor-down
bind-key -T copy-mode Left send-keys -X cursor-left
bind-key -T copy-mode Right send-keys -X cursor-right
bind-key -T copy-mode M-C-b send-keys -X previous-matching-bracket
bind-key -T copy-mode M-C-f send-keys -X next-matching-bracket
bind-key -T copy-mode M-1 command-prompt -N -I 1 -p (repeat) { send-keys -N "%%" }
bind-key -T copy-mode M-2 command-prompt -N -I 2 -p (repeat) { send-keys -N "%%" }
bind-key -T copy-mode M-3 command-prompt -N -I 3 -p (repeat) { send-keys -N "%%" }
bind-key -T copy-mode M-4 command-prompt -N -I 4 -p (repeat) { send-keys -N "%%" }
bind-key -T copy-mode M-5 command-prompt -N -I 5 -p (repeat) { send-keys -N "%%" }
bind-key -T copy-mode M-6 command-prompt -N -I 6 -p (repeat) { send-keys -N "%%" }
bind-key -T copy-mode M-7 command-prompt -N -I 7 -p (repeat) { send-keys -N "%%" }
bind-key -T copy-mode M-8 command-prompt -N -I 8 -p (repeat) { send-keys -N "%%" }
bind-key -T copy-mode M-9 command-prompt -N -I 9 -p (repeat) { send-keys -N "%%" }
bind-key -T copy-mode M-< send-keys -X history-top
bind-key -T copy-mode M-> send-keys -X history-bottom
bind-key -T copy-mode M-R send-keys -X top-line
bind-key -T copy-mode M-b send-keys -X previous-word
bind-key -T copy-mode M-f send-keys -X next-word-end
bind-key -T copy-mode M-m send-keys -X back-to-indentation
bind-key -T copy-mode M-r send-keys -X middle-line
bind-key -T copy-mode M-v send-keys -X page-up
bind-key -T copy-mode M-w send-keys -X copy-pipe-and-cancel
bind-key -T copy-mode M-x send-keys -X jump-to-mark
bind-key -T copy-mode M-y send-keys -X copy-pipe-and-cancel "pbcopy; tmux paste-buffer"
bind-key -T copy-mode "M-{" send-keys -X previous-paragraph
bind-key -T copy-mode "M-}" send-keys -X next-paragraph
bind-key -T copy-mode M-Up send-keys -X halfpage-up
bind-key -T copy-mode M-Down send-keys -X halfpage-down
bind-key -T copy-mode C-Up send-keys -X scroll-up
bind-key -T copy-mode C-Down send-keys -X scroll-down
bind-key -T copy-mode-vi C-b send-keys -X page-up
bind-key -T copy-mode-vi C-c send-keys -X cancel
bind-key -T copy-mode-vi C-d send-keys -X halfpage-down
bind-key -T copy-mode-vi C-e send-keys -X scroll-down
bind-key -T copy-mode-vi C-f send-keys -X page-down
bind-key -T copy-mode-vi C-h select-pane -L
bind-key -T copy-mode-vi C-j select-pane -D
bind-key -T copy-mode-vi C-k select-pane -U
bind-key -T copy-mode-vi C-l select-pane -R
bind-key -T copy-mode-vi Enter send-keys -X copy-pipe-and-cancel
bind-key -T copy-mode-vi C-u send-keys -X halfpage-up
bind-key -T copy-mode-vi C-v send-keys -X rectangle-toggle
bind-key -T copy-mode-vi C-y send-keys -X scroll-up
bind-key -T copy-mode-vi Escape send-keys -X clear-selection
bind-key -T copy-mode-vi C-\ select-pane -l
bind-key -T copy-mode-vi Space send-keys -X begin-selection
bind-key -T copy-mode-vi ! send-keys -X copy-pipe-and-cancel "tr -d '
' | pbcopy"
bind-key -T copy-mode-vi \# send-keys -FX search-backward "#{copy_cursor_word}"
bind-key -T copy-mode-vi \$ send-keys -X end-of-line
bind-key -T copy-mode-vi \% send-keys -X next-matching-bracket
bind-key -T copy-mode-vi * send-keys -FX search-forward "#{copy_cursor_word}"
bind-key -T copy-mode-vi , send-keys -X jump-reverse
bind-key -T copy-mode-vi / command-prompt -T search -p "(search down)" { send-keys -X search-forward "%%" }
bind-key -T copy-mode-vi 0 send-keys -X start-of-line
bind-key -T copy-mode-vi 1 command-prompt -N -I 1 -p (repeat) { send-keys -N "%%" }
bind-key -T copy-mode-vi 2 command-prompt -N -I 2 -p (repeat) { send-keys -N "%%" }
bind-key -T copy-mode-vi 3 command-prompt -N -I 3 -p (repeat) { send-keys -N "%%" }
bind-key -T copy-mode-vi 4 command-prompt -N -I 4 -p (repeat) { send-keys -N "%%" }
bind-key -T copy-mode-vi 5 command-prompt -N -I 5 -p (repeat) { send-keys -N "%%" }
bind-key -T copy-mode-vi 6 command-prompt -N -I 6 -p (repeat) { send-keys -N "%%" }
bind-key -T copy-mode-vi 7 command-prompt -N -I 7 -p (repeat) { send-keys -N "%%" }
bind-key -T copy-mode-vi 8 command-prompt -N -I 8 -p (repeat) { send-keys -N "%%" }
bind-key -T copy-mode-vi 9 command-prompt -N -I 9 -p (repeat) { send-keys -N "%%" }
bind-key -T copy-mode-vi : command-prompt -p "(goto line)" { send-keys -X goto-line "%%" }
bind-key -T copy-mode-vi \; send-keys -X jump-again
bind-key -T copy-mode-vi ? command-prompt -T search -p "(search up)" { send-keys -X search-backward "%%" }
bind-key -T copy-mode-vi A send-keys -X append-selection-and-cancel
bind-key -T copy-mode-vi B send-keys -X previous-space
bind-key -T copy-mode-vi D send-keys -X copy-pipe-end-of-line-and-cancel
bind-key -T copy-mode-vi E send-keys -X next-space-end
bind-key -T copy-mode-vi F command-prompt -1 -p "(jump backward)" { send-keys -X jump-backward "%%" }
bind-key -T copy-mode-vi G send-keys -X history-bottom
bind-key -T copy-mode-vi H send-keys -X top-line
bind-key -T copy-mode-vi J send-keys -X scroll-down
bind-key -T copy-mode-vi K send-keys -X scroll-up
bind-key -T copy-mode-vi L send-keys -X bottom-line
bind-key -T copy-mode-vi M send-keys -X middle-line
bind-key -T copy-mode-vi N send-keys -X search-reverse
bind-key -T copy-mode-vi P send-keys -X toggle-position
bind-key -T copy-mode-vi T command-prompt -1 -p "(jump to backward)" { send-keys -X jump-to-backward "%%" }
bind-key -T copy-mode-vi V send-keys -X select-line
bind-key -T copy-mode-vi W send-keys -X next-space
bind-key -T copy-mode-vi X send-keys -X set-mark
bind-key -T copy-mode-vi Y send-keys -X copy-pipe-and-cancel "tmux paste-buffer"
bind-key -T copy-mode-vi ^ send-keys -X back-to-indentation
bind-key -T copy-mode-vi b send-keys -X previous-word
bind-key -T copy-mode-vi e send-keys -X next-word-end
bind-key -T copy-mode-vi f command-prompt -1 -p "(jump forward)" { send-keys -X jump-forward "%%" }
bind-key -T copy-mode-vi g send-keys -X history-top
bind-key -T copy-mode-vi h send-keys -X cursor-left
bind-key -T copy-mode-vi j send-keys -X cursor-down
bind-key -T copy-mode-vi k send-keys -X cursor-up
bind-key -T copy-mode-vi l send-keys -X cursor-right
bind-key -T copy-mode-vi n send-keys -X search-again
bind-key -T copy-mode-vi o send-keys -X other-end
bind-key -T copy-mode-vi q send-keys -X cancel
bind-key -T copy-mode-vi r send-keys -X refresh-from-pane
bind-key -T copy-mode-vi t command-prompt -1 -p "(jump to forward)" { send-keys -X jump-to-forward "%%" }
bind-key -T copy-mode-vi v send-keys -X begin-selection
bind-key -T copy-mode-vi w send-keys -X next-word
bind-key -T copy-mode-vi y send-keys -X copy-pipe-and-cancel pbcopy
bind-key -T copy-mode-vi \{ send-keys -X previous-paragraph
bind-key -T copy-mode-vi \} send-keys -X next-paragraph
bind-key -T copy-mode-vi MouseDown1Pane select-pane
bind-key -T copy-mode-vi MouseDrag1Pane select-pane \; send-keys -X begin-selection
bind-key -T copy-mode-vi MouseDragEnd1Pane send-keys -X copy-pipe-and-cancel pbcopy
bind-key -T copy-mode-vi WheelUpPane select-pane \; send-keys -X -N 5 scroll-up
bind-key -T copy-mode-vi WheelDownPane select-pane \; send-keys -X -N 5 scroll-down
bind-key -T copy-mode-vi DoubleClick1Pane select-pane \; send-keys -X select-word \; run-shell -d 0.3 \; send-keys -X copy-pipe-and-cancel
bind-key -T copy-mode-vi TripleClick1Pane select-pane \; send-keys -X select-line \; run-shell -d 0.3 \; send-keys -X copy-pipe-and-cancel
bind-key -T copy-mode-vi BSpace send-keys -X cursor-left
bind-key -T copy-mode-vi NPage send-keys -X page-down
bind-key -T copy-mode-vi PPage send-keys -X page-up
bind-key -T copy-mode-vi Up send-keys -X cursor-up
bind-key -T copy-mode-vi Down send-keys -X cursor-down
bind-key -T copy-mode-vi Left send-keys -X cursor-left
bind-key -T copy-mode-vi Right send-keys -X cursor-right
bind-key -T copy-mode-vi M-x send-keys -X jump-to-mark
bind-key -T copy-mode-vi M-y send-keys -X copy-pipe-and-cancel "pbcopy; tmux paste-buffer"
bind-key -T copy-mode-vi C-Up send-keys -X scroll-up
bind-key -T copy-mode-vi C-Down send-keys -X scroll-down
bind-key -T join-pane \" run-shell "'/Users/ivuorinen/.config/tmux/plugins/tmux-sessionist/scripts/join_pane.sh' 'join-pane' '-b' '-v'"
bind-key -T join-pane \% run-shell "'/Users/ivuorinen/.config/tmux/plugins/tmux-sessionist/scripts/join_pane.sh' 'join-pane' '-b' '-h'"
bind-key -T join-pane - run-shell "'/Users/ivuorinen/.config/tmux/plugins/tmux-sessionist/scripts/join_pane.sh' 'join-pane' '-b' '-v'"
bind-key -T join-pane @ run-shell "'/Users/ivuorinen/.config/tmux/plugins/tmux-sessionist/scripts/join_pane.sh' 'join-pane' '-b' '-b'"
bind-key -T join-pane f run-shell "'/Users/ivuorinen/.config/tmux/plugins/tmux-sessionist/scripts/join_pane.sh' 'join-pane' '-b' '-b'"
bind-key -T join-pane h run-shell "'/Users/ivuorinen/.config/tmux/plugins/tmux-sessionist/scripts/join_pane.sh' 'join-pane' '-b' '-h'"
bind-key -T join-pane v run-shell "'/Users/ivuorinen/.config/tmux/plugins/tmux-sessionist/scripts/join_pane.sh' 'join-pane' '-b' '-v'"
bind-key -T join-pane | run-shell "'/Users/ivuorinen/.config/tmux/plugins/tmux-sessionist/scripts/join_pane.sh' 'join-pane' '-b' '-h'"
bind-key -T prefix C-Space run-shell "/Users/ivuorinen/.config/tmux/plugins/tmux-sessionist/scripts/promote_window.sh '#{session_name}' '#{window_id}' '#{window_name}' '#{pane_current_path}'"
bind-key -T prefix C-n next-window
bind-key -T prefix C-o rotate-window
bind-key -T prefix C-p previous-window
bind-key -T prefix C-r run-shell /Users/ivuorinen/.config/tmux/plugins/tmux-resurrect/scripts/restore.sh
bind-key -T prefix C-s run-shell /Users/ivuorinen/.config/tmux/plugins/tmux-resurrect/scripts/save.sh
bind-key -T prefix C-z suspend-client
bind-key -T prefix Escape copy-mode
bind-key -T prefix Space next-layout
bind-key -T prefix ! break-pane
bind-key -T prefix \" split-window -v -c "#{pane_current_path}"
bind-key -T prefix \# list-buffers
bind-key -T prefix \$ command-prompt -I "#S" { rename-session "%%" }
bind-key -T prefix \% split-window -h -c "#{pane_current_path}"
bind-key -T prefix & confirm-before -p "kill-window #W? (y/n)" kill-window
bind-key -T prefix \' command-prompt -T window-target -p index { select-window -t ":%%" }
bind-key -T prefix ( switch-client -p
bind-key -T prefix ) switch-client -n
bind-key -T prefix , command-prompt -I "#W" { rename-window "%%" }
bind-key -T prefix - delete-buffer
bind-key -T prefix . command-prompt -T target { move-window -t "%%" }
bind-key -T prefix / command-prompt -k -p key { list-keys -1N "%%" }
bind-key -T prefix 0 select-window -t :=0
bind-key -T prefix 1 select-window -t :=1
bind-key -T prefix 2 select-window -t :=2
bind-key -T prefix 3 select-window -t :=3
bind-key -T prefix 4 select-window -t :=4
bind-key -T prefix 5 select-window -t :=5
bind-key -T prefix 6 select-window -t :=6
bind-key -T prefix 7 select-window -t :=7
bind-key -T prefix 8 select-window -t :=8
bind-key -T prefix 9 select-window -t :=9
bind-key -T prefix : command-prompt
bind-key -T prefix \; last-pane
bind-key -T prefix < display-menu -T "#[align=centre]#{window_index}:#{window_name}" -x W -y W "#{?#{>:#{session_windows},1},,-}Swap Left" l { swap-window -t :-1 } "#{?#{>:#{session_windows},1},,-}Swap Right" r { swap-window -t :+1 } "#{?pane_marked_set,,-}Swap Marked" s { swap-window } '' Kill X { kill-window } Respawn R { respawn-window -k } "#{?pane_marked,Unmark,Mark}" m { select-pane -m } Rename n { command-prompt -F -I "#W" { rename-window -t "#{window_id}" "%%" } } '' "New After" w { new-window -a } "New At End" W { new-window }
bind-key -T prefix = choose-buffer -Z
bind-key -T prefix > display-menu -T "#[align=centre]#{pane_index} (#{pane_id})" -x P -y P "#{?#{m/r:(copy|view)-mode,#{pane_mode}},Go To Top,}" < { send-keys -X history-top } "#{?#{m/r:(copy|view)-mode,#{pane_mode}},Go To Bottom,}" > { send-keys -X history-bottom } '' "#{?mouse_word,Search For #[underscore]#{=/9/...:mouse_word},}" C-r { if-shell -F "#{?#{m/r:(copy|view)-mode,#{pane_mode}},0,1}" "copy-mode -t=" ; send-keys -X -t = search-backward "#{q:mouse_word}" } "#{?mouse_word,Type #[underscore]#{=/9/...:mouse_word},}" C-y { copy-mode -q ; send-keys -l "#{q:mouse_word}" } "#{?mouse_word,Copy #[underscore]#{=/9/...:mouse_word},}" c { copy-mode -q ; set-buffer "#{q:mouse_word}" } "#{?mouse_line,Copy Line,}" l { copy-mode -q ; set-buffer "#{q:mouse_line}" } '' "Horizontal Split" h { split-window -h } "Vertical Split" v { split-window -v } '' "#{?#{>:#{window_panes},1},,-}Swap Up" u { swap-pane -U } "#{?#{>:#{window_panes},1},,-}Swap Down" d { swap-pane -D } "#{?pane_marked_set,,-}Swap Marked" s { swap-pane } '' Kill X { kill-pane } Respawn R { respawn-pane -k } "#{?pane_marked,Unmark,Mark}" m { select-pane -m } "#{?#{>:#{window_panes},1},,-}#{?window_zoomed_flag,Unzoom,Zoom}" z { resize-pane -Z }
bind-key -T prefix ? list-keys -N
bind-key -T prefix @ run-shell "/Users/ivuorinen/.config/tmux/plugins/tmux-sessionist/scripts/promote_pane.sh '#{session_name}' '#{pane_id}' '#{pane_current_path}'"
bind-key -T prefix C run-shell /Users/ivuorinen/.config/tmux/plugins/tmux-sessionist/scripts/new_session_prompt.sh
bind-key -T prefix D choose-client -Z
bind-key -T prefix E select-layout -E
bind-key -T prefix I run-shell /Users/ivuorinen/.config/tmux/plugins/tpm/bindings/install_plugins
bind-key -T prefix L switch-client -l
bind-key -T prefix M select-pane -M
bind-key -T prefix N new-window
bind-key -T prefix R run-shell " tmux source-file /Users/ivuorinen/.config/tmux/tmux.conf > /dev/null; tmux display-message 'Sourced /Users/ivuorinen/.config/tmux/tmux.conf!'"
bind-key -T prefix S switch-client -l
bind-key -T prefix U run-shell /Users/ivuorinen/.config/tmux/plugins/tpm/bindings/update_plugins
bind-key -T prefix X run-shell "/Users/ivuorinen/.config/tmux/plugins/tmux-sessionist/scripts/kill_session_prompt.sh '#{session_name}' '#{session_id}'"
bind-key -T prefix Y run-shell -b /Users/ivuorinen/.config/tmux/plugins/tmux-yank/scripts/copy_pane_pwd.sh
bind-key -T prefix ] paste-buffer -p
bind-key -T prefix c new-window
bind-key -T prefix d detach-client
bind-key -T prefix f command-prompt { find-window -Z "%%" }
bind-key -T prefix g run-shell /Users/ivuorinen/.config/tmux/plugins/tmux-sessionist/scripts/goto_session.sh
bind-key -T prefix h select-pane -L
bind-key -T prefix i display-message
bind-key -T prefix j select-pane -D
bind-key -T prefix k select-pane -U
bind-key -T prefix l run-shell -b /Users/ivuorinen/.config/tmux/plugins/tmux-fzf/main.sh
bind-key -T prefix m run-shell /Users/ivuorinen/.config/tmux/plugins/tmux-menus/items/main.sh
bind-key -T prefix n next-window
bind-key -T prefix o select-pane -t :.+
bind-key -T prefix p paste-buffer
bind-key -T prefix q display-panes
bind-key -T prefix r source-file /Users/ivuorinen/.dotfiles/config/tmux/tmux.conf \; display-message "tmux cfg reloaded!"
bind-key -T prefix s choose-tree -Zs
bind-key -T prefix t run-shell "/Users/ivuorinen/.config/tmux/plugins/tmux-sessionist/scripts/join_pane.sh 'join-pane' '-b'"
bind-key -T prefix w choose-tree -Zw
bind-key -T prefix x confirm-before -p "kill-pane #P? (y/n)" kill-pane
bind-key -T prefix y run-shell -b /Users/ivuorinen/.config/tmux/plugins/tmux-yank/scripts/copy_line.sh
bind-key -T prefix z resize-pane -Z
bind-key -T prefix \{ swap-pane -U
bind-key -T prefix \} swap-pane -D
bind-key -T prefix \~ show-messages
bind-key -r -T prefix DC refresh-client -c
bind-key -T prefix PPage copy-mode -u
bind-key -r -T prefix Up select-pane -U
bind-key -r -T prefix Down select-pane -D
bind-key -r -T prefix Left select-pane -L
bind-key -r -T prefix Right select-pane -R
bind-key -T prefix M-1 select-layout even-horizontal
bind-key -T prefix M-2 select-layout even-vertical
bind-key -T prefix M-3 select-layout main-horizontal
bind-key -T prefix M-4 select-layout main-vertical
bind-key -T prefix M-5 select-layout tiled
bind-key -T prefix M-n next-window -a
bind-key -T prefix M-o rotate-window -D
bind-key -T prefix M-p previous-window -a
bind-key -T prefix M-u run-shell /Users/ivuorinen/.config/tmux/plugins/tpm/bindings/clean_plugins
bind-key -r -T prefix M-Up resize-pane -U 5
bind-key -r -T prefix M-Down resize-pane -D 5
bind-key -r -T prefix M-Left resize-pane -L 5
bind-key -r -T prefix M-Right resize-pane -R 5
bind-key -r -T prefix C-Up resize-pane -U
bind-key -r -T prefix C-Down resize-pane -D
bind-key -r -T prefix C-Left resize-pane -L
bind-key -r -T prefix C-Right resize-pane -R
bind-key -r -T prefix S-Up refresh-client -U 10
bind-key -r -T prefix S-Down refresh-client -D 10
bind-key -r -T prefix S-Left refresh-client -L 10
bind-key -r -T prefix S-Right refresh-client -R 10
bind-key -T root C-h if-shell "ps -o state= -o comm= -t '#{pane_tty}' | grep -iqE '^[^TXZ ]+ +(\S+\/)?g?(view|l?n?vim?x?)(diff)?$'" "send-keys C-h" "select-pane -L"
bind-key -T root C-j if-shell "ps -o state= -o comm= -t '#{pane_tty}' | grep -iqE '^[^TXZ ]+ +(\S+\/)?g?(view|l?n?vim?x?)(diff)?$'" "send-keys C-j" "select-pane -D"
bind-key -T root C-k if-shell "ps -o state= -o comm= -t '#{pane_tty}' | grep -iqE '^[^TXZ ]+ +(\S+\/)?g?(view|l?n?vim?x?)(diff)?$'" "send-keys C-k" "select-pane -U"
bind-key -T root C-l if-shell "ps -o state= -o comm= -t '#{pane_tty}' | grep -iqE '^[^TXZ ]+ +(\S+\/)?g?(view|l?n?vim?x?)(diff)?$'" "send-keys C-l" "select-pane -R"
bind-key -T root C-\ if-shell "ps -o state= -o comm= -t '#{pane_tty}' | grep -iqE '^[^TXZ ]+ +(S+/)?g?(view|l?n?vim?x?)(diff)?$'" "send-keys C-\\" "select-pane -l"
bind-key -T root MouseDown1Pane select-pane -t = \; send-keys -M
bind-key -T root MouseDown1Status select-window -t =
bind-key -T root MouseDown2Pane select-pane -t = \; if-shell -F "#{||:#{pane_in_mode},#{mouse_any_flag}}" { send-keys -M } { paste-buffer -p }
bind-key -T root MouseDown3Pane if-shell -F -t = "#{||:#{mouse_any_flag},#{&&:#{pane_in_mode},#{?#{m/r:(copy|view)-mode,#{pane_mode}},0,1}}}" { select-pane -t = ; send-keys -M } { display-menu -T "#[align=centre]#{pane_index} (#{pane_id})" -t = -x M -y M "#{?#{m/r:(copy|view)-mode,#{pane_mode}},Go To Top,}" < { send-keys -X history-top } "#{?#{m/r:(copy|view)-mode,#{pane_mode}},Go To Bottom,}" > { send-keys -X history-bottom } '' "#{?mouse_word,Search For #[underscore]#{=/9/...:mouse_word},}" C-r { if-shell -F "#{?#{m/r:(copy|view)-mode,#{pane_mode}},0,1}" "copy-mode -t=" ; send-keys -X -t = search-backward "#{q:mouse_word}" } "#{?mouse_word,Type #[underscore]#{=/9/...:mouse_word},}" C-y { copy-mode -q ; send-keys -l "#{q:mouse_word}" } "#{?mouse_word,Copy #[underscore]#{=/9/...:mouse_word},}" c { copy-mode -q ; set-buffer "#{q:mouse_word}" } "#{?mouse_line,Copy Line,}" l { copy-mode -q ; set-buffer "#{q:mouse_line}" } '' "Horizontal Split" h { split-window -h } "Vertical Split" v { split-window -v } '' "#{?#{>:#{window_panes},1},,-}Swap Up" u { swap-pane -U } "#{?#{>:#{window_panes},1},,-}Swap Down" d { swap-pane -D } "#{?pane_marked_set,,-}Swap Marked" s { swap-pane } '' Kill X { kill-pane } Respawn R { respawn-pane -k } "#{?pane_marked,Unmark,Mark}" m { select-pane -m } "#{?#{>:#{window_panes},1},,-}#{?window_zoomed_flag,Unzoom,Zoom}" z { resize-pane -Z } }
bind-key -T root MouseDown3Status display-menu -T "#[align=centre]#{window_index}:#{window_name}" -t = -x W -y W "#{?#{>:#{session_windows},1},,-}Swap Left" l { swap-window -t :-1 } "#{?#{>:#{session_windows},1},,-}Swap Right" r { swap-window -t :+1 } "#{?pane_marked_set,,-}Swap Marked" s { swap-window } '' Kill X { kill-window } Respawn R { respawn-window -k } "#{?pane_marked,Unmark,Mark}" m { select-pane -m } Rename n { command-prompt -F -I "#W" { rename-window -t "#{window_id}" "%%" } } '' "New After" w { new-window -a } "New At End" W { new-window }
bind-key -T root MouseDown3StatusLeft display-menu -T "#[align=centre]#{session_name}" -t = -x M -y W Next n { switch-client -n } Previous p { switch-client -p } '' Renumber N { move-window -r } Rename n { command-prompt -I "#S" { rename-session "%%" } } '' "New Session" s { new-session } "New Window" w { new-window }
bind-key -T root MouseDrag1Pane if-shell -F "#{||:#{pane_in_mode},#{mouse_any_flag}}" { send-keys -M } { copy-mode -M }
bind-key -T root MouseDrag1Border resize-pane -M
bind-key -T root WheelUpPane if-shell -F "#{||:#{pane_in_mode},#{mouse_any_flag}}" { send-keys -M } { copy-mode -e }
bind-key -T root WheelUpStatus previous-window
bind-key -T root WheelDownStatus next-window
bind-key -T root DoubleClick1Pane select-pane -t = \; if-shell -F "#{||:#{pane_in_mode},#{mouse_any_flag}}" { send-keys -M } { copy-mode -H ; send-keys -X select-word ; run-shell -d 0.3 ; send-keys -X copy-pipe-and-cancel }
bind-key -T root TripleClick1Pane select-pane -t = \; if-shell -F "#{||:#{pane_in_mode},#{mouse_any_flag}}" { send-keys -M } { copy-mode -H ; send-keys -X select-line ; run-shell -d 0.3 ; send-keys -X copy-pipe-and-cancel }
bind-key -T root M-H previous-window
bind-key -T root M-L next-window
bind-key -T root M-MouseDown3Pane display-menu -T "#[align=centre]#{pane_index} (#{pane_id})" -t = -x M -y M "#{?#{m/r:(copy|view)-mode,#{pane_mode}},Go To Top,}" < { send-keys -X history-top } "#{?#{m/r:(copy|view)-mode,#{pane_mode}},Go To Bottom,}" > { send-keys -X history-bottom } '' "#{?mouse_word,Search For #[underscore]#{=/9/...:mouse_word},}" C-r { if-shell -F "#{?#{m/r:(copy|view)-mode,#{pane_mode}},0,1}" "copy-mode -t=" ; send-keys -X -t = search-backward "#{q:mouse_word}" } "#{?mouse_word,Type #[underscore]#{=/9/...:mouse_word},}" C-y { copy-mode -q ; send-keys -l "#{q:mouse_word}" } "#{?mouse_word,Copy #[underscore]#{=/9/...:mouse_word},}" c { copy-mode -q ; set-buffer "#{q:mouse_word}" } "#{?mouse_line,Copy Line,}" l { copy-mode -q ; set-buffer "#{q:mouse_line}" } '' "Horizontal Split" h { split-window -h } "Vertical Split" v { split-window -v } '' "#{?#{>:#{window_panes},1},,-}Swap Up" u { swap-pane -U } "#{?#{>:#{window_panes},1},,-}Swap Down" d { swap-pane -D } "#{?pane_marked_set,,-}Swap Marked" s { swap-pane } '' Kill X { kill-pane } Respawn R { respawn-pane -k } "#{?pane_marked,Unmark,Mark}" m { select-pane -m } "#{?#{>:#{window_panes},1},,-}#{?window_zoomed_flag,Unzoom,Zoom}" z { resize-pane -Z }
bind-key -T root M-Up select-pane -U
bind-key -T root M-Down select-pane -D
bind-key -T root M-Left select-pane -L
bind-key -T root M-Right select-pane -R
bind-key -T root S-Left previous-window
bind-key -T root S-Right next-window
```

1
dotbot

Submodule dotbot deleted from 328bcb3259

View File

@@ -1,4 +1,4 @@
- include: 'hosts/defaults.yaml'
- include: "tools/dotbot-defaults.yaml"
- shell:
- echo "Configuring air"
- brewfile:

View File

@@ -1,4 +1,4 @@
- include: 'hosts/defaults.yaml'
- include: "tools/dotbot-defaults.yaml"
- shell:
- echo "Configuring lakka"
- link:

View File

@@ -1,4 +1,4 @@
- include: 'hosts/defaults.yaml'
- include: "tools/dotbot-defaults.yaml"
- shell:
- echo "Configuring tunkki"
- link:

View File

@@ -1,60 +1,11 @@
[include]
path = ~/.dotfiles/config/git/shared
[user]
name = Ismo Vuorinen
email = ismo.vuorinen@vincit.fi
signingkey = ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQDLyOvkr1nRqMVv3UAizmk6C+q40H4khvw7qIXXXyOyFmzjwYx/Cuxoi4uZVjX+q4qFYJ+c312uu6YXiEtfyoCao3wub8r1cLBQ3eIvuyWp2K8Ixcd9JmFmLmoeiENpJxqyr0WPZLDkrCWUZCsQQh8zzGFnfciUdUdTiZ7s21AEhhmFRSdFlVfQSlGMFxU321psg1YilcP80bDwFd1FsL4TssSkwlbgP/twqnpZ4436TTo7kp0UnH/RZkfRdDWScKHaWgncBG0CZeQxGWnRp8fvZn/7gDnthcZhvnDALVBE7QFuZ90GxqVw3IGpHryV0mFO6EGQ9Ke9YX7pKVZPUXZjeCN4SVKsqFdVJ6AjaSJ9K7nL98rYK7qNzndT3cKqPNgPteyXWRulH68A51ecQqHrjTttZcdN9hKt9uBHpzuXsby2QObT+VB4MNjZapa+YYF/WgwJCml4lzn2xMFg1vYZD78pfoJ9e5f2cL1MMlUSDb0TNxmEXfDQ77H/pRpKDz0=
[core]
excludesfile = ~/.config/git/gitignore
[alias]
reset-origin = !git fetch origin && git reset --hard origin/master && git clean -f -d
reset-upstream = !git fetch upstream && git reset --hard upstream/master && git clean -f -d
nah = !git reset --hard && git clean -df
undo-commit = reset HEAD~ --soft
llog = log --pretty=fuller
logs = log --graph --pretty=format:'%C(magenta)%h%Creset -%C(red)%d%Creset %s %C(dim green)(%cr) %C(cyan)<%an>%Creset' --abbrev-commit
rl = reflog --format='%C(auto)%h %<|(20)%gd %C(blue)%cr%C(reset) %gs (%s)'
tagdate = log --date-order --graph --tags --simplify-by-decoration --pretty=format:\"%ai %h %d\"
branchbydate = for-each-ref --count=30 --sort=-committerdate refs/heads/ --format='%(refname:short)'
branchcolor = "!for ref in $(git for-each-ref --sort=-committerdate --format=\"%(refname)\" refs/heads/ refs/remotes ); do git log -n1 $ref --pretty=format:\"%Cgreen%cr%Creset %C(yellow)%d%Creset %C(bold blue)<%an>%Creset%n\" | cat ; done | awk '! a[$0]++'"
[diff]
tool = difftastic
[difftool]
prompt = false
[difftool "difftastic"]
cmd = difft "$LOCAL" "$REMOTE"
[filter "lfs"]
clean = git-lfs clean -- %f
smudge = git-lfs smudge -- %f
process = git-lfs filter-process
required = true
[init]
defaultBranch = main
[pull]
rebase = true
[color]
ui = true
diff = auto
branch = auto
status = auto
[color "status"]
added = green bold
changed = yellow
deleted = red bold strike
untracked = cyan
branch = yellow black bold ul
[gpg]
format = ssh
[gpg "ssh"]
program = /Applications/1Password.app/Contents/MacOS/op-ssh-sign
allowedSignersFile = ~/.ssh/allowed_signers
@@ -69,7 +20,3 @@
[credential "https://gist.github.com"]
helper =
helper = !/opt/homebrew/bin/gh auth git-credential
[submodule]
recurse = true

View File

@@ -1,4 +1,4 @@
- include: 'hosts/defaults.yaml'
- include: "tools/dotbot-defaults.yaml"
- shell:
- echo "Configuring v"
- brewfile:

13
install
View File

@@ -3,12 +3,12 @@
set -e
CONFIG="install.conf.yaml"
DOTBOT_DIR="dotbot"
DOTBOT_DIR="tools/dotbot"
DOTBOT_BIN="bin/dotbot"
BASEDIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
DOTBOT_BIN_PATH="${BASEDIR}/${DOTBOT_DIR}/${DOTBOT_BIN}"
DOTBOT_HOST="$(hostname -s)" || ''
DOTBOT_HOST="$(hostname -s)"
cd "$BASEDIR"
git submodule sync --quiet --recursive
@@ -16,8 +16,8 @@ git submodule update --init --recursive
"${DOTBOT_BIN_PATH}" \
-d "${BASEDIR}" \
--plugin-dir=dotbot-brew \
--plugin-dir=dotbot-include \
--plugin-dir=tools/dotbot-brew \
--plugin-dir=tools/dotbot-include \
-c "${CONFIG}" \
"${@}"
@@ -28,9 +28,8 @@ if [ "${DOTBOT_HOST}" != "" ]; then
&& echo "(!) Found $DOTBOT_HOST_CONFIG" \
&& "$DOTBOT_BIN_PATH" \
-d "$BASEDIR" \
--plugin-dir=dotbot-brew \
--plugin-dir=dotbot-include \
--plugin-dir=tools/dotbot-brew \
--plugin-dir=tools/dotbot-include \
-c "$DOTBOT_HOST_CONFIG" \
"${@}"
fi

View File

@@ -1,4 +1,4 @@
- include: "hosts/defaults.yaml"
- include: "tools/dotbot-defaults.yaml"
- clean:
~/:
~/.config:
@@ -10,6 +10,8 @@
~/.cache/git:
~/.config:
~/.config/cheat/cheatsheets/personal:
~/.config/cheat/cheatsheets/pure-bash-bible:
~/.config/cheat/cheatsheets/tldr:
~/.local:
~/.local/run:
~/.local/share:

View File

@@ -28,6 +28,7 @@ function section_install
MENU=(
"all:Installs everything in the correct order"
"antigen:Updates the antigen.zsh file"
"cheat-databases:Install cheat external cheatsheet databases"
"composer:Install composer"
"dotenv:Install dotenv-linter"
"gh:Install GitHub CLI Extensions"
@@ -53,6 +54,7 @@ function section_install
$0 install fzf
$0 install gh
$0 install go
$0 install cheat-databases
$0 install imagick
$0 install neofetch
$0 install nvm
@@ -61,9 +63,15 @@ function section_install
$0 install z
;;
antigen)
curl -L git.io/antigen > "$DOTFILES/local/bin/antigen.zsh" \
curl -sSfL git.io/antigen -o "$DOTFILES/local/bin/antigen.zsh" \
&& msg_yay "New antigen installed!"
;;
cheat-databases)
for database in "$DOTFILES"/scripts/install-cheat-*; do
bash "$database" \
&& msg_yay "Cheat: $database run"
done
;;
composer)
bash "$DOTFILES/scripts/install-composer.sh" \
&& msg_yay "composer installed!"
@@ -92,7 +100,9 @@ function section_install
&& msg_yay "imagick installed!"
;;
starship)
curl -sS https://starship.rs/install.sh | sh -s -- --bin-dir ~/.local/bin \
curl -sS https://starship.rs/install.sh | sh -s -- \
--bin-dir ~/.local/bin \
--yes \
&& msg_yay "starship installed!"
;;
macos)
@@ -121,9 +131,7 @@ function section_install
bash "$DOTFILES/scripts/install-z.sh" \
&& msg_yay "z has been installed!"
;;
*)
menu_usage "$USAGE_PREFIX" "${MENU[@]}"
;;
*) menu_usage "$USAGE_PREFIX" "${MENU[@]}" ;;
esac
}
@@ -162,7 +170,23 @@ function section_brew
menu_usage "$USAGE_PREFIX" "${MENU[@]}"
;;
esac
} || menu_section "$USAGE_PREFIX" "brew not available on this system"
}
! have brew && menu_section "$USAGE_PREFIX" "brew not available on this system"
}
function section_docs
{
USAGE_PREFIX="$SCRIPT docs <command>"
MENU=(
"tmux:Update tmux keybindings documentation"
)
case "$1" in
tmux) bash "$DOTFILES/local/bin/x-dfm-docs-xterm-keybindings" ;;
*) menu_usage "$USAGE_PREFIX" "${MENU[@]}" ;;
esac
}
function section_dotfiles
@@ -196,8 +220,8 @@ function section_dotfiles
~/.config/astronvim \
~/.config/nvim
msg_ok "Deleted old nvim files"
ln -s $DOTFILES/config/astronvim ~/.config/astronvim
ln -s $DOTFILES/config/nvim ~/.config/nvim
ln -s "$DOTFILES/config/astronvim" ~/.config/astronvim
ln -s "$DOTFILES/config/nvim" ~/.config/nvim
msg_ok "Linked nvim and astronvim"
have npm && $0 install npm
msg_ok "Installed packages"
@@ -205,7 +229,8 @@ function section_dotfiles
;;
yamlfmt)
# format yaml files
have yamlfmt && yamlfmt -conf "$DOTFILES/.yamlfmt" || msg_err "yamlfmt not found"
have yamlfmt && yamlfmt -conf "$DOTFILES/.yamlfmt"
! have yamlfmt && msg_err "yamlfmt not found"
;;
shfmt)
# Format shell scripts according to following rules.
@@ -213,6 +238,7 @@ function section_dotfiles
-type f -perm +111 \
-not -path '*/.git/*' \
-not -path '*dotbot*' \
-not -path '*tmux*' \
-not -name '*.pl' \
-not -name '*.py' \
-not -name '*.php' \
@@ -224,9 +250,7 @@ function section_dotfiles
--binary-next-line {} \;
msg_yay "dotfiles have been shfmt formatted!"
;;
*)
menu_usage "$USAGE_PREFIX" "${MENU[@]}"
;;
*) menu_usage "$USAGE_PREFIX" "${MENU[@]}" ;;
esac
}
@@ -250,9 +274,7 @@ function section_check
[[ "$2" = "" ]] && echo "$X_HOSTNAME" && exit 0
[[ $X_HOSTNAME = "$2" ]] && exit 0 || exit 1
;;
*)
menu_usage "$USAGE_PREFIX" "${MENU[@]}"
;;
*) menu_usage "$USAGE_PREFIX" "${MENU[@]}" ;;
esac
}
@@ -282,9 +304,7 @@ function section_tests
msg_yay "msg_yay"
msg_yay_done "msg_yay_done"
;;
*)
menu_usage "$USAGE_PREFIX" "${MENU[@]}"
;;
*) menu_usage "$USAGE_PREFIX" "${MENU[@]}" ;;
esac
}
@@ -301,6 +321,8 @@ function usage
section_check
echo ""
section_dotfiles
echo ""
section_docs
}
# The main loop. first keyword after $0 triggers section, or help.
@@ -309,6 +331,7 @@ case "$1" in
brew) section_brew "$2" ;;
check) section_check "$2" ;;
dotfiles) section_dotfiles "$2" ;;
docs) section_docs "$2" ;;
tests) section_tests "$2" ;;
*) usage && exit 0 ;;
esac

BIN
local/bin/phpcs Executable file

Binary file not shown.

View File

@@ -13,11 +13,13 @@ if [ -z "${FILENAME}" ]; then
FILENAME=$DIRECTORY
fi
FILENAME=${FILENAME} \
| tr '/' _ \
| iconv -t ascii//TRANSLIT \
| sed -r s/[^a-zA-Z0-9]+/_/g \
| sed -r s/^_+\|-+$//g
FILENAME=$(
${FILENAME} \
| tr '/' _ \
| iconv -t ascii//TRANSLIT \
| sed -r s/[^a-zA-Z0-9]+/_/g \
| sed -r s/^_+\|-+$//g
)
TIMESTAMP=$(date "+%Y%m%d_%H%M%S")
FILENAME_TIMESTAMP="${FILENAME}_${TIMESTAMP}"

View File

@@ -0,0 +1,22 @@
#!/usr/bin/env bash
#
# x-xterm-update-keybindings
# Updates $HOME/.dotfiles/docs/tmux.md with my keybindings.
# shellcheck source=./../../scripts/shared.sh
source "$HOME/.dotfiles/scripts/shared.sh"
have tmux || {
msg_err "tmux not found" && exit 0
}
TMUX_KEYBINDINGS_DOCS="$DOTFILES/docs/tmux-keybindings.md"
CB="\n\`\`\`\n"
KB=$(tmux list-keys)
H="# tmux keybindings\n"
L="\n\nLeader: \`<ctrl><space>\`\n\n"
msg "Outputting tmux keybindings to $TMUX_KEYBINDINGS_DOCS"
echo -e "${H}${L}${CB}${KB}${CB}" > "$TMUX_KEYBINDINGS_DOCS"
msg_done "Done!"

View File

@@ -8,24 +8,24 @@ $quota = '';
$output = [];
$fsCharLenght = 0;
if ($debug) {
$quota = "Disk quotas for user viir (uid 2913):
Filesystem blocks quota limit grace files quota limit grace
10.0.0.89:/www/webroots/2 8277615 52428800 52428800 0 0 0
10.0.0.179:/users1/users/2 1999431 52428800 52428800 0 0 0
10.0.0.90:/siilo/2 24835106 524288000 524288000 0 0 0";
} else {
// $quota = system("quota -w");
$quota = shell_exec("quota -w");
}
$quota = shell_exec("quota -w");
function pad($i, $n = 3, $p = ' ') {
/**
* Pad string
*
* @param string $i Input string
* @param int $n Length
* @param string $p Padding string
* @return string
*/
function pad($i, $n = 3, $p = ' ')
{
return str_pad($i, $n, $p, STR_PAD_LEFT);
}
if (empty($quota)) {
var_dump($quota);
die("quota was empty\n");
var_dump($quota);
die("quota was empty\n");
}
$quota = explode("\n", $quota);
@@ -41,34 +41,34 @@ foreach ($quota as $lineNum => $line) {
if (count($values) != 4) {
continue;
}
$result = array_combine(['fs', 'used', 'quota', 'limit'], $values);
$result['used_percentage'] = round($result['used'] / $result['quota'] * 100, 3);
$result['used_gb'] = round($result['used'] / 1024 / 1024, 2);
$result['quota_gb'] = round($result['quota'] / 1024 / 1024, 2);
$char = strlen($result['fs']);
if ($char > $fsCharLenght) {
$fsCharLenght = $char;
}
$output[] = $result;
}
if (!empty($output)) {
$header = sprintf("%s | %s | %s | %s",
$header = sprintf(
"%s | %s | %s | %s",
str_pad("Mount", $fsCharLenght),
'Usage%',
'Used/Total',
'Bar'
);
$headerWidth = strlen($header);
echo "\n" . $header . "\n";
echo str_repeat('-', $headerWidth + 24) . "\n";
foreach ($output as $i) {
$barUsed = round($i['used_percentage']) / 4;
echo sprintf(
@@ -82,4 +82,3 @@ if (!empty($output)) {
echo "\n\n";
}

8
phpcs.xml Normal file
View File

@@ -0,0 +1,8 @@
<?xml version="1.0"?>
<ruleset name="PHP_CodeSniffer">
<description>PHP_CodeSniffer configuration</description>
<rule ref="PSR12">
<exclude name="PSR12.Operators.OperatorSpacing"/>
<exclude name="PSR1.Files.SideEffects.FoundWithSymbols"/>
</rule>
</ruleset>

View File

@@ -0,0 +1,55 @@
#!/usr/bin/env bash
# shellcheck disable=SC2231,SC2034,SC2181,SC2068
# shellcheck source=shared.sh
source "$HOME/.dotfiles/scripts/shared.sh"
PBB_REQUIRED_TOOLS=(basename git mkdir cheat ls grep head awk cp echo rm)
for t in ${PBB_REQUIRED_TOOLS[@]}; do
! have "$t" && echo "(!) $t is missing, can't continue..." && exit 1
done
PBB_GIT="https://github.com/dylanaraps/pure-bash-bible.git"
PBB_SOURCE="source: $PBB_GIT"
PBB_SYNTAX="syntax: bash"
PBB_TAGS="tags: [bash]"
PBB_TEMP_PREFIX=$(basename "$0")
PBB_TEMP_DIR="/tmp/pbb-$(rnd)"
# If there's no .git, clone the folder
if [ ! -d "$PBB_TEMP_DIR/.git" ]; then
msg_run "Starting to clone $PBB_GIT"
git clone --depth 1 --single-branch -q "$PBB_GIT" "$PBB_TEMP_DIR" \
&& msg_yay "Cloned $PBB_GIT"
fi
PBB_CHAPTERS=$(ls -1v "$PBB_TEMP_DIR"/manuscript/chapter*)
CHEAT_DEST="$(cheat -d | grep pure-bash-bible | head -1 | awk '{print $2}')"
if [ ! -d "$CHEAT_DEST" ]; then
mkdir -p "$CHEAT_DEST"
fi
for f in ${PBB_CHAPTERS[@]}; do
# get all headers, take the first one, strip the # and return the first word in lowercase
HEADER=$(grep -e '^[#] ' "$f" | head -1 | awk '{print tolower($2)}')
CHEAT_FILE="$CHEAT_DEST/${HEADER}"
if [ ! -f "$CHEAT_FILE" ]; then
cp "$f" "$CHEAT_FILE" && msg_run "$CHEAT_FILE"
fi
LC_ALL=C perl -pi.bak -e 's/\<\!-- CHAPTER END --\>//' "$CHEAT_FILE"
rm "$CHEAT_FILE.bak"
# add tags if the file doesn't have them
if [ '---' != "$(head -1 < "$CHEAT_FILE")" ]; then
T="$PBB_SYNTAX\n$PBB_TAGS\n$PBB_SOURCE\n"
echo -e "---\n$T---\n$(cat "$CHEAT_FILE")" > "$CHEAT_FILE"
fi
done
# Cleanup
if [ -d "$PBB_TEMP_DIR" ]; then
rm -rf "$PBB_TEMP_DIR"
fi

68
scripts/install-cheat-tldr.sh Executable file
View File

@@ -0,0 +1,68 @@
#!/usr/bin/env bash
# shellcheck disable=SC2231,SC2034,SC2181,SC2068
# shellcheck source=shared.sh
source "$HOME/.dotfiles/scripts/shared.sh"
TLDR_REQUIRED_TOOLS=(basename git mkdir cheat ls grep head awk cp echo rm)
for t in ${TLDR_REQUIRED_TOOLS[@]}; do
! have "$t" && echo "(!) $t is missing, can't continue..." && exit 1
done
TLDR_GIT="https://github.com/tldr-pages/tldr.git"
TLDR_SOURCE="source: $TLDR_GIT"
TLDR_SYNTAX="syntax: markdown"
TLDR_TEMP_PREFIX=$(basename "$0")
TLDR_TEMP_DIR="/tmp/cheat-tldr-$(rnd)"
# If there's no .git, clone the folder
if [ ! -d "$TLDR_TEMP_DIR/.git" ]; then
msg_run "Starting to clone $TLDR_GIT"
git clone --depth 1 --single-branch -q "$TLDR_GIT" "$TLDR_TEMP_DIR" \
&& msg_done "Cloned $TLDR_GIT"
fi
# Fetch the destination directory from cheat defined directories.
TLDR_CHEAT_DEST="$(cheat -d | grep tldr | head -1 | awk '{print $2}')"
[ "$TLDR_CHEAT_DEST" = "" ] \
&& msg_err "cheat doesn't know about the destination" \
&& exit 1
if [ ! -d "$TLDR_CHEAT_DEST" ]; then
mkdir -p "$TLDR_CHEAT_DEST"
fi
for d in "$TLDR_TEMP_DIR"/pages/*; do
DIRNAME=$(basename "$d")
# echo "-> $DIRNAME ($d)"
SECTION_DIR="${TLDR_CHEAT_DEST}/$DIRNAME"
TLDR_TAGS="tags: [$DIRNAME]"
if [ ! -d "$SECTION_DIR" ]; then
mkdir -p "$SECTION_DIR"
fi
for FILE in $d/*.md; do
BASENAME=$(basename "$FILE" .md)
FILENAME="${BASENAME%%.*}"
# echo "-> $FILE = $FILENAME"
TLDR_FILE="$SECTION_DIR/${FILENAME}"
# echo "-> dest: $TLDR_FILE"
if [ ! -f "$TLDR_FILE" ]; then
cp "$FILE" "$TLDR_FILE" && msg_run "$TLDR_FILE"
fi
if [ -f "$TLDR_FILE" ] && [ '---' != "$(head -1 < "$TLDR_FILE")" ]; then
echo -e "---\n$TLDR_SYNTAX\n$TLDR_TAGS\n$TLDR_SOURCE\n---\n$(cat "$TLDR_FILE")" > "$TLDR_FILE"
fi
done
done
# Cleanup
if [ -d "$TLDR_TEMP_DIR" ]; then
rm -rf "$TLDR_TEMP_DIR"
fi

View File

@@ -4,20 +4,20 @@
# shellcheck source="shared.sh"
source "$HOME/.dotfiles/scripts/shared.sh"
have php && {
EXPECTED_CHECKSUM="$(php -r 'copy("https://composer.github.io/installer.sig", "php://stdout");')"
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
ACTUAL_CHECKSUM="$(php -r "echo hash_file('sha384', 'composer-setup.php');")"
! have php && msg_err "PHP Not Available, cannot install composer" && exit 0
if [ "$EXPECTED_CHECKSUM" != "$ACTUAL_CHECKSUM" ]; then
echo >&2 'ERROR: Invalid installer checksum'
rm composer-setup.php
exit 1
fi
EXPECTED_CHECKSUM="$(php -r 'copy("https://composer.github.io/installer.sig", "php://stdout");')"
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
ACTUAL_CHECKSUM="$(php -r "echo hash_file('sha384', 'composer-setup.php');")"
php composer-setup.php --quiet
RESULT=$?
if [ "$EXPECTED_CHECKSUM" != "$ACTUAL_CHECKSUM" ]; then
echo >&2 'ERROR: Invalid installer checksum'
rm composer-setup.php
mv composer.phar ~/.local/bin/composer
exit $RESULT
} || msg_err "PHP Not Available, cannot install composer"
exit 1
fi
php composer-setup.php --quiet
RESULT=$?
rm composer-setup.php
mv composer.phar ~/.local/bin/composer
exit $RESULT

View File

@@ -10,8 +10,7 @@ FZF_PATH="${XDG_CONFIG_HOME}/fzf"
if [ ! -d "$FZF_PATH" ]; then
git clone --depth 1 "$FZF_GIT" "$FZF_PATH"
$FZF_PATH/install --xdg --all --no-update-rc
"$FZF_PATH/install" --xdg --all --no-update-rc
else
msg_done "fzf ($FZF_PATH/) already installed"
fi

View File

@@ -4,39 +4,41 @@
# shellcheck source="shared.sh"
source "$HOME/.dotfiles/scripts/shared.sh"
have gh && {
extensions=(
# GitHub CLI extension for generating a report on repository dependencies.
andyfeller/gh-dependency-report
# GitHub CLI extension to generate montage from GitHub user avatars
andyfeller/gh-montage
# An opinionated GitHub Cli extension for creating
# changelogs that adhere to the keep a changelog specification.
chelnak/gh-changelog
# Safely deletes local branches with no upstream and no un-pushed commits
davidraviv/gh-clean-branches
# A beautiful CLI dashboard for GitHub 🚀
dlvhdr/gh-dash
# A github-cli extension script to clone all repositories
# in an organization, optionally filtering by topic.
matt-bartel/gh-clone-org
# being an extension to view the overall health of
# an organization's use of actions
rsese/gh-actions-status
)
! have gh \
&& msg_err "gh (GitHub Client) could not be found, please install it first" \
&& exit 0
msg "Starting to install GitHub CLI extensions..."
extensions=(
# GitHub CLI extension for generating a report on repository dependencies.
andyfeller/gh-dependency-report
# GitHub CLI extension to generate montage from GitHub user avatars
andyfeller/gh-montage
# An opinionated GitHub Cli extension for creating
# changelogs that adhere to the keep a changelog specification.
chelnak/gh-changelog
# Safely deletes local branches with no upstream and no un-pushed commits
davidraviv/gh-clean-branches
# A beautiful CLI dashboard for GitHub 🚀
dlvhdr/gh-dash
# A github-cli extension script to clone all repositories
# in an organization, optionally filtering by topic.
matt-bartel/gh-clone-org
# being an extension to view the overall health of
# an organization's use of actions
rsese/gh-actions-status
)
for ext in "${extensions[@]}"; do
# Trim spaces
ext=${ext// /}
# Skip comments
if [[ ${ext:0:1} == "#" ]]; then continue; fi
msg "Starting to install GitHub CLI extensions..."
msg_run "Installing $ext"
gh extensions install "$ext"
echo ""
done
for ext in "${extensions[@]}"; do
# Trim spaces
ext=${ext// /}
# Skip comments
if [[ ${ext:0:1} == "#" ]]; then continue; fi
msg_ok "Done"
} || msg_err "gh (GitHub Client) could not be found, please install it first"
msg_run "Installing $ext"
gh extensions install "$ext"
echo ""
done
msg_ok "Done"

View File

@@ -4,34 +4,36 @@
# shellcheck source=shared.sh
source "$HOME/.dotfiles/scripts/shared.sh"
have go && {
packages=(
# sysadmin/scripting utilities, distributed as a single binary
github.com/skx/sysbox@latest
# Git Profile allows you to switch between user profiles in git repos
github.com/dotzero/git-profile@latest
# An extensible command line tool or library to format yaml files.
github.com/google/yamlfmt/cmd/yamlfmt@latest
# Parsing HTML at the command line
github.com/ericchiang/pup@latest
# HTML to Markdown converter
github.com/suntong/html2md@latest
# cheat allows you to create and view interactive cheatsheets on the cli.
github.com/cheat/cheat/cmd/cheat@latest
# Render markdown on the CLI, with pizzazz! 💅
github.com/charmbracelet/glow@latest
)
! have go && msg "go hasn't been installed yet." && exit 0
for pkg in "${packages[@]}"; do
# Trim spaces
pkg=${pkg// /}
# Skip comments
if [[ ${pkg:0:1} == "#" ]]; then continue; fi
packages=(
# sysadmin/scripting utilities, distributed as a single binary
github.com/skx/sysbox@latest
# Git Profile allows you to switch between user profiles in git repos
github.com/dotzero/git-profile@latest
# An extensible command line tool or library to format yaml files.
github.com/google/yamlfmt/cmd/yamlfmt@latest
# Parsing HTML at the command line
github.com/ericchiang/pup@latest
# HTML to Markdown converter
github.com/suntong/html2md@latest
# cheat allows you to create and view interactive cheatsheets on the cli.
github.com/cheat/cheat/cmd/cheat@latest
# Render markdown on the CLI, with pizzazz! 💅
github.com/charmbracelet/glow@latest
# Static checker for GitHub Actions workflow files
github.com/rhysd/actionlint/cmd/actionlint@latest
)
msg_run "Installing go package:" "$pkg"
go install "$pkg"
echo ""
done
for pkg in "${packages[@]}"; do
# Trim spaces
pkg=${pkg// /}
# Skip comments
if [[ ${pkg:0:1} == "#" ]]; then continue; fi
msg_ok "Done"
} || msg "go hasn't been installed yet."
msg_run "Installing go package:" "$pkg"
go install "$pkg"
echo ""
done
msg_ok "Done"

View File

@@ -4,36 +4,38 @@
# shellcheck source=shared.sh
source "$HOME/.dotfiles/scripts/shared.sh"
have npm && {
packages=(
# This is a tool to check if your files consider your .editorconfig rules.
"editorconfig-checker"
# Node module to create a release or a changelog from
# a tag and uses issues or commits to creating the release notes.
"github-release-notes"
"neovim"
"prettier"
"corepack"
"standardjs"
)
! have npm && msg_err "npm could not be found." && exit 0
for pkg in "${packages[@]}"; do
# Trim spaces
pkg=${pkg// /}
# Skip comments
if [[ ${pkg:0:1} == "#" ]]; then continue; fi
packages=(
# This is a tool to check if your files consider your .editorconfig rules.
"editorconfig-checker"
# Node module to create a release or a changelog from
# a tag and uses issues or commits to creating the release notes.
"github-release-notes"
"neovim"
"corepack"
# CLI and local web plain text notetaking, bookmarking, and archiving
# with linking, tagging, filtering, search, Git versioning & syncing,
# Pandoc conversion, + more, in a single portable script.
"nb.sh"
)
if [[ $(npm ls -g -p "$pkg") != "" ]]; then
msg_run_done "$pkg" "already installed"
else
msg_run "Installing npm package:" "$pkg"
npm install -g --no-fund --no-progress --no-timing "$pkg"
fi
for pkg in "${packages[@]}"; do
# Trim spaces
pkg=${pkg// /}
# Skip comments
if [[ ${pkg:0:1} == "#" ]]; then continue; fi
echo ""
done
if [[ $(npm ls -g -p "$pkg") != "" ]]; then
msg_run_done "$pkg" "already installed"
else
msg_run "Installing npm package:" "$pkg"
npm install -g --no-fund --no-progress --no-timing "$pkg"
fi
msg_run "Upgrading all global packages"
npm -g --no-progress --no-timing --no-fund outdated
npm -g --no-timing --no-fund upgrade
} || msg_err "npm could not be found."
echo ""
done
msg_run "Upgrading all global packages"
npm -g --no-progress --no-timing --no-fund outdated
npm -g --no-timing --no-fund upgrade

View File

@@ -6,32 +6,30 @@
source "$HOME/.dotfiles/scripts/shared.sh"
set -e
have ntfy && {
msg "ntfy already installed"
} || {
case $(dfm check arch) in
Linux)
NTFY_ARCH="linux_$(arch)"
;;
Darwin)
NTFY_ARCH="macOS_all"
;;
esac
have ntfy && msg "ntfy already installed" && exit 0
NTFY_VERSION=2.2.0
NTFY_URL="https://github.com/binwiederhier/ntfy"
NTFY_DEST="ntfy_${NTFY_VERSION}_${NTFY_ARCH}"
case $(dfm check arch) in
Linux)
NTFY_ARCH="linux_$(arch)"
;;
Darwin)
NTFY_ARCH="macOS_all"
;;
esac
curl -L "$NTFY_URL/releases/download/v${NTFY_VERSION}/${NTFY_DEST}.tar.gz" \
> "${NTFY_DEST}.tar.gz"
tar zxvf "${NTFY_DEST}.tar.gz"
cp -a "${NTFY_DEST}/ntfy" ~/.local/bin/ntfy
mkdir -p ~/.config/ntfy
NTFY_VERSION=2.2.0
NTFY_URL="https://github.com/binwiederhier/ntfy"
NTFY_DEST="ntfy_${NTFY_VERSION}_${NTFY_ARCH}"
# copy config only if it does not exist
if [ ! -f "$HOME/.config/ntfy/client.yml" ]; then
cp "${NTFY_DEST}/client/client.yml" ~/.config/ntfy/client.yml
fi
curl -L "$NTFY_URL/releases/download/v${NTFY_VERSION}/${NTFY_DEST}.tar.gz" \
> "${NTFY_DEST}.tar.gz"
tar zxvf "${NTFY_DEST}.tar.gz"
cp -a "${NTFY_DEST}/ntfy" ~/.local/bin/ntfy
mkdir -p ~/.config/ntfy
rm -rf "${NTFY_DEST}" "${NTFY_DEST}.tar.gz"
}
# copy config only if it does not exist
if [ ! -f "$HOME/.config/ntfy/client.yml" ]; then
cp "${NTFY_DEST}/client/client.yml" ~/.config/ntfy/client.yml
fi
rm -rf "${NTFY_DEST}" "${NTFY_DEST}.tar.gz"

View File

@@ -4,6 +4,12 @@
# Ismo Vuorinen <https://github.com/ivuorinen> 2018
#
[ "$(uname)" != "Darwin" ] && echo "Not a macOS system" && exit 0
! have xcode-select \
&& msg_err "xcode-select could not be found, skipping" \
&& exit 0
# Ask for the administrator password upfront
sudo -v
@@ -14,10 +20,12 @@ while true; do
kill -0 "$$" || exit
done 2> /dev/null &
# https://unix.stackexchange.com/a/408305
# check if user has git installed and propose to install if not installed
if [ "$(which git)" ]; then
echo "You already have git. Continuing..."
XCODE_TOOLS_PATH=$(xcode-select -p)
XCODE_SWIFT_PATH="$XCODE_TOOLS_PATH/usr/bin/swift"
# Modified from https://unix.stackexchange.com/a/408305
if [ -a "$XCODE_SWIFT_PATH" ]; then
echo "You have swift from xcode-select. Continuing..."
else
XCODE_MESSAGE="$(
osascript -e \
@@ -32,7 +40,7 @@ else
fi
fi
until [ "$(which git)" ]; do
until [ -f "$XCODE_SWIFT_PATH" ]; do
echo -n "."
sleep 1
done

View File

@@ -191,7 +191,8 @@ defaults write com.apple.finder FXInfoPanesExpanded -dict \
###############################################################################
# Set default screenshot location
#defaults write com.apple.screencapture "location" -string "~/Documents/Screenshots"
mkdir -p "$HOME/Documents/Screenshots"
defaults write com.apple.screencapture "location" -string "$HOME/Documents/Screenshots"
# Exclude date and time in screenshot filenames
defaults write com.apple.screencapture "include-date" -bool true
@@ -245,7 +246,10 @@ defaults write com.apple.Safari \
-bool true
# Dont display the annoying prompt when quitting iTerm
#defaults write com.googlecode.iterm2 PromptOnQuit -bool false
defaults write com.googlecode.iterm2 PromptOnQuit -bool false
# Use iTerm2 preferences from the .dotfiles folder.
defaults write com.googlecode.iterm2 PrefsCustomFolder \
-string "$HOME/.dotfiles/config/iterm2"
# Prevent Time Machine from prompting to use new hard drives as backup volume
defaults write com.apple.TimeMachine DoNotOfferNewDisksForBackup -bool true

View File

@@ -224,3 +224,9 @@ function path_prepend
path_remove "$1"
PATH="$1${PATH:+":$PATH"}"
}
# Creates a random string
rnd()
{
echo $RANDOM | md5sum | head -c 20
}

View File

@@ -0,0 +1,2 @@
ivuorinen@users.noreply.github.com ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQDLyOvkr1nRqMVv3UAizmk6C+q40H4khvw7qIXXXyOyFmzjwYx/Cuxoi4uZVjX+q4qFYJ+c312uu6YXiEtfyoCao3wub8r1cLBQ3eIvuyWp2K8Ixcd9JmFmLmoeiENpJxqyr0WPZLDkrCWUZCsQQh8zzGFnfciUdUdTiZ7s21AEhhmFRSdFlVfQSlGMFxU321psg1YilcP80bDwFd1FsL4TssSkwlbgP/twqnpZ4436TTo7kp0UnH/RZkfRdDWScKHaWgncBG0CZeQxGWnRp8fvZn/7gDnthcZhvnDALVBE7QFuZ90GxqVw3IGpHryV0mFO6EGQ9Ke9YX7pKVZPUXZjeCN4SVKsqFdVJ6AjaSJ9K7nL98rYK7qNzndT3cKqPNgPteyXWRulH68A51ecQqHrjTttZcdN9hKt9uBHpzuXsby2QObT+VB4MNjZapa+YYF/WgwJCml4lzn2xMFg1vYZD78pfoJ9e5f2cL1MMlUSDb0TNxmEXfDQ77H/pRpKDz0=
ismo.vuorinen@vincit.fi ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQDLyOvkr1nRqMVv3UAizmk6C+q40H4khvw7qIXXXyOyFmzjwYx/Cuxoi4uZVjX+q4qFYJ+c312uu6YXiEtfyoCao3wub8r1cLBQ3eIvuyWp2K8Ixcd9JmFmLmoeiENpJxqyr0WPZLDkrCWUZCsQQh8zzGFnfciUdUdTiZ7s21AEhhmFRSdFlVfQSlGMFxU321psg1YilcP80bDwFd1FsL4TssSkwlbgP/twqnpZ4436TTo7kp0UnH/RZkfRdDWScKHaWgncBG0CZeQxGWnRp8fvZn/7gDnthcZhvnDALVBE7QFuZ90GxqVw3IGpHryV0mFO6EGQ9Ke9YX7pKVZPUXZjeCN4SVKsqFdVJ6AjaSJ9K7nL98rYK7qNzndT3cKqPNgPteyXWRulH68A51ecQqHrjTttZcdN9hKt9uBHpzuXsby2QObT+VB4MNjZapa+YYF/WgwJCml4lzn2xMFg1vYZD78pfoJ9e5f2cL1MMlUSDb0TNxmEXfDQ77H/pRpKDz0=

1
tools/dotbot Submodule

Submodule tools/dotbot added at da928a4c6b

View File

@@ -4,6 +4,6 @@
link:
create: true
relink: true
exclude: ["*.md", "*renovate*"]
exclude: [ "*.md", "*renovate*", "LICENSE" ]
shell:
stdout: true