migrated zsh and generic shell configs

This commit is contained in:
pr0c3550r 2023-01-30 21:42:42 +01:00
parent 045a4401e5
commit 6735cf79f8
3 changed files with 192 additions and 0 deletions

View file

@ -0,0 +1,83 @@
#!/bin/sh
# Use neovim for vim if present.
[ -x "$(command -v nvim)" ] && alias vim="nvim" vimdiff="nvim -d"
# Use $XINITRC variable if file exists.
[ -f "$XINITRC" ] && alias startx="startx $XINITRC"
for command in mount umount apt dnf xbps-install pacman updatedb init systemctl service openrc-shutdown reboot ; do
alias $command="doas $command"
done; unset command
if command -v doas > /dev/null
then
alias \
sudo="doas" \
usod="doas" \
suod="doas" \
duso="doas" \
osud="doas" \
duso="doas" \
daos="doas" \
daso="doas" \
ados="doas" \
odas="doas";
else
alias \
doas="sudo" \
usod="sudo" \
suod="sudo" \
duso="sudo" \
osud="sudo" \
duso="sudo" \
daos="sudo" \
daso="sudo" \
ados="sudo" \
odas="sudo";
fi
alias \
sl="ls" \
ls="ls -hN --color=auto" \
la="ls -ahN --color=auto" \
ll="ls -ahlN --color=auto"
alias \
lsb="lsblk -a" \
lsu="lsusb"
alias \
:q="exit" \
ZZ="exit" \
ZQ="exit" \
quit="exit"
alias \
cp="cp -iv" \
mk="mkdir -pv" \
rm="rm -rI" \
mv="mv -iv"
alias \
rsync="rsync -rtvzP"
alias \
t="tmux" \
ta="tmux new -A -s" \
v="$EDITOR" \
e="$EDITOR" \
z="zathura" \
p="pacman" \
syu="pacman -Syu" \
ka="killall" \
n="nnn"
alias \
info="info --vi-keys" \
backup='doas rsync -aAXHv --exclude={"/dev/*","/proc/*","/sys/*","/tmp/*","/run/*","/mnt/*","/media/*","/lost+found","swapfile","/var/lib/dhcpcd/*","/home/*/Media/*","/home/*/.cache/BraveSoftware/*","/home/*/.cache/thumbnails/*","/home/*/.cache/spotify/*","/home/*/Downloads/*","home/*/.cache/mozilla/*","/home/*/.config/BraveSoftware/*","/home/*/.config/Signal/*","/home/*/.config/spotify/*","/home/*/.config/libreoffice/*","/home/*/.config/GeoGebra/*","/home/*/.config/blender/*","/home/*/.local/share/torbrowser/*","/home/*/.mozilla/*"} / /home/pr073c70r/Media/USB0'

View file

@ -0,0 +1,33 @@
#!/bin/sh
# profile file. Runs on login.
# Environmental variables are set here.
# Expanding $PATH to set ./local/bin
export PATH="$PATH:${$(find ~/.local/bin -type d -printf %p:)%%:}"
# Default programs:
export EDITOR="nvim"
export TERMINAL="st"
export TERM="tmux-256color"
export BROWSER="firefox"
# XDG
export XDG_CONFIG_HOME="$HOME/.config"
export XDG_DATA_HOME="$HOME/.local/share"
export XDG_CACHE_HOME="$HOME/.cache"
# Moving home config files to .config
export XINITRC="${XDG_CONFIG_HOME:-$HOME/.config}/x11/xinitrc"
export ZDOTDIR="${XDG_CONFIG_HOME:-$HOME/.config}/zsh"
export GTK2_RC_FILES="${XDG_CONFIG_HOME:-$HOME/.config}/gtk-2.0/gtkrc-2.0"
export WGETRC="${XDG_CONFIG_HOME:-$HOME/.config}/wget/wgetrc"
export HISTFILE="${XDG_DATA_HOME:-$HOME/.local/share}/history"
export WALLPAPER=~/Pictures/Wallpaper/coast.jpg
# NNN file manager
export NNN_FCOLORS='0B0B04060006060009060B06'
export LESSHISTFILE="-"

