Vim configuration file (my favorite style)

Source: Internet
Author: User

Vim configuration file (my favorite style)

In the/etc/vimrc File

If v: lang = ~ "Utf8 $" | v: lang = ~ UTF-8 $"

Set fileencodings = UTF-8, latin1

Endif

 

Set nu

Set tabstop = 4

Set nocompatible "Use Vim defaults (much better !)

Set bs = indent, eol, start "allow backspacing over everything in insert mode

"Set ai" always set autoindenting on

"Set backup" keep a backup file

Set viminfo = '20, \ "50" read/write a. viminfo file, don't store more

"Than 50 lines of registers

Set history = 50 "keep 50 lines of command line history

Set rsor "show the cursor position all the time

 

"Only do this part when compiled with support for autocommands

If has ("autocmd ")

Augroup redhat

"In text files, always limit the width of text to 78 characters

Autocmd BufRead *. txt set tw = 78

"When editing a file, always jump to the last cursor position

Autocmd BufReadPost *

\ If line ("'\" ")> 0 & line ("' \ "") <= line ("$") |

\ Exe "normal! G' \ "" |

\ Endif

Augroup END

Endif

 

If has ("CSAs") & filereadable ("/usr/bin/csable ")

Set csprg =/usr/bin/cs.pdf

Set csto = 0

Set cst

Set nocsverb

"Add any database in current directory

If filereadable ("cscope. out ")

Cs add cscope. out

"Else add database pointed to by environment

Elseif $ CSCOPE_DB! = ""

Cs add $ CSCOPE_DB

Endif

Set csverb

Endif

 

"Switch syntax highlighting on, when the terminal has colors

"Also switch on highlighting the last used search pattern.

If & t_Co> 2 | has ("gui_running ")

Syntax on

Set hlsearch

Endif

 

If & term = "xterm"

Set t_Co = 8

Set t_Sb = [4% dm

Set t_Sf = [3% dm

Endif

Highlight Comment ctermfg = green guifg = green

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.