From e4120c283e51c540f0fba965d28d4d9a14063fa3 Mon Sep 17 00:00:00 2001 From: Connor Olding Date: Mon, 17 Jun 2024 20:57:25 -0700 Subject: [PATCH] add keybind to join all lines in command --- home/zshrc | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/home/zshrc b/home/zshrc index e98e06a..9df69a7 100644 --- a/home/zshrc +++ b/home/zshrc @@ -123,6 +123,12 @@ dirview() { ### @- 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 # 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;3B' dirview # alt+down bindkey -s '^[s' '^Asudo ^E' # alt+s +bindkey '^[j' join-lines # alt+j bindkey '^[[3~' delete-char # del bindkey '^[[1~' beginning-of-line # home bindkey '^[[4~' end-of-line # end