+ Fix binding

This commit is contained in:
ziro 2020-06-20 14:22:04 +07:00
parent 19260309b2
commit d0648463ca
3 changed files with 51 additions and 27 deletions

View file

@ -432,3 +432,5 @@ Jun 20 09:30 : player: played "Japan/RADWIMPS - スパークル - movie ver.mp3"
Jun 20 09:33 : player: played "English or EDM/Calvin Harris - How Deep Is Your Love.mp3" Jun 20 09:33 : player: played "English or EDM/Calvin Harris - How Deep Is Your Love.mp3"
Jun 20 09:37 : player: played "English or EDM/Rynx - Want You.mp3" Jun 20 09:37 : player: played "English or EDM/Rynx - Want You.mp3"
Jun 20 09:40 : player: played "Japan/Harutya ft. Kobasolo - Fiction.mp3" Jun 20 09:40 : player: played "Japan/Harutya ft. Kobasolo - Fiction.mp3"
Jun 20 11:46 : exception: RTIOThread could not get realtime scheduling, continuing anyway: sched_setscheduler failed: Operation not permitted
Jun 20 14:20 : exception: RTIOThread could not get realtime scheduling, continuing anyway: sched_setscheduler failed: Operation not permitted

View file

@ -10,6 +10,9 @@ rateUSD
#python ~/Currency/USD2IDR/rate.py #PYTHON IS JUST TOO SLOW FOR TERMINAL #python ~/Currency/USD2IDR/rate.py #PYTHON IS JUST TOO SLOW FOR TERMINAL
#sh ~/.scripts/motd.sh #sh ~/.scripts/motd.sh
# Alias
[ -f ~/.config/zsh/aliases ] && source ~/.config/zsh/aliases
# Theme # Theme
[ -f ~/.config/zsh/theme ] && source ~/.config/zsh/theme [ -f ~/.config/zsh/theme ] && source ~/.config/zsh/theme
@ -18,41 +21,17 @@ HISTFILE=~/.cache/zsh/zsh_history
HISTSIZE=1000 HISTSIZE=1000
SAVEHIST=1000 SAVEHIST=1000
# Theme
#ZSH_THEME="zi"
# ZSH_THEME="spaceship"
# configuration
# SPACESHIP_CHAR_SYMBOL="$> "
# SPACESHIP_GIT_BRANCH_COLOR="magenta"
# SPACESHIP_GIT_PREFIX=""
# SPACESHIP_GIT_SUFFIX=""
# SPACESHIP_GIT_BRANCH_SUFFIX=""
# SPACESHIP_GIT_STATUS_PREFIX=' '
# SPACESHIP_GIT_STATUS_SUFFIX=''
# SPACESHIP_EXEC_TIME_SHOW=false
# SPACESHIP_DIR_COLOR="blue"
# SPACESHIP_DIR_TRUNC_PREFIX="~/"
# SPACESHIP_PYENV_SYMBOL=""
# vimrc # vimrc
export VIMINIT='let $MYVIMRC="$XDG_CONFIG_HOME/vim/vimrc" | source $MYVIMRC' export VIMINIT='let $MYVIMRC="$XDG_CONFIG_HOME/vim/vimrc" | source $MYVIMRC'
# vi mode # vi mode
#bindkey -v bindkey -v
#export KEYTIMEOUT=1 export KEYTIMEOUT=1
[ -f ~/.config/zsh/keybinds ] && source ~/.config/zsh/keybinds
# Plugins # Plugins
ZSH_PLUGIN="$XDG_DATA_HOME/zsh/plugins" ZSH_PLUGIN="$XDG_DATA_HOME/zsh/plugins"
#plugins=(
#git
#fast-syntax-highlighting
##zsh-syntax-highlighting
#zsh-autosuggestions
#)
# source $ZSH/oh-my-zsh.sh # source $ZSH/oh-my-zsh.sh
# Binds/Alias (Preventing from reverted to the original one)
[ -f ~/.config/zsh/aliases ] && source ~/.config/zsh/aliases
[ -f ~/.config/zsh/keybinds ] && source ~/.config/zsh/keybinds
# emulate -R zsh -c 'source $ZSH_PLUGINS/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh' # emulate -R zsh -c 'source $ZSH_PLUGINS/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh'
source $ZSH_CUSTOM/plugins/fast-syntax-highlighting/fast-syntax-highlighting.plugin.zsh 2>/dev/null source $ZSH_CUSTOM/plugins/fast-syntax-highlighting/fast-syntax-highlighting.plugin.zsh 2>/dev/null
source $ZSH_CUSTOM/plugins/zsh-autosuggestions/zsh-autosuggestions.plugin.zsh 2>/dev/null source $ZSH_CUSTOM/plugins/zsh-autosuggestions/zsh-autosuggestions.plugin.zsh 2>/dev/null

View file

@ -1,2 +1,45 @@
#!/bin/env zsh #!/bin/env zsh
# create a zkbd compatible hash;
# to add other keys to this hash, see: man 5 terminfo
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[Shift-Tab]="${terminfo[kcbt]}"
# setup key accordingly
[[ -n "${key[Home]}" ]] && bindkey -- "${key[Home]}" beginning-of-line
[[ -n "${key[End]}" ]] && bindkey -- "${key[End]}" end-of-line
[[ -n "${key[Insert]}" ]] && bindkey -- "${key[Insert]}" overwrite-mode
[[ -n "${key[Backspace]}" ]] && bindkey -- "${key[Backspace]}" backward-delete-char
[[ -n "${key[Delete]}" ]] && bindkey -- "${key[Delete]}" delete-char
[[ -n "${key[Up]}" ]] && bindkey -- "${key[Up]}" up-line-or-history
[[ -n "${key[Down]}" ]] && bindkey -- "${key[Down]}" down-line-or-history
[[ -n "${key[Left]}" ]] && bindkey -- "${key[Left]}" backward-char
[[ -n "${key[Right]}" ]] && bindkey -- "${key[Right]}" forward-char
[[ -n "${key[PageUp]}" ]] && bindkey -- "${key[PageUp]}" beginning-of-buffer-or-history
[[ -n "${key[PageDown]}" ]] && bindkey -- "${key[PageDown]}" end-of-buffer-or-history
[[ -n "${key[Shift-Tab]}" ]] && bindkey -- "${key[Shift-Tab]}" reverse-menu-complete
# Finally, make sure the terminal is in application mode, when zle is
# active. Only then are the values from $terminfo valid.
if (( ${+terminfo[smkx]} && ${+terminfo[rmkx]} )); then
autoload -Uz add-zle-hook-widget
function zle_application_mode_start { echoti smkx }
function zle_application_mode_stop { echoti rmkx }
add-zle-hook-widget -Uz zle-line-init zle_application_mode_start
add-zle-hook-widget -Uz zle-line-finish zle_application_mode_stop
fi
bindkey -v '^[[3~' delete-char
bindkey '^ ' autosuggest-accept bindkey '^ ' autosuggest-accept