2. 2
Vim
Vim
Vim
Vim
Vim
Vim
Vim
1
Vim
notepad, word, edit
Vim
BUG
Vim( vi)
Vim
Vim
1
Emacs
2
3. 3
Vim notepad, edit
UNIX
:help xxx
Mission Impossible
Vim
1
i18n internationalization
Vim the teh Vim
script
Vim
Vim
Vim SHELL
Vim
Vim
Vim Vim
LTEX
A
LTEX
A
email
<slimzhao@hotmail.com>
1
" " " "
3
4. 4
The Vim user manual and reference manual are
Copyright (c) 1988-2002 by Bram Moolenaar. This
material may be distributed only subject to
the terms and conditions set forth in the Open
Publication License, v1.0 or later. The latest
version is presently available at:
http://www.opencontent.org/openpub/
People who contribute to the manuals must agree
with the above copyright notice.
Vim
<slimzhao@hotmail.com>
2004/06/08
4
7. 7 6.3.0
6.3.0
1. 6.3.0
VIM 6.3, 6.1
2. 6.3.0 0.2
(A) 0.1 0.2 usr 21.txt, usr 22.txt, usr 29.txt,
usr 45.txt 4 4
(B) shell
ex command
:au BufRead *.tip setf tip
7 Vim
ex command 6
normal mode command
Vim normal
normal mode command
gg=G
shell command
unix shell windows
OS DOS BOX
shell command
env LANG=de_DE.ISO_8859-1 vim
Display
7
8. 8 6.3.0
Display
:!make | &tee /tmp/vim215953.err
gcc -g -Wall -o prog main.c sub.c
main.c: In function 'main':
main.c:6: too many arguments to function 'do_sub'
main.c: At top level:
main.c:10: parse error before '}'
make: *** [prog] Error 1
2 returned
"main.c" 11L, 111C
(3 of 6): too many arguments to function 'do_sub'
Hit ENTER or type command to continue
List
List
r Insert
o Normal "o" "O"
c 'textwidth'
code
code
while i < b {
if a {
b = c;
}
}
url
URL
http://www.cl.cam.ac.uk/~mgk25/download/ucs-fonts.tar.gz
(C) cmtt computer modern
typewriter cmr(computer modern roman)
Latex L TEX
A
cmr cmtt LTEX
A A
1
1
<unicell@gmail.com> " "
" " " ; "
8
9. 9 6.3.0
(D)
URL email
mail
(E) ‘‘...’’(LTEX
A ),
... "..." ’
'
/hello hi
hi
(F) CTRL-N,
<Esc>
(G) BUG
1
/
...
(H) PDF HTML HTML bgcolor
PDF
PDF Tex
2
PL (Public License
Piao Liang) windows
3. TODO:
upquote LTEX package
A ’ '
fancyvrb
" " " "
.
1
" " " " .
2
PDF
9
12. 12 7.1
7.1
7.1 7.0
bugfix bugfix
shell command
cd $VIM/vim71/doc
for i in usr*; do diff ../../vim70/doc/$i $i; done > tmp.txt
wc tmp.txt
366
Display
1c1
< *usr_01.txt* For Vim version 7.1. Last change: 2006 Oct 08
---
> *usr_01.txt* For Vim version 7.0. Last change: 2006 Apr 24
132
(A) |02.8| ( )
(B) |10.2| ":substitute" p
p
(C) |12.1| "fourty"
"fourteen" fourty
(D) |24.3| Omni
(E) |41.10| Comments Unix Vim
Vim shell
12
13. 13 7.1
1. 1.5
2. LTEX
A
LTEX
A LTEX
A
3.
Mail
" ... " " ... "
11,300,000
23,600,000
google :-)
" " " " 1986 " "
" " " ... " "
... "
<step by step@263.net> Mail
13
16. 16 LTEX
A
LTEX
A
0. LTEX
A
<slimzhao@hotmail.com>
LTEX
A *
1*. fancyvrb Verbatim
a
b
a
7.1
b
7.1
2*. fancyvrb Verbatim
Verbatim xleftmargin xrightmargin
16
17. 17 LTEX
A
3*. CJK
" "
"s:count" "other.vim"
1
COPY
sloppy LTEX
A /
"s:count"
"other.vim"
4*. :
EMAIL slimzhao@21cn.com " a"
CopyRight c
LTEX
A marvosym MVAt
@
MAIL :
L TEX
A
newcommand{VimMailURL}[1]
{textcolor{VimURLColor}{href{mailto:#1}{#1}
}
email VimMailURL
#1 @ MVAt.
1
Vim
C/C++/Java
"[a-zA-Z ][a-zA-Z0-9 ]*"
17
18. 18 LTEX
A
L TEX
A
newcommand{VimMailURL}[2]{
texttt{<}textcolor{VimURLColor}{href{mailto:#1@#2}
{#1{footnotesizeMVAt}#2}}texttt{>}}
Vim VimMailURL{xxx}{yyy.zzz}
5.
LTEX
A
6.3
18
19. 19 LaTeX
LTEX
A
LTEX
A
<rice maxwell@163.com> <chunmin.yang@gmail.com>
LTEX
A TEX/LTEX
A
PDF LTEX
A
LTEX
A PDF
TEX LTEX
A
LTEX
A .zip
CTeX
19
20. 20
0. <002424@fudan.edu.cn>
PDF
Acrobat
Reader Acrobat 7 -> (
CTRL-K)
check box
RGB
(255,255,242).
1. <laneast@hotmail.com> HTML Txt
HTML LTEX
A
docbook
2. <chunmin.yang@gmail.com>
Vim
3. <chenbo.liu@gmail.com> PDF
j k Acrobat Reader
4. (<taker2001@gmail.com>,
<chunlinyao@gmail.com>, <chunmin.yang@gmail.com> )
Vim
Vim
90% 90%
bash
:
20
21. 21
shell command
for i in usr*; do diff ../../vim70c/doc/$i $i; done > tmp.txt
gvim tmp.txt &
7.0
5.
MAIL :
<002424@fudan.edu.cn>
<ankyhe@gmail.com>
<baikaishiuc@hotmail.com>
<chenbo.liu@gmail.com>
<chunlinyao@gmail.com>
<chunmin.yang@gmail.com>
<huanlf@gmail.com>
<KDV367@motorola.com>
<laneast@hotmail.com>
<livahu@gmail.com>
<lsl635@sina.com>
<maintainer@vim.org>
<rice maxwell@163.com>
<ringken@gmail.com>
<step by step@263.net>
<taker2001@gmail.com>
<unicell@gmail.com>
<xyzguy@126.com>
<yangxcmail-linux@yahoo.com.cn>
<zhasm64@gmail.com>
sort -f| uniq -i mail
6.
MAIL
21
33. 33 00
Vim
Vimming
|usr 90.txt| Vim
|90.1| Unix
|90.2| MS-Windows
|90.3|
|90.4|
|90.5| Vim
|manual-copyright| vim:tw=78:ts=8:ft=help:norl:
33
34. 34 01
*usr 01.txt* Vim 7.0 . 2008 05 07
VIM --- Bram Moolenaar
Vim Vim
|01.1|
|01.2|
|01.3| Vim
|01.4|
|usr 02.txt|
|usr toc.txt|
*01.1*
Vim
1.
2. Vim
|notation|
1
:
1
Vim HTML <a
href=#somewhere>click here</a> click here "click here"
Vim
CTRL-]
CTRL-]
34
35. 35 01
List
CTRL-]
CTRL-O
|bars|
'number', ":write"
CTRL-] CTRL-]
":help" |help.txt|.
*01.2*
Vim
( GUI )
|usr 90.txt|
*not-compatible*
Vi Vim
Vi
vimrc
VIM
Unix:
ex command
:!cp -i $VIMRUNTIME/vimrc_example.vim ~/.vimrc
MS-DOS, MS-Windows, OS/2:
ex command
:!copy $VIMRUNTIME/vimrc_example.vim $VIM/_vimrc
Amiga:
ex command
:!copy $VIMRUNTIME/vimrc_example.vim $VIM/.vimrc
Vim, 'compatible'
35
36. 36 01
ex command
:set compatible?
'nocompatible' "compatible"
ex command
:scriptnames
'compatible'
|vimrc| |compatible-default|
: Vim
"evim"(easy vim) Vim
Notepad Insert
|evim-keys|
*01.3* Vim
( !) vimtutor Vim
30
Unix Vim
shell command
vimtutor
MS-Windows " /Vim"
$VIMRUNTIME vimtutor.bat.
36
37. 37 01
shell command
vimtutor fr
Unix , Vim,
"gvimtutor" "vimtutor -g" "vimtutor".
OpenVMS VIM
shell command
@ VIM:vimtutor
1. VIM ( ):
shell command
vim -u NONE -c 'e $VIMRUNTIME/tutor/tutor' -c 'w! TUTORCOPY' -c 'q'
"TUTORCOPY"
shell command
vim -u NONE -c 'e $VIMRUNTIME/tutor/tutor.fr' -c 'w! TUTORCOPY' -c 'q'
2. Vim
shell command
vim -u NONE -c "set nocp" TUTORCOPY
Vim happy
3.
shell command
del TUTORCOPY
*01.4* *manual-copyright*
37
38. 38 01
Vim c 1988-2003 by Bram
Moolenaar " "1.0
http://www.opencontent.org/opl.shtml
*frombook*
Steve Oualline Vi IMproved - Vim
( New Riders ISBN:0735710015). "
" (
Vim 6.0 )
|frombook|
Steve Oualline New Riders OPL
|iccf|
|usr 02.txt|
|manual-copyright| vim:tw=78:ts=8:ft=help:norl:
38
39. 39 02 Vim
*usr 02.txt* Vim 7.0 . 2007 02 28
VIM --- Bram Moolenaar
Vim
1
--- << >>
Vim
|02.1| Vim
|02.2|
|02.3|
|02.4|
|02.5|
|02.6|
|02.7|
|02.8|
|usr 03.txt|
|usr 01.txt|
|usr toc.txt|
*02.1* Vim
shell command
gvim file.txt
1
39
40. 40 02 Vim
Vim.
UNIX
Microsoft Windows, MS-DOS
Vim file.txt
Display
+---------------------------------------+
|# |
|~ |
|~ |
|~ |
|~ |
|"file.txt" [New file] |
+---------------------------------------+
("#" .)
(~) Vim
file.txt
VIM
gvim
shell command
vim file.txt
xterm
xterm Microsoft
Windows MS-DOS
gvim
*02.2*
Vim
Normal Insert Normal
40
41. 41 02 Vim
Insert
Vim Normal Insert "i"
(i Insert)
Display
iA very intelligent turtle
Found programming UNIX a hurdle
"turtle" <Esc> Insert
Normal Vim
Display
+---------------------------------------+
|A very intelligent turtle |
|Found programming UNIX a hurdle |
|~ |
|~ |
| |
+---------------------------------------+
ex command
:set showmode
( )
( ).
"i" Vim --INSERT--
Insert
41
42. 42 02 Vim
Display
+---------------------------------------+
|A very intelligent turtle |
|Found programming UNIX a hurdle |
|~ |
|~ |
|-- INSERT -- |
+---------------------------------------+
<Esc> Normal
1
"--INSERT--"
Vim ---
<Esc> Normal ( Normal
) <Esc> Vim
2
Normal
*02.3*
Normal
List
h
j
k
l
l
right
(
)
1
Normal --NORMAL--
2
google
42
43. 43 02 Vim
:
hjkl
h l
j
k
h l
j
"i" Insert hjkl
<Esc> Normal
|vimtutor|
Hiroshi Iwatani
Display
Komsomolsk
^
|
Huan Ho <--- ---> Los Angeles
(Yellow river) |
v
Java (the island, not the programming language)
*02.4*
"x". (
xxxx )
xxxxxxx(7 x) "A very "
43
44. 44 02 Vim
Display
+---------------------------------------+
|intelligent turtle |
|Found programming UNIX a hurdle |
|~ |
|~ |
| |
+---------------------------------------+
Display
iA young <Esc>
i( Insert ) "A young"
Insert ( <Esc>)
Display
+---------------------------------------+
|A young intelligent turtle |
|Found programming UNIX a hurdle |
|~ |
|~ |
| |
+---------------------------------------+
"dd"
Display
+---------------------------------------+
|Found programming UNIX a hurdle |
|~ |
|~ |
|~ |
| |
+---------------------------------------+
Vim
"J"
44
45. 45 02 Vim
Display
A young intelligent
turtle
"J":
Display
A young intelligent turtle
*02.5*
"u"
1
"dd"
"u"
A
Display
A young intelligent turtle
xxxxxxx "A young"
Display
intelligent turtle
"u" g
Display
g intelligent turtle
u
Display
ng intelligent turtle
u
1
...
45
46. 46 02 Vim
Display
ung intelligent turtle
oung intelligent turtle
young intelligent turtle
young intelligent turtle
A young intelligent turtle
: "u"
Vim Vi
|not-compatible|
Vim Vim Vi
CTRL-R( )
CTRL-R A
Display
young intelligent turtle
"U"
"U"
Display
A very intelligent turtle
xxxx very
A intelligent turtle
xxxxxx turtle
A intelligent
"U"
A very intelligent turtle
"u" "U"
A intelligent
"U" "u"
CTRL-R
46
47. 47 02 Vim
"u" CTRL-R |32.1|
*02.6*
Vim |Q in|
"i"
"a"
"i"
Display
and that's not saying much for the turtle.
Display
and that's not saying much for the turtle!!!
"x"
turtle e
normal mode command
a!!!<Esc>
e
Display
and that's not saying much for the turtle!!!
"o" Insert
Display
A very intelligent turtle
Found programming UNIX a hurdle
47
48. 48 02 Vim
"o"
normal mode command
oThat liked using Vim<Esc>
Display
A very intelligent turtle
That liked using Vim
Found programming UNIX a hurdle
"O" ( O)
9 "kkkkkkkkk" "9k"
"a!!!<Esc>"
"3a!<Esc>" 3 3
3 "3x"
*02.7*
Vim "ZZ" Vim.
: Vim
"ZZ", Vim
Vim |07.4|
Vim
ex command
:q!
48
49. 49 02 Vim
3
(:) q
1 2
(.!)
Vim
":q" Vim
Display
E37: No write since last change (use ! to override)
Vim, "
".
":e!"
*02.8*
Vim
ex command
:help
<F1>
<F1>
":help"
Vim ( )
hljk
"ZZ"
Vim.
(
|help|)
1
Vim
2
:! w!
49
50. 50 02 Vim
CTRL-]( )
( Vim
CTRL-] word
1
CTRL-T( )
CTRL-O( )
*help.txt* "*"
( ).
|29.1|
ex command
:help {subject}
"x"
ex command
:help x
ex command
:help deleting
Vim
ex command
:help index
( CTRL-A)
"CTRL-"
ex command
:help CTRL-A
1
HTML HTML
<a href="http://www.w3.org/2001/HTML">HTML</a>
Vim tag
Vim
50
51. 51 02 Vim
1
Vim Normal
Normal CTRL-H
ex command
:help CTRL-H
Insert "i " CTRL-H
ex command
:help i_CTRL-H
Vim -
-t
ex command
:help -t
Vim
'number'
ex command
:help 'number'
|help-context|
Insert
ex command
:help i_<Up>
Display
E37: No write since last change (use ! to override)
ID
1
Insert Normal
51
52. 52 02 Vim
ex command
:help E37
ex command
:help
( Vim ).
ex command
:help usr_toc.txt
1
ex command
:help :subject
"subject"
ex command
:help :help
ex command
:help abc
normal "abc"
ex command
:help CTRL-B
normal <C-B>
ex command
:help i_abc
:help i_CTRL-B
1
7.1 user-toc.txt
52
53. 53 02 Vim
ex command
:help v_abc
:help v_CTRL-B
Visual
ex command
:help c_abc
:help c_CTRL-B
ex command
:help ’subject’
'subject'
ex command
:help subject()
"subject"
ex command
:help -subject
1
"-subject"
ex command
:help +subject
"+subject"
ex command
:help EventName
"EventName"
1
" " shell vim Vim
53
54. 54 02 Vim
ex command
:help digraphs.txt
"digraphs.txt"
ex command
:help pattern<Tab>
"pattern" <Tab>
ex command
:help pattern<Ctrl-D>
"pattern"
ex command
:helpgrep pattern
"pattern"
ex command
:cn
ex command
:cprev
:cN
ex command
:cfirst
:clast
/
54
55. 55 02 Vim
ex command
:copen
:cclose
/ <Enter>
|usr 03.txt|
|manual-copyright| vim:tw=78:ts=8:ft=help:norl:
55
56. 56 03
*usr 03.txt* Vim 7.0 . 2006 06 21
VIM --- Bram Moolenaar
Vim
|Q lr|
|03.1| Word
|03.2|
|03.3|
|03.4|
|03.5|
|03.6|
|03.7|
|03.8|
|03.9|
|03.10|
|usr 04.txt|
|usr 02.txt|
|usr toc.txt|
*03.1* Word
"w" word Vim
"w" word
"3w" 3 words
56
57. 57 03
Display
This is a line with example text
--->-->->----------------->
w w w 3w
word "w"
word "b"1 word
Display
This is a line with example text
<----<--<-<---------<---
b b b 2b b
"e"2 word 3
. "w"
"b" "e" "ge"
4
word :
Display
This is a line with example text
<- <--- -----> ---->
ge ge e e
word "w"
word "w" "l"
"b"
non-word ".", "-" ")"
word Vim word 'iskeyword'
WORDs WORD
word WORD word
1
backward
2
:end of word
3
"w" word
"e" word
4
"e" word
word
57
58. 58 03
Display
ge b w e
<- <- ---> --->
This is-a line, with special/separated/words (and some more).
<----- <----- --------------------> ----->
gE B W E
*03.2*
"$" <End>
1
"^" . "0"
<Home>
Display
^
<------------
.....This is a line with example text
<----------------- --------------->
0 $
("....." )
"$"
"1$" "2$"
"0" "0"
"0"
2
"^"
*03.3*
1
2
"^"
58
59. 59 03
"fx"
x "f" "find"
human h
"fh"
Display
To err is human. To really foul up you need a computer.
---------->--------------->
fh fy
"fy" really
"3fl" "foul"
"l"
Display
To err is human. To really foul up you need a computer.
--------------------->
3fl
1
"F" :
Display
To err is human. To really foul up you need a computer.
<---------------------
Fh
"tx" "fx"
"t" "To" "Tx":
Display
To err is human. To really foul up you need a computer.
<------------ ------------->
Th tn
4 ";" ","
2
4
1
:
2
"Fx" ","
59
60. 60 03
1
*03.4*
() %2
"(" ")"
3
")" "(" :
Display
%
<----->
if (a == (b * c) / d)
<---------------->
%
[] {} (
4
'matchpairs' )
"%"
"%"
"(", ")":
code
if (a == (b * c) / d)
---+---------------->
%
*03.5*
C C++
1
"fx" x "f"
Vim
Windows
2
(<qzhen@flotu.org>)
3
4
<> HTML, XML
60
61. 61 03
Display
prog.c:33: j undeclared (first use in this function)
33 33
"9999k"1 "32j" 32
2
"G"
"33G" 33 (|usr 30.txt|
:make )
3
, "G"
"gg" "1G"
Display
| first line of a file ^
| text text text text |
| text text text text | gg
7G | text text text text |
| text text text text
| text text text text
V text text text text |
text text text text | G
text text text text |
last line of a file V
4
"%" .
5
"50%" . "90%"
6
1
9999 C/C++
Vim
2
G Go
3
Vim
4
: N
5
50%
6
Vim
:goto 3
61
62. 62 03
Display
+---------------------------+
H --> | text sample text |
| sample text |
| text sample text |
| sample text |
M --> | text sample text |
| sample text |
| text sample text |
| sample text |
L --> | text sample text |
+---------------------------+
"H" Home, "M" Middle, "L" Last.
*03.6*
1. CTRL-G (
'ruler' ):
Display
"usr_03.txt" line 233 of 650 --35%-- col 45-52
- "col 2-9"
8
9.
1
2. 'number'
ex command
:set number
1
62
63. 63 03
1 2
:
ex command
:set nonumber
'number' "no"
Vim
3. 'ruler' Vim
ex command
:set ruler
'ruler'
3
*03.7*
CTRL-U
CTRL-D
1
" " <xyzguy@126.com>
2
:no boolean
3
Vim set number
:set nonumber ruler
number |gq|
63
64. 64 03
Display
+----------------+
| some text |
| some text |
| some text |
+---------------+ | some text |
| some text | CTRL-U --> | |
| | | 123456 |
| 123456 | +----------------+
| 7890 |
| | +----------------+
| example | CTRL-D --> | 7890 |
+---------------+ | |
| example |
| example |
| example |
| example |
+----------------+
CTRL-E( ) CTRL-Y( )
CTRL-E Extra. ( MS-Windows
CTRL-Y ).
( ) CTRL-F
1 2
CTRL-B CTRL-F CTRL-B
"j"
"zz"
1
Forward
2
Backward
64
65. 65 03
Display
+------------------+ +------------------+
| some text | | some text |
| some text | | some text |
| some text | | some text |
| some text | zz --> | line with cursor |
| some text | | some text |
| some text | | some text |
| line with cursor | | some text |
+------------------+ +------------------+
1 2
"zt" "zb"
|Q sc|
'scrolloff'
*03.8*
"/string" "include"
normal mode command
/include
3
"/" Vim
: .*[]^%/?~$
"n"
#include:
1
"zt" t top z
zt Zhuan Tie( ) :-)
2
"b" bottom
3
Vim
65
66. 66 03
normal mode command
/#include
"n" #include
"n"
"3n" 3 "/"
1
2
"?" "/" :
normal mode command
?word
"N" "/" "?"
"/" "N" "?" "N"
'ignorecase'
ex command
:set ignorecase
"word" "Word" "WORD"
ex command
:set noignorecase
1
normal /
N N
/ /text
n N / N :
a 1 b
a 2 b
a 3 b
a 4 b
a 5 b
a 6 b
normal 1 2/d 3 2
n 4
2
Vim
66
67. 67 03
3
normal mode command
/one
/two
/three
"/"
Vim "/three" "three"
Vim "/two"
"/one"
"/o<Up>"1 Vim "/one"
":"
WORD
word "TheLongFunctionName"
"/TheLongFunctionName"
Vim
word
"*" Vim word
2
"#" "*"
:"3*" word
WORD
"/the" Vim "there"
"the"
1
<Up>
2
: word ?
Visual select, yank, :let @ /=@", n
67
68. 68 03
normal mode command
/the>
">"1 word "<"
2
word word "the"
normal mode command
/<the>
"there" "soothe". "*" "#"
word word(
"g*" "g#" word .)
"nr"
"nr"
"*" "n"
ex command
:set hlsearch
"nr", Vim
3
ex command
:set nohlsearch
4
:
ex command
:nohlsearch
1
<qujianning@gmail.com> >
2
word
0
3
|/%<3l|
4
'hlsearch'
68
69. 69 03
'hlsearch'
"n" "N"
ex command
:set incsearch
Vim
ex command
:set nowrapscan
'wrapscan'
1
Vim
Vim
|not-compatible|
ex command
:scriptnames
ex command
:edit ~/.vimrc
Vim
ex command
Go:set hlsearch<Esc>
1
<qujianning@gmail.com> INTERMEZZO
69
70. 70 03
"G" "o"
":set" <Esc>
normal mode command
ZZ
Vim 'hlsearch'
*03.9*
Vim
|usr 27.txt|. |pattern|
^
1
6 "include"
include "^include"
include.
$ "was$" was.
"x" "the"
Display
the solder holding one of the chips melted and the
xxx xxx xxx
"/the$"
Display
the solder holding one of the chips melted and the
xxx
"^the"
1
70
71. 71 03
Display
the solder holding one of the chips melted and the
xxx
"/^the$"
"the" "the "
. "c.m"
1
c m
Display
We use a computer that became the cummin winter.
xxx xxx xxx
"ter."
Display
We use a computer that became the cummin winter.
xxxx xxxx
"ter." 2
*03.10*
"G" Vim
Vim
normal mode command
``
1
l
71
72. 72 03
1
`
`
"/" "n" (
) "fx" "tx" word
"w" "e"
"j" "k"
`` CTRL-O
( O older). CTRL-I
( I O )
3
normal mode command
33G
/^The
CTRL-O
2
33 "The"
CTRL-O 33 CTRL-O "33G"
CTRL-I 33
CTRL-I "/^The"
Display
| example text ^ |
33G | example text | CTRL-O | CTRL-I
| example text | |
V line 33 text ^ V
| example text | |
/^The | example text | CTRL-O | CTRL-I
V There you are | V
example text
1
' ` 1
2
" "
72
73. 73 03
: CTRL-I <Tab>
":jumps"
">"
Vim "ma"
"a" a z 26
Vim
`{mark}, {mark}
normal mode command
`a
'mark( ) mark
`mark `mark mark
s(start)
normal mode command
ms
e(end)
normal mode command
me
normal mode command
's
'' 'e
e
73
74. 74 03
1 2
s e
ex command
:marks
List
'
"
[
]
|usr 04.txt|
|manual-copyright| vim:tw=78:ts=8:ft=help:norl:
1
start
2
end
74
75. 75 04
*usr 04.txt* Vim 7.0 . 2006 06 21
VIM --- Bram Moolenaar
---
3
Visual
|04.1|
|04.2|
|04.3|
|04.4| Visual
|04.5|
|04.6|
|04.7|
|04.8|
|04.9|
|04.10|
1
|usr 05.txt| Vim
|usr 03.txt|
|usr toc.txt|
*04.1*
2 "x"
"4x" 4
"dw" word "w"
word "d"
75
76. 76 04
"4w" 4 word "d4w"
4 word.
Display
To err is human. To really foul up you need a computer.
------------------>
d4w
To err is human. you need a computer.
Vim Vim
word "e" word
1
Vim :
Display
To err is human. you need a computer.
-------->
d2e
To err is human. a computer.
" "
2
" "
"$" "d$"
" "
Display
To err is human. a computer.
------------>
d$
To err is human
+
"d"
"4l" "w"
1
2
exclusive inclusive
[0, 5) 0≤x<5 [0, 5] 0≤x≤5
.
76
77. 77 04
*04.2*
"c" "d"
Insert "cw" word
word Insert
Display
To err is human
------->
c2wbe<Esc>
To be human
"c2wbe<Esc>"
List
c
2w word( Insert )
be
<Esc> Normal
"human"
"cw"
"c" d :"cw", "ce"
word word
Vi Vim
1
"dd" "cc"
( ).
"d$" "c$"
"d$" "a" Insert
1
:
77
78. 78 04
+
List
x dl( )
X dh( )
D d$( )
C c$( )
s cl( )
S cc( )
"3dw" "d3w" 3 word
"3dw" word 3
"d3w" 3 word
"3d2w" word 3
6 word.
"r"
"cl" "s" "r"
<Esc> Normal
Display
there is somerhing grong here
rT rt rw
There is something wrong here
"r"
Display
There is something wrong here
5rx
There is something xxxxx here
78
80. 80 04
Display
asdf xyz4
3 xyz.)
"four" "five"
List
/four<Enter> "four"
cwfive<Esc> "five"
n "four"
. "five"
n
.
*04.4* Visual
+
Visual
"v" Visual
Display
This is an examination sample of visual mode
---------->
velllld
This is an example of visual mode
"l"
"d"
<Esc>
Visual
80
81. 81 04
"V" Visual
"Vjj" 3
Display
+------------------------+
| text more text |
>> | more text more text | |
selected lines >> | text text text | | Vjj
>> | text more | V
| more text more |
+------------------------+
CTRL-V
Visual
Display
name Q1 Q2 Q3
pierre 123 455 234
john 0 90 39
steve 392 63 334
"Q2" "Q2" "Q" CTRL-V
Visual "3j" 3 "w"
word
"h" "d"
Visual
"o" ( o other end )
"o"
4 "o"
"O"
81
82. 82 04
1
"o" "O" Visual Normal Normal
*04.5*
"d" "x"
p ( Vim put)
"dd" "p"
Display
a line a line a line
line 2 dd line 3 p line 3
line 3 line 2
"p"
( word),
2
"p"
Display
Some more boring try text to out commands.
---->
dw
Some more boring text to out commands.
-------->
welp
Some more boring text to try out commands.
PUTTING
"P" "p"
1
4
2
82
83. 83 04
"dd" "P"
1
"dw" "P"
"p" "P"
"dd" "3p" 3
(
) "the" "teh" Vim
"teh" e "xp"
"x" e "p" e
h
Display
teh th the
x p
*04.6*
"u" "p"
yanking 2 . "y"
3
"p"
Yanking Vim "c"
4
, "y" "yank"
"y"
"y" "yw" word.
"y2w" word:
1
2
term:yanking
3
" " (")
4
change copy
83
84. 84 04
Display
let sqr = LongVariable *
-------------->
y2w
let sqr = LongVariable *
p
let sqr = LongVariable * LongVariable
"yw" word
"ye"
"yy" "dd"
"D" "Y"
"y$"
Display
a text line yy a text line a text line
line 2 line 2 p line 2
last line last line a text line
last line
*04.7*
Vim GUI (gvim) "Edit"
"Copy" Visual Edit/Copy
1
Vim .
Vim Edit/Paste Normal Insert
Visual
1
Copy Normal yank
Copy Vim
*, y Vim " Vim
84
85. 85 04
"Cut" "Copy",
"Cut" "Paste" (
) Vim
GUI
"y"(yank) "p"(put)
"*( )
normal mode command
"*yy
normal mode command
"*p
Vim
|09.3| |clipboard|
*04.8*
"dw" "daw"
1
Display
this is some example text.
daw
this is some text.
"daw" "d" "aw" "aw"
"A Word" "daw" "Delete A Word"
Word ( ).
1
Vim Perl There is more than one way to do the same
thing. <huanlf@gmail.com> PERL Perl
Perl perl : perl Perl PERL
Perl
85
86. 86 04
Vim
+ Visual +
+
"cis"
Display
Hello there. This
is an example. Just
some text.
"is an" "cis"
Display
Hello there. Just
some text.
"Another line.":
Display
Hello there. Another line. Just
some text.
"cis" "c" "is" "Inner Sentence"
"as"(a sentence)
"das".
"cis"
Visual
Visual Visual
"v" Visual "as"
"as"
|text-objects|
*04.9*
86
87. 87 04
"R" Vim replace
1
<Esc> .
"text" "t" Replace
Display
This is text.
Rinteresting.<Esc>
This is interesting.
12 "interesting."
2
5 "text." "R"
<Insert> Insert Replace
3
<BS>
*04.10*
N
M N*M
|operator|
1
replace
2
12
<ringken@gmail.com> .
3
Replace
87
88. 88 04
List
x ("dl" )
X ("dh" )
D ("d$" )
dw word
db word
diw word( )
daw word( )
dG
dgg
"c" "d" "y"
yank
List
~
(
'tildeop'a
Visual
I Insert
A Insert
a
'tildeop' g~
|usr 05.txt| Vim
|manual-copyright| vim:tw=78:ts=8:ft=help:norl:
88
89. 89 05 Vim
*usr 05.txt* Vim 7.0 . 2007 05 11
VIM --- Bram Moolenaar
Vim
" " " "
Vim Vim
plugin
|05.1| vimrc
|05.2| vimrc
|05.3|
|05.4| plugin
|05.5|
|05.6|
|05.7|
|usr 06.txt|
|usr 04.txt|
|usr toc.txt|
*05.1* vimrc *vimrc-intro*
vimrc Vim
vimrc (
) :
89
90. 90 05 Vim
ex command
:$MYVIMRC
vimrc |vimrc|
":version" Vim
Unix Macintosh --
List
~/.vimrc
MS-DOS MS-Windows
List
$HOME/_vimrc
$VIM/_vimrc
vimrc
Vim 'incsearch'
vimrc
ex command
set incsearch
Vim
Vim
vim
|usr 41.txt|
*05.2* vimrc *vimrc example.vim*
vimrc ( Vim
) Vim not-compatible ( |not-compatible|)
List
$VIMRUNTIME/vimrc_example.vim
90