Initial commit
This commit is contained in:
115
plugins/aliases.zsh
Normal file
115
plugins/aliases.zsh
Normal file
@@ -0,0 +1,115 @@
|
||||
# Basic command improvements
|
||||
alias ls='ls --color=auto'
|
||||
alias ll='ls -lah'
|
||||
alias la='ls -la'
|
||||
alias l='ls -l'
|
||||
alias lt='ls -laht' # Sort by time
|
||||
alias lS='ls -lahS' # Sort by size
|
||||
|
||||
# Directory navigation
|
||||
alias ..='cd ..'
|
||||
alias ...='cd ../..'
|
||||
alias ....='cd ../../..'
|
||||
alias .....='cd ../../../..'
|
||||
alias ~='cd ~'
|
||||
alias -- -='cd -'
|
||||
|
||||
# Safety nets
|
||||
alias rm='rm -i'
|
||||
alias cp='cp -i'
|
||||
alias mv='mv -i'
|
||||
alias mkdir='mkdir -pv'
|
||||
|
||||
# Colorize grep
|
||||
alias grep='grep --color=auto'
|
||||
alias egrep='egrep --color=auto'
|
||||
alias fgrep='fgrep --color=auto'
|
||||
|
||||
# System info
|
||||
alias df='df -h'
|
||||
alias du='du -h'
|
||||
alias free='free -h'
|
||||
alias ps='ps auxf'
|
||||
|
||||
# Pacman aliases
|
||||
alias pacup='sudo pacman -Syu'
|
||||
alias pacin='sudo pacman -S'
|
||||
alias pacins='sudo pacman -U'
|
||||
alias pacre='sudo pacman -R'
|
||||
alias pacrem='sudo pacman -Rns'
|
||||
alias pacrep='pacman -Si'
|
||||
alias pacreps='pacman -Ss'
|
||||
alias pacloc='pacman -Qi'
|
||||
alias paclocs='pacman -Qs'
|
||||
alias paclo='pacman -Qdt'
|
||||
alias pacc='sudo pacman -Scc'
|
||||
alias paclf='pacman -Ql'
|
||||
|
||||
# Paru aliases (AUR helper)
|
||||
alias parup='paru -Syu'
|
||||
alias parin='paru -S'
|
||||
alias parins='paru -U'
|
||||
alias parre='paru -R'
|
||||
alias parrem='paru -Rns'
|
||||
alias parrep='paru -Si'
|
||||
alias parreps='paru -Ss'
|
||||
|
||||
# Systemd aliases
|
||||
alias syss='systemctl status'
|
||||
alias systart='sudo systemctl start'
|
||||
alias systop='sudo systemctl stop'
|
||||
alias sysr='sudo systemctl restart'
|
||||
alias syse='sudo systemctl enable'
|
||||
alias sysd='sudo systemctl disable'
|
||||
alias syslog='journalctl -xe'
|
||||
alias syslogu='journalctl -u'
|
||||
alias syslogf='journalctl -f'
|
||||
|
||||
# Quick edits
|
||||
alias zshrc='$EDITOR ~/.config/zsh/zshrc'
|
||||
alias zshreload='source ~/.zshrc'
|
||||
alias hyprconf='$EDITOR ~/.config/hypr/hyprland.conf'
|
||||
alias nvimconf='$EDITOR ~/.config/nvim/init.lua'
|
||||
|
||||
# Git aliases
|
||||
alias g='git'
|
||||
alias ga='git add'
|
||||
alias gaa='git add .'
|
||||
alias gb='git branch'
|
||||
alias gc='git commit'
|
||||
alias gcm='git commit -m'
|
||||
alias gco='git checkout'
|
||||
alias gd='git diff'
|
||||
alias gl='git pull'
|
||||
alias glog='git log --oneline --graph'
|
||||
alias gp='git push'
|
||||
alias gs='git status'
|
||||
|
||||
# Navigation shortcuts
|
||||
alias docs='cd ~/Documents'
|
||||
alias dl='cd ~/Downloads'
|
||||
alias dots='cd ~/.config'
|
||||
alias proj='cd ~/Projects'
|
||||
|
||||
# Process management
|
||||
alias psg='ps aux | grep -v grep | grep -i -e VSZ -e'
|
||||
alias killp='kill -9'
|
||||
|
||||
# Network
|
||||
alias ports='netstat -tulanp'
|
||||
alias myip='curl http://ipecho.net/plain; echo'
|
||||
|
||||
# Misc
|
||||
alias h='history'
|
||||
alias j='jobs -l'
|
||||
alias which='type -a'
|
||||
alias path='echo -e ${PATH//:/\\n}'
|
||||
alias now='date +"%Y-%m-%d %T"'
|
||||
alias week='date +%V'
|
||||
|
||||
# Hyprland specific
|
||||
alias hyprlog='cat /tmp/hypr/hyprland.log'
|
||||
alias hyprcrash='cat /tmp/hypr/hyprlandCrashReport.txt'
|
||||
|
||||
# File operations
|
||||
alias cpv='rsync -ah --info=progress2'
|
||||
27
plugins/completion.zsh
Normal file
27
plugins/completion.zsh
Normal file
@@ -0,0 +1,27 @@
|
||||
# Load completions
|
||||
autoload -Uz compinit && compinit -d $ZSH_CACHE_DIR/zcompdump
|
||||
|
||||
# Smart completion
|
||||
setopt AUTO_MENU
|
||||
setopt COMPLETE_IN_WORD
|
||||
setopt ALWAYS_TO_END
|
||||
setopt PATH_DIRS
|
||||
setopt AUTO_PARAM_SLASH
|
||||
|
||||
# Completion styling
|
||||
zstyle ':completion:*' menu select
|
||||
zstyle ':completion:*' matcher-list 'm:{[:lower:][:upper:]}={[:upper:][:lower:]}' 'r:|=*' 'l:|=* r:|=*'
|
||||
zstyle ':completion:*' list-colors "${(s.:.)LS_COLORS}"
|
||||
zstyle ':completion:*' use-cache yes
|
||||
zstyle ':completion:*' cache-path $ZSH_CACHE_DIR
|
||||
zstyle ':completion:*' special-dirs true
|
||||
zstyle ':completion:*:*:kill:*:processes' list-colors '=(#b) #([0-9]#)*=0=01;31'
|
||||
|
||||
# Better directory navigation
|
||||
zstyle ':completion:*' expand-or-complete-prefix-with-dots
|
||||
zstyle ':completion:*:cd:*' tag-order local-directories directory-stack path-directories
|
||||
|
||||
# FZF-tab specific settings
|
||||
zstyle ':fzf-tab:complete:cd:*' fzf-preview 'ls -1 --color=always $realpath'
|
||||
zstyle ':fzf-tab:complete:*:*' fzf-preview 'less ${(Q)realpath}'
|
||||
zstyle ':fzf-tab:*' switch-group ',' '.'
|
||||
16
plugins/history.zsh
Normal file
16
plugins/history.zsh
Normal file
@@ -0,0 +1,16 @@
|
||||
# History configuration
|
||||
HISTSIZE=50000
|
||||
SAVEHIST=10000
|
||||
|
||||
# History behavior
|
||||
setopt EXTENDED_HISTORY # Save timestamp
|
||||
setopt INC_APPEND_HISTORY # Add immediately
|
||||
setopt SHARE_HISTORY # Share between sessions
|
||||
setopt HIST_EXPIRE_DUPS_FIRST # Remove dups first when trimming
|
||||
setopt HIST_IGNORE_DUPS # Don't record immediate dups
|
||||
setopt HIST_IGNORE_ALL_DUPS # Delete old dups
|
||||
setopt HIST_FIND_NO_DUPS # Don't show dups in search
|
||||
setopt HIST_IGNORE_SPACE # Ignore space-prefixed commands
|
||||
setopt HIST_SAVE_NO_DUPS # Don't save dups
|
||||
setopt HIST_REDUCE_BLANKS # Remove superfluous blanks
|
||||
setopt HIST_VERIFY # Show command before executing from history
|
||||
52
plugins/keybindings.zsh
Normal file
52
plugins/keybindings.zsh
Normal file
@@ -0,0 +1,52 @@
|
||||
# Emacs mode
|
||||
bindkey -e
|
||||
|
||||
# Make terminal keys work
|
||||
if [[ -n ${terminfo[smkx]} && -n ${terminfo[rmkx]} ]]; then
|
||||
autoload -Uz add-zle-hook-widget
|
||||
zle-application-mode () { echoti smkx }
|
||||
zle-application-mode-stop () { echoti rmkx }
|
||||
add-zle-hook-widget -Uz zle-line-init zle-application-mode
|
||||
add-zle-hook-widget -Uz zle-line-finish zle-application-mode-stop
|
||||
fi
|
||||
|
||||
# History search with arrows
|
||||
autoload -U up-line-or-beginning-search down-line-or-beginning-search
|
||||
zle -N up-line-or-beginning-search
|
||||
zle -N down-line-or-beginning-search
|
||||
bindkey '^[[A' up-line-or-beginning-search
|
||||
bindkey '^[[B' down-line-or-beginning-search
|
||||
|
||||
# Standard keys
|
||||
bindkey '^[[H' beginning-of-line # Home
|
||||
bindkey '^[[F' end-of-line # End
|
||||
bindkey '^[[3~' delete-char # Delete
|
||||
bindkey '^[[3;5~' kill-word # Ctrl+Delete
|
||||
bindkey '^[[1;5C' forward-word # Ctrl+Right
|
||||
bindkey '^[[1;5D' backward-word # Ctrl+Left
|
||||
bindkey '^[[Z' reverse-menu-complete # Shift+Tab
|
||||
bindkey '^R' history-incremental-search-backward
|
||||
bindkey ' ' magic-space # Do history expansion on space
|
||||
|
||||
# Useful extras
|
||||
bindkey '^U' backward-kill-line # Ctrl+U - delete from cursor to start
|
||||
bindkey '^K' kill-line # Ctrl+K - delete from cursor to end
|
||||
bindkey '^W' backward-kill-word # Ctrl+W - delete word backwards
|
||||
bindkey '^[[1;3D' backward-word # Alt+Left
|
||||
bindkey '^[[1;3C' forward-word # Alt+Right
|
||||
bindkey '^L' clear-screen # Ctrl+L - clear screen
|
||||
bindkey '^A' beginning-of-line # Ctrl+A - go to start
|
||||
bindkey '^E' end-of-line # Ctrl+E - go to end
|
||||
|
||||
# Edit command in $EDITOR
|
||||
autoload -U edit-command-line
|
||||
zle -N edit-command-line
|
||||
bindkey '^X^E' edit-command-line
|
||||
|
||||
# Undo/Redo
|
||||
bindkey '^Z' undo # Ctrl+Z - undo
|
||||
bindkey '^Y' redo # Ctrl+Y - redo
|
||||
|
||||
# Better word navigation (bash-style)
|
||||
autoload -U select-word-style
|
||||
select-word-style bash
|
||||
Reference in New Issue
Block a user