Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions .config/zsh/aliases.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -62,3 +62,35 @@ alias sqlite='rlwrap -a -N -c -i -f ~/.rlwrap/sqlite3_completions sqlite3'
if command -v uvx >/dev/null 2>&1; then
alias docx2pdf='uvx docx2pdf'
fi

# zmv convenience aliases (zmv loaded in init.zsh)
alias zcp='zmv -C' # Copy with patterns
alias zln='zmv -L' # Link with patterns

# Suffix aliases - open files by typing their name
# Markdown files with glow (pager mode)
if command -v glow >/dev/null 2>&1; then
alias -s md='glow -p'
fi

# JSON with jless if available, otherwise bat
if command -v jless >/dev/null 2>&1; then
alias -s json=jless
elif command -v bat >/dev/null 2>&1; then
alias -s json=bat
fi

# Text and log files with bat
if command -v bat >/dev/null 2>&1; then
alias -s txt=bat
alias -s log=bat
fi

# Source files open in editor
alias -s go='$EDITOR'
alias -s rs='$EDITOR'
alias -s py='$EDITOR'
alias -s js='$EDITOR'
alias -s ts='$EDITOR'
alias -s tsx='$EDITOR'
alias -s jsx='$EDITOR'
11 changes: 11 additions & 0 deletions .config/zsh/init.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,17 @@ bindkey '^[[H' beginning-of-line # Home key: beginning of line
bindkey '^[[F' end-of-line # End key: end of line
bindkey '^[[3~' delete-char # Delete key

# Edit command line in $EDITOR (Ctrl+X Ctrl+E)
autoload -Uz edit-command-line
zle -N edit-command-line
bindkey '^X^E' edit-command-line

# Magic space: expand history (!!, !$, etc.) when pressing space
bindkey ' ' magic-space

# zmv for batch file renaming with pattern matching
autoload -Uz zmv

# Add useful zsh options
setopt AUTO_CD # If a command is a directory name, cd to it
setopt AUTO_PUSHD # Push dirs to the stack automatically
Expand Down
Loading