refactor(config): rename starship.toml and remove stale zcompdump
This commit is contained in:
13 files changed
-2715
No files matched your search
File renamed without changes.
File diff suppressed because it is too large.
Load diff
@@ -1,3 +0,0 @@
|
||||
if uwsm check may-start; then
|
||||
exec uwsm start hyprland.desktop
|
||||
fi
|
||||
@@ -1,23 +0,0 @@
|
||||
## ░▀▀█░█▀▀░█░█░█▀▄░█▀▀
|
||||
## ░▄▀░░▀▀█░█▀█░█▀▄░█░░
|
||||
## ░▀▀▀░▀▀▀░▀░▀░▀░▀░▀▀▀
|
||||
##
|
||||
## rxyhn's Z-Shell configuration
|
||||
## https://github.com/rxyhn
|
||||
|
||||
while read file
|
||||
do
|
||||
source "$ZDOTDIR/$file.zsh"
|
||||
done <<-EOF
|
||||
theme
|
||||
env
|
||||
aliases
|
||||
utility
|
||||
options
|
||||
plugins
|
||||
keybinds
|
||||
prompt
|
||||
ascii
|
||||
EOF
|
||||
|
||||
# vim:ft=zsh:nowrap
|
||||
@@ -1,110 +0,0 @@
|
||||
|
||||
##
|
||||
## Aliases
|
||||
##
|
||||
|
||||
# Use the same editor
|
||||
alias vim='$EDITOR'
|
||||
alias vi='$EDITOR'
|
||||
alias code='$EDITOR'
|
||||
|
||||
# Suffix aliases (execute specific file types with desired tool)
|
||||
alias edit='vim' # Edit files with vim
|
||||
|
||||
#List
|
||||
alias ls="eza --color=auto --icons"
|
||||
alias l="ls -l"
|
||||
alias ll="ls -a"
|
||||
alias lla="ls -la"
|
||||
alias lt="ls --tree"
|
||||
|
||||
#pacman unlock
|
||||
alias unlock="sudo rm /var/lib/pacman/db.lck"
|
||||
alias rmpacmanlock="sudo rm /var/lib/pacman/db.lck"
|
||||
|
||||
# aur helper
|
||||
alias i="paru -S"
|
||||
alias r="paru -Rns"
|
||||
alias u="paru -Syu"
|
||||
alias s="paru -Ss"
|
||||
alias Q="paru -Q"
|
||||
|
||||
#cache clean
|
||||
alias clean="paru -Scc"
|
||||
|
||||
# pacman or pm
|
||||
alias pacman='sudo pacman --color auto'
|
||||
alias update='sudo pacman -Syyu'
|
||||
alias upgrade='paru -Syyu'
|
||||
|
||||
#add new fonts
|
||||
alias update-fc='sudo fc-cache -fv'
|
||||
|
||||
#switch between bash and zsh
|
||||
alias tobash="sudo chsh $USER -s /bin/bash && echo 'Now log out.'"
|
||||
alias tozsh="sudo chsh $USER -s /bin/zsh && echo 'Now log out.'"
|
||||
alias tofish="sudo chsh $USER -s /bin/fish && echo 'Now log out.'"
|
||||
|
||||
#Cleanup orphaned packages
|
||||
alias cleanup='sudo pacman -Rns $(pacman -Qtdq)'
|
||||
|
||||
|
||||
#fix obvious typo's
|
||||
alias c="clear"
|
||||
alias q="exit"
|
||||
alias :q="exit"
|
||||
alias mtar='tar -zcvf' # mtar <archive_compress>
|
||||
alias utar='tar -zxvf' # utar <archive_decompress> <file_list>
|
||||
alias z='zip -r' # z <archive_compress> <file_list>
|
||||
alias uz='unzip' # uz <archive_decompress> -d <dir>
|
||||
alias sr='source ~/.config/zsh/env.zsh'
|
||||
alias ..="cd .."
|
||||
alias mkdir="mkdir -p"
|
||||
alias cat="bat --color always --plain"
|
||||
alias grep='grep --color=auto'
|
||||
alias mv='mv -v'
|
||||
alias cp='cp -vr'
|
||||
alias rm='rm -vr'
|
||||
|
||||
|
||||
#clean caches
|
||||
alias cleanram="sudo sh -c 'sync; echo 3 > /proc/sys/vm/drop_caches'"
|
||||
|
||||
#grub update
|
||||
alias mkgrub='sudo grub-mkconfig -o /boot/grub/grub.cfg'
|
||||
|
||||
# other
|
||||
alias py='python'
|
||||
alias tree='tree -C'
|
||||
|
||||
venv() {
|
||||
if [[ -d .venv ]]; then
|
||||
source .venv/bin/activate && echo "Activated existing .venv"
|
||||
else
|
||||
python -m venv .venv && source .venv/bin/activate && echo "Created and activated new .venv"
|
||||
fi
|
||||
}
|
||||
|
||||
act() {
|
||||
local dir="$PWD"
|
||||
while [[ "$dir" != "/" ]]; do
|
||||
if [[ -f "$dir/venv/bin/activate" ]]; then
|
||||
source "$dir/venv/bin/activate" && echo "Activated: $dir/venv"
|
||||
return
|
||||
elif [[ -f "$dir/.venv/bin/activate" ]]; then
|
||||
source "$dir/.venv/bin/activate" && echo "Activated: $dir/.venv"
|
||||
return
|
||||
fi
|
||||
dir="$(dirname "$dir")"
|
||||
done
|
||||
echo "No virtualenv found"
|
||||
}
|
||||
|
||||
# Wifi management
|
||||
alias wifi-gui='nm-connection-editor'
|
||||
alias wifi-tui='nmtui'
|
||||
|
||||
# git Aliases
|
||||
alias commit="git add . && git commit -m"
|
||||
alias push="git push"
|
||||
# vim:ft=zsh
|
||||
@@ -1,36 +0,0 @@
|
||||
# echo '888888888888888888888888888888888888888888888888888888888888'
|
||||
# echo '888888888888888888888888888888888888888888888888888888888888'
|
||||
# echo '8888888888888888888888888P"" ""9888888888888888888888888888'
|
||||
# echo '8888888888888888P"88888P 988888"9888888888888888888'
|
||||
# echo '8888888888888888 "9888 888P" 888888888888888888'
|
||||
# echo '888888888888888888bo "9 d8o o8b P" od88888888888888888888'
|
||||
# echo '888888888888888888888bob 98" "8P dod88888888888888888888888'
|
||||
# echo '888888888888888888888888 db 88888888888888888888888888'
|
||||
# echo '88888888888888888888888888 8888888888888888888888888888'
|
||||
# echo '88888888888888888888888P"9bo odP"98888888888888888888888888'
|
||||
# echo '88888888888888888888P" od88888888bo "98888888888888888888888'
|
||||
# echo '888888888888888888 d88888888888888b 88888888888888888888'
|
||||
# echo '8888888888888888888oo8888888888888888oo888888888888888888888'
|
||||
# echo '8888888888888888888888888888888888888888888888888O8888888888'
|
||||
#
|
||||
# echo ' ▄ '
|
||||
# echo ' ▟█▙ '
|
||||
# echo ' ▟███▙ '
|
||||
# echo ' ▟█████▙ '
|
||||
# echo ' ▟███████▙ '
|
||||
# echo ' ▂▔▀▜██████▙ '
|
||||
# echo ' ▟██▅▂▝▜█████▙ '
|
||||
# echo ' ▟█████████████▙ '
|
||||
# echo ' ▟███████████████▙ '
|
||||
# echo ' ▟█████████████████▙ '
|
||||
# echo ' ▟███████████████████▙ '
|
||||
# echo ' ▟█████████▛▀▀▜████████▙ '
|
||||
# echo ' ▟████████▛ ▜███████▙ '
|
||||
# echo ' ▟█████████ ████████▙ '
|
||||
# echo ' ▟██████████ █████▆▅▄▃▂ '
|
||||
# echo ' ▟██████████▛ ▜█████████▙ '
|
||||
# echo ' ▟██████▀▀▀ ▀▀██████▙ '
|
||||
# echo ' ▟███▀▘ ▝▀███▙ '
|
||||
# echo ' ▟▛▀ ▀▜▙ '
|
||||
#
|
||||
# trek
|
||||
@@ -1,124 +0,0 @@
|
||||
##
|
||||
## PATH & ENV Var
|
||||
##
|
||||
|
||||
|
||||
|
||||
export PATH="$PNPM_HOME:$PATH"
|
||||
export PATH="$HOME/.scripts:$PATH"
|
||||
export PATH="$HOME/.local/bin:$PATH"
|
||||
|
||||
# Cargo
|
||||
export CARGO_HOME="$HOME/.local/state/cargo"
|
||||
export RUSTUP_HOME="$HOME/.local/state/rustup"
|
||||
|
||||
|
||||
#npm
|
||||
export NPM_CONFIG_CACHE="$XDG_STATE_HOME/npm/cache"
|
||||
export PATH="$HOME/.npm-global/bin:$PATH"
|
||||
|
||||
|
||||
|
||||
|
||||
# yarn
|
||||
export YARN_CACHE_FOLDER="$XDG_STATE_HOME/yarn"
|
||||
#
|
||||
# # pnpm
|
||||
export PNPM_HOME="$XDG_STATE_HOME/pnpm"
|
||||
export PNPM_STORE_PATH="$XDG_STATE_HOME/pnpm/store"
|
||||
export PATH="$PNPM_HOME:$PATH"
|
||||
|
||||
#python
|
||||
export XDG_CACHE_HOME="$HOME/.cache" # pip respects this for cache
|
||||
|
||||
#docker
|
||||
export DOCKER_CONFIG="$XDG_STATE_HOME/docker"
|
||||
|
||||
|
||||
|
||||
#Go
|
||||
export GOPATH="$XDG_STATE_HOME/.local/go"
|
||||
export PATH="$GOPATH/bin:$PATH"
|
||||
|
||||
|
||||
export SUDO_PROMPT="passwd: "
|
||||
export TERMINAL="kitty"
|
||||
export BROWSER="zen-browser"
|
||||
export VISUAL="nvim"
|
||||
export EDITOR="nvim"
|
||||
|
||||
export BUN_INSTALL="$HOME/.bun"
|
||||
export PATH="$BUN_INSTALL/bin:$PATH"
|
||||
|
||||
export JAVA_HOME=/usr/lib/jvm/java-17-openjdk
|
||||
export PATH=$JAVA_HOME/bin:$PATH
|
||||
|
||||
export XDG_CONFIG_HOME="$HOME/.config"
|
||||
export XDG_CACHE_HOME="$HOME/.cache"
|
||||
export XDG_DATA_HOME="$HOME/.local/share"
|
||||
export XDG_STATE_HOME="$HOME/.local/state"
|
||||
export XDG_CONFIG_DIRS="/etc/xdg"
|
||||
export XDG_DATA_DIRS="/usr/local/share:/usr/share:/var/lib/flatpak/exports/share:$XDG_DATA_HOME/flatpak/exports/share"
|
||||
export XDG_RUNTIME_DIR="/run/user/$(id -u)"
|
||||
export XDG_DESKTOP_DIR="$HOME/Desktop"
|
||||
export XDG_DOWNLOAD_DIR="$HOME/Downloads"
|
||||
export XDG_TEMPLATES_DIR="$HOME/Templates"
|
||||
export XDG_PUBLICSHARE_DIR="$HOME/Public"
|
||||
export XDG_DOCUMENTS_DIR="$HOME/Documents"
|
||||
export XDG_MUSIC_DIR="$HOME/Music"
|
||||
export XDG_PICTURES_DIR="$HOME/Pictures"
|
||||
export XDG_VIDEOS_DIR="$HOME/Videos"
|
||||
|
||||
export GOPATH="$XDG_DATA_HOME/.local/go"
|
||||
export GOMODCACHE="$XDG_CACHE_HOME/.local/go/mod"
|
||||
export CARGO_HOME="$XDG_DATA_HOME/cargo"
|
||||
export RUSTUP_HOME="XDG_DATA_HOME/rustup"
|
||||
# export ANDROID_HOME="$XDG_DATA_HOME/android"
|
||||
export ANDROID_HOME=/opt/android-sdk
|
||||
export NPM_CONFIG_USERCONFIG="$XDG_CONFIG_HOME/npm/npmrc"
|
||||
export PYENV_ROOT="$XDG_DATA_HOME/pyenv"
|
||||
export PYTHONSTARTUP="$XDG_CONFIG_HOME/python/pythonrc"
|
||||
|
||||
## Comment this to use normal manpager
|
||||
export MANPAGER='nvim +Man! +"set nocul" +"set noshowcmd" +"set noruler" +"set noshowmode" +"set laststatus=0" +"set showtabline=0" +"set nonumber"'
|
||||
|
||||
if [ $(echo $MANPAGER | awk '{print $1}') = nvim ]; then
|
||||
export LESS="--RAW-CONTROL-CHARS"
|
||||
export MANPAGER="less -s -M +Gg"
|
||||
|
||||
export LESS_TERMCAP_mb=$'\e[1;32m'
|
||||
export LESS_TERMCAP_md=$'\e[1;32m'
|
||||
export LESS_TERMCAP_me=$'\e[0m'
|
||||
export LESS_TERMCAP_se=$'\e[0m'
|
||||
export LESS_TERMCAP_so=$'\e[01;33m'
|
||||
export LESS_TERMCAP_ue=$'\e[0m'
|
||||
export LESS_TERMCAP_us=$'\e[1;4;31m'
|
||||
fi
|
||||
|
||||
# FZF bases
|
||||
export FZF_DEFAULT_OPTS="
|
||||
--color fg:#cfc9c2
|
||||
--color fg+:#cfc9c2
|
||||
--color bg:#1e1e2e
|
||||
--color bg+:#313244
|
||||
--color hl:#f7768e
|
||||
--color hl+:#f7768e
|
||||
--color info:#bb9af7
|
||||
--color prompt:#bb9af7
|
||||
--color spinner:#c0caf5
|
||||
--color pointer:#c0caf5
|
||||
--color marker:#c0caf5
|
||||
--color border:#1e1e2e
|
||||
--color header:#f7768e
|
||||
--prompt ' '
|
||||
--pointer ' λ'
|
||||
--layout=reverse
|
||||
--border horizontal
|
||||
--height 40"
|
||||
|
||||
# Fix LS_COLORS being unreadable.
|
||||
export LS_COLORS='*.7z=38;5;40:*.WARC=38;5;40:*.a=38;5;40:*.arj=38;5;40:*.bz2=38;5;40:*.cpio=38;5;40:*.gz=38;5;40:*.lrz=38;5;40:*.lz=38;5;40:*.lzma=38;5;40:*.lzo=38;5;40:*.rar=38;5;40:*.s7z=38;5;40:*.sz=38;5;40:*.tar=38;5;40:*.tbz=38;5;40:*.tgz=38;5;40:*.warc=38;5;40:*.xz=38;5;40:*.z=38;5;40:*.zip=38;5;40:*.zipx=38;5;40:*.zoo=38;5;40:*.zpaq=38;5;40:*.zst=38;5;40:*.zstd=38;5;40:*.zz=38;5;40:*@.service=38;5;45:*AUTHORS=38;5;220;1:*CHANGES=38;5;220;1:*CONTRIBUTORS=38;5;220;1:*COPYING=38;5;220;1:*COPYRIGHT=38;5;220;1:*CodeResources=38;5;239:*Dockerfile=38;5;155:*HISTORY=38;5;220;1:*INSTALL=38;5;220;1:*LICENSE=38;5;220;1:*LS_COLORS=48;5;89;38;5;197;1;3;4;7:*MANIFEST=38;5;243:*Makefile=38;5;155:*NOTICE=38;5;220;1:*PATENTS=38;5;220;1:*PkgInfo=38;5;239:*README=38;5;220;1:*README.md=38;5;220;1:*README.rst=38;5;220;1:*VERSION=38;5;220;1:*authorized_keys=1:*cfg=1:*conf=1:*config=1:*core=38;5;241:*id_dsa=38;5;192;3:*id_ecdsa=38;5;192;3:*id_ed25519=38;5;192;3:*id_rsa=38;5;192;3:*known_hosts=1:*lock=38;5;248:*lockfile=38;5;248:*pm_to_blib=38;5;240:*rc=1:*.1p=38;5;7:*.32x=38;5;213:*.3g2=38;5;115:*.3ga=38;5;137;1:*.3gp=38;5;115:*.3p=38;5;7:*.82p=38;5;121:*.83p=38;5;121:*.8eu=38;5;121:*.8xe=38;5;121:*.8xp=38;5;121:*.A64=38;5;213:*.BAT=38;5;172:*.BUP=38;5;241:*.C=38;5;81:*.CFUserTextEncoding=38;5;239:*.DS_Store=38;5;239:*.F=38;5;81:*.F03=38;5;81:*.F08=38;5;81:*.F90=38;5;81:*.F95=38;5;81:*.H=38;5;110:*.IFO=38;5;114:*.JPG=38;5;97:*.M=38;5;110:*.MOV=38;5;114:*.PDF=38;5;141:*.PFA=38;5;66:*.PL=38;5;160:*.R=38;5;49:*.RData=38;5;178:*.Rproj=38;5;11:*.S=38;5;110:*.S3M=38;5;137;1:*.SKIP=38;5;244:*.TIFF=38;5;97:*.VOB=38;5;115;1:*.a00=38;5;213:*.a52=38;5;213:*.a64=38;5;213:*.a78=38;5;213:*.aac=38;5;137;1:*.accdb=38;5;60:*.accde=38;5;60:*.accdr=38;5;60:*.accdt=38;5;60:*.adf=38;5;213:*.adoc=38;5;184:*.afm=38;5;66:*.agda=38;5;81:*.agdai=38;5;110:*.ahk=38;5;41:*.ai=38;5;99:*.aiff=38;5;136;1:*.alac=38;5;136;1:*.allow=38;5;112:*.am=38;5;242:*.amr=38;5;137;1:*.ape=38;5;136;1:*.apk=38;5;215:*.application=38;5;116:*.aria2=38;5;241:*.asc=38;5;192;3:*.asciidoc=38;5;184:*.asf=38;5;115:*.asm=38;5;81:*.ass=38;5;117:*.atr=38;5;213:*.au=38;5;137;1:*.automount=38;5;45:*.avi=38;5;114:*.awk=38;5;172:*.bak=38;5;241:*.bash=38;5;172:*.bash_login=1:*.bash_logout=1:*.bash_profile=1:*.bat=38;5;172:*.bfe=38;5;192;3:*.bib=38;5;178:*.bin=38;5;124:*.bmp=38;5;97:*.bsp=38;5;215:*.c=38;5;81:*.c++=38;5;81:*.cab=38;5;215:*.caf=38;5;137;1:*.cap=38;5;29:*.car=38;5;57:*.cbr=38;5;141:*.cbz=38;5;141:*.cc=38;5;81:*.cda=38;5;136;1:*.cdi=38;5;213:*.cdr=38;5;97:*.chm=38;5;141:*.cl=38;5;81:*.clj=38;5;41:*.cljc=38;5;41:*.cljs=38;5;41:*.cljw=38;5;41:*.cnc=38;5;7:*.coffee=38;5;074;1:*.cp=38;5;81:*.cpp=38;5;81:*.cr=38;5;81:*.crx=38;5;215:*.cs=38;5;81:*.css=38;5;125;1:*.csv=38;5;78:*.ctp=38;5;81:*.cue=38;5;116:*.cxx=38;5;81:*.dart=38;5;51:*.dat=38;5;137;1:*.db=38;5;60:*.deb=38;5;215:*.def=38;5;7:*.deny=38;5;196:*.description=38;5;116:*.device=38;5;45:*.dhall=38;5;178:*.dicom=38;5;97:*.diff=48;5;197;38;5;232:*.directory=38;5;116:*.divx=38;5;114:*.djvu=38;5;141:*.dll=38;5;241:*.dmg=38;5;215:*.dmp=38;5;29:*.doc=38;5;111:*.dockerignore=38;5;240:*.docm=38;5;111;4:*.docx=38;5;111:*.drw=38;5;99:*.dtd=38;5;178:*.dts=38;5;137;1:*.dump=38;5;241:*.dwg=38;5;216:*.dylib=38;5;241:*.ear=38;5;215:*.el=38;5;81:*.elc=38;5;241:*.eln=38;5;241:*.eml=38;5;125;1:*.enc=38;5;192;3:*.entitlements=1:*.epf=1:*.eps=38;5;99:*.epsf=38;5;99:*.epub=38;5;141:*.err=38;5;160;1:*.error=38;5;160;1:*.etx=38;5;184:*.ex=38;5;7:*.example=38;5;7:*.f=38;5;81:*.f03=38;5;81:*.f08=38;5;81:*.f4v=38;5;115:*.f90=38;5;81:*.f95=38;5;81:*.fcm=38;5;137;1:*.feature=38;5;7:*.flac=38;5;136;1:*.flif=38;5;97:*.flv=38;5;115:*.fm2=38;5;213:*.fmp12=38;5;60:*.fnt=38;5;66:*.fon=38;5;66:*.for=38;5;81:*.fp7=38;5;60:*.ftn=38;5;81:*.fvd=38;5;124:*.fxml=38;5;178:*.gb=38;5;213:*.gba=38;5;213:*.gbc=38;5;213:*.gbr=38;5;7:*.gel=38;5;213:*.gemspec=38;5;41:*.ger=38;5;7:*.gg=38;5;213:*.ggl=38;5;213:*.gif=38;5;97:*.git=38;5;197:*.gitattributes=38;5;240:*.gitignore=38;5;240:*.gitmodules=38;5;240:*.go=38;5;81:*.gp3=38;5;115:*.gp4=38;5;115:*.gpg=38;5;192;3:*.gs=38;5;81:*.h=38;5;110:*.h++=38;5;110:*.hi=38;5;110:*.hidden-base-scheme=1:*.hidden-tmTheme=1:*.hin=38;5;242:*.hpp=38;5;110:*.hs=38;5;81:*.htm=38;5;125;1:*.html=38;5;125;1:*.hxx=38;5;110:*.icns=38;5;97:*.ico=38;5;97:*.ics=38;5;7:*.ii=38;5;110:*.img=38;5;124:*.iml=38;5;166:*.in=38;5;242:*.info=38;5;184:*.ini=1:*.ipa=38;5;215:*.ipk=38;5;213:*.ipynb=38;5;41:*.iso=38;5;124:*.j64=38;5;213:*.jad=38;5;215:*.jar=38;5;215:*.java=38;5;074;1:*.jhtm=38;5;125;1:*.jpeg=38;5;97:*.jpg=38;5;97:*.js=38;5;074;1:*.jsm=38;5;074;1:*.json=38;5;178:*.jsonl=38;5;178:*.jsonnet=38;5;178:*.jsp=38;5;074;1:*.kak=38;5;172:*.key=38;5;166:*.lagda=38;5;81:*.lagda.md=38;5;81:*.lagda.rst=38;5;81:*.lagda.tex=38;5;81:*.last-run=1:*.less=38;5;125;1:*.lhs=38;5;81:*.libsonnet=38;5;142:*.lisp=38;5;81:*.lnk=38;5;39:*.localized=38;5;239:*.localstorage=38;5;60:*.log=38;5;190:*.lua=38;5;81:*.m=38;5;110:*.m2v=38;5;114:*.m3u=38;5;116:*.m3u8=38;5;116:*.mLine truncated
|
||||
|
||||
# Fix ranger locale error
|
||||
export LANGUAGE="en_US.UTF-8"
|
||||
export LC_ALL="en_US.UTF-8"
|
||||
@@ -1,21 +0,0 @@
|
||||
##
|
||||
## Keybindings
|
||||
##
|
||||
|
||||
bindkey '^[[H' beginning-of-line
|
||||
bindkey '^[[F' end-of-line
|
||||
bindkey -s '^K' 'ls^M'
|
||||
bindkey -s '^o' '_smooth_fzf^M'
|
||||
|
||||
# prepend sudo on the current commmand
|
||||
bindkey -M emacs '' _sudo_command_line
|
||||
bindkey -M vicmd '' _sudo_command_line
|
||||
bindkey -M viins '' _sudo_command_line
|
||||
|
||||
# fix backspace and other stuff in vi-mode
|
||||
bindkey -M viins '\e/' _vi_search_fix
|
||||
bindkey "^?" backward-delete-char
|
||||
bindkey "^H" backward-delete-char
|
||||
bindkey "^U" backward-kill-line
|
||||
|
||||
# vim:ft=zsh:nowrap
|
||||
@@ -1,85 +0,0 @@
|
||||
##
|
||||
## ZSH Options
|
||||
##
|
||||
|
||||
umask 022
|
||||
zmodload zsh/zle
|
||||
zmodload zsh/zpty
|
||||
zmodload zsh/complist
|
||||
|
||||
autoload _vi_search_fix
|
||||
autoload -Uz colors
|
||||
autoload -U compinit
|
||||
colors
|
||||
|
||||
zle -N _vi_search_fix
|
||||
zle -N _sudo_command_line
|
||||
|
||||
# Completion
|
||||
# disable sort when completing `git checkout`
|
||||
zstyle ':completion:*:git-checkout:*' sort false
|
||||
# set descriptions format to enable group support
|
||||
zstyle ':completion:*:descriptions' format '[%d]'
|
||||
# set list-colors to enable filename colorizing
|
||||
zstyle ':completion:*' list-colors ${(s.:.)LS_COLORS}
|
||||
# preview directory's content with exa when completing cd
|
||||
zstyle ':fzf-tab:complete:cd:*' fzf-preview 'exa -1 --color=always $realpath'
|
||||
# switch group using `,` and `.`
|
||||
zstyle ':fzf-tab:*' switch-group ',' '.'
|
||||
|
||||
# History
|
||||
HISTFILE=~/.config/zsh/history
|
||||
HISTSIZE=10000
|
||||
SAVEHIST=10000
|
||||
|
||||
# Autosuggestion
|
||||
ZSH_AUTOSUGGEST_USE_ASYNC="true"
|
||||
ZSH_HIGHLIGHT_HIGHLIGHTERS=(main brackets pattern cursor regexp root line)
|
||||
ZSH_HIGHLIGHT_MAXLENGTH=512
|
||||
ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE="fg=$color8,bold"
|
||||
|
||||
while read -r opt
|
||||
do
|
||||
setopt $opt
|
||||
done <<-EOF
|
||||
AUTOCD
|
||||
AUTO_MENU
|
||||
AUTO_PARAM_SLASH
|
||||
COMPLETE_IN_WORD
|
||||
NO_MENU_COMPLETE
|
||||
HASH_LIST_ALL
|
||||
ALWAYS_TO_END
|
||||
NOTIFY
|
||||
NOHUP
|
||||
MAILWARN
|
||||
INTERACTIVE_COMMENTS
|
||||
NOBEEP
|
||||
APPEND_HISTORY
|
||||
SHARE_HISTORY
|
||||
INC_APPEND_HISTORY
|
||||
EXTENDED_HISTORY
|
||||
HIST_IGNORE_ALL_DUPS
|
||||
HIST_IGNORE_SPACE
|
||||
HIST_NO_FUNCTIONS
|
||||
HIST_EXPIRE_DUPS_FIRST
|
||||
HIST_SAVE_NO_DUPS
|
||||
HIST_REDUCE_BLANKS
|
||||
EOF
|
||||
|
||||
while read -r opt
|
||||
do
|
||||
unsetopt $opt
|
||||
done <<-EOF
|
||||
FLOWCONTROL
|
||||
NOMATCH
|
||||
CORRECT
|
||||
EQUALS
|
||||
EOF
|
||||
|
||||
command -v zoxide &>/dev/null && eval "$(zoxide init zsh)"
|
||||
# eval "$(fnm env --use-on-cd)"
|
||||
|
||||
# Set editor default keymap to emacs (`-e`) or vi (`-v`)
|
||||
bindkey -e
|
||||
|
||||
# vim:filetype=zsh:nowrap
|
||||
@@ -1,50 +0,0 @@
|
||||
##
|
||||
## Plugins
|
||||
##
|
||||
|
||||
# Configure and load plugins using Zinit's
|
||||
ZINIT_HOME="${ZINIT_HOME:-${XDG_DATA_HOME:-${HOME}/.local/share}/zinit}"
|
||||
|
||||
# Added by Zinit's installer
|
||||
if [[ ! -f ${ZINIT_HOME}/zinit.git/zinit.zsh ]]; then
|
||||
print -P "%F{14}▓▒░ Installing Flexible and fast ZSH plugin manager %F{13}(zinit)%f"
|
||||
command mkdir -p "${ZINIT_HOME}" && command chmod g-rwX "${ZINIT_HOME}"
|
||||
command git clone https://github.com/zdharma-continuum/zinit.git "${ZINIT_HOME}/zinit.git" && \
|
||||
print -P "%F{10}▓▒░ Installation successful.%f%b" || \
|
||||
print -P "%F{9}▓▒░ The clone has failed.%f%b"
|
||||
fi
|
||||
|
||||
source "${ZINIT_HOME}/zinit.git/zinit.zsh"
|
||||
|
||||
zinit ice blockf atpull'zinit creinstall -q .'
|
||||
zinit light zsh-users/zsh-completions
|
||||
|
||||
autoload compinit
|
||||
compinit
|
||||
|
||||
zinit light-mode for \
|
||||
hlissner/zsh-autopair \
|
||||
zdharma-continuum/fast-syntax-highlighting \
|
||||
MichaelAquilina/zsh-you-should-use \
|
||||
zsh-users/zsh-autosuggestions \
|
||||
Aloxaf/fzf-tab
|
||||
|
||||
zinit ice wait'3' lucid
|
||||
zinit light zsh-users/zsh-history-substring-search
|
||||
|
||||
zinit ice wait'2' lucid
|
||||
zinit light zdharma-continuum/history-search-multi-word
|
||||
|
||||
# FZF
|
||||
zinit ice from"gh-r" as"command"
|
||||
zinit light junegunn/fzf-bin
|
||||
|
||||
# EZA
|
||||
zinit ice wait lucid from"gh-r" as"program" mv"bin/eza* -> eza"
|
||||
zinit light eza-community/eza
|
||||
|
||||
# BAT
|
||||
zinit ice wait lucid from"gh-r" as"program" mv"*/bat -> bat" atload"export BAT_THEME='Nord'"
|
||||
zinit light sharkdp/bat
|
||||
|
||||
# vim:ft=zsh
|
||||
@@ -1,12 +0,0 @@
|
||||
##
|
||||
## Prompt
|
||||
##
|
||||
|
||||
# Load starship
|
||||
zinit ice as'command' from'gh-r' \
|
||||
atload'export STARSHIP_CONFIG=$XDG_CONFIG_HOME/starship/starship.toml; eval $(starship init zsh)' \
|
||||
atclone'./starship init zsh > init.zsh; ./starship completions zsh > _starship' \
|
||||
atpull'%atclone' src'init.zsh'
|
||||
zinit light starship/starship
|
||||
|
||||
# vim:ft=zsh
|
||||
@@ -1,40 +0,0 @@
|
||||
##
|
||||
## Aesthetic Night Colorscheme
|
||||
##
|
||||
# special
|
||||
background='#1A1B26'
|
||||
foreground='#C0CAF5'
|
||||
|
||||
# black
|
||||
color0='#414868'
|
||||
color8='#414868'
|
||||
|
||||
# red
|
||||
color1='#F7768E'
|
||||
color9='#F7768E'
|
||||
|
||||
# green
|
||||
color2='#9ECE6A'
|
||||
color10='#9ECE6A'
|
||||
|
||||
# yellow
|
||||
color3='#E0AF68'
|
||||
color11='#E0AF68'
|
||||
|
||||
# blue
|
||||
color4='#7AA2F7'
|
||||
color12='#7AA2F7'
|
||||
|
||||
# magenta
|
||||
color5='#BB9AF7'
|
||||
color13='#BB9AF7'
|
||||
|
||||
# cyan
|
||||
color6='#7DCFFF'
|
||||
color14='#7DCFFF'
|
||||
|
||||
# white
|
||||
color7='#A9B1D6'
|
||||
color15='#C0CAF5'
|
||||
|
||||
# vim='iletype'=zsh
|
||||
@@ -1,123 +0,0 @@
|
||||
##
|
||||
## Utility Functions
|
||||
##
|
||||
|
||||
function _smooth_fzf() {
|
||||
local fname
|
||||
local current_dir="$PWD"
|
||||
cd "${XDG_CONFIG_HOME:-~/.config}"
|
||||
fname="$(fzf)" || return
|
||||
$EDITOR "$fname"
|
||||
cd "$current_dir"
|
||||
}
|
||||
|
||||
function _sudo_replace_buffer() {
|
||||
local old=$1 new=$2 space=${2:+ }
|
||||
|
||||
# if the cursor is positioned in the $old part of the text, make
|
||||
# the substitution and leave the cursor after the $new text
|
||||
if [[ $CURSOR -le ${#old} ]]; then
|
||||
BUFFER="${new}${space}${BUFFER#$old }"
|
||||
CURSOR=${#new}
|
||||
# otherwise just replace $old with $new in the text before the cursor
|
||||
else
|
||||
LBUFFER="${new}${space}${LBUFFER#$old }"
|
||||
fi
|
||||
}
|
||||
|
||||
function _sudo_command_line() {
|
||||
# If line is empty, get the last run command from history
|
||||
[[ -z $BUFFER ]] && LBUFFER="$(fc -ln -1)"
|
||||
|
||||
# Save beginning space
|
||||
local WHITESPACE=""
|
||||
if [[ ${LBUFFER:0:1} = " " ]]; then
|
||||
WHITESPACE=" "
|
||||
LBUFFER="${LBUFFER:1}"
|
||||
fi
|
||||
|
||||
{
|
||||
# If $SUDO_EDITOR or $VISUAL are defined, then use that as $EDITOR
|
||||
# Else use the default $EDITOR
|
||||
local EDITOR=${SUDO_EDITOR:-${VISUAL:-$EDITOR}}
|
||||
|
||||
# If $EDITOR is not set, just toggle the sudo prefix on and off
|
||||
if [[ -z "$EDITOR" ]]; then
|
||||
case "$BUFFER" in
|
||||
sudo\ -e\ *) _sudo_replace_buffer "sudo -e" "" ;;
|
||||
sudo\ *) _sudo_replace_buffer "sudo" "" ;;
|
||||
*) LBUFFER="sudo $LBUFFER" ;;
|
||||
esac
|
||||
return
|
||||
fi
|
||||
|
||||
# Check if the typed command is really an alias to $EDITOR
|
||||
|
||||
# Get the first part of the typed command
|
||||
local cmd="${${(Az)BUFFER}[1]}"
|
||||
# Get the first part of the alias of the same name as $cmd, or $cmd if no alias matches
|
||||
local realcmd="${${(Az)aliases[$cmd]}[1]:-$cmd}"
|
||||
# Get the first part of the $EDITOR command ($EDITOR may have arguments after it)
|
||||
local editorcmd="${${(Az)EDITOR}[1]}"
|
||||
|
||||
# Note: ${var:c} makes a $PATH search and expands $var to the full path
|
||||
# The if condition is met when:
|
||||
# - $realcmd is '$EDITOR'
|
||||
# - $realcmd is "cmd" and $EDITOR is "cmd"
|
||||
# - $realcmd is "cmd" and $EDITOR is "cmd --with --arguments"
|
||||
# - $realcmd is "/path/to/cmd" and $EDITOR is "cmd"
|
||||
# - $realcmd is "/path/to/cmd" and $EDITOR is "/path/to/cmd"
|
||||
# or
|
||||
# - $realcmd is "cmd" and $EDITOR is "cmd"
|
||||
# - $realcmd is "cmd" and $EDITOR is "/path/to/cmd"
|
||||
# or
|
||||
# - $realcmd is "cmd" and $EDITOR is /alternative/path/to/cmd that appears in $PATH
|
||||
if [[ "$realcmd" = (\$EDITOR|$editorcmd|${editorcmd:c}) \
|
||||
|| "${realcmd:c}" = ($editorcmd|${editorcmd:c}) ]] \
|
||||
|| builtin which -a "$realcmd" | command grep -Fx -q "$editorcmd"; then
|
||||
_sudo_replace_buffer "$cmd" "sudo -e"
|
||||
return
|
||||
fi
|
||||
|
||||
# Check for editor commands in the typed command and replace accordingly
|
||||
case "$BUFFER" in
|
||||
$editorcmd\ *) _sudo_replace_buffer "$editorcmd" "sudo -e" ;;
|
||||
\$EDITOR\ *) _sudo_replace_buffer '$EDITOR' "sudo -e" ;;
|
||||
sudo\ -e\ *) _sudo_replace_buffer "sudo -e" "$EDITOR" ;;
|
||||
sudo\ *) _sudo_replace_buffer "sudo" "" ;;
|
||||
*) LBUFFER="sudo $LBUFFER" ;;
|
||||
esac
|
||||
} always {
|
||||
# Preserve beginning space
|
||||
LBUFFER="${WHITESPACE}${LBUFFER}"
|
||||
|
||||
# Redisplay edit buffer (compatibility with zsh-syntax-highlighting)
|
||||
zle redisplay
|
||||
}
|
||||
}
|
||||
|
||||
function _vi_search_fix() {
|
||||
zle vi-cmd-mode
|
||||
zle .vi-history-search-backward
|
||||
}
|
||||
|
||||
function toppy() {
|
||||
history | awk '{CMD[$2]++;count++;}END { for (a in CMD)print CMD[a] " " CMD[a]/count*100 "% " a;}' | grep -v "./" | column -c3 -s " " -t | sort -nr | nl | head -n 21
|
||||
}
|
||||
|
||||
function cd() {
|
||||
# builtin cd "$@" && command ls --group-directories-first --color=auto -F
|
||||
builtin cd $@ && ls --group-directories-first
|
||||
}
|
||||
|
||||
function git-svn(){
|
||||
if [[ ! -z "$1" && ! -z "$2" ]]; then
|
||||
echo "Starting clone/copy ..."
|
||||
repo=$(echo $1 | sed 's/\/$\|.git$//')
|
||||
svn export "$repo/trunk/$2"
|
||||
else
|
||||
echo "Use: git-svn <repository> <subdirectory>"
|
||||
fi
|
||||
}
|
||||
|
||||
# vim:ft=sh
|
||||
Reference in new issue
Block a user