Add zkbd keys, add submodules

This commit is contained in:
Arthur Khachaturov 2023-11-28 17:08:55 +03:00
parent ea97367ac4
commit e915531d83
5 changed files with 49 additions and 1 deletions

6
.gitmodules vendored Normal file
View file

@ -0,0 +1,6 @@
[submodule ".local/share/zsh-plugins/zsh-syntax-highlighting"]
path = .local/share/zsh-plugins/zsh-syntax-highlighting
url = https://github.com/zsh-users/zsh-syntax-highlighting/
[submodule ".local/share/zsh-plugins/git-prompt.zsh"]
path = .local/share/zsh-plugins/git-prompt.zsh
url = https://github.com/woefe/git-prompt.zsh

@ -0,0 +1 @@
Subproject commit 55f40bdfb287122ea50c1c01ef056ca7dac175e5

@ -0,0 +1 @@
Subproject commit bb27265aeeb0a22fb77f1275118a5edba260ec47

26
.zkbd/xterm-256color-:0 Normal file
View file

@ -0,0 +1,26 @@
typeset -g -A key
key[F1]='OP'
key[F2]='^[OQ'
key[F3]='^[OR'
key[F4]='^[OS'
key[F5]='^[[15~'
key[F6]='^[[17~'
key[F7]='^[[18~'
key[F8]='^[[19~'
key[F9]='^[[20~'
key[F10]='^[[21~'
key[F11]=''''
key[F12]='^[[24~'
key[Backspace]='^?'
key[Insert]='^[[2~'
key[Home]=''''
key[PageUp]=''''
key[Delete]='^[[3~'
key[End]=''''
key[PageDown]=''''
key[Up]='^[[A'
key[Left]='^[[D'
key[Down]='^[[B'
key[Right]='^[[C'
key[Menu]=''''

16
.zshrc
View file

@ -1,3 +1,8 @@
# keybinds
source ~/.zkbd/$TERM-${${DISPLAY:t}:-$VENDOR-$OSTYPE}
# [[ -n ${key[Left]} ]] && bindkey "${key[Left]}" backward-char
# [[ -n ${key[Right]} ]] && bindkey "${key[Right]}" forward-char
# history
HISTSIZE=10000000
SAVEHIST=10000000
@ -6,6 +11,10 @@ setopt inc_append_history
setopt extended_history
setopt hist_find_no_dups
# enable alt+arrow movements
bindkey "^[[1;3D" forward-word
bindkey "^[[1;3C" backward-word
# change word-style
autoload -U select-word-style
select-word-style b
@ -16,6 +25,7 @@ bindkey -e
# completions
zstyle :compinstall filename '/home/wzray/.zshrc'
zstyle ':completion:*' menu select
autoload -Uz compinit
compinit
@ -26,13 +36,16 @@ RPROMPT='$(gitprompt)'
# ls aliases
alias ls="lsd --color=auto"
alias la="ls -lAh"
alias la="ls -lah"
alias ll="ls -lh"
alias tree="ls --tree"
# aliases
alias dt="git --git-dir=$HOME/.dotfiles/git --work-tree=$HOME"
alias rz="exec zsh"
alias bat="batcat"
alias ..="cd .."
# theming
ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg_bold[red]%}["
@ -55,3 +68,4 @@ ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg_bold[green]%}v"
# plugins
source "$HOME/.local/share/zsh-plugins/git-prompt.zsh/git-prompt.zsh"
# source "$HOME/.local/share/zsh-plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh" # don't like it, makes my terminal feel sluggish