Vim Script and configuration

Source: Internet
Author: User
Tags uppercase letter

============set optional===========
Set nu//Display line number
Set Rnu//Display relative line number cursor behavior 0 up and down rows increment relativenumber
Set numberwidth//setting line number width
Set wrap//over window width wrap
Set TextWidth//Sets text width per line
Let mapleader= ","//Map Prefix
Let maplocalleader= ","//The specified file type is valid
Set showtabline = 1//tab Help Tab-page



======================autocmd======================
Autocmd Event pattern cmd//event for monitored events pattern command multiple events for event-filtered mode cmd are separated by commas
Event:bufnewfile,bufread,bufwritepre
Evnet:filetype xxx//help autocmd-events
The Autocmd command replicates, each time the configuration file is refreshed, a copy of the command is performed, and the action is executed multiple times after the event occurs. Workaround: autocmd!
==================autocmd Group ========================
Augroup Testgroup
autocmd! Clear the group before the same name to eliminate replication, without this will before the same name group combination
Autocmd xxxx
Autocmd xxxx
Augroup END

===============command==================
echo//Bottom line echoing
Echom//Bottom row echo and cache available message view
Message//View cache output
Map,nmap,imap,vmap,omap//Set Shortcut key unmap,nnumap...//Cancel shortcut noremap,nnoremap...//non-recursive shortcut <buffer> local mapping <nop&gt ; no operation Key omap==operator-pending mapping
Iabbrev [<buffer>] ADN and//insert mode abbreviation INSERT mode input ADN then tap space back automatically replace and [] content is selected
Set, setlocal//SET option value
Execute "string"//String when command execution
Normal XXXX//hitting XXXX in normal mode
normal! XXXX//Ignore XXXX mapping function similar to normal XXXX and cannot parse <cr> enter (execute "normal! Gg/foo\<cr>dd "To resolve this issue)



==================================variable=====================================
Let &number//optional variable
Let &l:number//local Optional
Let @a = "Hello"//register variable @ "Copy stored register variable @/search/xxx
string-to-shape: correctly converts the beginning consecutive digits to the beginning of a number, otherwise 0
Help Internal-variables
==================================condition====================================
If condition XXX endif
If condition xxx elseif xxx else xxx endif
The set ignorecase control is case sensitive and is used as a comparison
==? Case insensitive comparison ignores set ignorecase
==#//Case sensitive comparison ignores set ignorecase help EXPR4
===================================function====================================
1 function definitions
function Meow ()//functions must start with an uppercase letter
echo "Hello World"
Endfunction//Default return 0
function Getmeow ()
Return "Hello World"
Endfunction
Call Meow () echo Getmeow ()//function calls
Call Getmeow ()//does not display the content, called calls is to see the function as an expression
2 function parameters
function DisplayName (name)
Ehco "Hi, my name is"
echo A:name//How to use A:argname
Endfunction
3 variable Parameter---read-only variable
function Args (foo,...)
echo A:foo//foo first parameter optional
echo a:0//number of variable parameters
echo a:1//variable parameter the first parameter a:n and so on
echo a:000//variable argument list, Echom when ECHO is set to variable argument list
Endfunction
==========================string====================
Echo ' That ' s enough '//this ' s enough ' special case
Ehco '//'///' does not parse the literal meaning string of special characters
echo "//"///"" To resolve special characters
Ps:. + Connection string


==========================================function api========================================
Substitute//s/xx/xx/g Replace command


==========================help==========================
Help scrolling//movement of text







====================================fold marker==================================
Zm{motion} Create collapsed
ZC off Folding
Zo Open fold



==================================== Common Configuration =================================
"Complement background color
Highlight Pmenu Guibg=black Guifg=black
Highlight Pmenusel Guibg=black Guifg=black
"Complement background color terminal
Highlight Pmenu Ctermbg=darkgrey Ctermfg=black
Highlight Pmenusel Ctermbg=lightgrey Ctermfg=black

Vim Script and configuration

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.