better titlestrings
This commit is contained in:
parent
921ab05d42
commit
c5a98cc0e2
|
@ -1,3 +0,0 @@
|
||||||
#!/usr/bin/env bash
|
|
||||||
kitty +kitten icat --clear --transfer-mode file
|
|
||||||
|
|
|
@ -9,7 +9,6 @@ set wrapscroll
|
||||||
set period 1
|
set period 1
|
||||||
set previewer ~/.config/lf/preview
|
set previewer ~/.config/lf/preview
|
||||||
set cleaner ~/.config/lf/clean
|
set cleaner ~/.config/lf/clean
|
||||||
set promptfmt "\033[34;1m%u\033[36m@\033[34m%h \033[35m[\033[0;1m%d\033[33m%f\033[35m]\033[0m"
|
|
||||||
|
|
||||||
cmd open ${{
|
cmd open ${{
|
||||||
case $(file --mime-type "$(readlink -f $f)" -b) in
|
case $(file --mime-type "$(readlink -f $f)" -b) in
|
||||||
|
@ -95,8 +94,9 @@ cmd link %{{
|
||||||
cmd bulkrename $vidir
|
cmd bulkrename $vidir
|
||||||
|
|
||||||
cmd on-cd &{{
|
cmd on-cd &{{
|
||||||
DIR=$(echo $PWD | sed "s|$HOME|~|")
|
printf "%b" "\033]0;$(zsh -c 'source $XDG_CONFIG_HOME/zsh/configs/autogenerated/hashes; print -Pn "$USER@$HOST [%3~]"') \007" > /dev/tty
|
||||||
printf "\033]0; $DIR\007" > /dev/tty
|
fmt="\033[34;1m%u\033[36m@\033[34m%h \033[35m[\033[0;1m$(zsh -c 'source $XDG_CONFIG_HOME/zsh/configs/autogenerated/hashes; print -Pn "%3~"')\033[35m]\033[32m » \033[33m%f\033[0m"
|
||||||
|
lf -remote "send $id set promptfmt \"$fmt\""
|
||||||
}}
|
}}
|
||||||
on-cd
|
on-cd
|
||||||
|
|
||||||
|
|
|
@ -52,8 +52,18 @@ zle -N zle-line-init
|
||||||
echo -ne '\e[5 q' # Use beam shape cursor on startup.
|
echo -ne '\e[5 q' # Use beam shape cursor on startup.
|
||||||
preexec() { echo -ne '\e[5 q' ;} # Use beam shape cursor for each new prompt.
|
preexec() { echo -ne '\e[5 q' ;} # Use beam shape cursor for each new prompt.
|
||||||
|
|
||||||
|
# Set the titlestring
|
||||||
|
function write_title_cmd() {
|
||||||
|
if [ ${1[(w)1]} != "lfwrap" ]; then
|
||||||
|
echo -ne "\033]0;$(print -P "%n@%m [%3~] » ${1[(w)1]}")\007"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
add-zsh-hook preexec write_title_cmd
|
||||||
|
function write_title_wd() { echo -ne "\033]0;$(print -P "%n@%m [%3~]")\007" }
|
||||||
|
add-zsh-hook precmd write_title_wd
|
||||||
|
|
||||||
# Use lf to switch directories and bind it to ctrl-o
|
# Use lf to switch directories and bind it to ctrl-o
|
||||||
lfcd () {
|
lfwrap () {
|
||||||
tmp="$(mktemp)"
|
tmp="$(mktemp)"
|
||||||
fid="$(mktemp)"
|
fid="$(mktemp)"
|
||||||
lf -command '$printf $id > '"$fid"'' -last-dir-path="$tmp" "$@"
|
lf -command '$printf $id > '"$fid"'' -last-dir-path="$tmp" "$@"
|
||||||
|
@ -75,12 +85,12 @@ lfcd () {
|
||||||
tput cuu1;tput el
|
tput cuu1;tput el
|
||||||
}
|
}
|
||||||
|
|
||||||
_lfcd () {
|
_lf () {
|
||||||
BUFFER="lfcd"
|
BUFFER="lfwrap"
|
||||||
zle accept-line
|
zle accept-line
|
||||||
}
|
}
|
||||||
zle -N _lfcd
|
zle -N _lf
|
||||||
bindkey '^e' _lfcd
|
bindkey '^e' _lf
|
||||||
|
|
||||||
# bind lazygit to ctrl-g
|
# bind lazygit to ctrl-g
|
||||||
lg () {
|
lg () {
|
||||||
|
|
Loading…
Reference in New Issue