0

Possible Duplicate:
How to change VIM cursor shape while in different modes in Gnome Terminal

I tried making GNOME Terminal vim mimic GVim's default behavior of using a white block for command mode and a vertical pipe (aka I beam) for insert mode by following instructions this post, but the system doesn't work particularly well with tmux and multiple terminal vims being open.

I don't want to give up just yet, so at the very least I would like to have some indication of what mode I'm in. I read somewhere that old-school vim users used to have some trick for it, but I can't quite find it. Something about highlighting.

Any help would be appreciated.

Community
  • 1
  • 1
Alexandr Kurilin
  • 7,685
  • 6
  • 48
  • 76
  • 4
    This question is an almost exact duplicate of [that one](http://stackoverflow.com/q/14266346/546861) asked yesterday. As you may have noticed by now, there's no definitive answer to that problem. Or, rather, that *non*-problem. Isn't the `showmode` option enough? It shows **-- VISUAL --** in *visual* mode, **-- INSERT --** in *insert* mode, **-- REPLACE --** in replace mode… and it's `on` by default. – romainl Jan 12 '13 at 09:00
  • 1
    If `showmode` is NOT enough. You can also check this file of mine which also changes the statusline color depending on the mode: https://github.com/Greduan/dotfiles/blob/master/vim/plugin/statusline.vim – greduan Jan 12 '13 at 14:20
  • @romainl showmode is better than nothing, to be honest. I was so used to GVim's outrageously convenient visual cue that I never even paid attention to the status bar below. I'm still hoping there's a solution somewhere for this that doesn't require a rather elaborate workaround like the one Eduan shared, but the status bar might suffice for the time being. – Alexandr Kurilin Jan 13 '13 at 06:48
  • See `:h termcap-cursor-shape`: changing the color of the cursor is easy and, AFAIK, quite portable across terminal emulators. It is not perfect though, as you can read. Changing the *shape* of the cursor, on the other hand, will depend on the capabilities of your terminal emulator. It can be done rather easily in iTerm2 on Mac OS X but you'll have to find if your emulator supports this. And the whole idea depends on the availabilty of `+cursorshape` in your Vim build in the first place, of course. – romainl Jan 13 '13 at 08:07
  • @AlexandrKurilin No problem. :) It's really not too difficult, you can check what I actually did in the statusline and you will notice I just `%{toupper(g:currentmode[mode()])}`, which is just converting to uppercase the variable I defined earlier. You can do that, or you can also implement my function for changing colors, to work for your tastes. :) – greduan Jan 13 '13 at 14:45
  • @romainl I have to check that out now, still trying to make the cursor perfect in a Terminal. :) – greduan Jan 13 '13 at 14:46
  • @romainl, asserting that this is a "non-problem" is a bit much. You might not find this to be a problem, but when I'm editing a single line git commit message, and my status bar is 70 lines away at the bottom of the screen, *I* find it to be a problem. – Roger Lipscombe Oct 31 '13 at 14:06
  • @RogerLipscombe, the OP had a "non-problem" because he needed a mode indicator and such a mode indicator was already buit-in. Whether it is enough or not is an entirely different topic and my "non-problem" didn't apply to that topic at all. That said, my mode indicator is colored with an horrible green and is visible enough for my peripheral vision but YMMV. – romainl Oct 31 '13 at 14:34

0 Answers0