6

I am using ibeam a.k.a vertical bar cursor right now. When I switch to terminal mode in vim, it changes the cursor shape to block - but doesn't restore it after I quit the terminal.

I tried changing it in my shell as per the below comment; it works for :terminal but not for :terminal tig.

:help terminal has a section called terminal-cursor-style, but I am not able sure what to do with that information.

Is it possible to inherit the terminal emulator's cursor shape inside vim -- if not, can I at-least configure it to us my cursor style?

5
  • 2
    well, the cursor style is usually defined using some xterm escape sequences. If you know the correct escape sequences to make an ibeam cursor (whatever that is), simply run it in Vims terminal and it should adjust the cursor accordingly. Commented Apr 18, 2019 at 6:04
  • Thanks @ChristianBrabandt, I could probably use echo -e -n "\x1b[\x35 q". I would like know if this is configurable + if I can re-use this info from my terminal and not repeat it.
    – Nishant
    Commented Apr 18, 2019 at 6:10
  • 1
    don't think so and I think such a configuration option belongs into your .bashrc or similar shell configuration file. Commented Apr 18, 2019 at 6:21
  • 1
    [[ $TERM == xterm* ]] && echo -e -n "\x1b[\x35 q" works when you simply do :terminal. But when you do something like :terminal tig and come back, it changes back to block cursor.
    – Nishant
    Commented Apr 18, 2019 at 11:14
  • this [[ $TERM == xterm* ]] && echo -e -n "\x1b[\x35 q", doesnt work.
    – alexzander
    Commented Sep 23, 2021 at 21:39

1 Answer 1

1

Checkout https://vi.stackexchange.com/a/14529/10652

set t_SH=6 might be what you are looking for...

t_SH must take one argument:
        0, 1 or none    blinking block cursor
        2               block cursor
        3               blinking underline cursor
        4               underline cursor
        5               blinking vertical bar cursor
        6               vertical bar cursor

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.