I would like to make vim screen tabs name more useful. I've turned on the screen plugin, and tried several approachs. One that I would enjoy most was to make the screen name fixed using another load screen file, i.e.:
screen -S sectionName -c .screenTest
and screenTest file would have something like:
source $HOME/.screenrc
chdir $HOME/place
# Screen 0
screen
stuff "something^M"
# Screen 1
screen
stuff "something^M"
stuff "cd place^M"
stuff "vim -p `find -type f -not -path \"*/\.*\" -not -path \"*x86*\" \( -name \"*.py\" -o -name \"*.cxx\" -o -name \"*.h\" \)`^M"
title "Screen1"
The problem is that the title command is read before the stuff commands run. If someone knows how to make the title command runs afterwards the stuff commands are finished, it would be perfect. I tried:
stuff "^A:title TitleValue ^M"
but it doesn't write on the screen command insertion, it writes on the terminal (the ^A and ^M is written in vim using ^V^A
).
Then I tried editing the screen.plugin.zsh file.
I tried changing the prexec and precmd zsh methods when the input command has vim
to display the place instead. But I couldn't do that.
I am sorry to post it here, but if someone could help me do that, it sounds quite simple, but I am stuck at that even if I change the $cmd, it doesnt change the TAB syntax, that is, if I do:
if [[ "$cmd" == "vim*" ]]; then
# How do I check if variable $cmd has string "vim" in it using zsh?
echo "changing for vim!"
cmd=''
fi
it changes the terminal title, but not the screen window title. Any ideas? This question is also here, but I think this question is more appropriated here, since it is not an oh-my-zsh issue exactly.
Another thing that would help, is that if I could set some windows not to change automatically their titles, whereas other would change.
print -n "\033kTITEL\033\134"
if this helps in any way.print -n
was exactly what I wanted. You may post it as an answer: usingstuff "print -n "\\033kTITEL\\033\\134\" "
solved my issue instead of title. There are many other questions, but with time to study zsh I may learn it.stuff
commands run, and with thetitle
command it was changed before thestuff
commands were run. By usingstuff "print -n "\\033kTITEL\\033\\134\" "
my screen titles are set as I wanted.