How to change cursor shape in VIM when entering insert mode using MACOSX Terminal.app?

I want to change the shape of the cursor from underline to vertical when I enter insert mode in VIM running in Terminal.app. (NOTE: I know this is the default behavior in macvim.)

This link: http://vim.wikia.com/wiki/Change_cursor_shape_in_different_modes contains instructions on how to do this. For example, the following works with iterm2:

let &t_SI = "\<Esc>]50;CursorShape=1\x7" let &t_EI = "\<Esc>]50;CursorShape=0\x7" 

Unfortunately, this does not work with Terminal.app (under Lion).

Are there any tricks for this with Terminal.app - or is it just not supported?

+4
source share
2 answers

I am absolutely sure that I saw the Applescript solution in the past, but Google didn’t bring anything in 5 minutes. It was a bit barbaric, but it seemed to work ... IIRC changed the cursor shape preference on the fly and was called with autocmd .

Keep looking, somewhere.

Is there a reason you don't want to use iTerm?

0
source

I ran into a similar problem myself and found that this answer helped:

https://superuser.com/questions/712098/customize-vim-cursor-style-under-mac-os-x-terminal

When I started running vim inside tmux (still using the terminal), the cursor change commands started to work!

Tmux is a really cool terminal manager that allows you to have several terminal windows, tabs, split screens, you name it, and also save your sessions. Here is a good lesson that I used to set it up and be useful:

http://fideloper.com/mac-vim-tmux

0
source

All Articles