Vim Common settings

Source: Internet
Author: User
Tags define function

Set Description
Set IM "Sets the mode to enter at startup
Set Magic The Set Magic
ColorScheme Slate The Set theme
Set Shortmess=ati "When it starts, it doesn't show the tip of that aid to Ugandan children.
Set Nu The Display line number
Set Guifont=youyuan:h18 "Set the font and size
Set Cursorline "Highlight when moving forward
Syntax on The syntax highlighting
Autocmd Insertleave * SE nocul "Highlight with light as you move forward
Autocmd insertenter * SE cul "Highlight with light as you move forward
Set ruler The show ruler
Set Autochdir "Automatically switches the current directory to the directory where the current file is located
Set ShowCmd "The input command is displayed, so I can see it clearly.
Set Cmdheight=1 The height of the command line (under the status line), set to 1
Set foldenable The Allow folding
Set Foldmethod=manual The manual folding
Set Fileencodings=utf-8,gb18030,utf-16,big5 Format of open File
FileType plugin indent on "Turn on plugins
Set IgnoreCase smartcase "Ignores case when searching, but remains case sensitive when one or more uppercase letters are available
Set Nowrapscan "Prevents re-searching when searching to both ends of a file
Set Incsearch "Search results are displayed when you enter search content
Set Hlsearch "Highlight the text that was found when searching
Set Completeopt=preview,menu The Code completion
Set Autowrite The Auto Save
Set Autoindent The Auto Indent
Set Smartindent "Use Smart Auto indent when new rows are turned on
Set Showmatch "Highlight matching parentheses
Set scrolloff=3 "Keep 3 lines away when the cursor moves to the top and bottom of the buffer
FileType indent on "Loading related indentation files for a specific file type
Set viminfo+=! "Save Global variables
Set Nobackup "Prohibit generation of temporary files
Vmap <C-c> "+y" in the selected state Ctrl + C copy

"My status line displays the contents (including file type and decoding)

Set statusline=%f%m%r%h%w\ [format=%{&ff}]\ [type=%y]\ [pos=%l,%v][%p%%]\ %{strftime (\"%d/%m/%y\-\%h:%m\")}"Set Statusline=[%f]%y%r%m%*%=[line:%l/%l,Column:%c][%p%%]"Set statusline=%f%m%r%h%w\ [format=%{&ff}]\ [type=%y]\ [pos=%l,%v][%p%%]\%{strftime (\"%d/%m/%y\-\%h:%m\")}   "What the status line displays

"----------------------------------------------------------
"Create a new. c,.h,.sh,.java file, insert the file header automatically

autocmdBufNewFile*.cpp,*.[ch],*.sh,*.javaexec":callSetTitle()

"" Define function Settitle, insert file header automatically

func Settitle ()     "If the file type is. sh file     if &filetype == ' sh '         Pager setline (1, "\#########################################################################")         Pager append ("."), "\# File Name: ". Expand ("% "))         Pager Append (Line (".") +1, "\# Author: ma6174 ")         Pager Append (Line (".") +2, "\# Mail: [email protected] ")         Pager Append (Line (".") +3, "\# Created Time : ". Strftime ("%c "))         Pager Append (Line (".") +4, "\#########################################################################")         Pager Append (Line (".") +5, "\#!/bin/bash")         Pager Append (Line (".") +6, "")     Else         Pager setline (1, "/*************************************************************************")         Pager append ("."), "    > File Name: ". Expand ("% "))         Pager Append (Line (".") +1, "    > Author: ma6174 ")         Pager Append (Line (".") +2, "    > Mail: [email protected] ")         Pager Append (Line (".") +3, "    > Created Time : ". Strftime ("%c "))         Pager Append (Line (".") +4, " ************************************************************************/")         Pager Append (Line (".") +5, "")    endif    if &filetype == ' CPP '        Pager Append (Line (".") +6, "#include <iostream>")        Pager Append (Line (".") +7, the Using namespace std; ")        Pager Append (Line (".") +8, "")    endif    if &filetype == ' C '        Pager Append (Line (".") +6, "#include <stdio.h>")        Pager Append (Line (".") +7, "")    endif    "Automatically navigates to the end of a file after you create a new file    Autocmd Bufnewfile * Normal GEndfunc 

Vim Common settings

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.