mirror of
https://github.com/kristoferssolo/solorice.git
synced 2025-10-21 20:10:34 +00:00
Changed zshrc
This commit is contained in:
parent
b60c90203d
commit
88f120ccab
98
zsh/.zshrc
98
zsh/.zshrc
@ -1,4 +1,3 @@
|
|||||||
# Clear terminal
|
|
||||||
# clear
|
# clear
|
||||||
# cd ~
|
# cd ~
|
||||||
|
|
||||||
@ -20,6 +19,8 @@ setopt histignorespace # Don't save commands that start with space
|
|||||||
|
|
||||||
autoload -U select-word-style
|
autoload -U select-word-style
|
||||||
|
|
||||||
|
# Themeing
|
||||||
|
autoload -U colors && colors
|
||||||
|
|
||||||
zstyle ':completion:*' matcher-list 'm:{a-zA-Z}={A-Za-z}' # Case sensetive TAB completions
|
zstyle ':completion:*' matcher-list 'm:{a-zA-Z}={A-Za-z}' # Case sensetive TAB completions
|
||||||
zstyle ':completion:*' list-colors "${(s.:.)LS_COLORS}" # Colored completion (different colors fr dirs/files/etc)
|
zstyle ':completion:*' list-colors "${(s.:.)LS_COLORS}" # Colored completion (different colors fr dirs/files/etc)
|
||||||
@ -29,6 +30,10 @@ zstyle ':completion:*' accept-exact '*(N)'
|
|||||||
zstyle ':completion:*' use-cache on
|
zstyle ':completion:*' use-cache on
|
||||||
zstyle ':completion:*' cache-path ~/.config/zsh/cache
|
zstyle ':completion:*' cache-path ~/.config/zsh/cache
|
||||||
zstyle ':completion:*' menu select
|
zstyle ':completion:*' menu select
|
||||||
|
autoload -U compinit
|
||||||
|
zmodload zsh/complist
|
||||||
|
compinit
|
||||||
|
_comp_options+=(globdots) # Include hidden files
|
||||||
|
|
||||||
HISTFILE=~/.config/zsh/.zshistory
|
HISTFILE=~/.config/zsh/.zshistory
|
||||||
HISTSIZE=10000
|
HISTSIZE=10000
|
||||||
@ -37,49 +42,33 @@ WORDCHARS=${WORDCHARS//\/[&.;]} # Don't consider certain part of the word
|
|||||||
|
|
||||||
|
|
||||||
# theme/plugins
|
# theme/plugins
|
||||||
source /usr/share/zsh/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
|
source /usr/share/zsh/plugins/zsh-autosuggestions/zsh-autosuggestions.zsh 2>/dev/null
|
||||||
source /usr/share/zsh/plugins/zsh-autosuggestions/zsh-autosuggestions.zsh
|
source /usr/share/zsh/plugins/zsh-history-substring-search/zsh-history-substring-search.zsh 2>/dev/null
|
||||||
source /usr/share/zsh/plugins/zsh-history-substring-search/zsh-history-substring-search.zsh
|
|
||||||
zmodload zsh/terminfo
|
zmodload zsh/terminfo
|
||||||
|
|
||||||
|
|
||||||
# Keybindings
|
# Keybindings
|
||||||
bindkey -e
|
bindkey -e
|
||||||
|
# vi mode
|
||||||
bindkey -v
|
bindkey -v
|
||||||
export KEYTIMEOUT=1
|
export KEYTIMEOUT=1
|
||||||
|
|
||||||
# Navigate words with CTRL+ARROW keys
|
|
||||||
bindkey '^[Oc' forward-word #
|
|
||||||
bindkey '^[Od' backward-word #
|
|
||||||
bindkey '^[[1;5C' forward-word #
|
|
||||||
bindkey '^[[1;5D' backward-word #
|
|
||||||
bindkey '^H' backward-kill-word # delete previous word with CTRL+BACKSPACE
|
|
||||||
bindkey '^[[Z' undo # SHIFT+TAB undo last action
|
|
||||||
bindkey "^[[3~" delete-char
|
|
||||||
|
|
||||||
bindkey '^[[A' history-substring-search-up
|
# Change cursor shape for different vi modes.
|
||||||
bindkey '^[[B' history-substring-search-down
|
function zle-keymap-select {
|
||||||
|
case $KEYMAP in
|
||||||
# # Change cursor shape for different vi modes.
|
vicmd) echo -ne "\e[1 q";; # block
|
||||||
# function zle-keymap-select {
|
viins|main) echo -ne "\e[5 q";; # beam
|
||||||
# if [[ ${KEYMAP} == vicmd ]] ||
|
esac
|
||||||
# [[ $1 = 'block' ]]; then
|
}
|
||||||
# echo -ne '\e[1 q'
|
zle -N zle-keymap-select
|
||||||
# elif [[ ${KEYMAP} == main ]] ||
|
zle-line-init() {
|
||||||
# [[ ${KEYMAP} == viins ]] ||
|
zle -K viins # initiate `vi insert` as keymap (can be removed if `bindkey -V` has been set elsewhere)
|
||||||
# [[ ${KEYMAP} = '' ]] ||
|
echo -ne "\e[5 q"
|
||||||
# [[ $1 = 'beam' ]]; then
|
}
|
||||||
# echo -ne '\e[5 q'
|
zle -N zle-line-init
|
||||||
# fi
|
echo -ne "\e[5 q" # Use beam shape cursor on startup.
|
||||||
# }
|
preexec() { echo -ne "\e[5 q" ;} # Use beam shape cursor for each new prompt.
|
||||||
# zle -N zle-keymap-select
|
|
||||||
# zle-line-init() {
|
|
||||||
# zle -K viins # initiate `vi insert` as keymap (can be removed if `bindkey -V` has been set elsewhere)
|
|
||||||
# echo -ne "\e[5 q"
|
|
||||||
# }
|
|
||||||
# zle -N zle-line-init
|
|
||||||
# echo -ne '\e[5 q' # Use beam shape cursor on startup.
|
|
||||||
# preexec() { echo -ne '\e[5 q' ;} # Use beam shape cursor for each new prompt.
|
|
||||||
|
|
||||||
|
|
||||||
function cd() {
|
function cd() {
|
||||||
@ -101,7 +90,36 @@ lfcd () {
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
bindkey -s '^o' 'lfcd\n'
|
|
||||||
|
# Navigate words with CTRL+ARROW keys
|
||||||
|
bindkey '^[Oc' forward-word
|
||||||
|
bindkey '^[Od' backward-word
|
||||||
|
bindkey '^[[1;5C' forward-word
|
||||||
|
bindkey '^[[1;5D' backward-word
|
||||||
|
bindkey '^H' backward-kill-word # delete previous word with CTRL+BACKSPACE
|
||||||
|
bindkey '^[[Z' undo # SHIFT+TAB undo last action
|
||||||
|
bindkey "^[[3~" delete-char
|
||||||
|
|
||||||
|
bindkey '^[[A' history-substring-search-up
|
||||||
|
bindkey '^[[B' history-substring-search-down
|
||||||
|
|
||||||
|
# Use vim keys in tab complete menu
|
||||||
|
bindkey -M menuselect 'h' vi-backward-char
|
||||||
|
bindkey -M menuselect 'k' vi-up-line-or-history
|
||||||
|
bindkey -M menuselect 'l' vi-forward-char
|
||||||
|
bindkey -M menuselect 'j' vi-down-line-or-history
|
||||||
|
bindkey -v '^?' backward-delete-char
|
||||||
|
|
||||||
|
bindkey -s "^o" "^ulfcd\n"
|
||||||
|
bindkey -s "^a" "ubc -lq\n"
|
||||||
|
bindkey "^[[P" delete-char
|
||||||
|
|
||||||
|
# Edit line in vim with ctrl-e
|
||||||
|
autoload edit-command-line; zle -N edit-command-line
|
||||||
|
bindkey "^e" edit-command-line
|
||||||
|
bindkey -M vicmd "^[[P" vi-delete-char
|
||||||
|
bindkey -M vicmd "^e" edit-command-line
|
||||||
|
bindkey -M visual "^[[P" vi-delete
|
||||||
|
|
||||||
# Aliases
|
# Aliases
|
||||||
alias cp='cp -iv' # Confirm before overwriting something
|
alias cp='cp -iv' # Confirm before overwriting something
|
||||||
@ -114,7 +132,7 @@ alias gitu='git add . && git commit && git push'
|
|||||||
alias ls='exa -a --icons --group-directories-first'
|
alias ls='exa -a --icons --group-directories-first'
|
||||||
alias lf='lfrun'
|
alias lf='lfrun'
|
||||||
alias v='nvim'
|
alias v='nvim'
|
||||||
alias dv='doas nvim'
|
alias sv='sudoedit'
|
||||||
alias matrix='unimatrix -s 95'
|
alias matrix='unimatrix -s 95'
|
||||||
alias p='sudo pacman'
|
alias p='sudo pacman'
|
||||||
alias battery='acpi'
|
alias battery='acpi'
|
||||||
@ -128,10 +146,8 @@ alias ip="ip -color=auto"
|
|||||||
alias grep="rg"
|
alias grep="rg"
|
||||||
alias code="vscodium"
|
alias code="vscodium"
|
||||||
|
|
||||||
# Themeing
|
|
||||||
autoload -U compinit colors zcalc
|
source /usr/share/zsh/plugins/fast-syntax-highlighting/fast-syntax-highlighting.plugin.zsh 2>/dev/null
|
||||||
compinit -d
|
|
||||||
colors
|
|
||||||
|
|
||||||
autoload -U promptinit; promptinit
|
autoload -U promptinit; promptinit
|
||||||
prompt spaceship
|
prompt spaceship
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user