A byte of vim--Learning summary

Source: Internet
Author: User
Tags autoload imap

Say in front--a byte of Vim is the best book I've ever seen about vim, someone who wants to learn about the powerful vim, or someone who is already using VIM and intends to learn more about it, I think I should look at this, the content is refined but covers a wide range ... "Why is vim so powerful?" When I finish reading this book, I think you can fully understand ... In addition, the book is an English version, but very simple, learn the language while learning English very little ...

Attach the latest version of the download link http://download.csdn.net/detail/wuzhimang/8933257, of course, the last officer net is the hard truth


Here is your own learning summary for a byte of vim, the content of the original text, convenient for later use and recall-because the good book (even the reference books) read one or two times is not enough


# # A Byte of Vim

1.Perface
"There is no great writing, only great rewriting."--Louis Brandeis
"Vim if one of the few pieces of software that I use for nearly ten hours a day."--Authors
The mantra is *concepts. Examples. pithy*
Perfection was achieved, not when there was nothing more than add, but when there was nothing left to take away.

2.Introduction
Powerful means following the paradigm of "Minimal effort. Maximal effect. "

Press * RUN:SP run:50 Run:, 100s/old/new/g Press GF
Run:colorscheme Desert Run:nmap <c-s>:w<cr>
Run:mksession ~/latest_session.vim, Vim-s ~/latest_session.vim
Run:syntax on: Set Filetype=wikipedia
Run:set foldmethod=indent Run:tabedit <file>
Press Ctrl-n RUN:0,10S/FORM/TO/GC Run:%s/from/to/g
Run:help vim-modes-intro run:edit hello.txt run:e hello.txt
Run:help notation Run:help keycodes
Press DB Press DW Press 2D3W

3.Modes
There is three basic modes in Vim-normal, insert and visual

Run:echo "Hello World" run:help usr_toc
Run:help Index
Run:help Vim-modes-intro run:help mode-switching
A,a i,i o,o r,r s,s v,v

4.Typing Skills
Vi/vim Graphical Cheat Sheet

Press} {() ~press 3fh~
Press Ctrl-o Press Ctrl-i
Press ^ $ ctrl-f crtl-b
Press G H M L press:help word-motions
Press:help cursor-motions
Press:help text-objects press:help motion/various Motions

5.Help
Run:help Run:help usr-manual
Run:help abbreviate Press CTRL]
Run:helpgrep GT Run:cnext Run:cprev run:clist
Press Ma-Press ' a press ~
Run:let &keywordprg= ': Help '

"The true delight is in the finding out rather than in the knowing"

6.Editing Basics
Run:swapname Run:help Swap-file

Nmap <c-s>:w<cr>
IMAP <c-s> &LT;ESC&GT;:W&LT;CR&GT;A
Run:e. /tmp/test.txt CD pwd
Run:e C:\\shopping\\monday.txt
Y-Yank
1G and | -Moves to the first line and the first column respectively
Run:d L DW
YY-operation name twice, it'll operate on the
Yap-Yank the current paragraph
Swap, XP-characters
DWWP-swap-words
M{a-za-z}, ' {a-za-z}

"If I had eight hours to chop down a tree, I ' d spent six hours sharpening my axe"--Abraham Lincoln

u/u <-> ctrl-r-undolevels:earlier 4m:later 45s
: Undolist run:help:undolist/undo-redo/usr_32.txt

Set Incsearch/ignorecase/smartcase--/step/step
Run:help Vimrc-intro:help Pattern
Run:/\<step\>/\d\+/\d\*

7.Multiplicity
: Set Foldmethod=indent--and Zc zo za
: Nnoremap <space> za--Noremap

Run:help BUFFER-LIST:BUFFERS:LS:BD 1
: E test.txt
: SP or ctrl-w s:vsp or ctrl-w V
Ctrl-w R--Rotate the Windows
Ctrl-w K--and move the current windows to the topmost position
Ctrl-w _--and make the cutternt windows as big as possible
Ctrl-w =--Make the Windows ' equal ' in height again
: Resize 10
: Help windows

: Tabnew:tabc:help TabPage
: Tab Help Tabpage:tabmove 0:tabdo
: Help Setting-guitablabel

8.Personal Information Management


9.Scripting
QA-to-start recording the macro named as a (register)
GUl-to-switch the first letter to upper case
g# # g* *
Q--Stop recording the macro
@a--Lines
. -Repeat the last action
: ColorScheme Desert--<tab> to cycle through the available schemes

: Echo strlen (Getline ('. '))

: Let Len = strlen (Getline ('. '))
: echo "We have ' len ' characters" on this line. "

: Echo $HOME: Echo &filetype:echo @a
: Help Function-list

: Source Capitalize.vim:call Capitalize ()
: Echo has ("Python")

: Help Eval:help Python-commands:help perl-using
: Help Ruby-commands


10.Plugins
There is various kinds of plugins that can be written
--VIMRC----plugin, filetype plugin
--Syntax highlighting plugin---Compiler plugin

VIMRC---General customizations
GVIMRC---GUI specific customizations
: Help VIMRC

The colon is optional if writing scripts in files

Vim-u NONE, start up Vim without any initialization scripts being run
: hlep-u: Help starting


11.Programmers Editor
"Let's me reiterate that typing skills was critical for a programmer"
"We are typists first, programmers second"

: Set Filetype=vim $VIMRUNTIME/syntax--the list of language types available
SVN diff | Vim-r-
: Set Autoindent:set smartindent
%-Bounce (Curly bracket)
! Shell Commands:sh-A full-fledged shell:%!sort

GF-I open the file GD-move to the local definition of the variable name
GD--the global declaration]]
: Help Object-motions [I--Display all lines that contain they keyword under the cursor

: Vex-so: Sex

Ctags Cscope:make
Omnicompletion, Pythoncomplete.vim, Ftplugin/<language>complete.vim
: runtime! Autoload/pythoncomplete.vim
~/.VIMRC-autocmd Filttype python runtime! Autoload/pythoncomplete.vim
Ctrl-n ctrl-p
: Help New-omni-completion
IMAP <c-space> <c-x><c-o> omnicompletion
Snippet-Snippetsemu
: Source%: runtime! Ftplugin/python_snippets.vim


12.More
Modeline-Vim:noexpandtab
Portable Vim-GVimPortable.exe
Upgrade plugins: Glvs (which stands for ' G ' et ' L ' atest ' V ' im ' S ' cripts)
--: Help Getscript
Dr.chip ' s plugins-drawit.vim
Blog from Vim-vimpress plugin
Make Firefox work like Vim-Vimperator add-on
Contribute to Vim, help development
Bram's talk on the Seven habits, "seven habit of effective text editing"
Community-Hang off at the [email protected]


13.What Next
The other important resources, "Best of Vim Tips": Help User-manual, the all-important
: Help New-7



Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.

A byte of vim--Learning summary

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.