some changes
This commit is contained in:
parent
370d6ea0f3
commit
ddaaa1e99d
6 changed files with 314 additions and 0 deletions
91
dotfiles/.config/.zshrc
Executable file
91
dotfiles/.config/.zshrc
Executable file
|
@ -0,0 +1,91 @@
|
|||
|
||||
# Enable Powerlevel10k instant prompt. Should stay close to the top of ~/.zshrc.
|
||||
# Initialization code that may require console input (password prompts, [y/n]
|
||||
# confirmations, etc.) must go above this block; everything else may go below.
|
||||
if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]; then
|
||||
source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh"
|
||||
fi
|
||||
|
||||
if [[ -f "/opt/homebrew/bin/brew" ]] then
|
||||
# If you're using macOS, you'll want this enabled
|
||||
eval "$(/opt/homebrew/bin/brew shellenv)"
|
||||
fi
|
||||
|
||||
# Set the directory we want to store zinit and plugins
|
||||
ZINIT_HOME="${XDG_DATA_HOME:-${HOME}/.local/share}/zinit/zinit.git"
|
||||
|
||||
# Download Zinit, if it's not there yet
|
||||
if [ ! -d "$ZINIT_HOME" ]; then
|
||||
mkdir -p "$(dirname $ZINIT_HOME)"
|
||||
git clone https://github.com/zdharma-continuum/zinit.git "$ZINIT_HOME"
|
||||
fi
|
||||
|
||||
# Source/Load zinit
|
||||
source "${ZINIT_HOME}/zinit.zsh"
|
||||
source "$HOME/.config/zsh/upin-alias"
|
||||
source "$HOME/.config/zsh/dependencies"
|
||||
source "$HOME/.config/zsh/init"
|
||||
source "$HOME/.config/zsh/toolbox"
|
||||
|
||||
# Add in Powerlevel10k
|
||||
zinit ice depth=1; zinit light romkatv/powerlevel10k
|
||||
|
||||
# Add in zsh plugins
|
||||
zinit light zsh-users/zsh-syntax-highlighting
|
||||
zinit light zsh-users/zsh-completions
|
||||
zinit light zsh-users/zsh-autosuggestions
|
||||
zinit light Aloxaf/fzf-tab
|
||||
|
||||
# Add in snippets
|
||||
zinit snippet OMZP::git
|
||||
zinit snippet OMZP::sudo
|
||||
zinit snippet OMZP::archlinux
|
||||
zinit snippet OMZP::aws
|
||||
zinit snippet OMZP::docker-compose
|
||||
zinit snippet OMZP::kubectl
|
||||
zinit snippet OMZP::kubectx
|
||||
zinit snippet OMZP::command-not-found
|
||||
|
||||
# Load completions
|
||||
autoload -Uz compinit && compinit
|
||||
|
||||
zinit cdreplay -q
|
||||
|
||||
# To customize prompt, run `p10k configure` or edit ~/.p10k.zsh.
|
||||
[[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh
|
||||
|
||||
# Keybindings
|
||||
#bindkey -e
|
||||
#bindkey '^p' history-search-backward
|
||||
#bindkey '^n' history-search-forward
|
||||
#bindkey '^[w' kill-region
|
||||
|
||||
# History
|
||||
HISTSIZE=5000
|
||||
HISTFILE=~/.zsh_history
|
||||
SAVEHIST=$HISTSIZE
|
||||
HISTDUP=erase
|
||||
setopt appendhistory
|
||||
setopt sharehistory
|
||||
setopt hist_ignore_space
|
||||
setopt hist_ignore_all_dups
|
||||
setopt hist_save_no_dups
|
||||
setopt hist_ignore_dups
|
||||
setopt hist_find_no_dups
|
||||
|
||||
# Completion styling
|
||||
zstyle ':completion:*' matcher-list 'm:{a-z}={A-Za-z}'
|
||||
zstyle ':completion:*' list-colors "${(s.:.)LS_COLORS}"
|
||||
zstyle ':completion:*' menu no
|
||||
zstyle ':fzf-tab:complete:cd:*' fzf-preview 'ls --color $realpath'
|
||||
zstyle ':fzf-tab:complete:__zoxide_z:*' fzf-preview 'ls --color $realpath'
|
||||
|
||||
# Aliases
|
||||
alias ls='ls --color'
|
||||
alias vim='nvim'
|
||||
alias c='clear'
|
||||
|
||||
# Shell integrations
|
||||
# eval "$(fzf --zsh)"
|
||||
eval "$(zoxide init --cmd cd zsh)"
|
||||
|
1
dotfiles/.config/zsh/dependencies
Executable file
1
dotfiles/.config/zsh/dependencies
Executable file
|
@ -0,0 +1 @@
|
|||
#!/usr/bin/zsh
|
101
dotfiles/.config/zsh/init
Executable file
101
dotfiles/.config/zsh/init
Executable file
|
@ -0,0 +1,101 @@
|
|||
#!/bin/zsh
|
||||
# Initial file for zsh
|
||||
# sudo/please
|
||||
alias please='sudo'
|
||||
|
||||
#colored everything
|
||||
alias ip="ip -c"
|
||||
#ripgrep
|
||||
if command -v rg >/dev/null 2>&1; then
|
||||
alias grep="rg --color=always"
|
||||
else
|
||||
alias grep="grep --color=always"
|
||||
fi
|
||||
|
||||
#weather
|
||||
alias www='curl wttr.in/Ulm'
|
||||
|
||||
# ls alias
|
||||
if command -v lsd >/dev/null 2>&1; then
|
||||
alias ls='lsd --icon always'
|
||||
alias ll='lsd --icon always -lA'
|
||||
alias l='lsd --icon always -l'
|
||||
LS="lsd"
|
||||
elif command -v exa >/dev/null 2>&1; then
|
||||
alias ls='exa --icons=always'
|
||||
alias ll='exa --icons=always -lA'
|
||||
alias l='exa --icons=always -l'
|
||||
LS="exa"
|
||||
elif command -v eza >/dev/null 2>&1; then
|
||||
alias ls='eza --icons=always'
|
||||
alias ll='eza --icons=always -lA'
|
||||
alias l='eza --icons=always -l'
|
||||
LS="eza"
|
||||
else
|
||||
alias ls='ls --color=always -lph'
|
||||
alias ll='ls --color=always -lAph'
|
||||
alias l='ls --color=always -l'
|
||||
fi
|
||||
|
||||
# pfetch alias
|
||||
if command -v fastfetch >/dev/null 2>&1; then
|
||||
alias ff='fastfetch'
|
||||
alias fetch='fastfetch'
|
||||
alias f='fastfetch --config examples/8'
|
||||
alias clear='command clear && f'
|
||||
alias clearl='command clear && f && l && pwd'
|
||||
elif command -v pfetch >/dev/null 2>&1; then
|
||||
alias p='pfetch'
|
||||
alias clear='command clear && pfetch'
|
||||
alias clearl='command clear && p && l && pwd'
|
||||
else
|
||||
$ZSH_UPDATE fastfetch
|
||||
fi
|
||||
|
||||
# git alias
|
||||
if command -v git >/dev/null 2>&1; then
|
||||
alias g='git'
|
||||
alias gc='git clone'
|
||||
alias gs='git status'
|
||||
alias ga='git add'
|
||||
alias gcm='git commit'
|
||||
alias gp='git pull'
|
||||
fi
|
||||
|
||||
# docker alias
|
||||
if command -v docker >/dev/null 2>&1; then
|
||||
alias up='docker compose up'
|
||||
alias down='docker compose down'
|
||||
alias pull='docker compose pull'
|
||||
alias d='docker'
|
||||
alias dr='docker run --rm -it'
|
||||
alias ds='docker ps -a'
|
||||
alias dc='docker compose'
|
||||
alias db='docker build'
|
||||
alias appupdate='docker pull && docker compose up -d --force-recreate'
|
||||
fi
|
||||
|
||||
# z stands for zoxide
|
||||
if command -v zoxide >/dev/null 2>&1; then
|
||||
alias z='cd'
|
||||
eval "$(zoxide init --cmd cd zsh)"
|
||||
if command -v fzf >/dev/null 2>&1; then
|
||||
# Shell integrations
|
||||
eval "$(fzf --zsh)"
|
||||
else
|
||||
"$ZSH_INSTALL" fzf
|
||||
fi
|
||||
fi
|
||||
|
||||
# rsync alias
|
||||
if command -v rsync >/dev/null 2>&1; then
|
||||
alias cp='rsync -avP'
|
||||
alias scp='rsync -avP'
|
||||
fi
|
||||
|
||||
# tmux alias
|
||||
if command -v tmux >/dev/null 2>&1; then
|
||||
alias ts="tmux source $HOME/.tmux.conf"
|
||||
alias ta="tmux a"
|
||||
alias t="tmux"
|
||||
fi
|
22
dotfiles/.config/zsh/toolbox
Executable file
22
dotfiles/.config/zsh/toolbox
Executable file
|
@ -0,0 +1,22 @@
|
|||
#!/bin/zsh
|
||||
# variables
|
||||
toolbox_on="The following tools are installed:
|
||||
"
|
||||
toolbox_off="The following tools are NOT installed:
|
||||
"
|
||||
# various tools/cmdlets to check for
|
||||
tools=("nvim" "tmux" "git" "zoxide" "docker" "fzf" "distrobox")
|
||||
|
||||
for tool in "$tools[@]" do
|
||||
if command -v "$tool" >/dev/null 2>&1; then
|
||||
toolbox_on="$toolbox_on
|
||||
$tool"
|
||||
else
|
||||
toolbox_off="$toolbox_off
|
||||
$tool"
|
||||
fi
|
||||
done
|
||||
|
||||
TOOLBOX="$toolbox_on
|
||||
|
||||
$toolbox_off"
|
88
dotfiles/.config/zsh/upin-alias
Executable file
88
dotfiles/.config/zsh/upin-alias
Executable file
|
@ -0,0 +1,88 @@
|
|||
#!/usr/bin/zsh
|
||||
|
||||
# check for sudo
|
||||
if [ "$USER" != "root" ]; then
|
||||
sudo="sudo"
|
||||
else
|
||||
sudo=""
|
||||
fi
|
||||
|
||||
# APT/NALA - Debian
|
||||
if command -v nala >/dev/null 2>&1; then
|
||||
pkg="$sudo nala"
|
||||
install="$pkg update && $pkg install"
|
||||
remove="$pkg prune"
|
||||
update="$pkg update && $pkg upgrade"
|
||||
ref="$pkg update"
|
||||
search="$pkg search"
|
||||
elif command -v apt-get >/dev/null 2>&1; then
|
||||
pkg="$sudo apt-get"
|
||||
install="$pkg update && $pkg install"
|
||||
remove="$pkg remove"
|
||||
update="$pkg update && $pkg upgrade"
|
||||
ref="$pkg update"
|
||||
search="$pkg search"
|
||||
fi
|
||||
|
||||
# DNF - Fedora
|
||||
if command -v dnf >/dev/null 2>&1; then
|
||||
pkg="$sudo dnf"
|
||||
install="$pkg install"
|
||||
remove="$pkg remove"
|
||||
update="$pkg update"
|
||||
ref="$update"
|
||||
search="$pkg search"
|
||||
fi
|
||||
|
||||
# Pacman - Arch
|
||||
if command -v paru >/dev/null 2>&1; then
|
||||
pkg="paru"
|
||||
install="$pkg -S"
|
||||
remove="$pkg -R"
|
||||
update="$pkg -Syu"
|
||||
ref="$pkg"
|
||||
search="$pkg -Ss"
|
||||
elif command -v yay >/dev/null 2>&1; then
|
||||
pkg="yay"
|
||||
install="$pkg -S"
|
||||
remove="$pkg -R"
|
||||
update="$pkg -Syu"
|
||||
ref="$pkg -Sy"
|
||||
search="$pkg -Ss"
|
||||
elif command -v pacman >/dev/null 2>&1; then
|
||||
pkg="$sudo pacman"
|
||||
install="$pkg -S"
|
||||
remove="$pkg -R"
|
||||
update="$pkg -Syu"
|
||||
ref="$pkg -Sy"
|
||||
search="$pkg -Ss"
|
||||
fi
|
||||
|
||||
|
||||
# Zypper - OpenSuse
|
||||
if command -v zypper >/dev/null 2>&1; then
|
||||
pkg="$sudo zypper"
|
||||
install="$pkg install"
|
||||
remove="$pkg remove"
|
||||
update="$pkg dup"
|
||||
ref="$pkg refresh"
|
||||
search="$pkg search"
|
||||
fi
|
||||
|
||||
# APK - Alpine
|
||||
if command -v apk >/dev/null 2>&1; then
|
||||
pkg="$sudo apk"
|
||||
install="$pkg add"
|
||||
update="$pkg upgrade"
|
||||
ref="$pkg update"
|
||||
search="$pkg search"
|
||||
fi
|
||||
|
||||
ZSH_INSTALL="$install"
|
||||
ZSH_UPDATE="$ref"
|
||||
|
||||
alias install="$install"
|
||||
alias update="$update"
|
||||
alias remove="$remove"
|
||||
alias refresh="$ref"
|
||||
alias search="$search"
|
11
makefile
Normal file
11
makefile
Normal file
|
@ -0,0 +1,11 @@
|
|||
all:
|
||||
stow --verbose --target=$$HOME --adopt --restow */
|
||||
|
||||
install:
|
||||
stow --verbose --target=$$HOME --adopt --restow */
|
||||
|
||||
delete:
|
||||
stow --verbose --target=$$HOME --delete */
|
||||
|
||||
remove:
|
||||
stow --verbose --target=$$HOME --delete */
|
Loading…
Add table
Add a link
Reference in a new issue