Configurazione per Zsh shell

Creati file di configurazione per shell zsh
(basati sui corrispondenti file del branch fedora-kde),
con leggere modifiche specifiche per Linux Mint.

File `.zsh_aliases` è circa uguale a `.bash_aliases`
This commit is contained in:
Luca Pellegrini 2023-02-03 15:39:15 +01:00
parent 64ab6e567a
commit edbd3baaba
3 changed files with 1864 additions and 0 deletions

1761
zsh/.p10k.zsh Normal file

File diff suppressed because it is too large Load diff

60
zsh/.zsh_aliases Normal file
View file

@ -0,0 +1,60 @@
# .zsh_aliases
# Alias definitions
# Questo file viene letto da ogni shell zsh, dopo il file '~/.zshrc'
# Common commands
alias q='exit'
alias c='clear'
alias h='history'
alias cs='clear;ls'
alias p='cat'
alias o='xdg-open' # open any file in the configured default application
#alias t='time'
#alias k='kill'
# exa/ls aliases (overwritten if 'exa' zsh plugin is enabled)
alias ls="exa --icons --color=auto --group-directories-first"
alias la="ls -a"
alias ll="ls -al -g -h"
alias tree="ll --tree -L 3"
# Colorize grep output (good for log files)
alias grep='grep --color=auto'
alias egrep='egrep --color=auto'
alias fgrep='fgrep --color=auto'
# Confirm before overwriting something
alias cp="cp -i"
alias mv='mv -i'
alias rm='rm -i'
# Directories
alias home='cd ~'
alias data='cd /Data'
alias root='cd /'
alias ..='cd ..'
alias ...='cd ..; cd ..'
alias ....='cd ..; cd ..; cd ..'
# Directories in home and Data partition
alias libri="cd $HOME/Libri"
alias dendron-git="cd /Data/Dendron && git status"
alias nextcloud="cd /Data/Nextcloud && la"
alias python-lab="cd /Data/Git/python-lab && la"
alias programmazione="cd /Data/Programmazione && la"
# Git
alias g='git'
alias g-ad='git add'
alias g-st='git status'
alias g-com='git commit'
#alias g-pl='git pull'
#alias g-ps='git push'
# apt
alias upgrade="sudo apt update && sudo apt upgrade"
alias apt-info="apt show"
# Altri programmi usati di frequente
alias dolphin="dolphin --new-window"
alias dendron="/usr/bin/codium --new-window /Data/Dendron/dendron.code-workspace"
alias email="thunderbird"

43
zsh/.zshrc Normal file
View file

@ -0,0 +1,43 @@
#!/bin/zsh
# .zshrc
# Enable Powerlevel10k instant prompt. Should stay close to the top of ~/.zshrc.
# Initialization code that may require console input (password prompts, [y/n]
# confirmations, etc.) must go above this block; everything else may go below.
if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]; then
source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh"
fi
# Zap plugin manager
# Source '~/.local/share/zap/zap.zsh' if it exists
if [ -f "$HOME/.local/share/zap/zap.zsh" ]; then
source "$HOME/.local/share/zap/zap.zsh"
fi
# History
HISTFILE=~/.zsh_history
HISTSIZE=1000
SAVEHIST=2000
# Export some variables
export EDITOR="xed"
export TERMINAL="gnome-terminal"
export BROWSER="firefox"
# Alias definitions
# Must be sourced before the zsh plugins
if [ -f "$HOME/.zsh_aliases" ]; then
source "$HOME/.zsh_aliases"
fi
# Plugins (Zap plugin manager)
plug "zsh-users/zsh-autosuggestions"
plug "zsh-users/zsh-syntax-highlighting"
#plug "zap-zsh/supercharge"
#plug "zap-zsh/exa"
# Custom prompt
plug "romkatv/powerlevel10k"
# To customize prompt, run `p10k configure` or edit ~/.p10k.zsh.
[[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh
[ -f "$HOME/.local/share/zap/zap.zsh" ] && source "$HOME/.local/share/zap/zap.zsh"