1
0
Fork 0
mirror of https://github.com/notwa/rc synced 2024-11-05 06:29:02 -08:00

add keybind to join all lines in command

This commit is contained in:
Connor Olding 2024-06-17 20:57:25 -07:00
parent 7ef87b0f88
commit e4120c283e

View file

@ -123,6 +123,12 @@ dirview() { ### @-
for x (dummy dirprev dirnext dirup dirview) zle -N $x for x (dummy dirprev dirnext dirup dirview) zle -N $x
join-lines() {
BUFFER="${BUFFER//$'\n'/ }"
CURSOR="${#BUFFER}"
}
zle -N join-lines
bindkey -e # emacs-style keybinds bindkey -e # emacs-style keybinds
# oh thank god: http://blog.samsonis.me/2013/12/bash-like-history-search-functionality-for-zsh/ # oh thank god: http://blog.samsonis.me/2013/12/bash-like-history-search-functionality-for-zsh/
@ -140,6 +146,7 @@ bindkey '^[[1;3C' dirnext # alt+right
bindkey '^[[1;3A' dirup # alt+up bindkey '^[[1;3A' dirup # alt+up
bindkey '^[[1;3B' dirview # alt+down bindkey '^[[1;3B' dirview # alt+down
bindkey -s '^[s' '^Asudo ^E' # alt+s bindkey -s '^[s' '^Asudo ^E' # alt+s
bindkey '^[j' join-lines # alt+j
bindkey '^[[3~' delete-char # del bindkey '^[[3~' delete-char # del
bindkey '^[[1~' beginning-of-line # home bindkey '^[[1~' beginning-of-line # home
bindkey '^[[4~' end-of-line # end bindkey '^[[4~' end-of-line # end