184 lines
6.6 KiB
Bash
184 lines
6.6 KiB
Bash
# -*- mode: shell-script -*-
|
|
# vim:ft=zsh
|
|
# Opciones principales {{{
|
|
autoload -Uz compinit promptinit
|
|
autoload -Uz compinit
|
|
_comp_files=(${ZDOTDIR:-$HOME}/.zcompdump(Nm-20))
|
|
if (( $#_comp_files )); then
|
|
compinit -i -C
|
|
else
|
|
compinit -i
|
|
fi
|
|
unset _comp_files
|
|
promptinit
|
|
|
|
autoload -U colors && colors
|
|
|
|
autoload -Uz url-quote-magic
|
|
zle -N self-insert url-quote-magic
|
|
|
|
unsetopt CASE_GLOB
|
|
unsetopt FLOW_CONTROL
|
|
setopt GLOBDOTS
|
|
setopt NUMERICGLOBSORT
|
|
setopt AUTOCD
|
|
setopt EXTENDEDGLOB
|
|
setopt BRACE_CCL
|
|
setopt COMBINING_CHARS
|
|
setopt RC_QUOTES
|
|
setopt LONG_LIST_JOBS
|
|
setopt AUTO_RESUME
|
|
setopt RM_STAR_WAIT
|
|
setopt LIST_TYPES
|
|
setopt CORRECT
|
|
setopt NO_LIST_BEEP
|
|
setopt COMPLETE_IN_WORD
|
|
setopt ALWAYS_TO_END
|
|
setopt PATH_DIRS
|
|
setopt AUTO_MENU
|
|
setopt AUTO_LIST
|
|
setopt AUTO_PARAM_SLASH
|
|
setopt MARK_DIRS
|
|
setopt LIST_PACKED
|
|
setopt MAGIC_EQUAL_SUBST
|
|
setopt NO_NOMATCH
|
|
setopt AUTO_CONTINUE
|
|
# }}}
|
|
# Autocompletar {{{
|
|
zstyle ':completion:*' list-colors $LS_COLORS
|
|
zstyle ':completion:*' menu select
|
|
zstyle ':completion:*' group-name ''
|
|
zstyle ':completion:*' matcher-list 'm:{a-zA-Z}={A-Za-z}' 'r:|[._-]=* r:|=*' 'l:|=* r:|=*'
|
|
zstyle ':completion:*' verbose true
|
|
zstyle ':completion:*' format $'\n %F{yellow}--- %d ---%f'
|
|
zstyle ':completion:*' list-separator "--"
|
|
zstyle ':completion:*' list-dirs-first true
|
|
zstyle ':completion:*:default' list-prompt '%S%M matches%s'
|
|
zstyle ':completion:*:default' select-prompt ' --- Match %M %P ---'
|
|
zstyle ':completion:*:options' description 'yes'
|
|
zstyle ':completion:*:options' auto-description '%d'
|
|
zstyle ':completion:*:expand:*' tag-order all-expansions
|
|
zstyle ':completion:*:matches' group 'yes'
|
|
zstyle ':completion:*:correct:*' insert-unambiguous true
|
|
zstyle ':completion:*:correct:*' original true
|
|
zstyle ':completion:*:corrections' format $'\n %F{green}--- %d (errors: %e) ---%f'
|
|
zstyle ':completion:*:descriptions' format $'\n %F{yellow}--- %d ---%f'
|
|
zstyle ':completion:*:messages' format $'\n %F{purple}--- %d ---%f'
|
|
zstyle ':completion:*:warnings' format $'\n %F{red}-- No Matches Found --%f'
|
|
zstyle ':completion:*:*:cd:*:directory-stack' menu yes select
|
|
zstyle ':completion:*:approximate:' max-errors 'reply=( $((($#PREFIX+$#SUFFIX)/3 )) numeric )'
|
|
zstyle ':completion::(^approximate*):*:functions' ignored-patterns '_*'
|
|
zstyle ':completion::complete:*' use-cache on
|
|
zstyle ':completion::complete:*' cache-path "$ZDOTDIR/.zcompcache"
|
|
zstyle ':completion:*:complete:-command-::commands' ignored-patterns '*\~'
|
|
zstyle ':completion:*:processes' command 'ps -au $USER -o pid,stat,%cpu,%mem,cputime,command'
|
|
zstyle ':completion:*:killall:*' command 'ps -u $USER -o pid,%cpu,tty,cputime,cmd'
|
|
zstyle ':completion:*:processes-names' command 'ps c -u ${USER} -o command | uniq'
|
|
zstyle ':completion:*:man:*' menu yes select
|
|
zstyle ':completion:*:manuals' separate-sections true
|
|
zstyle ':completion:*:manuals.(^1*)' insert-sections true
|
|
zstyle ':completion:*:parameters' list-colors '=*=34'
|
|
zstyle ':completion:*:commands' list-colors '=*=32'
|
|
zstyle ':completion:*:builtins' list-colors '=*=1;38;5;142'
|
|
zstyle ':completion:*:aliases' list-colors '=*=2;38;5;120'
|
|
zstyle ':completion:*:options' list-colors '=^(-- *)=34'
|
|
zstyle ':completion:*:default' list-colors '=(#b)*(-- *)=36=33' '=*=36'
|
|
zstyle ':completion::*:kill:*:*' command 'ps xf -U $USER -o pid,%cpu,cmd'
|
|
zstyle ':completion:*:*:kill:*' menu yes select
|
|
zstyle ':completion:*:*:kill:*' force-list always
|
|
zstyle ':completion:*:*:kill:*' insert-ids single
|
|
zstyle ':completion:*:*:kill:*:processes' list-colors '=(#b) #([0-9]#) ([0-9a-z-]#)*=01;34=0=01'
|
|
zstyle ':completion:*:functions' ignored-patterns '(_*|pre(cmd|exec))'
|
|
zstyle ':completion:*' accept-exact '*(N)'
|
|
zstyle ':completion:*' ignore-parents pwd
|
|
zstyle ':completion:*' rehash true
|
|
zmodload -i zsh/complist
|
|
# }}}
|
|
# Historial {{{
|
|
export HISTIGNORE="ls:cd:cd -:pwd:exit:date:* --help:* --version:* -v:man *:up:rtv *"
|
|
HISTFILE="$ZDOTDIR/histfile"
|
|
HISTSIZE=1000
|
|
SAVEHIST=1000
|
|
setopt BANG_HIST
|
|
setopt EXTENDED_HISTORY
|
|
setopt HIST_EXPIRE_DUPS_FIRST
|
|
setopt HIST_FIND_NO_DUPS
|
|
setopt HIST_IGNORE_ALL_DUPS
|
|
setopt HIST_IGNORE_DUPS
|
|
setopt HIST_IGNORE_SPACE
|
|
setopt HIST_REDUCE_BLANKS
|
|
setopt HIST_SAVE_NO_DUPS
|
|
setopt HIST_VERIFY
|
|
setopt INC_APPEND_HISTORY
|
|
setopt SHARE_HISTORY
|
|
# }}}
|
|
# Plugins y extras {{{
|
|
foreach extra (
|
|
zsh-completions/zsh-completions.plugin.zsh
|
|
up.plugin.zsh
|
|
k.sh
|
|
teclas.zsh
|
|
extras.zsh
|
|
aliases.plugin.zsh
|
|
dotfiles.zsh
|
|
zsh-system-clipboard/zsh-system-clipboard.zsh
|
|
lf-icons.zsh
|
|
) {
|
|
source $ZDOTDIR/$extra
|
|
}
|
|
|
|
foreach programa (
|
|
LS_COLORS/dircolors.sh
|
|
fzf/key-bindings.zsh
|
|
fzf/completion.zsh
|
|
) {
|
|
source /usr/share/$programa
|
|
}
|
|
|
|
typeset -g ZSH_SYSTEM_CLIPBOARD_TMUX_SUPPORT='true'
|
|
|
|
source $XDG_CONFIG_HOME/broot/launcher/bash/br
|
|
source /usr/share/doc/pkgfile/command-not-found.zsh
|
|
|
|
foreach plugin (
|
|
zsh-autopair/autopair.zsh
|
|
zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
|
|
zsh-history-substring-search/zsh-history-substring-search.zsh
|
|
) {
|
|
source /usr/share/zsh/plugins/$plugin
|
|
}
|
|
# }}}
|
|
# Prompt {{{
|
|
function precmd() {
|
|
# Print a newline before the prompt, unless it's the
|
|
# first prompt in the process.
|
|
if [ -z "$NEW_LINE_BEFORE_PROMPT" ]; then
|
|
NEW_LINE_BEFORE_PROMPT=1
|
|
elif [ "$NEW_LINE_BEFORE_PROMPT" -eq 1 ]; then
|
|
echo "\n"
|
|
fi
|
|
}
|
|
|
|
PS1="%(?..%{%F{red}%}(%?%)%{%f%} )%{%F{blue}%}%~ %{%f%}%# "
|
|
|
|
function zle-keymap-select {
|
|
if [[ ${KEYMAP} == vicmd ]] ||
|
|
[[ $1 = 'block' ]]; then
|
|
echo -ne '\e[2 q'
|
|
elif [[ ${KEYMAP} == main ]] ||
|
|
[[ ${KEYMAP} == viins ]] ||
|
|
[[ ${KEYMAP} = '' ]] ||
|
|
[[ $1 = 'beam' ]]; then
|
|
echo -ne '\e[6 q'
|
|
fi
|
|
}
|
|
zle -N zle-keymap-select
|
|
zle-line-init() {
|
|
echo -ne "\e[6 q"
|
|
}
|
|
zle -N zle-line-init
|
|
echo -ne '\e[5 q' # Use beam shape cursor on startup.
|
|
preexec() { echo -ne '\e[6 q' ;} # Use beam shape cursor for each new prompt.
|
|
# }}}
|
|
# vim:foldmethod=marker:foldlevel=0
|