export TERMCMD=urxvtc export LANG=es_MX.UTF-8 export SUDO_EDITOR=vim export EDITOR=vim export PACMAN=/usr/bin/powerpill export STARDICT_DATA_DIR="/home/sergio/.local/share/sdcv/" export SYSTEMD_LESS=FRXMK #For tmux in linux export EVENT_NOEPOLL=1 #================================================================================ #NO EDITAR DESPUÉS DE ESTA LÍNEA # The following lines were added by compinstall zstyle ':completion:*' auto-description 'Introduce %d' zstyle ':completion:*' completer _oldlist _expand _complete _ignored _match _correct _approximate _prefix zstyle ':completion:*' completions 1 zstyle ':completion:*' condition 0 zstyle ':completion:*' expand prefix zstyle ':completion:*' file-sort name zstyle ':completion:*' format 'Completing %d' zstyle ':completion:*' glob 1 zstyle ':completion:*' group-name '' zstyle ':completion:*' insert-unambiguous true zstyle ':completion:*' list-colors '' zstyle ':completion:*' list-prompt '%SAt %p: Hit TAB for more, or the character to insert%s' zstyle ':completion:*' list-suffixes true zstyle ':completion:*' matcher-list '' '+m:{[:lower:]}={[:upper:]} m:{[:lower:][:upper:]}={[:upper:][:lower:]}' '+r:|[._-]=* r:|=*' zstyle ':completion:*' max-errors 2 zstyle ':completion:*' menu select=0 zstyle ':completion:*' original true zstyle ':completion:*' preserve-prefix '//[^/]##/' zstyle ':completion:*' prompt 'Found %e errors' zstyle ':completion:*' select-prompt '%SScrolling active: current selection at %p%s' zstyle ':completion:*' substitute 1 zstyle ':completion:*' verbose true zstyle :compinstall filename '/home/sergio/.zshrc' autoload -Uz compinit compinit # End of lines added by compinstall # Lines configured by zsh-newuser-install HISTFILE=~/.histfile HISTSIZE=1024 SAVEHIST=1024 setopt appendhistory autocd extendedglob nomatch unsetopt beep bindkey -v # End of lines configured by zsh-newuser-install #NO EDITAR ANTES DE ESTA LÍNEA #================================================================================ #Configuración propia: source /usr/share/zsh/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh setopt nohashdirs setopt completealiases setopt INC_APPEND_HISTORY setopt HIST_IGNORE_ALL_DUPS setopt HIST_IGNORE_DUPS setopt HIST_IGNORE_SPACE setopt HIST_EXPIRE_DUPS_FIRST setopt HIST_REDUCE_BLANKS setopt HIST_VERIFY alias ls='ls --color=auto --group-directories-first' alias cp='cp -i' alias mv='mv -i' alias grep='grep --color=auto ' alias sbcl="rlwrap -pred -r -s 65536 -m -i -c -D 2 sbcl" alias rm='rm -I' alias vi='vim' alias enable_vbox='sudo modprobe vboxdrv vboxnetadp vboxnetflt vboxpci' alias disable_vbox='sudo modprobe -r vboxdrv vboxnetadp vboxnetflt vboxpci' alias speed_test='wget -O /dev/null http://speedtest.wdc01.softlayer.com/downloads/test10.zip' alias sudo='sudo ' alias mpd_start='systemctl start mpd.service mpdscribble.service --user' alias mpd_stop='systemctl stop mpd.service mpdscribble.service --user' alias wifi_on='nmcli radio wifi on' alias wifi_off='nmcli radio wifi off' function ranger-cd { tempfile='/tmp/chosendir' /usr/bin/ranger --choosedir="$tempfile" "${@:-$(pwd)}" test -f "$tempfile" && if [ "$(cat -- "$tempfile")" != "$(echo -n `pwd`)" ]; then cd -- "$(cat "$tempfile")" fi rm -f -- "$tempfile" } typeset -A key key[Home]=${terminfo[khome]} key[End]=${terminfo[kend]} key[Insert]=${terminfo[kich1]} key[Delete]=${terminfo[kdch1]} key[Up]=${terminfo[kcuu1]} key[Down]=${terminfo[kcud1]} key[Left]=${terminfo[kcub1]} key[Right]=${terminfo[kcuf1]} key[PageUp]=${terminfo[kpp]} key[PageDown]=${terminfo[knp]} # setup key accordingly [[ -n "${key[Home]}" ]] && bindkey "${key[Home]}" beginning-of-line [[ -n "${key[End]}" ]] && bindkey "${key[End]}" end-of-line [[ -n "${key[Insert]}" ]] && bindkey "${key[Insert]}" overwrite-mode [[ -n "${key[Delete]}" ]] && bindkey "${key[Delete]}" delete-char [[ -n "${key[Left]}" ]] && bindkey "${key[Left]}" backward-char [[ -n "${key[Right]}" ]] && bindkey "${key[Right]}" forward-char [[ -n "${key[PageUp]}" ]] && bindkey "${key[PageUp]}" beginning-of-buffer-or-history [[ -n "${key[PageDown]}" ]] && bindkey "${key[PageDown]}" end-of-buffer-or-history [[ -n "${key[Up]}" ]] && bindkey "${key[Up]}" history-beginning-search-backward [[ -n "${key[Down]}" ]] && bindkey "${key[Down]}" history-beginning-search-forward # Finally, make sure the terminal is in application mode, when zle is # active. Only then are the values from $terminfo valid. if (( ${+terminfo[smkx]} )) && (( ${+terminfo[rmkx]} )); then function zle-line-init () { echoti smkx } function zle-line-finish () { echoti rmkx } zle -N zle-line-init zle -N zle-line-finish fi setopt prompt_subst autoload -U colors && colors function calcula_ancho { temp=" ${USER} _ ${HOST} _ _" dir_actual=$PWD if [[ "$dir_actual[0,${#HOME}]" == "$HOME" ]] then dir_actual="~$dir_actual[$((${#HOME}+1)),-1]" fi let restante=${COLUMNS}-${#temp} longitud_dir=${#dir_actual} if [[ "$longitud_dir" -gt "$restante" ]] then dir_actual="...${dir_actual:$(($longitud_dir-$restante+3))}" fi } function nivel_ranger { if [ -z "$RANGER_LEVEL" ] then string_nivel="" else string_nivel=" ranger │" fi } reload () { exec "${SHELL}" "$@" } case $TERM in termite|*xterm*|rxvt|rxvt-unicode|rxvt-256color|rxvt-unicode-256color|(dt|k|E)term) separador1= separador2= separador3= precmd () { print -Pn "\e]0;%n@%M: %1~ \a" calcula_ancho tmux_sessions } preexec () { print -Pn "\e]0;%n@%M %1~ ($1)\a" } ;; screen|screen-256color) separador1= separador2= separador3= precmd () { print -Pn "\e]83;title \"$1\"\a" print -Pn "\e]0;TMUX - %n@%M %1~\a" calcula_ancho tmux_sessions } preexec () { print -Pn "\e]83;title \"$1\"\a" print -Pn "\e]0;TMUX - %n@%M %# %1~ ($1)\a" } ;; *) separador1=▒ separador2=│ separador3=▒ precmd () { calcula_ancho tmux_sessions } ;; esac over_ssh() { if [ -n "${SSH_CLIENT}" ]; then return 0 else return 1 fi } if over_ssh; then prompt_is_ssh="%{%K{green}%B%F{white}%} SSH %{%b%K{cyan}%F{green}%}" else prompt_is_ssh="%{%b%K{cyan}%F{green}%}" fi if [ -n "${RANGER_LEVEL}" ] then nivel_ranger="%{%K{cyan}%B%F{white}%} ranger %{%b%K{magenta}%F{cyan}%}" else nivel_ranger="%{%K{magenta}%F{cyan}%}" fi tmux_sessions(){ if $(tmux info &> /dev/null) then numero_tmux="%{%K{magenta}%B%F{white}%} tmux: $(tmux ls | wc -l) %{%b%K{red}%F{magenta}%}" else numero_tmux="%{%b%K{red}%F{magenta}%}" fi } PROMPT='%{%B%K{blue}%15F%} %n %{%b%K{green}%F{blue}%}$separador1%{%B%15F%} %m %{%b%K{red}%F{green}%}$separador1%{%B%15F%} $dir_actual %{%b%k%F{red}%}$separador1 $prompt_is_ssh$separador1$nivel_ranger$separador1$numero_tmux$separador1%{%K{red}%B%F{white}%} %#%(0?,, %{%b%K{red}%15F%}$separador2 %{%B%F{white}%}%?) %{%b%k%F{red}%}$separador1%{%b%k$reset_color%} ' RPROMPT='%{%F{red}%}$separador3%{%B%K{red}%F{white}%} %* %{%b%F{red}%}$separador1%{$reset_color%}' autoload -U edit-command-line zle -N edit-command-line bindkey -M vicmd 'v' edit-command-line setopt interactivecomments