Vim configuration in wnidows

Source: Internet
Author: User

Set nocompatible
Set nu
Set IC
Set Ts = 4
Set shiftwidth = 4
Set fileencodings = UTF-8, Chinese, Latin-1, uc-bom, gb18030, big5, EUC-JP, sjis, EUC-KR, EUC
If has ("Win32 ")
"For Chinese
Set fileencoding = Chinese
"For Japan-EUC
"Set fenc = EUC-JP
"For japan ese shift-JIS
"Set fenc = sjis
Else
Set fileencoding = UTF-8
Endif

"Set ENC = UTF-8" default for UTF-8

"Set for Chinese gb2312
"Set ENC = cp936
"Set fenc = cp936

"Just for show Japan
"Set ENC = cp932" for jp_euc
"Set fenc = EUC-JP" for jp_euc

Set ENC = sjis "for shift-JIS
Set fenc = sjis "for shift-JIS

Set cindent
Language message zh_CN.utf-8
"For JP Language
"Language message JP. UTF-8

"Language message
"Fixed the garbled menu
Source $ vimruntime/delmenu. Vim
Source $ vimruntime/menu. Vim
"Set Font
Set guifont = nsimsun

Set nobackup

Set nobackup
Colorscheme Koehler
Source $ vimruntime/vimrc_example.vim
Source $ vimruntime/mswin. Vim
Behave mswin

Set diffexpr = mydiff ()
Function mydiff ()
Let opt = '-A -- binary'
If & diffopt = ~ 'Icase' | let opt = opt. '-I' | endif
If & diffopt = ~ 'Iwhite' | let opt = opt. '-B' | endif
Let arg1 = V: fname_in
If arg1 = ~ ''| Let arg1 = '"'. arg1. '"' | endif
Let arg2 = V: fname_new
If arg2 = ~ ''| Let arg2 = '"'. arg2. '"' | endif
Let arg3 = V: fname_out
If arg3 = ~ ''| Let arg3 = '"'. arg3. '"' | endif
Let eq =''
If $ vimruntime = ~ ''
If & SH = ~ '\ <Cmd'
Let cmd = '""'. $ vimruntime. '\ diff "'
Let eq = '"'
Else
Let cmd = substitute ($ vimruntime, '', '"', ''). '\ diff "'
Endif
Else
Let cmd = $ vimruntime. '\ diff'
Endif
Silent execute '! '. Cmd. ''. Opt. arg1.''. arg2.'> '. arg3. EQ
Endfunction

"Color default
: Colorscheme darkblue
"Language English
: Lang Eng

Let fcomm = "fenc"
Let optval = eval ('&'. fcomm)
If optval = "cp936"
Set guifont = nsimsun
"Echo" cp936"
Elseif optval = "cp932"
Set guifont = msmincho
Elseif optval = "sjis"
Set guifont = msmincho
Endif

------------ About the font settings in VIM ---------------------

In addition, there are some useful plug-ins, see
Http://learn.tsinghua.edu.cn: 8080/2005212716/html/vimplugins.html

Vim in the console cannot change the font because the font changes with the terminal font, but in gvim, you have the right to change the font to what you want.

In Linux, the command to set the font is:

: Set guifont = courier \ 14

In Windows, it is:

: Set guifont = courier: H14

Of course, if you need to set multiple fonts, you can add commas (,) between each font to set multiple fonts, such:

: Set guifont = courier \ new \ 12, Arial \ 10

 

If the font name contains spaces, we need to use \ for escape, while in windows, we can convert spaces to: characters. Of course, this setting will only work for the current session. If you want to use it every time, you need to add it to its gvimrc setting file (remove the preceding command ).

If you do not know the available font names, use the following command to get a list of font names:

 

: Set guifont = *

 

To use a specific font for a specific file type, you can add the following statement to the vimrc file:

 

Autocmd bufenter *. txt set guifont = Arial \ 12

In this case, the Arial 12 font will be set when the .txt file is opened the next time.

 

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.