Compare commits

...

18 Commits

Author SHA1 Message Date
e7f078fe96 fix(nvim): merge mason ensure_installed defs 2023-11-16 15:34:22 +02:00
49778fe936 chore: update alacritty, nvim and tmux colors 2023-11-16 15:18:40 +02:00
6a718a41b1 feat(config): config loading changes and fixes 2023-11-16 14:07:22 +02:00
f392938e9e fix(dfm): have to x-have 2023-11-13 12:44:28 +02:00
7fb38fe8f3 feat(tmux): update theme, fix plugins, update docs 2023-11-13 12:44:09 +02:00
639cbe4939 chore(lint): dfm dotfiles fmt 2023-11-13 12:24:12 +02:00
1dc84a9cc5 chore(deps): updated Brewfile 2023-11-13 09:31:03 +02:00
6ae753d257 feat(cargo): added bottom 2023-11-13 09:28:37 +02:00
b7c9d4851a chore(scripts): mkd -> x-mkd 2023-11-13 09:28:15 +02:00
4699233d46 chore(shell): touching the paths again, no regrats 2023-11-13 09:25:58 +02:00
a5895abfa0 chore(config): update terraform config 2023-11-10 14:52:52 +02:00
fae34d10ef chore(config): update tmux config 2023-11-10 14:52:32 +02:00
c0448b5e7f feat(scripts): update pip install script 2023-11-10 14:51:57 +02:00
4d7cc568af feat(config): terraform configs 2023-11-10 14:06:58 +02:00
01a2815a68 chore(repo): added .nvmrc with lts/* 2023-11-10 08:38:54 +02:00
39e896f331 chore(deps): updated brewfile 2023-11-09 15:19:06 +02:00
622c8f991a chore(alias): wget 2023-11-07 07:20:44 +02:00
88894a33a5 feat(dfm): install latest lts node with nvm-latest 2023-11-07 07:20:02 +02:00
40 changed files with 389 additions and 612 deletions

1
.nvmrc Normal file
View File

@@ -0,0 +1 @@
lts/*

View File

@@ -18,11 +18,7 @@ export XDG_RUNTIME_DIR="$HOME/.local/run"
# Paths
export PATH="$XDG_BIN_HOME:$DOTFILES/local/bin:$HOME/.local/go/bin:$XDG_DATA_HOME/cargo/bin:$PATH"
# shellcheck source=scripts/shared.sh
# source "$DOTFILES/scripts/shared.sh"
source "$DOTFILES/config/exports"
source "$DOTFILES/config/alias"
x-load-configs
# shellcheck source=../config/fzf/fzf.bash
[ -f "${DOTFILES}/config/fzf/fzf.bash" ] &&
@@ -31,6 +27,10 @@ source "$DOTFILES/config/alias"
# Import ssh keys in keychain
ssh-add -A 2>/dev/null
x-have rbenv && {
eval "$(rbenv init - bash)"
}
# Enable the subsequent settings only in interactive sessions
case $- in
*i*) ;;

View File

@@ -14,28 +14,17 @@ export XDG_BIN_HOME="$HOME/.local/bin"
export XDG_CACHE_HOME="$HOME/.cache"
export XDG_RUNTIME_DIR="$HOME/.local/run"
export PATH="$XDG_BIN_HOME:$DOTFILES/local/bin:$HOME/.local/go/bin:$XDG_DATA_HOME/cargo/bin:$PATH"
export PATH="$XDG_BIN_HOME:$DOTFILES/local/bin:$HOME/.local/go/bin:$XDG_DATA_HOME/bob/nvim-bin:$XDG_DATA_HOME/cargo/bin:/opt/homebrew/bin:/usr/local/bin:$PATH"
source "$DOTFILES/config/exports"
source "$DOTFILES/config/alias"
source "$DOTFILES/config/functions"
source "$DOTFILES/scripts/shared.sh"
x-load-configs
export COMPLETION_WAITING_DOTS=true
path_append "/opt/homebrew/bin"
if type brew &> /dev/null; then
eval "$(brew shellenv)"
FPATH="$HOMEBREW_PREFIX/share/zsh/site-functions:${FPATH}"
fi
path_append "/usr/local/bin"
path_prepend "$XDG_DATA_HOME/cargo/bin"
path_prepend "$XDG_BIN_HOME"
path_prepend "$HOME/.local/go/bin"
path_prepend "$XDG_DATA_HOME/bob/nvim-bin"
export ZSH_CUSTOM_COMPLETION_PATH="$XDG_CONFIG_HOME/zsh/completion"
x-dc "$ZSH_CUSTOM_COMPLETION_PATH"
@@ -72,9 +61,9 @@ antigen bundle jreese/zsh-titles
antigen bundle zsh-users/zsh-completions
# these should be available if there's need
have brew && antigen bundle brew
have php && antigen bundle php
have python && antigen bundle MichaelAquilina/zsh-autoswitch-virtualenv
x-have brew && antigen bundle brew
x-have php && antigen bundle php
x-have python && antigen bundle MichaelAquilina/zsh-autoswitch-virtualenv
# nvm is a strange beast
zstyle ':omz:plugins:nvm' autoload yes
@@ -92,5 +81,26 @@ antigen apply
[ -f "${DOTFILES}/config/fzf/fzf.zsh" ] \
&& source "${DOTFILES}/config/fzf/fzf.zsh"
x-have op && {
eval "$(op completion zsh)"
compdef _op op
}
x-have rbenv && {
eval "$(rbenv init - zsh)"
}
# Autoupdate tmux window name
TMUX_WINDOW_NAME_PLUGIN="$DOTFILES/config/tmux/plugins/tmux-window-name/scripts/rename_session_windows.py"
[ -f "$TMUX_WINDOW_NAME_PLUGIN" ] && {
tmux-window-name()
{
($TMUX_WINDOW_NAME_PLUGIN &)
}
add-zsh-hook chpwd tmux-window-name
}
# Start starship
eval "$(starship init zsh)"
source $DOTFILES/config/alias

View File

@@ -19,8 +19,8 @@ env:
window:
dynamic_title: true
dimensions:
columns: 130
lines: 40
columns: 200
lines: 100
# Adds this many blank pixels of padding around the window
# Units are physical pixels; this is not DPI aware.
@@ -31,7 +31,7 @@ window:
decorations: buttonless
opacity: 0.97
opacity: 0.98
# When true, bold text is drawn using the bright variant of colors.
draw_bold_text_with_bright_colors: true
@@ -104,9 +104,9 @@ colors:
cyan: '0x7dcfff'
white: '0xc0caf5'
indexed_colors:
- { index: 16, color: '0xff9e64' }
- { index: 17, color: '0xdb4b4b' }
# indexed_colors:
# - { index: 16, color: '0xff9e64' }
# - { index: 17, color: '0xdb4b4b' }
key_bindings:
- { key: V, mods: Command, action: Paste }

View File

@@ -1,69 +1,15 @@
#!/usr/bin/env bash
# shellcheck source="../scripts/shared.sh"
# shellcheck disable=1091,2139
DOTFILES="$HOME/.dotfiles"
# Get installed php versions from brew and setup aliases
function x-set-php-aliases
{
x-have brew && {
local php_versions=()
while IFS="" read -r line; do php_versions+=("$line"); done < <(bkt -- brew list | grep '^php')
php_error_reporting='-d error_reporting=22527'
for version in "${php_versions[@]}"; do
# drop the dot from version (8.0 -> 80)
local php_abbr="${version//\./}"
# replace "php@" with "p" so "php@80" becomes "p80"
local php_alias="${php_abbr//php@/p}"
# Fetch the exec path once
php_exec="$(brew --prefix "$version")/bin/php"
# Raw PHP without error_reporting flag.
# shellcheck disable=SC2139
alias "${php_alias}"r="$php_exec"
# PHP with error_reporting flag.
# shellcheck disable=SC2139,SC2140
alias "$php_alias"="$php_exec $php_error_reporting"
# Local PHP Server.
# shellcheck disable=SC2139,SC2140
alias "${php_alias}s"="$php_exec -S localhost:9000"
# Use composer with specific PHP and error_reporting flag on.
# shellcheck disable=SC2139,SC2140
alias "${php_alias}c"="$php_exec $php_error_reporting $(which composer)"
done
}
}
if [[ $(uname) == 'Darwin' ]]; then
x-set-php-aliases
# Laravel Sail shortcut
alias sail='[ -f sail ] && bash sail || bash vendor/bin/sail'
# Flush Directory Service cache
alias flushdns="sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder"
# Lock the screen
alias afk="osascript -e 'tell application \"System Events\" to keystroke \"q\" using {command down,control down}'"
# Empty the Trash on all mounted volumes and the main HDD
# Also, clear Apples System Logs to improve shell startup speed
alias emptytrash="sudo rm -rfv /Volumes/*/.Trashes; sudo rm -rfv ~/.Trash; sudo rm -rfv /private/var/log/asl/*.asl"
fi
# Be nice
alias please="sudo "
# Color the grep output
alias grep='grep --color'
alias grep="grep --color"
! x-have eza && alias ls='ls --color=auto'
x-have eza && {
alias ls='eza -h -s=type --git --icons --group-directories-first'
alias ls="eza -h -s=type --git --icons --group-directories-first"
}
# Easier navigation: .., ..., ....
@@ -139,14 +85,27 @@ alias zedit='$EDITOR ~/.dotfiles'
alias irssi="irssi --config=$XDG_CONFIG_HOME/irssi/config --home=$XDG_CONFIG_HOME/irssi"
if [[ -f "$HOME/.aliases.local" ]]; then
# shellcheck disable=SC1091
source "$HOME/.aliases.local"
fi
alias wget=wget --hsts-file="$XDG_DATA_HOME/wget-hsts"
alias wget="wget --hsts-file=$XDG_DATA_HOME/wget-hsts"
alias svn="svn --config-dir $XDG_CONFIG_HOME/subversion"
if [[ $(uname) == 'Darwin' ]]; then
# Laravel Sail shortcut
alias sail='[ -f sail ] && bash sail || bash vendor/bin/sail'
# Flush Directory Service cache
alias flushdns="sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder"
# Lock the screen
alias afk="osascript -e 'tell application \"System Events\" to keystroke \"q\" using {command down,control down}'"
# Empty the Trash on all mounted volumes and the main HDD
# Also, clear Apple's System Logs to improve shell startup speed
alias emptytrash="sudo rm -rfv /Volumes/*/.Trashes; sudo rm -rfv ~/.Trash; sudo rm -rfv /private/var/log/asl/*.asl"
x-set-php-aliases
fi
# Alacritty preexec hook to update dynamic title
preexec()
{

View File

@@ -2,11 +2,6 @@
# shellcheck shell=bash
# vim: filetype=zsh
# if cargo directory exists, add it to path
if [[ -d "$HOME/.local/share/cargo/bin" ]]; then
export PATH="$HOME/.local/share/cargo/bin:$PATH"
fi
# Cache commands using bkt if installed
if command -v bkt >&/dev/null; then
bkt()
@@ -26,7 +21,7 @@ fi
# shorthand for checking if the system has the bin in path,
# this version does not use caching
# usage: have_command php && php -v
function have_command
have_command()
{
command -v "$1" >&/dev/null
}
@@ -34,21 +29,21 @@ function have_command
# shorthand for checking if the system has the bin in path,
# this version uses caching
# usage: have php && php -v
function have
have()
{
bkt -- which "$1" >&/dev/null
}
function brew_installed
brew_installed()
{
bkt -- brew list
}
# shorthand for checking if brew package is installed
# usage: have_brew php && php -v
function have_brew
have_brew()
{
! have brew && return 125
! x-have brew && return 125
if bkt -- brew list "$1" &> /dev/null; then
return 0
@@ -59,4 +54,3 @@ function have_brew
source "$DOTFILES/config/exports-shell"
source "$DOTFILES/config/exports-apps"

View File

@@ -21,15 +21,14 @@ x-dc "$ANSIBLE_GALAXY_CACHE_DIR"
export ANDROID_HOME="$XDG_DATA_HOME/android"
# bob manages nvim versions
x-path-prepend "$XDG_DATA_HOME/bob/nvim-bin"
x-have nvim && export EDITOR="nvim"
export PATH="$XDG_DATA_HOME/bob/nvim-bin:$PATH"
export HOMEBREW_NO_ENV_HINTS=true
# composer, https://getcomposer.org/
export COMPOSER_HOME="$XDG_STATE_HOME/composer"
export COMPOSER_BIN="$COMPOSER_HOME/vendor/bin"
x-path-append "$COMPOSER_BIN"
export PATH="$COMPOSER_BIN:$PATH"
# docker, https://docs.docker.com/engine/reference/commandline/cli/
export DOCKER_CONFIG="$XDG_CONFIG_HOME/docker"
@@ -55,17 +54,11 @@ export NB_DIR="$XDG_STATE_HOME/nb"
# NPM: Add npm packages to path
x-have node && {
NVM_NODE_BIN_DIR="$(dirname "$(which node)")"
x-path-append "$NVM_NODE_BIN_DIR"
export PATH="$NVM_NODE_BIN_DIR:$PATH"
}
# op (1Password cli) is present
export OP_CACHE="$XDG_STATE_HOME/1password"
x-have op && {
[ "$DOTFILES_CURRENT_SHELL" = "zsh" ] && {
eval "$(op completion zsh)"
compdef _op op
}
}
# Python
#
@@ -73,7 +66,7 @@ x-have op && {
export WORKON_HOME="$XDG_DATA_HOME/virtualenvs"
export PYENV_ROOT="$XDG_STATE_HOME/pyenv"
x-have pyenv && {
x-path-append "$PYENV_ROOT/shims"
export PATH="$PYENV_ROOT/shims:$PATH"
eval "$(pyenv init -)"
}
@@ -87,16 +80,12 @@ export BUNDLE_USER_CACHE="$XDG_CACHE_HOME"/bundle
export BUNDLE_USER_PLUGIN="$XDG_DATA_HOME"/bundle
export RBENV_ROOT="$XDG_STATE_HOME/rbenv"
x-dc "$RBENV_ROOT"
x-have gem && x-path-append "${GEM_HOME}/bin"
x-have rbenv && {
[ "$DOTFILES_CURRENT_SHELL" = "zsh" ] && eval "$(rbenv init - zsh)"
[ "$DOTFILES_CURRENT_SHELL" = "bash" ] && eval "$(rbenv init - bash)"
}
x-have gem && export PATH="${GEM_HOME}/bin:$PATH"
# Rust / cargo
export RUSTUP_HOME="$XDG_DATA_HOME/rustup"
export CARGO_HOME="$XDG_DATA_HOME/cargo"
x-path-append "$CARGO_HOME/bin"
export PATH="$CARGO_HOME/bin:$PATH"
# screen
export SCREENRC="$XDG_CONFIG_HOME/misc/screenrc"
@@ -104,6 +93,13 @@ export SCREENRC="$XDG_CONFIG_HOME/misc/screenrc"
# sonarlint
export SONARLINT_USER_HOME="$XDG_DATA_HOME/sonarlint"
# terraform
# https://www.terraform.io/docs/cli/config/config-file.html
# https://www.terraform.io/docs/cli/config/environment-variables.html
export TF_DATA_DIR="$XDG_STATE_HOME/terraform"
export TF_CLI_CONFIG_FILE="$XDG_CONFIG_HOME/terraform/terraformrc"
export TF_PLUGIN_CACHE_DIR="$XDG_CACHE_HOME/terraform/plugin-cache"
# tldr / tealdeer
export TEALDEER_CONFIG_DIR="$XDG_CONFIG_HOME/tealdeer/"

View File

@@ -1,9 +1,9 @@
# lakka exports
## LUA
have luarocks && $(luarocks path --bin)
x-have luarocks && $(luarocks path --bin)
path_prepend "$HOME/.local/go/bin"
export PATH="$HOME/.local/go/bin:$PATH"
alias logrotate='/usr/sbin/logrotate -s $HOME/logs/state'
alias nano='nano -wS -$'
@@ -17,4 +17,3 @@ export RVM_PATH="$HOME/.rvm"
export PATH="$RVM_PATH/bin:$PATH"
# shellcheck source=$HOME/.rvm/scripts/rvm
[[ -s "$RVM_PATH/scripts/rvm" ]] && source "$RVM_PATH/scripts/rvm" # Load RVM into a shell session *as a function*

View File

@@ -3,21 +3,6 @@
# shellcheck disable=1091,2046
# vim: filetype=bash
export DOTFILES="$HOME/.dotfiles"
# Explicitly set XDG folders
# https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html
export XDG_CONFIG_HOME="$HOME/.config"
export XDG_DATA_HOME="$HOME/.local/share"
export XDG_STATE_HOME="$HOME/.local/state"
# custom variables
export XDG_BIN_HOME="$HOME/.local/bin"
export XDG_CACHE_HOME="$HOME/.cache"
export XDG_RUNTIME_DIR="$HOME/.local/run"
export LC_ALL=fi_FI.UTF-8
# Bash completion file location
export BASH_COMPLETION_USER_FILE="${XDG_CONFIG_HOME}/bash-completion/bash_completion"
@@ -38,13 +23,13 @@ export HISTORY_IGNORE="(ls|cd|cd -|pwd|exit|date|* --help)"
export LESSHISTFILE="$XDG_STATE_HOME"/less/history
# Highlight section titles in manual pages
export LESS_TERMCAP_md="$ORANGE"
# export LESS_TERMCAP_md="$ORANGE"
# zsh autoloaded terminfo
export TERMINFO="$XDG_DATA_HOME"/terminfo
export TERMINFO_DIRS="$XDG_DATA_HOME"/terminfo:/usr/share/terminfo
export TERMINFO="${XDG_DATA_HOME}/terminfo"
export TERMINFO_DIRS="${XDG_DATA_HOME}/terminfo":/usr/share/terminfo
# Dont clear the screen after quitting a manual page
# Don't clear the screen after quitting a manual page
export MANPAGER="less -X"
# Always enable colored `grep` output
@@ -53,4 +38,3 @@ export GREP_OPTIONS="--color=auto"
# check the window size after each command and, if necessary,
# update the values of LINES and COLUMNS.
hash shopt 2> /dev/null && shopt -s checkwinsize

View File

@@ -1,3 +1,5 @@
#!/usr/bin/env bash
#
# shell functions
set -euo pipefail

View File

@@ -22,8 +22,6 @@ brew "ca-certificates"
brew "libyaml"
# Cryptography and SSL/TLS Toolkit
brew "openssl@3"
# Interpreted, interactive, object-oriented programming language
brew "python@3.11"
# Automate deployment, configuration, and upgrading
brew "ansible"
# Checks ansible playbooks for practices and behaviour
@@ -62,6 +60,8 @@ brew "coreutils"
brew "asdf"
# Spell checker with better logic than ispell
brew "aspell"
# Interpreted, interactive, object-oriented programming language
brew "python@3.11"
# Official Amazon AWS command-line interface
brew "awscli"
# Bourne-Again SHell, a UNIX command interpreter
@@ -208,8 +208,6 @@ brew "mas"
brew "mutt"
# NCurses Disk Usage
brew "ncdu"
# Ambitious Vim-fork focused on extensibility and agility
brew "neovim"
# HTTP(S) server and reverse proxy, and IMAP/POP3 proxy server
brew "nginx"
# Port scanning utility for large networks
@@ -246,8 +244,6 @@ brew "rbenv"
brew "rcm"
# Search tool like grep and The Silver Searcher
brew "ripgrep"
# Safe, concurrent, practical language
brew "rust"
# Static analysis and lint tool, for (ba)sh scripts
brew "shellcheck"
# Autoformat shell script source code
@@ -270,6 +266,8 @@ brew "terragrunt"
brew "testssl"
# Terraform version manager inspired by rbenv
brew "tfenv"
# Linter for Terraform files
brew "tflint"
# Static analysis security scanner for your terraform code
brew "tfsec"
# Programmatically correct mistyped console commands
@@ -368,6 +366,8 @@ cask "google-cloud-sdk"
cask "insomnia"
# JetBrains tools manager
cask "jetbrains-toolbox"
# End-to-end encryption software
cask "keybase"
# Kubernetes IDE
cask "lens"
# Keep all tasks from your todo apps on your menu bar
@@ -433,6 +433,7 @@ mas "LastPass", id: 926036361
mas "Numbers", id: 409203825
mas "Pages", id: 409201541
mas "Pixelmator Pro", id: 1289583905
mas "Final Cut Pro", id: 424389933
mas "Tailscale", id: 1475387142
mas "Xcode", id: 497799835
vscode "4ops.terraform"

View File

@@ -12,9 +12,14 @@ require("lazy").setup({
{
"LazyVim/LazyVim",
import = "lazyvim.plugins",
opts = {
colorscheme = "tokyonight",
},
},
{
"folke/tokyonight.nvim",
lazy = false,
priority = 1000,
opts = {
style = "night",
transparent = true,
@@ -23,6 +28,8 @@ require("lazy").setup({
sidebars = "transparent",
floats = "transparent",
},
dim_inactive = true,
lualine_bold = true,
},
},
{ import = "plugins" },

View File

@@ -15,6 +15,10 @@ return {
},
},
keys = {
{
"<leader>ba",
desc = "Annotations / Comments",
},
{
"<leader>baa",
function()
@@ -68,10 +72,12 @@ return {
-- Clarify and beautify your comments using boxes and lines.
-- https://github.com/LudoPinelli/comment-box.nvim
{ "LudoPinelli/comment-box.nvim", opts = {} },
-- Mason
-- https://github.com/williamboman/mason.nvim
{
"williamboman/mason.nvim",
opts = {
ensure_installed = {
opts = function(_, opts)
vim.list_extend(opts.ensure_installed, {
"actionlint",
"ansible-language-server",
"ansible-lint",
@@ -86,18 +92,24 @@ return {
"dockerfile-language-server",
"editorconfig-checker",
"fixjson",
"flake8",
"html-lsp",
"jq",
"jsonlint",
"luacheck",
"nginx-language-server",
"php-cs-fixer",
"phpcs",
"phpmd",
"semgrep",
"sonarlint-language-server",
"stylua",
"shellcheck",
"shfmt",
"flake8",
},
},
"sonarlint-language-server",
"stylelint",
"stylua",
"yamllint",
})
end,
},
-- Vim plugin for automatic time tracking and metrics generated from your programming activity.
-- https://github.com/wakatime/vim-wakatime

View File

@@ -1,24 +0,0 @@
return {
{
"williamboman/mason.nvim",
opts = {
ensure_installed = {
"actionlint",
"ansible-lint",
"bash-language-server",
"commitlint",
"flake8",
"intelephense",
"jsonlint",
"luacheck",
"phpcs",
"phpmd",
"shellcheck",
"shfmt",
"stylelint",
"stylua",
"yamllint",
},
},
},
}

View File

@@ -0,0 +1,2 @@
plugin_cache_dir = "$HOME/.cache/terraform/plugin-cache"

View File

@@ -67,6 +67,9 @@ bind p paste-buffer
# │ Settings │
# ╰──────────────────────────────────────────────────────────╯
# Setting status on
set -g status "on"
# Expose window title
set-option -g set-titles on
@@ -85,8 +88,25 @@ set-option -g renumber-windows on
# set vi-mode
set-window-option -g mode-keys vi
# Set theme to tokyonight
source-file ~/.dotfiles/config/tmux/tokyonight_storm.tmux
# ╭──────────────────────────────────────────────────────────╮
# │ Theme │
# ╰──────────────────────────────────────────────────────────╯
# Make sure status sides are long enough and centered is in the middle
set -g status-left-length "30"
set -g status-right-length "30"
set-option -g status-position "bottom"
set-option -g status-style 'bg=default,fg=#ffffff'
set-option -g status-justify centre
set-option -g status-left '#h '
set-window-option -g window-status-style 'fg=#ffffff,bg=default'
set-option -g window-status-format ' #I:#W '
set-window-option -g window-status-current-style 'fg=#111111,bg=#7aa2f7'
set-option -g window-status-current-format ' #I:#W#{?window_zoomed_flag,  , } '
set-option -g status-left "#S"
set-option -g status-right "%H:%M #{tmux_mode_indicator}"
# ╭──────────────────────────────────────────────────────────╮
# │ Plugins related configurations │
@@ -103,6 +123,9 @@ set -g @suspend_key 'F12'
set -g @tmux_window_name_max_name_len "30"
### Replace $HOME with ~ in window names
set -g @tmux_window_name_use_tilde "True"
set -g @tmux_window_name_shells "['bash', 'fish', 'sh', 'zsh']"
set -g @tmux_window_dir_programs "['nvim', 'vim', 'vi', 'git']"
set -g @tmux_window_name_ignored_programs "['sqlite3']" # Default is []
## https://github.com/tmux-plugins/tmux-continuum
set -g @continuum-restore 'on'
@@ -111,8 +134,11 @@ set -g @continuum-restore 'on'
set -g @resurrect-strategy-nvim 'session'
set -g @resurrect-dir '$HOME/.local/state/tmux/tmux-resurrect'
# Modified from tokyonight_storm to include tmux_mode_indicator
set -g status-right "#[fg=#1f2335,bg=#1f2335,nobold,nounderscore,noitalics]#[fg=#7aa2f7,bg=#1f2335] #{prefix_highlight} #[fg=#3b4261,bg=#1f2335,nobold,nounderscore,noitalics]#[fg=#7aa2f7,bg=#3b4261] %Y-%m-%d  %H:%M #[fg=#7aa2f7,bg=#3b4261,nobold,nounderscore,noitalics]#[fg=#1d202f,bg=#7aa2f7,bold] #h #{tmux_mode_indicator}"
## https://github.com/MunifTanjim/tmux-mode-indicator
set -g @mode_indicator_prefix_mode_style 'bg=default,fg=#7aa2f7'
set -g @mode_indicator_copy_mode_style 'bg=default,fg=yellow'
set -g @mode_indicator_empty_mode_style 'bg=default,fg=#7aa2f7'
set -g @mode_indicator_sync_mode_style 'bg=default,fg=red'
# ╭──────────────────────────────────────────────────────────╮
# │ Plugins │

View File

@@ -1,38 +0,0 @@
#!/usr/bin/env bash
# TokyoNight colors for Tmux
set -g mode-style "fg=#7aa2f7,bg=#3b4261"
set -g message-style "fg=#7aa2f7,bg=#3b4261"
set -g message-command-style "fg=#7aa2f7,bg=#3b4261"
set -g pane-border-style "fg=#3b4261"
set -g pane-active-border-style "fg=#7aa2f7"
set -g status "on"
set -g status-justify "left"
set -g status-style "fg=#7aa2f7,bg=#1f2335"
set -g status-left-length "100"
set -g status-right-length "100"
set -g status-left-style NONE
set -g status-right-style NONE
set -g status-left "#[fg=#1d202f,bg=#7aa2f7,bold] #S #[fg=#7aa2f7,bg=#1f2335,nobold,nounderscore,noitalics]"
set -g status-right "#[fg=#1f2335,bg=#1f2335,nobold,nounderscore,noitalics]#[fg=#7aa2f7,bg=#1f2335] #{prefix_highlight} #[fg=#3b4261,bg=#1f2335,nobold,nounderscore,noitalics]#[fg=#7aa2f7,bg=#3b4261] %Y-%m-%d  %I:%M %p #[fg=#7aa2f7,bg=#3b4261,nobold,nounderscore,noitalics]#[fg=#1d202f,bg=#7aa2f7,bold] #h "
if-shell '[ "$(tmux show-option -gqv "clock-mode-style")" == "24" ]' {
set -g status-right "#[fg=#1f2335,bg=#1f2335,nobold,nounderscore,noitalics]#[fg=#7aa2f7,bg=#1f2335] #{prefix_highlight} #[fg=#3b4261,bg=#1f2335,nobold,nounderscore,noitalics]#[fg=#7aa2f7,bg=#3b4261] %Y-%m-%d  %H:%M #[fg=#7aa2f7,bg=#3b4261,nobold,nounderscore,noitalics]#[fg=#1d202f,bg=#7aa2f7,bold] #h "
}
setw -g window-status-activity-style "underscore,fg=#a9b1d6,bg=#1f2335"
setw -g window-status-separator ""
setw -g window-status-style "NONE,fg=#a9b1d6,bg=#1f2335"
setw -g window-status-format "#[fg=#1f2335,bg=#1f2335,nobold,nounderscore,noitalics]#[default] #I  #W #F #[fg=#1f2335,bg=#1f2335,nobold,nounderscore,noitalics]"
setw -g window-status-current-format "#[fg=#1f2335,bg=#3b4261,nobold,nounderscore,noitalics]#[fg=#7aa2f7,bg=#3b4261,bold] #I  #W #F #[fg=#3b4261,bg=#1f2335,nobold,nounderscore,noitalics]"
# tmux-plugins/tmux-prefix-highlight support
set -g @prefix_highlight_output_prefix "#[fg=#e0af68]#[bg=#1f2335]#[fg=#1f2335]#[bg=#e0af68]"
set -g @prefix_highlight_output_suffix ""

View File

@@ -3,296 +3,80 @@
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
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 send-keys -X cursor-left
bind-key -T copy-mode-vi C-j send-keys -X copy-pipe-and-cancel
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 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
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 prefix C-Space send-prefix
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 $HOME/.dotfiles/config/tmux/plugins/tmux-resurrect/scripts/restore.sh
bind-key -T prefix C-s run-shell $HOME/.dotfiles/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 ! split-window -h -c "#{pane_current_path}"
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
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 "$HOME/.dotfiles/config/tmux/plugins/tmux-sessionist/scripts/promote_pane.sh '#{session_name}' '#{pane_id}' '#{pane_current_path}'"
bind-key -T prefix C run-shell $HOME/.dotfiles/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 $HOME/.dotfiles/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 ~/.tmux.conf > /dev/null; \
tmux display-message \"Sourced .tmux.conf!\""
bind-key -T prefix S switch-client -l
bind-key -T prefix U run-shell $HOME/.dotfiles/config/tmux/plugins/tpm/bindings/update_plugins
bind-key -T prefix X run-shell "$HOME/.dotfiles/config/tmux/plugins/tmux-sessionist/scripts/kill_session_prompt.sh '#{session_name}' '#{session_id}'"
bind-key -T prefix Y run-shell -b $HOME/.dotfiles/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 $HOME/.dotfiles/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 select-pane -R
bind-key -T prefix m run-shell $HOME/.dotfiles/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 $HOME/.dotfiles/config/tmux/tmux.conf \; display-message "tmux cfg reloaded!"
bind-key -T prefix s choose-tree -Zs
bind-key -T prefix t clock-mode
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 $HOME/.dotfiles/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-c attach-session -c "#{pane_current_path}"
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 $HOME/.dotfiles/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 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-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 C-Tab previous-window
bind-key -T root C-S-Tab next-window
C-o Rotate through the panes
C-z Suspend the current client
Space Select next layout
# List all paste buffers
$ Rename current session
% Split window horizontally
& Kill current window
' Prompt for window index to select
( Switch to previous client
) Switch to next client
, Rename current window
- Delete the most recent paste buffer
. Move the current window
/ Describe key binding
0 Select window 0
1 Select window 1
2 Select window 2
3 Select window 3
4 Select window 4
5 Select window 5
6 Select window 6
7 Select window 7
8 Select window 8
9 Select window 9
: Prompt for a command
; Move to the previously active pane
= Choose a paste buffer from a list
? List key bindings
D Choose a client from a list
E Spread panes out evenly
L Switch to the last client
M Clear the marked pane
] Paste the most recent paste buffer
c Create a new window
d Detach the current client
f Search for a pane
i Display window information
m Toggle the marked pane
n Select the next window
o Select the next pane
q Display pane numbers
s Choose a session from a list
t Show a clock
w Choose a window from a list
x Kill the active pane
z Zoom the active pane
{ Swap the active pane with the pane above
} Swap the active pane with the pane below
~ Show messages
DC Reset so the visible part of the window follows the cursor
PPage Enter copy mode and scroll up
Up Select the pane above the active pane
Down Select the pane below the active pane
Left Select the pane to the left of the active pane
Right Select the pane to the right of the active pane
M-1 Set the even-horizontal layout
M-2 Set the even-vertical layout
M-3 Set the main-horizontal layout
M-4 Set the main-vertical layout
M-5 Select the tiled layout
M-n Select the next window with an alert
M-o Rotate through the panes in reverse
M-p Select the previous window with an alert
M-Up Resize the pane up by 5
M-Down Resize the pane down by 5
M-Left Resize the pane left by 5
M-Right Resize the pane right by 5
C-Up Resize the pane up
C-Down Resize the pane down
C-Left Resize the pane left
C-Right Resize the pane right
S-Up Move the visible part of the window up
S-Down Move the visible part of the window down
S-Left Move the visible part of the window left
S-Right Move the visible part of the window right
```

View File

@@ -25,9 +25,9 @@ git submodule update --init --recursive "${DOTBOT_DIR}"
if [ "${DOTBOT_HOST}" != "" ]; then
DOTBOT_HOST_CONFIG="${BASEDIR}/hosts/${DOTBOT_HOST}/${CONFIG}"
echo "-> Trying if host config can be found: ${DOTBOT_HOST_CONFIG}"
[ -r "$DOTBOT_HOST_CONFIG" ] && [ -f "$DOTBOT_HOST_CONFIG" ] &&
echo "(!) Found $DOTBOT_HOST_CONFIG" &&
"$DOTBOT_BIN_PATH" \
[ -r "$DOTBOT_HOST_CONFIG" ] && [ -f "$DOTBOT_HOST_CONFIG" ] \
&& echo "(!) Found $DOTBOT_HOST_CONFIG" \
&& "$DOTBOT_BIN_PATH" \
-d "$BASEDIR" \
--plugin-dir=tools/dotbot-brew \
--plugin-dir=tools/dotbot-include \

View File

@@ -42,6 +42,7 @@ function section_install
"macos:Setup nice macOS defaults"
"neofetch:Install neofetch"
"nvm:Install Node Version Manager (nvm)"
"nvm-latest:Install latest lts node using nvm"
"npm:Install NPM Packages"
"ntfy:Install ntfy"
"ohmybash:Install oh-my-bash"
@@ -150,11 +151,19 @@ function section_install
;;
nvm)
msg "Installing nvm..."
curl -o- "https://raw.githubusercontent.com/nvm-sh/nvm/$VERSION_NVM/install.sh" | bash \
&& nvm install --lts --latest-npm --default
git checkout "$DOTFILES/base/zshrc"
curl -o- "https://raw.githubusercontent.com/nvm-sh/nvm/$VERSION_NVM/install.sh" | bash
$0 install nvm-latest
msg_yay "nvm installed!"
;;
nvm-latest)
msg "Installing latest lts node..."
if [ -n "$NVM_DIR" ]; then
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
fi
nvm install --lts --latest-npm --default
git checkout "$DOTFILES/base/*"
msg_yay "latest lts node installed!"
;;
npm)
msg "NPM Packages install started..."
bash "$DOTFILES/scripts/install-npm-packages.sh" \
@@ -194,7 +203,7 @@ function section_brew
"autoupdate:Setups brew auto-update and runs it immediately"
)
have brew && {
x-have brew && {
case "$1" in
install)
brew bundle install --file="$BREWFILE" --force --quiet && msg_yay "Done!"
@@ -220,7 +229,7 @@ function section_brew
esac
}
! have brew && menu_section "$USAGE_PREFIX" "brew not available on this system"
! x-have brew && menu_section "$USAGE_PREFIX" "brew not available on this system"
}
function section_helpers
@@ -285,14 +294,14 @@ function section_dotfiles
msg_ok "Deleted old nvim files (share, state and cache + config)"
ln -s "$DOTFILES/config/nvim" ~/.config/nvim
msg_ok "Linked nvim and astronvim"
have npm && $0 install npm
x-have npm && $0 install npm
msg_ok "Installed packages"
msg_done "nvim reset!"
;;
yamlfmt)
# format yaml files
have yamlfmt && yamlfmt -conf "$DOTFILES/.yamlfmt"
! have yamlfmt && msg_err "yamlfmt not found"
x-have yamlfmt && yamlfmt -conf "$DOTFILES/.yamlfmt"
! x-have yamlfmt && msg_err "yamlfmt not found"
;;
shfmt)
# Format shell scripts according to following rules.

View File

@@ -4,17 +4,16 @@
# Updates $HOME/.dotfiles/docs/tmux.md with my keybindings.
# shellcheck source=./../../scripts/shared.sh
DOTFILES_SHARED_LOADED=""
source "$HOME/.dotfiles/scripts/shared.sh"
have tmux || {
x-have tmux || {
msg_err "tmux not found" && exit 0
}
TMUX_KEYBINDINGS_DOCS="$DOTFILES/docs/tmux-keybindings.md"
CB="\n\`\`\`\n"
KB=$(tmux list-keys)
KB=$(tmux lsk -Tprefix -N | sed -e 's/^/ /;')
H="# tmux keybindings\n"
L="\nLeader: \`<ctrl><space>\`\n"

View File

@@ -2,30 +2,76 @@
# Load our configuration files
# Copyright (c) 2023 Ismo Vuorinen. All Rights Reserved.
DOTFILES="$HOME/.dotfiles"
source "$HOME/.dotfiles/scripts/shared.sh"
set -euo pipefail
# Set verbosity with VERBOSE=1 x-load-configs
VERBOSE="${VERBOSE:=0}"
[ "$VERBOSE" = "1" ] && {
set -x
}
CONFIG_PATH="$DOTFILES/config"
# Load the shell dotfiles, and then some:
function x-load-config-fn()
{
for FILE in $CONFIG_PATH/{exports,alias,functions}; do
FILENAME="$FILE"
HOST="$(hostname -s)"
# global (exports|alias|functions) FILENAME for all hosts
# shellcheck source=../config/exports
[ -r "$FILENAME" ] && source "$FILENAME"
# global secret FILENAME, git ignored
# shellcheck source=../config/exports-secret
[ -r "$FILENAME-secret" ] && source "$FILENAME-secret"
# host specific (exports|alias|functions) FILENAME
# shellcheck source=../config/exports
[ -r "$FILENAME-$HOST" ] && source "$FILENAME-$HOST"
# host specific (exports|alias|functions) FILENAME, git ignored
# shellcheck source=../config/exports
[ -r "$FILENAME-$HOST-secret" ] && source "$FILENAME-$HOST-secret"
done
HOST="$(hostname -s)"
[ "$VERBOSE" = "1" ] && {
echo "x-load-configs: VERBOSE=1"
echo "x-load-configs: HOST: $HOST"
}
x-load-config-fn
configFile()
{
echo "$CONFIG_PATH/$1"
}
configMsg()
{
printf 'x-load-configs: %s %s\n' "$1" "$2"
}
loadConfigFiles()
{
CONFIG_FILE=$1
SECRET_FILE=$CONFIG_FILE-secret
HOST_FILE=$CONFIG_FILE-$HOST
SECRET_HOST=$HOST_FILE-secret
[ "$VERBOSE" = "1" ] && configMsg "?" "$CONFIG_FILE"
# global (exports|alias|functions) FILENAME for all hosts
# shellcheck source=../config/exports
[ -r "$CONFIG_FILE" ] && {
source "$CONFIG_FILE" && [ "$VERBOSE" = "1" ] && configMsg "Found" "$CONFIG_FILE"
}
# global secret FILENAME, git ignored
# shellcheck source=../config/exports-secret
[ "$VERBOSE" = "1" ] && configMsg "?" "$SECRET_FILE"
[ -r "$SECRET_FILE" ] && {
source "$SECRET_FILE" && [ "$VERBOSE" = "1" ] && configMsg "Found" "$SECRET_FILE"
}
# host specific (exports|alias|functions) FILENAME
# shellcheck source=../config/exports
[ "$VERBOSE" = "1" ] && configMsg "?" "$HOST_FILE"
[ -r "$HOST_FILE" ] && {
source "$HOST_FILE" && [ "$VERBOSE" = "1" ] && configMsg "Found" "$HOST_FILE"
}
# host specific (exports|alias|functions) FILENAME, git ignored
# shellcheck source=../config/exports
[ "$VERBOSE" = "1" ] && configMsg "?" "$SECRET_HOST"
[ -r "$SECRET_HOST" ] && {
source "$SECRET_HOST" \
&& [ "$VERBOSE" = "1" ] && configMsg "Found" "$SECRET_HOST"
}
}
FILE_EXPORTS=$(configFile "exports")
FILE_FUNCTIONS=$(configFile "functions")
FILE_ALIAS=$(configFile "alias")
loadConfigFiles "$FILE_EXPORTS"
loadConfigFiles "$FILE_FUNCTIONS"
loadConfigFiles "$FILE_ALIAS"
exit 0

4
local/bin/x-mkd Executable file
View File

@@ -0,0 +1,4 @@
#!/usr/bin/env bash
# Create a directory and cd into it
mkdir -p "$@" && cd "$@" || exit

View File

@@ -5,4 +5,3 @@
x-path-remove "$1"
export PATH="${PATH:+"$PATH:"}$1"

View File

@@ -4,4 +4,3 @@
# Usage: x-path-prepend <dir>
export PATH="$1${PATH:+":$PATH"}"

View File

@@ -4,4 +4,3 @@
# Usage: x-path-remove <dir>
export PATH=$(echo -n "$PATH" | awk -v RS=: -v ORS=: "\$0 != \"$1\"" | sed 's/:$//')

50
local/bin/x-set-php-aliases Executable file
View File

@@ -0,0 +1,50 @@
#!/usr/bin/env bash
# Check which php versions are installed with brew, and create aliases for each installation.
# Copyright (c) 2023 Ismo Vuorinen. All Rights Reserved.
set -euo pipefail
# Set verbosity with VERBOSE=1 x-load-configs
VERBOSE="${VERBOSE:=0}"
[ "$VERBOSE" = "2" ] && {
set -x
}
! x-have brew && {
exit 0
}
# Get installed php versions from brew and setup aliases
php_versions=()
while IFS="" read -r line; do php_versions+=("$line"); done < <(bkt -- brew list | grep '^php')
php_error_reporting='-d error_reporting=22527'
for version in "${php_versions[@]}"; do
[ "$VERBOSE" = "1" ] && echo "Setting aliases for $version"
# drop the dot from version (8.0 -> 80)
php_abbr="${version//\./}"
# replace "php@" with "p" so "php@80" becomes "p80"
php_alias="${php_abbr//php@/p}"
# Fetch the exec path once
php_exec="$HOMEBREW_PREFIX/opt/$version/bin/php"
[ -f "$php_exec" ] && {
[ "$VERBOSE" = "1" ] && echo "-> php_exec $php_exec"
# Raw PHP without error_reporting flag.
# shellcheck disable=SC2139
alias "${php_alias}"r="$php_exec"
# PHP with error_reporting flag.
# shellcheck disable=SC2139,SC2140
alias "$php_alias"="$php_exec $php_error_reporting"
# Local PHP Server.
# shellcheck disable=SC2139,SC2140
alias "${php_alias}s"="$php_exec -S localhost:9000"
# Use composer with specific PHP and error_reporting flag on.
# shellcheck disable=SC2139,SC2140
alias "${php_alias}c"="$php_exec $php_error_reporting $(which composer)"
}
done

View File

@@ -6,7 +6,7 @@ source "$HOME/.dotfiles/scripts/shared.sh"
msg "Starting to install rust/cargo packages"
[[ $(x-have "cargo") == "1" ]] && {
! x-have cargo && {
msg "cargo could not be found. installing cargo with rustup.rs"
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- --no-modify-path
}
@@ -34,6 +34,7 @@ packages=(
"ripgrep"
# A version manager for neovim
"bob-nvim"
"bottom"
)
for pkg in "${packages[@]}"; do
@@ -53,8 +54,8 @@ msg_done "Installed cargo packages!"
msg_run "Now doing the next steps for cargo packages"
# use bob to install nvim
have bob && {
bob use stable && path_append "$XDG_DATA_HOME/bob/nvim-bin"
x-have bob && {
bob use stable && x-path-append "$XDG_DATA_HOME/bob/nvim-bin"
}
msg_done "All next steps done!"

View File

@@ -5,7 +5,7 @@ source "$HOME/.dotfiles/scripts/shared.sh"
PBB_REQUIRED_TOOLS=(git cheat)
for t in ${PBB_REQUIRED_TOOLS[@]}; do
[[ $(x-have "$t") == "1" ]] && echo "(!) $t is missing, can't continue..." && exit 1
! x-have "$t" && echo "(!) $t is missing, can't continue..." && exit 1
done
PBB_GIT="https://github.com/dylanaraps/pure-bash-bible.git"

View File

@@ -5,7 +5,7 @@ source "$HOME/.dotfiles/scripts/shared.sh"
TLDR_REQUIRED_TOOLS=(git cheat)
for t in ${TLDR_REQUIRED_TOOLS[@]}; do
[[ $(x-have "$t") == "1" ]] && echo "(!) $t is missing, can't continue..." && exit 1
! x-have "$t" && echo "(!) $t is missing, can't continue..." && exit 1
done
TLDR_GIT="https://github.com/tldr-pages/tldr.git"

View File

@@ -4,7 +4,7 @@
# shellcheck source="shared.sh"
source "$HOME/.dotfiles/scripts/shared.sh"
[[ $(x-have "php") == "1" ]] && msg_err "PHP Not Available, cannot install composer" && exit 0
! x-have "php" && msg_err "PHP Not Available, cannot install composer" && exit 0
EXPECTED_CHECKSUM="$(php -r 'copy("https://composer.github.io/installer.sig", "php://stdout");')"
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"

View File

@@ -6,7 +6,7 @@ source "$HOME/.dotfiles/scripts/shared.sh"
msg_run "Installing gh (GitHub Client) extensions"
[[ $(x-have "gh") == "1" ]] \
! x-have "gh" \
&& msg_err "gh (GitHub Client) could not be found, please install it first" \
&& exit 0

View File

@@ -8,7 +8,7 @@ source "$HOME/.dotfiles/scripts/shared.sh"
msg_run "Installing git-crypt"
[[ $(x-have "git-crypt") == "1" ]] && {
x-have "git-crypt" || {
REPO_URL="https://github.com/AGWA/git-crypt.git"
CHECK_PATH="${XDG_BIN_HOME}/git-crypt"

View File

@@ -6,7 +6,7 @@ source "$HOME/.dotfiles/scripts/shared.sh"
msg_run "Installing go packages"
[[ $(x-have "go") == "1" ]] && msg "go hasn't been installed yet." && exit 0
! x-have "go" && msg "go hasn't been installed yet." && exit 0
packages=(
# A shell parser, formatter, and interpreter with bash support; includes shfmt
@@ -44,7 +44,7 @@ done
msg_run "Installing completions for selected packages"
have git-profile && {
x-have git-profile && {
git-profile completion zsh > "$ZSH_CUSTOM_COMPLETION_PATH/_git-profile" \
&& msg_ok "Installed completions for git-profile"
}

View File

@@ -11,7 +11,7 @@ NEOFETCH_URL="${NEOFETCH_REPO}/archive/refs/tags/${NEOFETCH_VERSION}.tar.gz"
NEOFETCH_TEMP="/tmp/neofetch"
NEOFETCH_INSTALL_PREFIX="$HOME/.local"
[[ $(x-have "neofetch") == "1" ]] && {
x-have "neofetch" || {
LC_ALL=C
mkdir -p "$NEOFETCH_TEMP" "$NEOFETCH_INSTALL_PREFIX"

View File

@@ -6,7 +6,7 @@ source "$HOME/.dotfiles/scripts/shared.sh"
msg "Starting to install npm packages"
[[ $(x-have "npm") == "1" ]] && msg_err "npm could not be found." && exit 0
! x-have "npm" && msg_err "npm could not be found." && exit 0
packages=(
# This is a tool to check if your files consider your .editorconfig rules.

View File

@@ -6,7 +6,7 @@
source "$HOME/.dotfiles/scripts/shared.sh"
set -e
[[ $(x-have "ntfy") == "0" ]] && msg "ntfy already installed" && exit 0
x-have "ntfy" && msg "ntfy already installed" && exit 0
case $(dfm check arch) in
Linux)

View File

@@ -6,14 +6,16 @@ source "$HOME/.dotfiles/scripts/shared.sh"
msg "Starting to install pip packages"
[[ $(x-have "python3") == "1" ]] && {
x-have "python3" || {
msg_err "Could not find python3, something really weird is going on." && exit 1
}
msg_nested "Upgrading pip"
python3 -m pip install --user --upgrade pip
packages=(
"pipx"
"libtmux"
"ensurepath"
)
for pkg in "${packages[@]}"; do
@@ -23,7 +25,7 @@ for pkg in "${packages[@]}"; do
if [[ ${pkg:0:1} == "#" ]]; then continue; fi
msg_nested "Installing pip package: $pkg"
python3 -m pip install --user "$pkg"
python3 -m pip install --user --upgrade "$pkg"
echo ""
done

View File

@@ -6,7 +6,7 @@
[ "$(uname)" != "Darwin" ] && echo "Not a macOS system" && exit 0
! have xcode-select \
! x-have xcode-select \
&& msg_err "xcode-select could not be found, skipping" \
&& exit 0

View File

@@ -50,27 +50,6 @@ function path_prepend
x-path-prepend "$1"
}
# Create directory if it doesn't exist already
x-dc()
{
dir="$1"
[ $# -eq 0 ] && {
echo "Usage: $0 full/path/to/dir/to/create"
exit 1
}
if [ ! -d "$dir" ]; then
mkdir -p "$dir" && exit 0
fi
}
# Create a new directory and enter it
mkd()
{
mkdir -p "$@" && cd "$@" || exit
}
# Run command silently
# Usage: silent uptime
silent()
@@ -84,31 +63,6 @@ nonascii()
LC_ALL=C grep -n '[^[:print:][:space:]]' "${@}"
}
CONFIG_PATH="$DOTFILES/config"
# Load the shell dotfiles, and then some:
function x-load-config-fn()
{
for FILE in $CONFIG_PATH/{exports,alias,functions}; do
FILENAME="$FILE"
HOST="$(hostname -s)"
# global (exports|alias|functions) FILENAME for all hosts
# shellcheck source=../config/exports
[ -r "$FILENAME" ] && source "$FILENAME"
# global secret FILENAME, git ignored
# shellcheck source=../config/exports-secret
[ -r "$FILENAME-secret" ] && source "$FILENAME-secret"
# host specific (exports|alias|functions) FILENAME
# shellcheck source=../config/exports
[ -r "$FILENAME-$HOST" ] && source "$FILENAME-$HOST"
# host specific (exports|alias|functions) FILENAME, git ignored
# shellcheck source=../config/exports
[ -r "$FILENAME-$HOST-secret" ] && source "$FILENAME-$HOST-secret"
done
}
x-load-config-fn
source "$DOTFILES/local/bin/msgr"
# -- Menu builder -- #