diff options
author | self <self@sateoki.xyz> | 2022-01-07 16:55:21 +0000 |
---|---|---|
committer | self <self@sateoki.xyz> | 2022-01-07 16:55:21 +0000 |
commit | e71c6ccddedaa8b7ea5f22ee176fe56b776fc6ba (patch) | |
tree | 28d588ed33ccaf1a9aa665a5a942175841dd4897 /zsh/.zshrc | |
parent | b2ccfbf3b732f30c403c9b09122dcac5142abea5 (diff) |
Various additions
Diffstat (limited to 'zsh/.zshrc')
-rw-r--r-- | zsh/.zshrc | 112 |
1 files changed, 98 insertions, 14 deletions
@@ -1,7 +1,15 @@ -# Lines configured by zsh-newuser-install -HISTFILE=~/.config/zsh/histfile -HISTSIZE=1000 +# History +HISTFILE=~/.config/zsh/zsh_history +HISTSIZE=1001 SAVEHIST=1000 +setopt HIST_EXPIRE_DUPS_FIRST +setopt HIST_IGNORE_DUPS +setopt HIST_IGNORE_ALL_DUPS +setopt HIST_IGNORE_SPACE +setopt HIST_FIND_NO_DUPS +setopt HIST_SAVE_NO_DUPS + +# Various setopt autocd unsetopt beep bindkey -v @@ -9,29 +17,105 @@ bindkey -v # The following lines were added by compinstall zstyle :compinstall filename '/home/george/.zshrc' +# Path +export PATH="$PATH:/home/george/.local/bin" + +# Configuring applications to use nvidia GPU +alias mpv='__NV_PRIME_RENDER_OFFLOAD=1 __GLX_VENDOR_LIBRARY_NAME="nvidia" __VK_LAYER_NV_optimus="NVIDIA_only" __GL_SHOW_GRAPHICS_OSD=1 mpv' + # Other general user config -export LESSHISTFILE=/dev/null # Remove ~/.lesshst generation +export USRCONFDIR=/home/george/.usrconf # Set user configuration directory +export LANG=en_GB.UTF-8 autoload -U colors && colors autoload -U promptinit && promptinit +# Dealing with .lesshst +export LESSHISTFILE=/dev/null # Remove ~/.lesshst generation + +# TODO: add all XDG directories in the right places, and then run the commands +# as per the SO post: https://stackoverflow.com/questions/26198926/why-does-lesshst-keep-showing-up-in-my +# to get rid of .lesshst file and where man creates it as well + +# alias less='less --lesskey-file=$XDG_CONFIG_HOME/lesskey' +# alias man='man --pager="less --lesskey-file=$XDG_CONFIG_HOME/lesskey"' + +# Dealing with .fehbg +alias feh="feh --no-fehbg" + +# Newsboat +alias newsboat="newsboat -u ~/.config/newsboat/urls" + + # Changing Default Prompt -PROMPT='[%F{160}%n %F{93}%1d%f] $ ' +PS1='[%F{#ff0000}%n%f| %F{#6a0dad}%1d%f] => ' +PROMPT=$PS1 -# Aliases +# Aliases / Functions alias ls='ls -a --color=always' -alias exa="exa -a --header --long --git" +alias e="exa -a --header --long --git" +alias pkg-query="pacman -Qq | fzf --preview 'pacman -Qil {}' --layout=reverse --bind 'enter:execute(pacman -Qil {} | less)'" +alias s="systemctl" +alias c="clear ; e" +alias r="newsboat" +alias m="ncmpcpp" +alias v="nvim" +alias randbg="wal -i $USRCONFDIR/backgrounds/nice-photos > /dev/null" # random background +alias rb="wal -R > /dev/null" # refresh bg +alias rbghs="randbg --backend haishoku" # random background haishoku backend +alias td="mn todos" +alias wtd="mn work-todos" +alias awl="mn anime-watchlist" + +lle() { # Life Log Entry + if [ -z "$1" ]; then + mkdir -p /mnt/Shared/Text/daily-log/$(date +%Y-%m) + nvim /mnt/Shared/Text/daily-log/$(date +%Y-%m)/L$(date --iso-8601).txt + else + mkdir -p /mnt/Shared/Text/daily-log/$(date +%Y-%m -d $1) + nvim /mnt/Shared/Text/daily-log/$(date +%Y-%m -d $1)/L$(date --iso-8601 -d $1).txt + fi +} + +mer() { # Month End Recap - TODO: get this to work just with e.g. mer 2022-01 + if [ -z "$1"]; then + mkdir -p /mnt/Shared/Text/daily-log/$(date +%Y-%m) + nvim "/mnt/Shared/Text/daily-log/$(date +%Y-%m)/L$(date +%Y-%m) - Month End Recap" + else + mkdir -p /mnt/Shared/Text/daily-log/$(date +%Y-%m -d $1) + nvim "/mnt/Shared/Text/daily-log/$(date +%Y-%m -d $1)/L$(date +%Y-%m -d $1) - Month End Recap" + fi +} + +yer() { # Year End Recap - TODO: see mer TODO + if [ -z "$1"]; then + mkdir -p /mnt/Shared/Text/daily-log/$(date +%Y)-12 + nvim "/mnt/Shared/Text/daily-log/$(date +%Y)-12/$(date +%Y) - Year End Recap" + else + mkdir -p /mnt/Shared/Text/daily-log/$(date %Y -d $1)-12 + nvim "/mnt/Shared/Text/daily-log/$(date +%Y -d $1)-12/$(date +%Y -d $1) - Year End Recap" + fi +} -alias mount-shared="[ \"$(findmnt | grep /mnt/Shared -c)\" = \"0\" ] && sudo mount /dev/sda1 /mnt/Shared ; echo \"$(findmnt | grep /mnt/Shared -c)\"" -alias mount-fedora="[ \"$(findmnt | grep /mnt/Fedora -c)\" = \"0\" ] && sudo mount /dev/sda5 /mnt/Fedora" -alias umount-shared="sudo umount /mnt/Shared" -alias umount-fedora="sudo umount /mnt/Fedora" -alias lle="mount-shared ; mkdir -p /mnt/Shared/Text/daily-log/$(date +%Y-%m) ; nvim /mnt/Shared/Text/daily-log/$(date +%Y-%m)/L$(date --iso-8601).txt" -alias fin="mount-shared ; libreoffice --calc /mnt/Shared/Trackers/Financial/new/$(date +%Y-%m).ods & " -# Add command that open Month end entry for final month, at /mnt/Shared/Text/daily-log/ and previous months month then filename 2021-NN - How I Improved.txt +mn() { # make note + nvim "/mnt/Shared/Text/$1" +} +alias en="nvim /mnt/Shared/Text" +alias fin="libreoffice --calc /mnt/Shared/Trackers/Financial/new/$(date +%Y-%m).ods & " + +# Aliases for git +alias gb="git branch" +alias gco="git checkout" +alias gcom="git checkout master" +alias gdb="git branch -d" + + autoload -Uz compinit compinit # End of lines added by compinstall + +# Sourcing for zsh +source /usr/share/zsh/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh |