Replace tmux split editing with kitty split
This commit is contained in:
		
							parent
							
								
									b3758b0c8e
								
							
						
					
					
						commit
						205558b999
					
				
					 2 changed files with 5 additions and 6 deletions
				
			
		| 
						 | 
					@ -1,4 +1,5 @@
 | 
				
			||||||
#!/bin/zsh
 | 
					#!/bin/zsh
 | 
				
			||||||
 | 
					fpath=( "${ZDOTDIR:+$ZDOTDIR/widgets}" $fpath )
 | 
				
			||||||
 | 
					
 | 
				
			||||||
bindkey -v
 | 
					bindkey -v
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -31,7 +32,7 @@ bindkey " "     magic-space            # Do history expansion on space.
 | 
				
			||||||
bindkey $'\177' backward-delete-char   # backspace
 | 
					bindkey $'\177' backward-delete-char   # backspace
 | 
				
			||||||
bindkey $'\10'  backward-delete-word   # C-backspace
 | 
					bindkey $'\10'  backward-delete-word   # C-backspace
 | 
				
			||||||
 | 
					
 | 
				
			||||||
bindkey -M vicmd ! edit-command-line-tmux
 | 
					bindkey -M vicmd ! edit-command-line-split
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#unicode input
 | 
					#unicode input
 | 
				
			||||||
autoload -U insert-unicode-char
 | 
					autoload -U insert-unicode-char
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,13 +1,11 @@
 | 
				
			||||||
ECLHEIGHT=${ECLHEIGHT:-5}
 | 
					 | 
				
			||||||
edit-command-line-tmux() {
 | 
					edit-command-line-tmux() {
 | 
				
			||||||
	local tmpfile=${TMPPREFIX:-/tmp/zsh}ecl$$
 | 
						local tmpfile=${TMPPREFIX:-/tmp/zsh}ecl$$
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	print -R - "$PREBUFFER$BUFFER" >$tmpfile
 | 
						print -R - "$PREBUFFER$BUFFER" >$tmpfile
 | 
				
			||||||
	exec </dev/tty
 | 
						exec </dev/tty
 | 
				
			||||||
	if [ -n "$TMUX" ] && [ "$UID" -ne 0 ]; then
 | 
						if [[ $KITTY_WINDOW_ID ]]; then
 | 
				
			||||||
		tmux splitw -v -l $ECLHEIGHT "vim -c 'set laststatus=0 showtabline=0 ft=zsh' $tmpfile"
 | 
							kitty @launch --type overlay vim -c 'set laststatus=0 showtabline=0 ft=zsh' $tmpfile
 | 
				
			||||||
		pid=$(ps -ef | awk "/[0-9] vim.*${tmpfile:t}/ { print \$2 }")
 | 
							tail -f --pid=$(pgrep -f "vim.*${tmpfile:t}") /dev/null
 | 
				
			||||||
		wait_on_pid $pid
 | 
					 | 
				
			||||||
	else
 | 
						else
 | 
				
			||||||
		${=${VISUAL:-${EDITOR:-vi}}} $tmpfile
 | 
							${=${VISUAL:-${EDITOR:-vi}}} $tmpfile
 | 
				
			||||||
	fi
 | 
						fi
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue