2019-12-09 19:25:42 +01:00
|
|
|
# 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
|
|
|
|
|
2019-10-21 21:28:20 +02:00
|
|
|
# LEL
|
2019-12-01 17:36:00 +01:00
|
|
|
|
|
|
|
# _
|
|
|
|
# _______| |__
|
|
|
|
# |_ / __| '_ \
|
|
|
|
# / /\__ \ | | |
|
|
|
|
# /___|___/_| |_|
|
2019-12-09 19:25:42 +01:00
|
|
|
|
2019-11-23 02:20:04 +01:00
|
|
|
# Environment Vairables {{{
|
2019-10-16 02:28:41 +02:00
|
|
|
export QT_QPA_PLATFORMTHEME=qt5ct
|
|
|
|
export PATH=$PATH:~/.local/bin
|
|
|
|
|
|
|
|
export EDITOR=nvim
|
|
|
|
export VISUAL=nvim
|
2019-11-23 02:20:04 +01:00
|
|
|
# export BROWSER=qutebrowser
|
2019-10-16 02:28:41 +02:00
|
|
|
export PAGER=less
|
|
|
|
|
2019-10-21 21:28:20 +02:00
|
|
|
#}}}
|
|
|
|
# set window title {{{
|
2019-10-18 15:48:39 +02:00
|
|
|
#
|
|
|
|
autoload -Uz add-zsh-hook
|
|
|
|
|
|
|
|
function xterm_title_precmd () {
|
|
|
|
print -Pn -- '\e]2;%n@%m %~\a'
|
|
|
|
}
|
|
|
|
|
|
|
|
function xterm_title_preexec () {
|
|
|
|
print -Pn -- '\e]2;%n@%m %~ %# ' && print -n -- "${(q)1}\a"
|
|
|
|
}
|
|
|
|
|
|
|
|
if [[ "$TERM" == (screen*|xterm*|rxvt*|tmux*|putty*|konsole*|gnome*) ]]; then
|
|
|
|
add-zsh-hook -Uz precmd xterm_title_precmd
|
|
|
|
add-zsh-hook -Uz preexec xterm_title_preexec
|
|
|
|
fi
|
2019-10-21 21:28:20 +02:00
|
|
|
# }}}
|
|
|
|
# start sway if using tty1 {{{
|
2019-10-18 15:48:39 +02:00
|
|
|
#
|
2019-11-26 15:05:25 +01:00
|
|
|
esway() {
|
|
|
|
clear
|
2019-12-01 20:19:33 +01:00
|
|
|
# export XDG_CURRENT_DESKTOP=Unity
|
2019-11-26 15:05:25 +01:00
|
|
|
export QT_SCALE_FACTOR=1
|
|
|
|
export QPA_PLATFORM=wayland
|
|
|
|
export QT_QPA_PLATFORM=wayland
|
|
|
|
export _JAVA_AWT_WM_NONREPARENTING=1
|
|
|
|
export GTK_CSD=0
|
|
|
|
export LD_PRELOAD=/usr/lib/libgtk3-nocsd.so.0
|
|
|
|
export XCURSOR_THEME=capitaine-cursors
|
|
|
|
exec sway
|
|
|
|
}
|
2019-12-04 04:03:28 +01:00
|
|
|
ei3() {
|
|
|
|
clear
|
|
|
|
export _JAVA_AWT_WM_NONREPARENTING=1
|
|
|
|
export GTK_CSD=0
|
|
|
|
export LD_PRELOAD=/usr/lib/libgtk3-nocsd.so.0
|
|
|
|
export XCURSOR_THEME=capitaine-cursors
|
|
|
|
exec startx i3
|
|
|
|
}
|
2019-11-23 02:20:04 +01:00
|
|
|
if [[ $XDG_VTNR -eq 1 ]] #faster like this
|
2019-10-18 15:48:39 +02:00
|
|
|
then
|
2019-11-23 02:20:04 +01:00
|
|
|
if systemctl -q is-active graphical.target && [[ ! $DISPLAY ]]
|
|
|
|
then
|
2019-12-09 19:25:42 +01:00
|
|
|
esway > .swaylog
|
|
|
|
# ei3 > .i3log
|
2019-11-23 02:20:04 +01:00
|
|
|
fi
|
2019-10-18 15:48:39 +02:00
|
|
|
fi
|
2019-10-16 02:28:41 +02:00
|
|
|
|
2019-11-23 02:20:04 +01:00
|
|
|
# }}}
|
|
|
|
# use tmux{{{
|
2019-11-23 18:35:46 +01:00
|
|
|
|
2019-12-09 19:25:42 +01:00
|
|
|
TMUX=1
|
2019-12-02 19:57:45 +01:00
|
|
|
if [ -z "$TMUX" ] && [ "$TERM" != "xterm-kitty" ]; then
|
2019-12-01 17:36:00 +01:00
|
|
|
attach_session=$(tmux 2> /dev/null ls -F \
|
|
|
|
'#{session_attached} #{?#{==:#{session_last_attached},},1,#{session_last_attached}} #{session_id}' |
|
|
|
|
awk '/^0/ { if ($2 > t) { t = $2; s = $3 } }; END { if (s) printf "%s", s }')
|
|
|
|
if [ -n "$attach_session" ]
|
|
|
|
then
|
|
|
|
exec tmux attach -t "$attach_session"
|
|
|
|
else
|
|
|
|
exec tmux
|
|
|
|
fi
|
|
|
|
fi
|
2019-11-23 18:35:46 +01:00
|
|
|
|
2019-10-21 21:28:20 +02:00
|
|
|
# }}}
|
|
|
|
# Plugins {{{
|
2019-10-16 02:28:41 +02:00
|
|
|
#
|
|
|
|
export ZPLUG_HOME=~/.local/share/zplug
|
|
|
|
if [ ! -d $ZPLUG_HOME ]
|
|
|
|
then
|
|
|
|
git clone https://github.com/zplug/zplug $ZPLUG_HOME
|
|
|
|
fi
|
|
|
|
source $ZPLUG_HOME/init.zsh
|
|
|
|
zplug 'zplug/zplug', hook-build:'zplug --self-manage'
|
|
|
|
|
|
|
|
zplug "zsh-users/zsh-completions"
|
2019-12-09 19:25:42 +01:00
|
|
|
zplug "hlissner/zsh-autopair", defer:2
|
2019-10-18 15:48:39 +02:00
|
|
|
|
|
|
|
# History
|
2019-10-16 02:28:41 +02:00
|
|
|
zplug "scripts/dirhistory", from:oh-my-zsh
|
|
|
|
zplug "zsh-users/zsh-history-substring-search"
|
2019-10-18 15:48:39 +02:00
|
|
|
HISTFILE=~/.histfile
|
|
|
|
HISTSIZE=1000
|
|
|
|
SAVEHIST=1000
|
2019-10-16 02:28:41 +02:00
|
|
|
|
|
|
|
# sugestões automaticas
|
|
|
|
zplug "momo-lab/zsh-abbrev-alias"
|
|
|
|
zplug "zsh-users/zsh-syntax-highlighting", defer:2
|
|
|
|
ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE="fg=black"
|
|
|
|
ZSH_AUTOSUGGEST_STRATEGY=(completion history)
|
|
|
|
ZSH_AUTOSUGGEST_USE_ASYNC=true
|
|
|
|
zplug "zsh-users/zsh-autosuggestions"
|
|
|
|
|
2019-10-18 15:48:39 +02:00
|
|
|
# Promp config
|
2019-12-09 19:25:42 +01:00
|
|
|
# bindkey -e
|
|
|
|
# SPACESHIP_PROMPT_ADD_NEWLINE=false
|
|
|
|
# SPACESHIP_CHAR_SYMBOL='$ '
|
|
|
|
# SPACESHIP_CHAR_SYMBOL_ROOT='# '
|
|
|
|
# zplug "denysdovhan/spaceship-prompt", use:spaceship.zsh, from:github, as:theme
|
2019-10-16 02:28:41 +02:00
|
|
|
|
2019-12-09 19:25:42 +01:00
|
|
|
zplug "romkatv/powerlevel10k", as:theme, depth:1
|
2019-10-18 15:48:39 +02:00
|
|
|
if ! zplug check
|
|
|
|
then
|
2019-12-01 17:36:00 +01:00
|
|
|
zplug install
|
2019-10-18 15:48:39 +02:00
|
|
|
fi
|
2019-10-16 02:28:41 +02:00
|
|
|
|
2019-10-18 15:48:39 +02:00
|
|
|
zplug load
|
2019-10-16 02:28:41 +02:00
|
|
|
|
2019-10-21 21:28:20 +02:00
|
|
|
# }}}
|
|
|
|
# Aliases {{{
|
2019-10-18 15:48:39 +02:00
|
|
|
#
|
|
|
|
abbrev-alias -g v=nvim
|
|
|
|
abbrev-alias -g rv="sudo nvim"
|
|
|
|
abbrev-alias es="nvim ~/.config/sway/config"
|
|
|
|
abbrev-alias ez="nvim ~/.zshrc"
|
|
|
|
abbrev-alias ev="nvim ~/.config/nvim/init.vim"
|
|
|
|
abbrev-alias r=ranger
|
|
|
|
abbrev-alias rm=trash
|
|
|
|
abbrev-alias suspend="systemctl suspend"
|
|
|
|
abbrev-alias tlsave='telegram-cli -We "send_document @lelgenio "'
|
|
|
|
|
|
|
|
alias emacs='env TERM=xterm-256color /usr/bin/emacs -nw'
|
|
|
|
abbrev-alias em='emacs -nw'
|
|
|
|
|
|
|
|
abbrev-alias -i
|
|
|
|
alias ls='ls --color=auto --human-readable --group-directories-first --classify'
|
|
|
|
alias ll='ls --color=auto --human-readable --group-directories-first --classify -l'
|
|
|
|
alias lla='ls --color=auto --human-readable --group-directories-first --classify -la'
|
|
|
|
|
|
|
|
man() {
|
|
|
|
LESS_TERMCAP_md=$'\e[01;31m' \
|
|
|
|
LESS_TERMCAP_me=$'\e[0m' \
|
|
|
|
LESS_TERMCAP_se=$'\e[0m' \
|
|
|
|
LESS_TERMCAP_so=$'\e[01;44;33m' \
|
|
|
|
LESS_TERMCAP_ue=$'\e[0m' \
|
|
|
|
LESS_TERMCAP_us=$'\e[01;32m' \
|
|
|
|
command man "$@"
|
|
|
|
}
|
2019-10-16 02:28:41 +02:00
|
|
|
|
2019-10-21 21:28:20 +02:00
|
|
|
# }}}
|
|
|
|
# Keys. {{{
|
2019-10-18 15:48:39 +02:00
|
|
|
#
|
|
|
|
autoload -z edit-command-line
|
|
|
|
zle -N edit-command-line
|
2019-12-09 19:25:42 +01:00
|
|
|
bindkey "^X" edit-command-line
|
|
|
|
|
|
|
|
# typeset -g -A key
|
|
|
|
|
|
|
|
# key[Home]="${terminfo[khome]}"
|
|
|
|
# key[End]="${terminfo[kend]}"
|
|
|
|
# key[Insert]="${terminfo[kich1]}"
|
|
|
|
# key[Backspace]="${terminfo[kbs]}"
|
|
|
|
# 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]}"
|
|
|
|
# key[ShiftTab]="${terminfo[kcbt]}"
|
|
|
|
|
|
|
|
# ${key[Home]}
|
|
|
|
# ${key[End]}
|
|
|
|
# ${key[Delete]}
|
|
|
|
# ${key[Insert]}
|
|
|
|
# ${key[Backspace]}
|
|
|
|
# ${key[Up]}
|
|
|
|
# ${key[Down]}
|
|
|
|
# ${key[Left]}
|
|
|
|
# ${key[Right]}
|
|
|
|
# ${key[PageUp]}
|
|
|
|
# ${key[PageDown]}
|
|
|
|
# ${key[ShiftTab]}
|
2019-10-18 15:48:39 +02:00
|
|
|
|
|
|
|
case $TERM in
|
|
|
|
rxvt*|xterm*)
|
|
|
|
bindkey "^[[H" beginning-of-line #Home key
|
|
|
|
bindkey "^[[F" end-of-line #End key
|
|
|
|
bindkey "^[[3~" delete-char #Del key
|
|
|
|
bindkey "^[[A" history-substring-search-up #Up Arrow
|
|
|
|
bindkey "^[[B" history-substring-search-down #Down Arrow
|
|
|
|
bindkey "^[Oc" forward-word # control + right arrow
|
|
|
|
bindkey "^[Od" backward-word # control + left arrow
|
2019-12-09 19:25:42 +01:00
|
|
|
bindkey "^H" backward-kill-word # control + backspace
|
2019-10-18 15:48:39 +02:00
|
|
|
bindkey "^[[3^" kill-word # control + delete
|
|
|
|
;;
|
|
|
|
linux)
|
|
|
|
bindkey "^[[1~" beginning-of-line #Home key
|
|
|
|
bindkey "^[[4~" end-of-line #End key
|
|
|
|
bindkey "^[[3~" delete-char #Del key
|
|
|
|
bindkey "^[[A" history-beginning-search-backward
|
|
|
|
bindkey "^[[B" history-beginning-search-forward
|
|
|
|
;;
|
|
|
|
screen|screen-*)
|
|
|
|
bindkey "^[[1~" beginning-of-line #Home key
|
|
|
|
bindkey "^[[4~" end-of-line #End key
|
|
|
|
bindkey "^[[3~" delete-char #Del key
|
|
|
|
bindkey "^[[A" history-beginning-search-backward #Up Arrow
|
|
|
|
bindkey "^[[B" history-beginning-search-forward #Down Arrow
|
|
|
|
bindkey "^[Oc" forward-word # control + right arrow
|
|
|
|
bindkey "^[OC" forward-word # control + right arrow
|
|
|
|
bindkey "^[Od" backward-word # control + left arrow
|
|
|
|
bindkey "^[OD" backward-word # control + left arrow
|
|
|
|
bindkey "^H" backward-kill-word # control + backspace
|
|
|
|
bindkey "^[[3^" kill-word # control + delete
|
|
|
|
;;
|
|
|
|
esac
|
2019-10-16 02:28:41 +02:00
|
|
|
|
|
|
|
|
2019-10-21 21:28:20 +02:00
|
|
|
# }}}
|
|
|
|
# Completions {{{
|
2019-10-18 15:48:39 +02:00
|
|
|
#
|
|
|
|
HYPHEN_INSENSITIVE="true"
|
|
|
|
ENABLE_CORRECTION="true"
|
|
|
|
|
|
|
|
COMPLETION_WAITING_DOTS="true"
|
|
|
|
zstyle ':completion:*' completer _oldlist _expand _complete _ignored _match _correct _approximate _prefix
|
|
|
|
zstyle ':completion:*' group-name ''
|
|
|
|
zstyle ':completion:*' matcher-list '' 'm:{[:lower:]}={[:upper:]}' 'r:|[._-]=* r:|=*' 'l:|=* r:|=*'
|
|
|
|
zstyle ':completion:*' menu select=list select=0
|
|
|
|
zstyle ':completion:*' list-prompt %SAt %p: Hit TAB for more, or the character to insert%s
|
|
|
|
zstyle ':completion:*' use-compctl true
|
|
|
|
zstyle ':completion:*' verbose true
|
|
|
|
zstyle ':completion:*' rehash true
|
|
|
|
zstyle :compinstall filename '/home/lelgenio/.config//zsh//.zshrc'
|
|
|
|
zstyle ':completion:*' select-prompt %SScrolling active: current selection at %p%s
|
|
|
|
source /usr/share/doc/pkgfile/command-not-found.zsh
|
|
|
|
|
|
|
|
autoload -Uz compinit
|
|
|
|
compinit
|
2019-11-23 18:35:46 +01:00
|
|
|
|
|
|
|
setopt GLOBSTARSHORT
|
2019-10-21 21:28:20 +02:00
|
|
|
#}}}
|
2019-10-16 02:28:41 +02:00
|
|
|
|
2019-10-21 21:28:20 +02:00
|
|
|
# vim:foldmethod=marker
|
2019-12-09 19:25:42 +01:00
|
|
|
|
|
|
|
# To customize prompt, run `p10k configure` or edit ~/.p10k.zsh.
|
|
|
|
[[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh
|