Update dotfiles
This commit is contained in:
26
zsh/aliases.zsh
Normal file
26
zsh/aliases.zsh
Normal file
@@ -0,0 +1,26 @@
|
||||
#!/usr/bin/false
|
||||
|
||||
# LC_COLLATE=C: sort case-sensitive, i.e. README before aaa.py
|
||||
alias ls='LC_COLLATE=C ls --color --group-directories-first'
|
||||
alias ll='LC_COLLATE=C ls -la'
|
||||
alias la='LC_COLLATE=C ls -A'
|
||||
alias l='LC_COLLATE=C ls -CF'
|
||||
|
||||
alias xo='xdg-open'
|
||||
|
||||
alias pacman="sudo pacman"
|
||||
|
||||
alias history="history 0" # force zsh to show the complete history
|
||||
|
||||
# create directory and set it as cwd
|
||||
alias take=_take
|
||||
_take() {
|
||||
if [ -z "$1" ]; then
|
||||
printf 'usage: %s directory' $0 > /dev/stderr
|
||||
return 1
|
||||
fi
|
||||
|
||||
mkdir -p $1
|
||||
cd $1
|
||||
}
|
||||
|
||||
51
zsh/options.zsh
Normal file
51
zsh/options.zsh
Normal file
@@ -0,0 +1,51 @@
|
||||
|
||||
#setopt autocd # change directory just by typing its name
|
||||
#setopt correct # auto correct mistakes
|
||||
setopt interactivecomments # allow comments in interactive mode
|
||||
setopt magicequalsubst # enable filename expansion for arguments of the form ‘anything=expression’
|
||||
setopt nonomatch # hide error message if there is no match for the pattern
|
||||
setopt notify # report the status of background jobs immediately
|
||||
setopt numericglobsort # sort filenames numerically when it makes sense
|
||||
setopt promptsubst # enable command substitution in prompt
|
||||
color_prompt=yes # enable colors
|
||||
WORDCHARS=${WORDCHARS//\/} # Don't consider certain characters part of the word
|
||||
PROMPT_EOL_MARK="" # hide EOL sign ('%')
|
||||
|
||||
# enable completion features
|
||||
autoload -Uz compinit
|
||||
compinit -d ~/.cache/zcompdump
|
||||
zstyle ':completion:*:*:*:*:*' menu select
|
||||
zstyle ':completion:*' auto-description 'specify: %d'
|
||||
zstyle ':completion:*' completer _expand _complete
|
||||
zstyle ':completion:*' format 'Completing %d'
|
||||
zstyle ':completion:*' group-name ''
|
||||
zstyle ':completion:*' list-colors ''
|
||||
zstyle ':completion:*' list-prompt %SAt %p: Hit TAB for more, or the character to insert%s
|
||||
zstyle ':completion:*' matcher-list 'm:{a-zA-Z}={A-Za-z}'
|
||||
zstyle ':completion:*' rehash true
|
||||
zstyle ':completion:*' select-prompt %SScrolling active: current selection at %p%s
|
||||
zstyle ':completion:*' use-compctl false
|
||||
zstyle ':completion:*' verbose true
|
||||
zstyle ':completion:*:kill:*' command 'ps -u $USER -o pid,%cpu,tty,cputime,cmd'
|
||||
zstyle ':completion:*' list-colors "${(s.:.)LS_COLORS}"
|
||||
zstyle ':completion:*:*:kill:*:processes' list-colors '=(#b) #([0-9]#)*=0=01;31'
|
||||
|
||||
# History configurations
|
||||
HISTFILE=~/.zsh_history
|
||||
HISTSIZE=10000
|
||||
SAVEHIST=20000
|
||||
setopt hist_expire_dups_first # delete duplicates first when HISTFILE size exceeds HISTSIZE
|
||||
setopt hist_ignore_dups # ignore duplicated commands history list
|
||||
setopt hist_ignore_space # ignore commands that start with space
|
||||
setopt hist_verify # show command with history expansion to user before running it
|
||||
setopt share_history # share command history data
|
||||
|
||||
# configure `time` format
|
||||
TIMEFMT=$'\nreal\t%E\nuser\t%U\nsys\t%S\ncpu\t%P'
|
||||
|
||||
# make less more friendly for non-text input files, see lesspipe(1)
|
||||
#[ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)"
|
||||
|
||||
bindkey "^[[H" beginning-of-line
|
||||
bindkey "^[[F" end-of-line
|
||||
bindkey "^[[3~" delete-char
|
||||
30
zsh/prompt.zsh
Normal file
30
zsh/prompt.zsh
Normal file
@@ -0,0 +1,30 @@
|
||||
|
||||
autoload -Uz add-zsh-hook
|
||||
autoload -Uz vcs_info
|
||||
|
||||
add-zsh-hook precmd vcs_info
|
||||
|
||||
precmd() {
|
||||
# Print the previously configured title
|
||||
print -Pnr -- "$TERM_TITLE"
|
||||
print ""
|
||||
}
|
||||
|
||||
zstyle ':vcs_info:*' enable git
|
||||
zstyle ':vcs_info:git:*' check-for-changes true
|
||||
zstyle ':vcs_info:git:*' stagedstr '+'
|
||||
zstyle ':vcs_info:git:*' unstagedstr '!'
|
||||
zstyle ':vcs_info:git:*' formats '(%s %b%u%c)'
|
||||
zstyle ':vcs_info:git:*' actionformats '(%s %b%u%c %a)'
|
||||
zstyle ':vcs_info:*:*' actionformats '(%s %b)'
|
||||
|
||||
setopt prompt_subst
|
||||
setopt print_exit_value
|
||||
|
||||
|
||||
# ternary example: "%(?.A.B)"
|
||||
# (here ? is the previous return)
|
||||
|
||||
PROMPT='%F{240} [%T] %~ ${vcs_info_msg_0_}
|
||||
$%f '
|
||||
RPROMPT=""
|
||||
Reference in New Issue
Block a user