I was half-baked, if anyone unfortunate to see this article recommendations point X
Introduction: God vim, ancient artifact, the editor of.
I know common ide and basically have vim editor mode (of course, not parse vimscript, only vim-style keypad. So it is with vim, after all, more plug-ins Sao operation).
A key mode, traveled world are not afraid, I do not remember my mother no longer have to worry about the shortcuts, not to learn is not human.
commonly used vim and vimscript basis
vim configuration file $ HOME / .vimrc, to change the path vim vimscript loaded by adding a path to rpt variable.
Common objects have buffer, window, tab. Editing a file operation between the buffer, not written to by an instruction after storage (w)
corresponding to the file.
There are four modes when vim work
- insert mode: In this mode, a character input can be entered press i.
- visual mode: In the character mode can be selected, according to v, V enters.
- normal mode: In this mode a variety of text operations, such as moving, deleting, into the ESC.
- command mode: the normal mode: enter, enter the command mode command syntax consistent with vimscript
vim command
the normal mode [range] com, range table range, typically line number, separated by commas:
operated to move hjkl, x, d delete operation, or the like R & lt replace operationYou can change some option vim by the set:
As set number- display line numbers, set nonumber- not display line numbers
set number -? Value of the number of display settings.Performed by mapping a key map.
map divided into three kinds respectively corresponding to the three modes, imap, vmap.nmap.
before adding nore map may be closed recursive evaluation, inoremap.vnoremap.nnoremap
Example: inoremap jk, The insert mode esc to mapping values jk vimscript
- C Represents various control flow statements .if-endif, while-endwhile, for - endfor
- Function, function-endfunction
- let bind variables represent variables scope, such as s, a, g, b, l by prefixing.
let L: filename = xxx.txtFirst so be it, too many things, or see the information directly to the reality learn vimscript the hard way
Original: Big Box vim and vimscript