I've noticed when I use the Terminal that the cursor is not as I configured it.
In other words, in the GUI it looks perfect, the cursor that is, but in the Terminal it takes time to update, it doesn't look like I configured it etc.
Here are my settings for the cursor:
set guicursor=n-v-c:block-Cursor-blinkon0
set guicursor+=ve:ver35-Cursor
set guicursor+=o:hor50-Cursor-blinkwait175-blinkoff150-blinkon175
set guicursor+=i-ci:ver20-Cursor
set guicursor+=r-cr:hor20-Cursor
set guicursor+=sm:block-Cursor-blinkwait175-blinkoff150-blinkon175
I do notice it's called the guicursor
setting, however in Terminal some of these do take effect, they just don't take a full effect.
Also, it seems the cursor doesn't get updated a lot. For example if I enter insert mode the correct cursor is put, but if I get out, the same cursor is used until I move or something then it updated to the normal mode cursor.
Do you have any tips on this? Or do I just have to bear with it?
EDIT:
My OS is a Mac Mini with Mountain Lion installed. I am using iTerm2 with xterm-color256
as the Terminal.
Re-wording the question: How can I make the cursor redrawing faster in a Terminal and how can I make it take the settings I put above? I already tried ttyfast
and lazyredraw
.
Press the Insert key on your keyboard to switch back to insert mode.
Simply putting :set cursorline in your vimrc will highlight the current line in every window and update the highlight as the cursor moves. With the default backslash leader key, typing \c will toggle highlighting on and off. That makes it easy to locate the cursor after scrolling in a large file.
Your settings are for GUI Vim. You can't expect them to work in CLI Vim. If you don't like how CLI Vim works, just use MacVim.
I've got a slightly different version of this function executed in my ~/.vimrc
:
" changes the cursor shape/color
" in the terminal depending on the mode
" see http://code.google.com/p/iterm2/issues/detail?id=710&q=cursor
function! SetCursorStyle()
if &term =~ "xterm\\|rxvt"
" use a | cursor in insert mode
let &t_SI = "\<Esc>]50;CursorShape=1\x7"
" use a rectangle cursor otherwise
let &t_EI = "\<Esc>]50;CursorShape=0\x7"
" reset cursor when vim exits
autocmd VimLeave * silent !echo -ne "\<Esc>]50;CursorShape=0\x7"
endif
endfunction
I use Cygwin, and I use the above setting but Cygwin's xterm may can't recognize the "\]50;CursorShape=1\x7"
So I try this one, and it work
if &term =~ "xterm\\|rxvt"
" use a | cursor in insert mode
let &t_SI = "\<Esc>[5 q"
" use a rectangle cursor otherwise
let &t_EI = "\<Esc>[1 q"
endif
then, I add this to .bashrc to change the term cursor to block, and it perfect to me.
# change cursor to blinking block
echo -ne "\x1b[1 q"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With