It is not always applicable to prepare such resource/config files as they are out of control (docker, remote, or someone else's system), so I need to do this inside the editor.
With all the information pile made for "add this to vimrc/shell", I am having a difficulty to find a solution.
Is it possible to change the cursor style for the active session/editor without touching any resource/config file? If so, how?
What have I tried:
My attempts lead me to solutions made only for resource/config files for vi/vim and/or shells. I don't know what exact search terms shall I use to get close to a result if any.
EDIT: Knowing how to "use Vi(m) to edit" files does not necessarily mean/imply you know how to set it up. Settings are some whole new level to learn advanced Vi/m. "Copy-paste" resources show one way, but fail to explain the WHY part.
EDIT: Thanks to commenters, I got the courage to try with more keen eyes and got my solution posted. Better explanations are welcome.
Until today, I believed it is
guicursorthat changes cursor style. I still do not know what it changes but this explains why I was failing.Yet, it seems the cursor is directly related to the shell used, and then
t_SI,t_EI, andt_SRare responsible to tell the shell which one to use and when.With "my preference" explained on the right side comments, these 3 are the way to set cursor style.
The
\epart of the commands might need to change depending on the shell. some require it to be\<ESC>as in"\<ESC>[1 q"The numbers here are: 1/2 for blinking/steady block, 3/4 for blinking/steady underline, and 5/6 for blinking/steady vertical bar
Also, as an extra, if the selection in visual mode is not readable, this should help:
@romainl, thanks for "Everything you can do in your vimrc can be done manually in Vim's command-line"