[zsh] Corrected: set tab title for neovim
This commit is contained in:
parent
0ca285a3ca
commit
a789dfcc68
1 changed files with 1 additions and 37 deletions
|
@ -1,40 +1,4 @@
|
||||||
# This function emits an OSC 1337 sequence to set a user var
|
alias nvim='[[ -d "./.git" ]] && wezterm cli set-tab-title "${PWD##*/}"; nvim'
|
||||||
# associated with the current terminal pane.
|
|
||||||
# It requires the `base64` utility to be available in the path.
|
|
||||||
# This function is included in the wezterm shell integration script, but
|
|
||||||
# is reproduced here for clarity
|
|
||||||
# __wezterm_set_user_var() {
|
|
||||||
# if hash base64 2>/dev/null ; then
|
|
||||||
# if [[ -z "${TMUX}" ]] ; then
|
|
||||||
# printf "\033]1337;SetUserVar=%s=%s\007" "$1" `echo -n "$2" | base64`
|
|
||||||
# else
|
|
||||||
# # <https://github.com/tmux/tmux/wiki/FAQ#what-is-the-passthrough-escape-sequence-and-how-do-i-use-it>
|
|
||||||
# # Note that you ALSO need to add "set -g allow-passthrough on" to your tmux.conf
|
|
||||||
# printf "\033Ptmux;\033\033]1337;SetUserVar=%s=%s\007\033\\" "$1" `echo -n "$2" | base64`
|
|
||||||
# fi
|
|
||||||
# fi
|
|
||||||
# }
|
|
||||||
#
|
|
||||||
# function _run_prog() {
|
|
||||||
# # set PROG to the program being run
|
|
||||||
# __wezterm_set_user_var "PROG" "$1"
|
|
||||||
#
|
|
||||||
# # arrange to clear it when it is done
|
|
||||||
# trap '__wezterm_set_user_var PROG ""' EXIT
|
|
||||||
#
|
|
||||||
# # and now run the corresponding command, taking care to avoid looping
|
|
||||||
# # with the alias definition
|
|
||||||
# command "$@"
|
|
||||||
# }
|
|
||||||
|
|
||||||
function _set_nvim_title() {
|
|
||||||
[[ -d "./git" ]] && wezterm cli set-tab-title "${PWD##*/}"
|
|
||||||
command "$@"
|
|
||||||
}
|
|
||||||
|
|
||||||
# alias vim="_run_prog vim"
|
|
||||||
# alias tmux="_run_prog tmux"
|
|
||||||
alias nvim="_set_nvim_title nvim"
|
|
||||||
alias exi='eza --icons --group -al'
|
alias exi='eza --icons --group -al'
|
||||||
alias fgj='tea'
|
alias fgj='tea'
|
||||||
alias qb='QT_SCALE_FACTOR=1.5 /usr/bin/qutebrowser &'
|
alias qb='QT_SCALE_FACTOR=1.5 /usr/bin/qutebrowser &'
|
||||||
|
|
Loading…
Add table
Reference in a new issue