mirror of
https://github.com/rywng/dotfiles.git
synced 2024-11-24 11:51:50 +08:00
feat(shell): change bindings, and zsh settings
This commit is contained in:
parent
135b1e7f88
commit
5a86871551
@ -9,7 +9,7 @@ if [[ ! $(which swayidle 2> /dev/null) ]]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
choices=("suspend" "poweroff" "reboot" "lock")
|
choices=("suspend" "poweroff" "reboot" "lock")
|
||||||
choice=$(printf "%s\n" "${choices[@]}" | fuzzel -d --prompt ": ")
|
choice=$(printf "%s\n" "${choices[@]}" | fuzzel -d --prompt "🔌: ")
|
||||||
|
|
||||||
|
|
||||||
if test "$choice" = lock ; then
|
if test "$choice" = lock ; then
|
||||||
|
37
.zshrc
37
.zshrc
@ -26,13 +26,11 @@ zinit wait lucid for \
|
|||||||
zpm-zsh/colorize \
|
zpm-zsh/colorize \
|
||||||
rywng/shortify.zsh
|
rywng/shortify.zsh
|
||||||
|
|
||||||
zinit ice wait lucid atinit"bindkey '' autosuggest-execute" atload'_zsh_autosuggest_start'
|
zinit ice wait lucid atinit"bindkey '^ ' autosuggest-execute" atload'_zsh_autosuggest_start'
|
||||||
zinit light zsh-users/zsh-autosuggestions
|
zinit light zsh-users/zsh-autosuggestions
|
||||||
|
|
||||||
zinit ice wait lucid
|
|
||||||
zinit load hlissner/zsh-autopair
|
|
||||||
|
|
||||||
zinit light zsh-users/zsh-completions
|
zinit light zsh-users/zsh-completions
|
||||||
|
zinit light zsh-users/zsh-history-substring-search
|
||||||
|
|
||||||
# Software
|
# Software
|
||||||
if ! command -v bat &> /dev/null ; then
|
if ! command -v bat &> /dev/null ; then
|
||||||
@ -40,13 +38,16 @@ if ! command -v bat &> /dev/null ; then
|
|||||||
zinit light sharkdp/bat
|
zinit light sharkdp/bat
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if ! command -v direnv &> /dev/null; then
|
||||||
zinit ice from"gh-r" as"program" mv"direnv* -> direnv"
|
zinit ice from"gh-r" as"program" mv"direnv* -> direnv"
|
||||||
zinit light direnv/direnv
|
zinit light direnv/direnv
|
||||||
|
fi
|
||||||
|
|
||||||
autoload -Uz _zinit
|
autoload -Uz _zinit
|
||||||
(( ${+_comps} )) && _comps[zinit]=_zinit
|
(( ${+_comps} )) && _comps[zinit]=_zinit
|
||||||
|
|
||||||
test -n "$LS_COLORS" || eval $(dircolors) || echo 'Warning: Unable to set LS_COLORS'
|
test -n "$LS_COLORS" || eval $(dircolors) || echo 'Warning: Unable to set LS_COLORS'
|
||||||
|
|
||||||
# The following lines were added by compinstall
|
# The following lines were added by compinstall
|
||||||
|
|
||||||
zstyle ':completion:*' auto-description '%F{green}Specify%f: %F{cyan}%d%f'
|
zstyle ':completion:*' auto-description '%F{green}Specify%f: %F{cyan}%d%f'
|
||||||
@ -57,20 +58,19 @@ zstyle ':completion:*' file-sort name
|
|||||||
zstyle ':completion:*' format '%F{green}Completing%f %F{yellow}%d%f'
|
zstyle ':completion:*' format '%F{green}Completing%f %F{yellow}%d%f'
|
||||||
zstyle ':completion:*' glob 1
|
zstyle ':completion:*' glob 1
|
||||||
zstyle ':completion:*' group-name ''
|
zstyle ':completion:*' group-name ''
|
||||||
zstyle ':completion:*' ignore-parents parent pwd ..
|
zstyle ':completion:*' ignore-parents parent pwd .. directory
|
||||||
zstyle ':completion:*' insert-unambiguous true
|
zstyle ':completion:*' insert-unambiguous true
|
||||||
zstyle ':completion:*' list-colors ${(s.:.)LS_COLORS}
|
zstyle ':completion:*' list-colors ${(s.:.)LS_COLORS}
|
||||||
zstyle ':completion:*' list-prompt %S%F{green}At %p%f: Hit TAB for more, or the character to insert%s
|
zstyle ':completion:*' matcher-list '' 'm:{[:lower:]}={[:upper:]}' 'r:|[._-]=** r:|=**' 'l:|=* r:|=*'
|
||||||
zstyle ':completion:*' matcher-list '' 'm:{[:lower:][:upper:]}={[:upper:][:lower:]}' 'r:|[._-]=** r:|=**' 'l:|=* r:|=*'
|
zstyle ':completion:*' max-errors 2
|
||||||
zstyle ':completion:*' max-errors 16 numeric
|
|
||||||
zstyle ':completion:*' menu select=1
|
zstyle ':completion:*' menu select=1
|
||||||
zstyle ':completion:*' original false
|
zstyle ':completion:*' original false
|
||||||
zstyle ':completion:*' preserve-prefix '//[^/]##/'
|
zstyle ':completion:*' preserve-prefix '//[^/]##/'
|
||||||
zstyle ':completion:*' prompt '%F{green}Completing%f, with %F{red}%e%f errors'
|
zstyle ':completion:*' prompt '%F{green}Completing%f, with %F{red}%e%f errors'
|
||||||
zstyle ':completion:*' select-prompt %S%F{green}Scrolling%f active: current selection at %F{blue}%p%f%s
|
zstyle ':completion:*' select-prompt '%S%F{green}Scrolling%f active: current selection at %F{blue}%p%f%s'
|
||||||
zstyle ':completion:*' substitute 1
|
zstyle ':completion:*' substitute 0
|
||||||
zstyle ':completion:*' use-compctl true
|
zstyle ':completion:*' verbose true
|
||||||
zstyle :compinstall filename ~/.zshrc
|
zstyle :compinstall filename '/home/ryan/.zshrc'
|
||||||
|
|
||||||
autoload -Uz compinit
|
autoload -Uz compinit
|
||||||
compinit
|
compinit
|
||||||
@ -79,8 +79,8 @@ compinit
|
|||||||
HISTFILE=~/.cache/zhistory
|
HISTFILE=~/.cache/zhistory
|
||||||
HISTSIZE=8192
|
HISTSIZE=8192
|
||||||
SAVEHIST=8192
|
SAVEHIST=8192
|
||||||
setopt autocd extendedglob nomatch notify auto_pushd
|
setopt autocd autopushd extendedglob nomatch
|
||||||
unsetopt beep
|
unsetopt beep notify
|
||||||
bindkey -e
|
bindkey -e
|
||||||
# End of lines configured by zsh-newuser-install
|
# End of lines configured by zsh-newuser-install
|
||||||
|
|
||||||
@ -103,6 +103,11 @@ bindkey -M menuselect 'k' vi-up-line-or-history
|
|||||||
bindkey -M menuselect 'l' vi-forward-char
|
bindkey -M menuselect 'l' vi-forward-char
|
||||||
bindkey -M menuselect 'j' vi-down-line-or-history
|
bindkey -M menuselect 'j' vi-down-line-or-history
|
||||||
|
|
||||||
|
bindkey '^[[A' history-substring-search-up
|
||||||
|
bindkey '^[[B' history-substring-search-down
|
||||||
|
bindkey '^P' history-substring-search-up
|
||||||
|
bindkey '^N' history-substring-search-down
|
||||||
|
|
||||||
bindkey ' ' magic-space
|
bindkey ' ' magic-space
|
||||||
|
|
||||||
# config & cache location
|
# config & cache location
|
||||||
@ -118,14 +123,14 @@ export ZSHZ_DATA=$HOME/.cache/z
|
|||||||
export BAT_THEME="base16"
|
export BAT_THEME="base16"
|
||||||
export FZF_DEFAULT_OPTS="--reverse --cycle --height=40% --border sharp --prompt=🔎"
|
export FZF_DEFAULT_OPTS="--reverse --cycle --height=40% --border sharp --prompt=🔎"
|
||||||
export GPG_TTY=$(tty) # fixes gpg
|
export GPG_TTY=$(tty) # fixes gpg
|
||||||
|
export LESS="-i $LESS"
|
||||||
export MANROFFOPT="-c"
|
export MANROFFOPT="-c"
|
||||||
export MANWIDTH=${MANWIDTH:-78}
|
export MANWIDTH=${MANWIDTH:-78}
|
||||||
export SSH_AUTH_SOCK=$XDG_RUNTIME_DIR/ssh-agent.socket
|
export SSH_AUTH_SOCK=$XDG_RUNTIME_DIR/ssh-agent.socket
|
||||||
|
|
||||||
# local path
|
# local path
|
||||||
export MANPATH="${MANPATH}:${HOME}/.local/share/man"
|
export MANPATH="${MANPATH}:${HOME}/.local/share/man"
|
||||||
export PATH="${PATH}:${HOME}/.local/bin:${HOME}/.scripts:${HOME}/cargo/bin:${HOME}/.cache/go/bin:${HOME}/.local/share/nvim/mason/bin"
|
export PATH="${PATH}:${HOME}/.local/bin:${HOME}/.scripts:${HOME}/.cache/go/bin:${HOME}/.local/share/nvim/mason/bin"
|
||||||
|
|
||||||
# ccache support
|
# ccache support
|
||||||
export PATH="/usr/lib/ccache/bin${PATH:+:}$PATH"
|
export PATH="/usr/lib/ccache/bin${PATH:+:}$PATH"
|
||||||
export USE_CCACHE=1
|
|
||||||
|
Loading…
Reference in New Issue
Block a user