Since mac os x's terminal.app
does not support many of the vim visual aspects, including the cursor change from block to line when switching to insert mode, I use osascript
to accopmlisch something similar.
In my .vimrc
file I've written:
autocmd InsertEnter * silent !osascript -e 'tell application "Terminal" to set current settings of first window to settings set 11`j
autocmd InsertLeave * silent !osascript -e 'tell application "Terminal" to set current settings of first window to settings set 12`j
where settings set 11
is a set of terminal setting that has a line cursor and settings set 12
is one that has a block cursor.
This actually works quite well but there is one small problem.. On InsertLeave the cursor always gets moved one character to the left, which isn't such a big deal but it can be anoying.
I tried to compensate by putting autocmd InsertLeave h
into my .vimrc
, but to no avail (it gives me an error).
How should I tell vim to:
- not shift to the left?
- if the above isn't possible, to compensate by shifting to the right