2

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?

  • 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. – Christian Brabandt Apr 18 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 Apr 18 at 6:10
  • 1
    don't think so and I think such a configuration option belongs into your .bashrc or similar shell configuration file. – Christian Brabandt Apr 18 at 6:21
  • [[ $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 Apr 18 at 11:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.