76
zsh/.config/zsh/.zshrc Executable file
View file

@ -0,0 +1,76 @@
#ZSH-CONFIG
#Configuration of ZSH by: pr073c70r
#Version: 1.3
#Last Update: 03.10.2021
#Info: Runs on Openrc
#Dependency: zsh-syntax-highlighting, zsh-autosuggestions
# PS1='%B%F{ebdbb2}[%f%F{#cc241d}%n%f%F{ebdbb2}@%f%F{#689d6a}%m%f%F{ebdbb2}]%f%b %B%F{ebdbb2}[%F{#fabd2f}%~%f%b%B%F{ebdbb2}]%b %B%F{#fabd2f}${vcs_info_msg_0_}%f%b'$'\n''%B%F{#8ec07c}>%f%b '
PS1='╭%F{#7daea3} ﱮ %f %F{#7daea3}%~%f ${vcs_info_msg_0_}'$'\n''╰%B%F{#a9b665}%f%b '
zstyle ':completion:*' completer _complete _ignored _approximate
zstyle ':completion:*' list-colors ''
zstyle ':completion:*' menu select=long-list select=0
zstyle ':completion:*' select-prompt %SScrolling active: current selection at %p%s
zstyle ':completion:*' use-compctl true
zstyle :compinstall filename '/home/pr073c70r/.zshrc'
zmodload zsh/complist
autoload -Uz compinit
compinit
_comp_options+=(globdots)
HISTSIZE=10000000
SAVEHIST=10000000
HISTFILE=$XDG_DATA_HOME/histfile
setopt nomatch notify
unsetopt beep
setopt autocd
stty stop undef
bindkey -v
[ -f "$XINITRC" ] && alias startx="startx $XINITRC"
[ -f "${XDG_CONFIG_HOME:-$HOME/.config}/shell/aliasrc" ] && source "${XDG_CONFIG_HOME:-$HOME/.config}/shell/aliasrc"
# Configs for Git in Prompt
# autoload zsh add-zsh-hook and vcs_info functions (-U autoload w/o substition, -z use zsh style)
autoload -Uz add-zsh-hook vcs_info
# # Enable substitution in the prompt.
setopt prompt_subst
# Run vcs_info just before a prompt is displayed (precmd)
add-zsh-hook precmd vcs_info
# Enable checking for (un)staged changes, enabling use of %u and %c
zstyle ':vcs_info:*' check-for-changes true
# Set custom strings for an unstaged vcs repo changes (*) and staged changes (+)
zstyle ':vcs_info:*' unstagedstr ' +'
zstyle ':vcs_info:*' stagedstr ' *'
# Set the format of the Git information for vcs_info
zstyle ':vcs_info:git:*' formats '%B%F{#fabd2f}%f%%b %F{#fabd2f}%B%b%f%%b%B%F{#ea6962}%u%c%%b%f'
zstyle ':vcs_info:git:*' actionformats '%B%F{#fabd2f}%f%%b %F{#fabd2f}%B%b%f%%b %F{#a9b665}(%a)%f%B%F{#ea6962}%u%c%%b%f'
#TERMINALCLOCK
#Refresh the Terminalprompt to show running clock
#TMOUT=1
#
#TRAPALRM() {
# zle reset-prompt
#}
# use the vi keys to navigate the menu completion
bindkey -M menuselect 'h' vi-backward-char
bindkey -M menuselect 'k' vi-up-line-or-history
bindkey -M menuselect 'l' vi-forward-char
bindkey -M menuselect 'j' vi-down-line-or-history
source /usr/share/zsh/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
source /usr/share/zsh/plugins/zsh-autosuggestions/zsh-autosuggestions.zsh