From e915531d8397eb29010253126e98b88d288d65c5 Mon Sep 17 00:00:00 2001 From: Arthur Khachaturov Date: Tue, 28 Nov 2023 17:08:55 +0300 Subject: [PATCH] Add zkbd keys, add submodules --- .gitmodules | 6 +++++ .local/share/zsh-plugins/git-prompt.zsh | 1 + .../share/zsh-plugins/zsh-syntax-highlighting | 1 + .zkbd/xterm-256color-:0 | 26 +++++++++++++++++++ .zshrc | 16 +++++++++++- 5 files changed, 49 insertions(+), 1 deletion(-) create mode 100644 .gitmodules create mode 160000 .local/share/zsh-plugins/git-prompt.zsh create mode 160000 .local/share/zsh-plugins/zsh-syntax-highlighting create mode 100644 .zkbd/xterm-256color-:0 diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..536d84d --- /dev/null +++ b/.gitmodules @@ -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 diff --git a/.local/share/zsh-plugins/git-prompt.zsh b/.local/share/zsh-plugins/git-prompt.zsh new file mode 160000 index 0000000..55f40bd --- /dev/null +++ b/.local/share/zsh-plugins/git-prompt.zsh @@ -0,0 +1 @@ +Subproject commit 55f40bdfb287122ea50c1c01ef056ca7dac175e5 diff --git a/.local/share/zsh-plugins/zsh-syntax-highlighting b/.local/share/zsh-plugins/zsh-syntax-highlighting new file mode 160000 index 0000000..bb27265 --- /dev/null +++ b/.local/share/zsh-plugins/zsh-syntax-highlighting @@ -0,0 +1 @@ +Subproject commit bb27265aeeb0a22fb77f1275118a5edba260ec47 diff --git a/.zkbd/xterm-256color-:0 b/.zkbd/xterm-256color-:0 new file mode 100644 index 0000000..0eff172 --- /dev/null +++ b/.zkbd/xterm-256color-:0 @@ -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]='''' diff --git a/.zshrc b/.zshrc index 84b5031..c288dea 100644 --- a/.zshrc +++ b/.zshrc @@ -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