mirror of
https://github.com/ivuorinen/dotfiles.git
synced 2026-02-03 15:48:44 +00:00
Compare commits
13 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| d2904274cb | |||
| 7ce8c78920 | |||
| 71301a6436 | |||
| e4f925e5b0 | |||
| 63ebd6df47 | |||
| d598aade16 | |||
| 1b49de9645 | |||
| d56338e233 | |||
| ef6ccb92c0 | |||
| 16bb91dd81 | |||
| e7f078fe96 | |||
| 49778fe936 | |||
| 6a718a41b1 |
82
base/bashrc
82
base/bashrc
@@ -18,6 +18,9 @@ export XDG_RUNTIME_DIR="$HOME/.local/run"
|
|||||||
# Paths
|
# Paths
|
||||||
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/cargo/bin:$PATH"
|
||||||
|
|
||||||
|
source "$DOTFILES/config/exports"
|
||||||
|
source "$DOTFILES/config/functions"
|
||||||
|
source "$DOTFILES/config/alias"
|
||||||
x-load-configs
|
x-load-configs
|
||||||
|
|
||||||
# shellcheck source=../config/fzf/fzf.bash
|
# shellcheck source=../config/fzf/fzf.bash
|
||||||
@@ -27,78 +30,9 @@ x-load-configs
|
|||||||
# Import ssh keys in keychain
|
# Import ssh keys in keychain
|
||||||
ssh-add -A 2>/dev/null
|
ssh-add -A 2>/dev/null
|
||||||
|
|
||||||
# Enable the subsequent settings only in interactive sessions
|
x-have rbenv && {
|
||||||
case $- in
|
eval "$(rbenv init - bash)"
|
||||||
*i*) ;;
|
|
||||||
*) return ;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
# Path to your oh-my-bash installation.
|
|
||||||
export OSH="$HOME/.local/share/oh-my-bash"
|
|
||||||
|
|
||||||
[ -d "$OSH" ] && {
|
|
||||||
export OSH_THEME="powerline-multiline"
|
|
||||||
|
|
||||||
# PowerLine theme config
|
|
||||||
export POWERLINE_LEFT_PROMPT="cwd scm"
|
|
||||||
export POWERLINE_RIGHT_PROMPT="python_venv ruby in_vim battery user_info"
|
|
||||||
|
|
||||||
# Display red dots whilst waiting for completion.
|
|
||||||
export COMPLETION_WAITING_DOTS="true"
|
|
||||||
|
|
||||||
# Uncomment the following line if you want to disable marking untracked files
|
|
||||||
# under VCS as dirty. This makes repository status check for large repositories
|
|
||||||
# much, much faster.
|
|
||||||
export DISABLE_UNTRACKED_FILES_DIRTY="true"
|
|
||||||
|
|
||||||
# To disable the uses of "sudo" by oh-my-bash, please set "false" to
|
|
||||||
# this variable. The default behavior for the empty value is "true".
|
|
||||||
export OMB_USE_SUDO=true
|
|
||||||
|
|
||||||
# To enable/disable display of Python virtualenv and condaenv
|
|
||||||
export OMB_PROMPT_SHOW_PYTHON_VENV=true # enable
|
|
||||||
# OMB_PROMPT_SHOW_PYTHON_VENV=false # disable
|
|
||||||
|
|
||||||
# Which completions would you like to load? (completions can be found in ~/.oh-my-bash/completions/*)
|
|
||||||
# Custom completions may be added to ~/.oh-my-bash/custom/completions/
|
|
||||||
# Example format: completions=(ssh git bundler gem pip pip3)
|
|
||||||
# Add wisely, as too many completions slow down shell startup.
|
|
||||||
export completions=(
|
|
||||||
git
|
|
||||||
composer
|
|
||||||
ssh
|
|
||||||
)
|
|
||||||
|
|
||||||
# Which aliases would you like to load? (aliases can be found in ~/.oh-my-bash/aliases/*)
|
|
||||||
# Custom aliases may be added to ~/.oh-my-bash/custom/aliases/
|
|
||||||
# Example format: aliases=(vagrant composer git-avh)
|
|
||||||
# Add wisely, as too many aliases slow down shell startup.
|
|
||||||
export aliases=(
|
|
||||||
general
|
|
||||||
)
|
|
||||||
|
|
||||||
# Which plugins would you like to load? (plugins can be found in ~/.oh-my-bash/plugins/*)
|
|
||||||
# Custom plugins may be added to ~/.oh-my-bash/custom/plugins/
|
|
||||||
# Example format: plugins=(rails git textmate ruby lighthouse)
|
|
||||||
# Add wisely, as too many plugins slow down shell startup.
|
|
||||||
export plugins=(
|
|
||||||
git
|
|
||||||
bashmarks
|
|
||||||
)
|
|
||||||
|
|
||||||
# Which plugins would you like to conditionally load? (plugins can be found in ~/.oh-my-bash/plugins/*)
|
|
||||||
# Custom plugins may be added to ~/.oh-my-bash/custom/plugins/
|
|
||||||
# Example format:
|
|
||||||
# if [ "$DISPLAY" ] || [ "$SSH" ]; then
|
|
||||||
# plugins+=(tmux-autoattach)
|
|
||||||
# fi
|
|
||||||
|
|
||||||
source "$OSH/oh-my-bash.sh"
|
|
||||||
|
|
||||||
# Preferred editor for local and remote sessions
|
|
||||||
# if [[ -n $SSH_CONNECTION ]]; then
|
|
||||||
# export EDITOR='vim'
|
|
||||||
# else
|
|
||||||
# export EDITOR='mvim'
|
|
||||||
# fi
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
eval "$(starship init bash)"
|
||||||
|
source "$DOTFILES/config/alias"
|
||||||
|
|||||||
22
base/zshrc
22
base/zshrc
@@ -61,9 +61,9 @@ antigen bundle jreese/zsh-titles
|
|||||||
antigen bundle zsh-users/zsh-completions
|
antigen bundle zsh-users/zsh-completions
|
||||||
|
|
||||||
# these should be available if there's need
|
# these should be available if there's need
|
||||||
have brew && antigen bundle brew
|
x-have brew && antigen bundle brew
|
||||||
have php && antigen bundle php
|
x-have php && antigen bundle php
|
||||||
have python && antigen bundle MichaelAquilina/zsh-autoswitch-virtualenv
|
x-have python && antigen bundle MichaelAquilina/zsh-autoswitch-virtualenv
|
||||||
|
|
||||||
# nvm is a strange beast
|
# nvm is a strange beast
|
||||||
zstyle ':omz:plugins:nvm' autoload yes
|
zstyle ':omz:plugins:nvm' autoload yes
|
||||||
@@ -81,14 +81,24 @@ antigen apply
|
|||||||
[ -f "${DOTFILES}/config/fzf/fzf.zsh" ] \
|
[ -f "${DOTFILES}/config/fzf/fzf.zsh" ] \
|
||||||
&& source "${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
|
# Autoupdate tmux window name
|
||||||
TMUX_WINDOW_NAME_PLUGIN="$DOTFILES/config/tmux/plugins/tmux-window-name/scripts/rename_session_windows.py"
|
TMUX_WINDOW_NAME_PLUGIN="$DOTFILES/config/tmux/plugins/tmux-window-name/scripts/rename_session_windows.py"
|
||||||
[ -f "$TMUX_WINDOW_NAME_PLUGIN" ] && {
|
[ -f "$TMUX_WINDOW_NAME_PLUGIN" ] && {
|
||||||
tmux-window-name() {
|
tmux-window-name()
|
||||||
($TMUX_WINDOW_NAME_PLUGIN &)
|
{
|
||||||
|
($TMUX_WINDOW_NAME_PLUGIN &)
|
||||||
}
|
}
|
||||||
add-zsh-hook chpwd tmux-window-name
|
add-zsh-hook chpwd tmux-window-name
|
||||||
}
|
}
|
||||||
|
|
||||||
# Start starship
|
|
||||||
eval "$(starship init zsh)"
|
eval "$(starship init zsh)"
|
||||||
|
source "$DOTFILES/config/alias"
|
||||||
|
|||||||
@@ -19,8 +19,8 @@ env:
|
|||||||
window:
|
window:
|
||||||
dynamic_title: true
|
dynamic_title: true
|
||||||
dimensions:
|
dimensions:
|
||||||
columns: 130
|
columns: 200
|
||||||
lines: 40
|
lines: 100
|
||||||
|
|
||||||
# Adds this many blank pixels of padding around the window
|
# Adds this many blank pixels of padding around the window
|
||||||
# Units are physical pixels; this is not DPI aware.
|
# Units are physical pixels; this is not DPI aware.
|
||||||
@@ -31,7 +31,7 @@ window:
|
|||||||
|
|
||||||
decorations: buttonless
|
decorations: buttonless
|
||||||
|
|
||||||
opacity: 0.97
|
opacity: 0.98
|
||||||
|
|
||||||
# When true, bold text is drawn using the bright variant of colors.
|
# When true, bold text is drawn using the bright variant of colors.
|
||||||
draw_bold_text_with_bright_colors: true
|
draw_bold_text_with_bright_colors: true
|
||||||
@@ -104,9 +104,9 @@ colors:
|
|||||||
cyan: '0x7dcfff'
|
cyan: '0x7dcfff'
|
||||||
white: '0xc0caf5'
|
white: '0xc0caf5'
|
||||||
|
|
||||||
indexed_colors:
|
# indexed_colors:
|
||||||
- { index: 16, color: '0xff9e64' }
|
# - { index: 16, color: '0xff9e64' }
|
||||||
- { index: 17, color: '0xdb4b4b' }
|
# - { index: 17, color: '0xdb4b4b' }
|
||||||
|
|
||||||
key_bindings:
|
key_bindings:
|
||||||
- { key: V, mods: Command, action: Paste }
|
- { key: V, mods: Command, action: Paste }
|
||||||
|
|||||||
108
config/alias
108
config/alias
@@ -1,68 +1,12 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
# shellcheck source="../scripts/shared.sh"
|
# shellcheck source="../scripts/shared.sh"
|
||||||
# shellcheck disable=1091,2139
|
# 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 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"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Be nice
|
|
||||||
alias please="sudo "
|
|
||||||
|
|
||||||
# Color the grep output
|
# Color the grep output
|
||||||
alias grep='grep --color'
|
alias grep="grep --color"
|
||||||
|
|
||||||
x-have eza && {
|
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: .., ..., ....
|
# Easier navigation: .., ..., ....
|
||||||
@@ -85,7 +29,7 @@ alias sl="ls"
|
|||||||
alias lsd="ls -lF | grep '^d'"
|
alias lsd="ls -lF | grep '^d'"
|
||||||
|
|
||||||
# IP addresses
|
# IP addresses
|
||||||
alias ip="dig +short myip.opendns.com @resolver1.opendns.com"
|
alias x-ip="dig +short myip.opendns.com @resolver1.opendns.com"
|
||||||
alias localip="ipconfig getifaddr en1"
|
alias localip="ipconfig getifaddr en1"
|
||||||
alias ips="ifconfig -a | grep -o 'inet6\? \(\([0-9]\+\.[0-9]\+\.[0-9]\+\.[0-9]\+\)\|[a-fA-F0-9:]\+\)' | sed -e 's/inet6* //'"
|
alias ips="ifconfig -a | grep -o 'inet6\? \(\([0-9]\+\.[0-9]\+\.[0-9]\+\.[0-9]\+\)\|[a-fA-F0-9:]\+\)' | sed -e 's/inet6* //'"
|
||||||
|
|
||||||
@@ -102,9 +46,6 @@ alias flush="dscacheutil -flushcache"
|
|||||||
# Update locatedb
|
# Update locatedb
|
||||||
alias updatedb="sudo /usr/libexec/locate.updatedb"
|
alias updatedb="sudo /usr/libexec/locate.updatedb"
|
||||||
|
|
||||||
# Always return full history
|
|
||||||
alias history="history 1"
|
|
||||||
|
|
||||||
# tmux: automatically attach or create session with name 'main'
|
# tmux: automatically attach or create session with name 'main'
|
||||||
alias tmux='tmux new-session -A -s main'
|
alias tmux='tmux new-session -A -s main'
|
||||||
# tmux: attach or create new session
|
# tmux: attach or create new session
|
||||||
@@ -138,22 +79,35 @@ alias zedit='$EDITOR ~/.dotfiles'
|
|||||||
|
|
||||||
alias irssi="irssi --config=$XDG_CONFIG_HOME/irssi/config --home=$XDG_CONFIG_HOME/irssi"
|
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"
|
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
|
# Alacritty preexec hook to update dynamic title
|
||||||
function preexec()
|
preexec()
|
||||||
{
|
{
|
||||||
print -Pn "\e]0;$1%~\a"
|
print -Pn "\e]0;$1%~\a"
|
||||||
}
|
}
|
||||||
|
|
||||||
# Update dotfiles
|
# Update dotfiles
|
||||||
function dfu()
|
dfu()
|
||||||
{
|
{
|
||||||
(
|
(
|
||||||
cd "$DOTFILES" && git pull --ff-only && ./install -q
|
cd "$DOTFILES" && git pull --ff-only && ./install -q
|
||||||
@@ -161,7 +115,7 @@ function dfu()
|
|||||||
}
|
}
|
||||||
|
|
||||||
# Weather in Tampere, or other city
|
# Weather in Tampere, or other city
|
||||||
function weather()
|
weather()
|
||||||
{
|
{
|
||||||
# https://github.com/chubin/wttr.in#usage
|
# https://github.com/chubin/wttr.in#usage
|
||||||
local city="${1:-Tampere}"
|
local city="${1:-Tampere}"
|
||||||
@@ -169,19 +123,13 @@ function weather()
|
|||||||
}
|
}
|
||||||
|
|
||||||
# Docker
|
# Docker
|
||||||
function ssh-docker()
|
ssh-docker()
|
||||||
{
|
{
|
||||||
docker exec -it "$@" bash
|
docker exec -it "$@" bash
|
||||||
}
|
}
|
||||||
|
|
||||||
# All the dig info
|
|
||||||
function digga()
|
|
||||||
{
|
|
||||||
dig +nocmd "$1" any +multiline +noall +answer
|
|
||||||
}
|
|
||||||
|
|
||||||
# Rector project to php version 8.2 by default.
|
# Rector project to php version 8.2 by default.
|
||||||
function rector()
|
rector()
|
||||||
{
|
{
|
||||||
local php="${1:-82}"
|
local php="${1:-82}"
|
||||||
docker run -v "$(pwd)":/project rector/rector:latest process \
|
docker run -v "$(pwd)":/project rector/rector:latest process \
|
||||||
@@ -191,7 +139,7 @@ function rector()
|
|||||||
}
|
}
|
||||||
|
|
||||||
# Commit everything
|
# Commit everything
|
||||||
function commit()
|
commit()
|
||||||
{
|
{
|
||||||
commitMessage="$*"
|
commitMessage="$*"
|
||||||
|
|
||||||
@@ -203,7 +151,7 @@ function commit()
|
|||||||
eval "git commit -a -m '${commitMessage}'"
|
eval "git commit -a -m '${commitMessage}'"
|
||||||
}
|
}
|
||||||
|
|
||||||
function scheduler()
|
scheduler()
|
||||||
{
|
{
|
||||||
while :; do
|
while :; do
|
||||||
php artisan schedule:run
|
php artisan schedule:run
|
||||||
|
|||||||
@@ -2,11 +2,6 @@
|
|||||||
# shellcheck shell=bash
|
# shellcheck shell=bash
|
||||||
# vim: filetype=zsh
|
# 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
|
# Cache commands using bkt if installed
|
||||||
if command -v bkt >&/dev/null; then
|
if command -v bkt >&/dev/null; then
|
||||||
bkt()
|
bkt()
|
||||||
@@ -26,7 +21,7 @@ fi
|
|||||||
# shorthand for checking if the system has the bin in path,
|
# shorthand for checking if the system has the bin in path,
|
||||||
# this version does not use caching
|
# this version does not use caching
|
||||||
# usage: have_command php && php -v
|
# usage: have_command php && php -v
|
||||||
function have_command
|
have_command()
|
||||||
{
|
{
|
||||||
command -v "$1" >&/dev/null
|
command -v "$1" >&/dev/null
|
||||||
}
|
}
|
||||||
@@ -34,21 +29,21 @@ function have_command
|
|||||||
# shorthand for checking if the system has the bin in path,
|
# shorthand for checking if the system has the bin in path,
|
||||||
# this version uses caching
|
# this version uses caching
|
||||||
# usage: have php && php -v
|
# usage: have php && php -v
|
||||||
function have
|
have()
|
||||||
{
|
{
|
||||||
bkt -- which "$1" >&/dev/null
|
bkt -- which "$1" >&/dev/null
|
||||||
}
|
}
|
||||||
|
|
||||||
function brew_installed
|
brew_installed()
|
||||||
{
|
{
|
||||||
bkt -- brew list
|
bkt -- brew list
|
||||||
}
|
}
|
||||||
|
|
||||||
# shorthand for checking if brew package is installed
|
# shorthand for checking if brew package is installed
|
||||||
# usage: have_brew php && php -v
|
# 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
|
if bkt -- brew list "$1" &> /dev/null; then
|
||||||
return 0
|
return 0
|
||||||
|
|||||||
@@ -7,6 +7,7 @@
|
|||||||
# Antigen configuration
|
# Antigen configuration
|
||||||
# https://github.com/zsh-users/antigen/wiki/Configuration
|
# https://github.com/zsh-users/antigen/wiki/Configuration
|
||||||
export ADOTDIR="$XDG_DATA_HOME/antigen"
|
export ADOTDIR="$XDG_DATA_HOME/antigen"
|
||||||
|
export ANTIGEN_CACHE="$XDG_CACHE_HOME/antigen"
|
||||||
export ANTIGEN_SYSTEM_RECEIPT_F=".local/share/antigen/antigen_system_lastupdate"
|
export ANTIGEN_SYSTEM_RECEIPT_F=".local/share/antigen/antigen_system_lastupdate"
|
||||||
export ANTIGEN_PLUGIN_RECEIPT_F=".local/share/antigen/antigen_plugin_lastupdate"
|
export ANTIGEN_PLUGIN_RECEIPT_F=".local/share/antigen/antigen_plugin_lastupdate"
|
||||||
|
|
||||||
@@ -59,12 +60,6 @@ x-have node && {
|
|||||||
|
|
||||||
# op (1Password cli) is present
|
# op (1Password cli) is present
|
||||||
export OP_CACHE="$XDG_STATE_HOME/1password"
|
export OP_CACHE="$XDG_STATE_HOME/1password"
|
||||||
x-have op && {
|
|
||||||
[ "$DOTFILES_CURRENT_SHELL" = "zsh" ] && {
|
|
||||||
eval "$(op completion zsh)"
|
|
||||||
compdef _op op
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
# Python
|
# Python
|
||||||
#
|
#
|
||||||
@@ -87,10 +82,6 @@ export BUNDLE_USER_PLUGIN="$XDG_DATA_HOME"/bundle
|
|||||||
export RBENV_ROOT="$XDG_STATE_HOME/rbenv"
|
export RBENV_ROOT="$XDG_STATE_HOME/rbenv"
|
||||||
x-dc "$RBENV_ROOT"
|
x-dc "$RBENV_ROOT"
|
||||||
x-have gem && export PATH="${GEM_HOME}/bin:$PATH"
|
x-have gem && export PATH="${GEM_HOME}/bin:$PATH"
|
||||||
x-have rbenv && {
|
|
||||||
[ "$DOTFILES_CURRENT_SHELL" = "zsh" ] && eval "$(rbenv init - zsh)"
|
|
||||||
[ "$DOTFILES_CURRENT_SHELL" = "bash" ] && eval "$(rbenv init - bash)"
|
|
||||||
}
|
|
||||||
|
|
||||||
# Rust / cargo
|
# Rust / cargo
|
||||||
export RUSTUP_HOME="$XDG_DATA_HOME/rustup"
|
export RUSTUP_HOME="$XDG_DATA_HOME/rustup"
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
# lakka exports
|
# lakka exports
|
||||||
|
|
||||||
## LUA
|
## LUA
|
||||||
have luarocks && $(luarocks path --bin)
|
x-have luarocks && $(luarocks path --bin)
|
||||||
|
|
||||||
export PATH="$HOME/.local/go/bin:$PATH"
|
export PATH="$HOME/.local/go/bin:$PATH"
|
||||||
|
|
||||||
@@ -17,4 +17,3 @@ export RVM_PATH="$HOME/.rvm"
|
|||||||
export PATH="$RVM_PATH/bin:$PATH"
|
export PATH="$RVM_PATH/bin:$PATH"
|
||||||
# shellcheck source=$HOME/.rvm/scripts/rvm
|
# 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*
|
[[ -s "$RVM_PATH/scripts/rvm" ]] && source "$RVM_PATH/scripts/rvm" # Load RVM into a shell session *as a function*
|
||||||
|
|
||||||
|
|||||||
@@ -3,21 +3,6 @@
|
|||||||
# shellcheck disable=1091,2046
|
# shellcheck disable=1091,2046
|
||||||
# vim: filetype=bash
|
# 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
|
# Bash completion file location
|
||||||
export BASH_COMPLETION_USER_FILE="${XDG_CONFIG_HOME}/bash-completion/bash_completion"
|
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
|
export LESSHISTFILE="$XDG_STATE_HOME"/less/history
|
||||||
|
|
||||||
# Highlight section titles in manual pages
|
# Highlight section titles in manual pages
|
||||||
export LESS_TERMCAP_md="$ORANGE"
|
# export LESS_TERMCAP_md="$ORANGE"
|
||||||
|
|
||||||
# zsh autoloaded terminfo
|
# zsh autoloaded terminfo
|
||||||
export TERMINFO="$XDG_DATA_HOME"/terminfo
|
export TERMINFO="${XDG_DATA_HOME}/terminfo"
|
||||||
export TERMINFO_DIRS="$XDG_DATA_HOME"/terminfo:/usr/share/terminfo
|
export TERMINFO_DIRS="${XDG_DATA_HOME}/terminfo":/usr/share/terminfo
|
||||||
|
|
||||||
# Don’t clear the screen after quitting a manual page
|
# Don't clear the screen after quitting a manual page
|
||||||
export MANPAGER="less -X"
|
export MANPAGER="less -X"
|
||||||
|
|
||||||
# Always enable colored `grep` output
|
# Always enable colored `grep` output
|
||||||
|
|||||||
@@ -12,9 +12,14 @@ require("lazy").setup({
|
|||||||
{
|
{
|
||||||
"LazyVim/LazyVim",
|
"LazyVim/LazyVim",
|
||||||
import = "lazyvim.plugins",
|
import = "lazyvim.plugins",
|
||||||
|
opts = {
|
||||||
|
colorscheme = "tokyonight",
|
||||||
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"folke/tokyonight.nvim",
|
"folke/tokyonight.nvim",
|
||||||
|
lazy = false,
|
||||||
|
priority = 1000,
|
||||||
opts = {
|
opts = {
|
||||||
style = "night",
|
style = "night",
|
||||||
transparent = true,
|
transparent = true,
|
||||||
@@ -23,6 +28,8 @@ require("lazy").setup({
|
|||||||
sidebars = "transparent",
|
sidebars = "transparent",
|
||||||
floats = "transparent",
|
floats = "transparent",
|
||||||
},
|
},
|
||||||
|
dim_inactive = true,
|
||||||
|
lualine_bold = true,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{ import = "plugins" },
|
{ import = "plugins" },
|
||||||
|
|||||||
@@ -15,6 +15,10 @@ return {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
keys = {
|
keys = {
|
||||||
|
{
|
||||||
|
"<leader>ba",
|
||||||
|
desc = "Annotations / Comments",
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"<leader>baa",
|
"<leader>baa",
|
||||||
function()
|
function()
|
||||||
@@ -68,10 +72,12 @@ return {
|
|||||||
-- Clarify and beautify your comments using boxes and lines.
|
-- Clarify and beautify your comments using boxes and lines.
|
||||||
-- https://github.com/LudoPinelli/comment-box.nvim
|
-- https://github.com/LudoPinelli/comment-box.nvim
|
||||||
{ "LudoPinelli/comment-box.nvim", opts = {} },
|
{ "LudoPinelli/comment-box.nvim", opts = {} },
|
||||||
|
-- Mason
|
||||||
|
-- https://github.com/williamboman/mason.nvim
|
||||||
{
|
{
|
||||||
"williamboman/mason.nvim",
|
"williamboman/mason.nvim",
|
||||||
opts = {
|
opts = function(_, opts)
|
||||||
ensure_installed = {
|
vim.list_extend(opts.ensure_installed, {
|
||||||
"actionlint",
|
"actionlint",
|
||||||
"ansible-language-server",
|
"ansible-language-server",
|
||||||
"ansible-lint",
|
"ansible-lint",
|
||||||
@@ -86,18 +92,24 @@ return {
|
|||||||
"dockerfile-language-server",
|
"dockerfile-language-server",
|
||||||
"editorconfig-checker",
|
"editorconfig-checker",
|
||||||
"fixjson",
|
"fixjson",
|
||||||
|
"flake8",
|
||||||
"html-lsp",
|
"html-lsp",
|
||||||
"jq",
|
"jq",
|
||||||
|
"jsonlint",
|
||||||
|
"luacheck",
|
||||||
"nginx-language-server",
|
"nginx-language-server",
|
||||||
"php-cs-fixer",
|
"php-cs-fixer",
|
||||||
|
"phpcs",
|
||||||
|
"phpmd",
|
||||||
"semgrep",
|
"semgrep",
|
||||||
"sonarlint-language-server",
|
|
||||||
"stylua",
|
|
||||||
"shellcheck",
|
"shellcheck",
|
||||||
"shfmt",
|
"shfmt",
|
||||||
"flake8",
|
"sonarlint-language-server",
|
||||||
},
|
"stylelint",
|
||||||
},
|
"stylua",
|
||||||
|
"yamllint",
|
||||||
|
})
|
||||||
|
end,
|
||||||
},
|
},
|
||||||
-- Vim plugin for automatic time tracking and metrics generated from your programming activity.
|
-- Vim plugin for automatic time tracking and metrics generated from your programming activity.
|
||||||
-- https://github.com/wakatime/vim-wakatime
|
-- https://github.com/wakatime/vim-wakatime
|
||||||
|
|||||||
@@ -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",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
}
|
|
||||||
@@ -92,9 +92,6 @@ set-window-option -g mode-keys vi
|
|||||||
# │ Theme │
|
# │ Theme │
|
||||||
# ╰──────────────────────────────────────────────────────────╯
|
# ╰──────────────────────────────────────────────────────────╯
|
||||||
|
|
||||||
# Set theme to tokyonight
|
|
||||||
# source-file ~/.dotfiles/config/tmux/tokyonight_storm.tmux
|
|
||||||
|
|
||||||
# Make sure status sides are long enough and centered is in the middle
|
# Make sure status sides are long enough and centered is in the middle
|
||||||
set -g status-left-length "30"
|
set -g status-left-length "30"
|
||||||
set -g status-right-length "30"
|
set -g status-right-length "30"
|
||||||
@@ -143,9 +140,6 @@ 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_empty_mode_style 'bg=default,fg=#7aa2f7'
|
||||||
set -g @mode_indicator_sync_mode_style 'bg=default,fg=red'
|
set -g @mode_indicator_sync_mode_style 'bg=default,fg=red'
|
||||||
|
|
||||||
# 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}"
|
|
||||||
|
|
||||||
# ╭──────────────────────────────────────────────────────────╮
|
# ╭──────────────────────────────────────────────────────────╮
|
||||||
# │ Plugins │
|
# │ Plugins │
|
||||||
# ╰──────────────────────────────────────────────────────────╯
|
# ╰──────────────────────────────────────────────────────────╯
|
||||||
|
|||||||
@@ -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 ""
|
|
||||||
15
config/user-dirs.dirs
Normal file
15
config/user-dirs.dirs
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
# This file is written by xdg-user-dirs-update
|
||||||
|
# If you want to change or add directories, just edit the line you're
|
||||||
|
# interested in. All local changes will be retained on the next run.
|
||||||
|
# Format is XDG_xxx_DIR="$HOME/yyy", where yyy is a shell-escaped
|
||||||
|
# homedir-relative path, or XDG_xxx_DIR="/yyy", where /yyy is an
|
||||||
|
# absolute path. No other format is supported.
|
||||||
|
#
|
||||||
|
XDG_DESKTOP_DIR="$HOME/Desktop"
|
||||||
|
XDG_DOWNLOAD_DIR="$HOME/Downloads"
|
||||||
|
XDG_TEMPLATES_DIR="$HOME/"
|
||||||
|
XDG_PUBLICSHARE_DIR="$HOME/"
|
||||||
|
XDG_DOCUMENTS_DIR="$HOME/"
|
||||||
|
XDG_MUSIC_DIR="$HOME/"
|
||||||
|
XDG_PICTURES_DIR="$HOME/"
|
||||||
|
XDG_VIDEOS_DIR="$HOME/"
|
||||||
1
config/user-dirs.locale
Normal file
1
config/user-dirs.locale
Normal file
@@ -0,0 +1 @@
|
|||||||
|
en_US
|
||||||
@@ -19,6 +19,9 @@ VERSION_NVM="v0.39.5"
|
|||||||
export DOTFILES="$HOME/.dotfiles"
|
export DOTFILES="$HOME/.dotfiles"
|
||||||
# shellcheck source=./../../scripts/shared.sh
|
# shellcheck source=./../../scripts/shared.sh
|
||||||
source "$HOME/.dotfiles/scripts/shared.sh"
|
source "$HOME/.dotfiles/scripts/shared.sh"
|
||||||
|
source "$DOTFILES/config/exports"
|
||||||
|
source "$DOTFILES/config/alias"
|
||||||
|
source "$DOTFILES/config/functions"
|
||||||
|
|
||||||
# Loads configs for better installation experience
|
# Loads configs for better installation experience
|
||||||
x-load-configs
|
x-load-configs
|
||||||
@@ -152,6 +155,8 @@ function section_install
|
|||||||
nvm)
|
nvm)
|
||||||
msg "Installing nvm..."
|
msg "Installing nvm..."
|
||||||
curl -o- "https://raw.githubusercontent.com/nvm-sh/nvm/$VERSION_NVM/install.sh" | bash
|
curl -o- "https://raw.githubusercontent.com/nvm-sh/nvm/$VERSION_NVM/install.sh" | bash
|
||||||
|
git checkout "$DOTFILES/base/zshrc"
|
||||||
|
git checkout "$DOTFILES/base/bashrc"
|
||||||
$0 install nvm-latest
|
$0 install nvm-latest
|
||||||
msg_yay "nvm installed!"
|
msg_yay "nvm installed!"
|
||||||
;;
|
;;
|
||||||
@@ -161,7 +166,8 @@ function section_install
|
|||||||
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
|
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
|
||||||
fi
|
fi
|
||||||
nvm install --lts --latest-npm --default
|
nvm install --lts --latest-npm --default
|
||||||
git checkout "$DOTFILES/base/*"
|
git checkout "$DOTFILES/base/zshrc"
|
||||||
|
git checkout "$DOTFILES/base/bashrc"
|
||||||
msg_yay "latest lts node installed!"
|
msg_yay "latest lts node installed!"
|
||||||
;;
|
;;
|
||||||
npm)
|
npm)
|
||||||
|
|||||||
@@ -2,35 +2,76 @@
|
|||||||
# Load our configuration files
|
# Load our configuration files
|
||||||
# Copyright (c) 2023 Ismo Vuorinen. All Rights Reserved.
|
# Copyright (c) 2023 Ismo Vuorinen. All Rights Reserved.
|
||||||
|
|
||||||
# Set verbosity with VERBOSE=1 x-load-configs
|
set -euo pipefail
|
||||||
: "${VERBOSE:0}"
|
|
||||||
|
|
||||||
DOTFILES="$HOME/.dotfiles"
|
# Set verbosity with VERBOSE=1 x-load-configs
|
||||||
|
VERBOSE="${VERBOSE:=0}"
|
||||||
|
|
||||||
|
[ "$VERBOSE" = "1" ] && {
|
||||||
|
set -x
|
||||||
|
}
|
||||||
|
|
||||||
CONFIG_PATH="$DOTFILES/config"
|
CONFIG_PATH="$DOTFILES/config"
|
||||||
|
|
||||||
# Load the shell dotfiles, and then some:
|
# Load the shell dotfiles, and then some:
|
||||||
HOST="$(hostname -s)"
|
HOST="$(hostname -s)"
|
||||||
[ "$VERBOSE" = "1" ] && {
|
[ "$VERBOSE" = "1" ] && {
|
||||||
echo "x-load-config-fn: VERBOSE=1"
|
echo "x-load-configs: VERBOSE=1"
|
||||||
echo "x-load-config-fn: HOST: $HOST"
|
echo "x-load-configs: HOST: $HOST"
|
||||||
}
|
}
|
||||||
for FILE in $CONFIG_PATH/{exports,alias,functions}; do
|
|
||||||
FILENAME="$FILE"
|
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
|
# global (exports|alias|functions) FILENAME for all hosts
|
||||||
# shellcheck source=../config/exports
|
# shellcheck source=../config/exports
|
||||||
[ -r "$FILENAME" ] && source "$FILENAME" \
|
[ -r "$CONFIG_FILE" ] && {
|
||||||
&& [ "$VERBOSE" = "1" ] && echo "x-load-config-fn: $FILENAME"
|
source "$CONFIG_FILE" && [ "$VERBOSE" = "1" ] && configMsg "Found" "$CONFIG_FILE"
|
||||||
|
}
|
||||||
|
|
||||||
# global secret FILENAME, git ignored
|
# global secret FILENAME, git ignored
|
||||||
# shellcheck source=../config/exports-secret
|
# shellcheck source=../config/exports-secret
|
||||||
[ -r "$FILENAME-secret" ] && source "$FILENAME-secret" \
|
[ "$VERBOSE" = "1" ] && configMsg "?" "$SECRET_FILE"
|
||||||
&& [ "$VERBOSE" = "1" ] && echo "x-load-config-fn: $FILENAME-secret"
|
[ -r "$SECRET_FILE" ] && {
|
||||||
|
source "$SECRET_FILE" && [ "$VERBOSE" = "1" ] && configMsg "Found" "$SECRET_FILE"
|
||||||
|
}
|
||||||
# host specific (exports|alias|functions) FILENAME
|
# host specific (exports|alias|functions) FILENAME
|
||||||
# shellcheck source=../config/exports
|
# shellcheck source=../config/exports
|
||||||
[ -r "$FILENAME-$HOST" ] && source "$FILENAME-$HOST" \
|
[ "$VERBOSE" = "1" ] && configMsg "?" "$HOST_FILE"
|
||||||
&& [ "$VERBOSE" = "1" ] && echo "x-load-config-fn: $FILENAME-$HOST"
|
[ -r "$HOST_FILE" ] && {
|
||||||
|
source "$HOST_FILE" && [ "$VERBOSE" = "1" ] && configMsg "Found" "$HOST_FILE"
|
||||||
|
}
|
||||||
# host specific (exports|alias|functions) FILENAME, git ignored
|
# host specific (exports|alias|functions) FILENAME, git ignored
|
||||||
# shellcheck source=../config/exports
|
# shellcheck source=../config/exports
|
||||||
[ -r "$FILENAME-$HOST-secret" ] && source "$FILENAME-$HOST-secret" \
|
[ "$VERBOSE" = "1" ] && configMsg "?" "$SECRET_HOST"
|
||||||
&& [ "$VERBOSE" = "1" ] && echo "x-load-config-fn: $FILENAME-$HOST-secret"
|
[ -r "$SECRET_HOST" ] && {
|
||||||
done
|
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
|
||||||
|
|||||||
50
local/bin/x-set-php-aliases
Executable file
50
local/bin/x-set-php-aliases
Executable 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
|
||||||
@@ -2,18 +2,29 @@
|
|||||||
# Install cargo/rust packages.
|
# Install cargo/rust packages.
|
||||||
#
|
#
|
||||||
# shellcheck source=shared.sh
|
# shellcheck source=shared.sh
|
||||||
|
source "$HOME/.dotfiles/config/exports"
|
||||||
|
source "$HOME/.dotfiles/config/alias"
|
||||||
|
source "$HOME/.dotfiles/config/functions"
|
||||||
source "$HOME/.dotfiles/scripts/shared.sh"
|
source "$HOME/.dotfiles/scripts/shared.sh"
|
||||||
|
|
||||||
msg "Starting to install rust/cargo packages"
|
msg "Starting to install rust/cargo packages"
|
||||||
|
|
||||||
! x-have cargo && {
|
! x-have cargo && {
|
||||||
msg "cargo could not be found. installing cargo with rustup.rs"
|
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
|
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- --no-modify-path -y
|
||||||
}
|
}
|
||||||
|
|
||||||
source "$CARGO_HOME/env"
|
source "$CARGO_HOME/env"
|
||||||
|
|
||||||
|
! x-have rustup && {
|
||||||
|
msg_err "rustup could not be found. Aborting..."
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
|
||||||
|
rustup default system
|
||||||
|
|
||||||
packages=(
|
packages=(
|
||||||
|
"cargo-cache"
|
||||||
# starship.rs
|
# starship.rs
|
||||||
"starship"
|
"starship"
|
||||||
# An incremental parsing system for programming tools
|
# An incremental parsing system for programming tools
|
||||||
@@ -58,4 +69,5 @@ x-have bob && {
|
|||||||
bob use stable && x-path-append "$XDG_DATA_HOME/bob/nvim-bin"
|
bob use stable && x-path-append "$XDG_DATA_HOME/bob/nvim-bin"
|
||||||
}
|
}
|
||||||
|
|
||||||
msg_done "All next steps done!"
|
msg_run "Removing cargo cache"
|
||||||
|
cargo cache --autoclean
|
||||||
|
|||||||
@@ -24,10 +24,13 @@ else
|
|||||||
# Update the repo
|
# Update the repo
|
||||||
msg_run "Starting to update $TLDR_GIT"
|
msg_run "Starting to update $TLDR_GIT"
|
||||||
git -C "$TLDR_TEMP_DIR" reset --hard origin/main
|
git -C "$TLDR_TEMP_DIR" reset --hard origin/main
|
||||||
git -C "$TLDR_TEMP_DIR" pull -q \
|
git -C "$TLDR_TEMP_DIR" pull -q --depth 2 \
|
||||||
&& msg_done "Updated $TLDR_GIT"
|
&& msg_done "Updated $TLDR_GIT"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
msg_run "Removing non-english translation files"
|
||||||
|
rm -rf "$TLDR_TEMP_DIR/pages.*"
|
||||||
|
|
||||||
# Fetch the destination directory from cheat defined directories.
|
# Fetch the destination directory from cheat defined directories.
|
||||||
TLDR_CHEAT_DEST="$(cheat -d | grep tldr | head -1 | awk '{print $2}')"
|
TLDR_CHEAT_DEST="$(cheat -d | grep tldr | head -1 | awk '{print $2}')"
|
||||||
|
|
||||||
|
|||||||
@@ -50,4 +50,8 @@ x-have git-profile && {
|
|||||||
}
|
}
|
||||||
|
|
||||||
echo ""
|
echo ""
|
||||||
|
|
||||||
|
msg_run "Clearing go cache"
|
||||||
|
go clean -cache -modcache
|
||||||
|
|
||||||
msg_ok "Done"
|
msg_ok "Done"
|
||||||
|
|||||||
@@ -37,3 +37,8 @@ done
|
|||||||
msg_run "Upgrading all global packages"
|
msg_run "Upgrading all global packages"
|
||||||
npm -g --no-progress --no-timing --no-fund outdated
|
npm -g --no-progress --no-timing --no-fund outdated
|
||||||
npm -g --no-timing --no-fund upgrade
|
npm -g --no-timing --no-fund upgrade
|
||||||
|
|
||||||
|
msg_run "Cleaning up npm cache"
|
||||||
|
npm cache verify
|
||||||
|
npm cache clean --force
|
||||||
|
npm cache verify
|
||||||
|
|||||||
Reference in New Issue
Block a user