"Notes" Changes the cursor shape of vim or terminal terminal. It looks a lot more refreshed after the cursor becomes thinner!

Source: Internet
Author: User

Users who have just turned to Linux from Windows may have a bad place, that is, the cursor in the terminal and Vim is the width of a character, very coarse, at the time of input it is easy to find the current input characters will appear in the middle of the two characters.

So, in order to have a good eye and a refreshing mind, I looked at how to change the shape of the cursor in the terminal. Here's a summary.

Because my intention was to make Vim's cursor change, so the way to use it is to write some code in the. VIMRC

Method (i)

Add the following code to the current user's./vimrc file. The effect is that all the cursors in the terminal are thinner, which means that both vim Normal mode and insert mode are thin cursors

  " makes the terminal cursor a thin line instead of the default thick bar. This normal mode and insert mode in VIM will take effect. Set Gcr=n-v-c:ver25-cursor/lcursor,ve:ver35-cursor,o:hor50-cursor,i-ci:ver25-cursor/lcursor

Method (ii)

Add the following code to the current user's./vimrc file. The effect is that the cursor becomes thinner in VIM's insert mode.

  

ifHas ("Autocmd") au insertenter* Silent Execute"!gconftool-2--type string--set/apps/gnome-terminal/profiles/default/cursor_shape ibeam"au insertleave* Silent Execute"!gconftool-2--type string--set/apps/gnome-terminal/profiles/default/cursor_shape block"au vimleave* Silent Execute"!gconftool-2--type string--set/apps/gnome-terminal/profiles/default/cursor_shape ibeam"endif

Resources:

Http://blog.sina.com.cn/s/blog_ac9fdc0b0101ol0b.html

http://blog.csdn.net/xiaohui5319/article/details/7507042

Thank the original author very much!

"Notes" Changes the cursor shape of vim or terminal terminal. It looks a lot more refreshed after the cursor becomes thinner!

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.