vim7.0发布啦
时间:2006-05-09 来源:cnscn2008
期待已久的Vim7.0终于发布正式版了,赶快下载吧 vim7.0
gvim7.0 of Windows :
系统 vimrc 文件: "$VIM\vimrc"
用户 vimrc 文件: "$HOME\_vimrc"
第二用户 vimrc 文件 : "$VIM\_vimrc"
用户 exrc 文件: "$HOME\_exrc"
第二用户 exrc 文件 : "$VIM\_exrc"
系统 gvimrc 文件: "$VIM\gvimrc"
用户 gvimrc 文件 : "$HOME\_gvimrc"
第二用户 gvimrc 文件 : "$VIM\_gvimrc"
系统菜单文件 : "$VIMRUNTIME\menu.vim"
With the mouse:
":set mouse=a" to enable the mouse (in xterm or GUI).
Jump back:
Type CTRL-T or CTRL-O (repeat to go further back).
Get specific help:
WHAT PREPEND EXAMPLE ~
Normal mode command (nothing) :help x
Visual mode command v_ :help v_u
Insert mode command i_ :help i_<Esc>
Command-line command : :help :quit
Command-line editing c_ :help c_<Del>
Vim command argument - :help -r
Option ' :help 'textwidth'
Copy the vimrc (in vim):
1)Unix:
:!cp -i $VIMRUNTIME/vimrc_example.vim ~/.vimrc
2)MS-DOS, MS-Windows, OS/2: >
:!copy $VIMRUNTIME/vimrc_example.vim $VIM/_vimrc
3)Amiga:
:!copy $VIMRUNTIME/vimrc_example.vim $VIM/.vimrc
compatible option:
check the 'compatible' option
:set compatible?
If it responds with "nocompatible" you are doing well. If the response is
"compatible" you are in trouble. You will have to find out why the option is
still set. Perhaps the file you wrote above is not found. Use this command
to find out: >
:scriptnames
If your file is not in the list, check its location and name. If it is in the
list, there must be some other place where the 'compatible' option is switched
back on.
see what mode you are in:
:set showmode
Moving around:
h left k
j down h l
k up j
l right
w move the cursor forward one word
b move backward to the start of the previous word
e move to the next end of a word
ge move to the previous end of a word
$ move the cursor to the end of a line
0 (zero) move to the very first character of the line
fx searches forward in the line for the single character x
Fx searches backward in the line for the single character x
% move to the matching paren, such as { or }, ( or ), [ or ]
gg go to the start of a file
G go to the end of a file
H go to the top of window
M go to the Middle of window
L go to the End of window
u undo
C-r redo
:set nu show line numbers
:set nonu hide the line numbers
:set ruler show the curor position of the lower right corner of the vim window
C-U move half window up
C-D move half window down
:set hlsearch highlight for search
:set nohlsearch nohighlight for search
:scriptnames the script file name
d0 deletes from the cursor to the head of the line
d$ deletes from the cursor to the end of the line
cw modify the word
cc modify the line
x (dl) (delete character under the cursor)
X (dh) (delete character left of the cursor)
D (d$) (delete to end of the line)
C (c$) (change to end of the line)
s (cl) (change one character)
S (cc) (change a whole line)
v visual mode
C-q virtical block visual mode
~ change case of the character under the cursor
I Start Insert mode after moving the cursor to the first
non-blank in the line.
A Start Insert mode after moving the cursor to the end of the
line.
Settings
:edit $MYVIMRC edit the _vimrc or .vimrc
:set nocompatible the compatible will be off, thus 'nocompatible' takes care of this.
>
:set backspace=indent,eol,start
This specifies where in Insert mode the <BS> is allowed to delete the character in front of the cursor. The three items, separated by commas, tell Vim to delete the white space at the start of the line, a line break and the character before where Insert mode started.
backup file
if has("vms")
set nobackup
else
set backup
endif
This tells Vim to keep a backup copy of a file when overwriting it. But not on the VMS system, since it keeps old versions of files already. The backup file will have the same name as the original file with "~" added
history length
:set history=50
Keep 50 commands and 50 search patterns in the history.
show ruler
:set ruler
Always display the current cursor position in the lower right corner of the Vim window.
Display an incomplete command in the lower right corner of the window
:set showcmd
Simple mappings
:map <F5> i{<Esc>ea}<Esc>
gvim7.0 of Windows :
系统 vimrc 文件: "$VIM\vimrc"
用户 vimrc 文件: "$HOME\_vimrc"
第二用户 vimrc 文件 : "$VIM\_vimrc"
用户 exrc 文件: "$HOME\_exrc"
第二用户 exrc 文件 : "$VIM\_exrc"
系统 gvimrc 文件: "$VIM\gvimrc"
用户 gvimrc 文件 : "$HOME\_gvimrc"
第二用户 gvimrc 文件 : "$VIM\_gvimrc"
系统菜单文件 : "$VIMRUNTIME\menu.vim"
With the mouse:
":set mouse=a" to enable the mouse (in xterm or GUI).
Jump back:
Type CTRL-T or CTRL-O (repeat to go further back).
Get specific help:
WHAT PREPEND EXAMPLE ~
Normal mode command (nothing) :help x
Visual mode command v_ :help v_u
Insert mode command i_ :help i_<Esc>
Command-line command : :help :quit
Command-line editing c_ :help c_<Del>
Vim command argument - :help -r
Option ' :help 'textwidth'
Copy the vimrc (in vim):
1)Unix:
:!cp -i $VIMRUNTIME/vimrc_example.vim ~/.vimrc
2)MS-DOS, MS-Windows, OS/2: >
:!copy $VIMRUNTIME/vimrc_example.vim $VIM/_vimrc
3)Amiga:
:!copy $VIMRUNTIME/vimrc_example.vim $VIM/.vimrc
compatible option:
check the 'compatible' option
:set compatible?
If it responds with "nocompatible" you are doing well. If the response is
"compatible" you are in trouble. You will have to find out why the option is
still set. Perhaps the file you wrote above is not found. Use this command
to find out: >
:scriptnames
If your file is not in the list, check its location and name. If it is in the
list, there must be some other place where the 'compatible' option is switched
back on.
see what mode you are in:
:set showmode
Moving around:
h left k
j down h l
k up j
l right
w move the cursor forward one word
b move backward to the start of the previous word
e move to the next end of a word
ge move to the previous end of a word
$ move the cursor to the end of a line
0 (zero) move to the very first character of the line
fx searches forward in the line for the single character x
Fx searches backward in the line for the single character x
% move to the matching paren, such as { or }, ( or ), [ or ]
gg go to the start of a file
G go to the end of a file
H go to the top of window
M go to the Middle of window
L go to the End of window
u undo
C-r redo
:set nu show line numbers
:set nonu hide the line numbers
:set ruler show the curor position of the lower right corner of the vim window
C-U move half window up
C-D move half window down
:set hlsearch highlight for search
:set nohlsearch nohighlight for search
:scriptnames the script file name
d0 deletes from the cursor to the head of the line
d$ deletes from the cursor to the end of the line
cw modify the word
cc modify the line
x (dl) (delete character under the cursor)
X (dh) (delete character left of the cursor)
D (d$) (delete to end of the line)
C (c$) (change to end of the line)
s (cl) (change one character)
S (cc) (change a whole line)
v visual mode
C-q virtical block visual mode
~ change case of the character under the cursor
I Start Insert mode after moving the cursor to the first
non-blank in the line.
A Start Insert mode after moving the cursor to the end of the
line.
Settings
:edit $MYVIMRC edit the _vimrc or .vimrc
:set nocompatible the compatible will be off, thus 'nocompatible' takes care of this.
>
:set backspace=indent,eol,start
This specifies where in Insert mode the <BS> is allowed to delete the character in front of the cursor. The three items, separated by commas, tell Vim to delete the white space at the start of the line, a line break and the character before where Insert mode started.
backup file
if has("vms")
set nobackup
else
set backup
endif
This tells Vim to keep a backup copy of a file when overwriting it. But not on the VMS system, since it keeps old versions of files already. The backup file will have the same name as the original file with "~" added
history length
:set history=50
Keep 50 commands and 50 search patterns in the history.
show ruler
:set ruler
Always display the current cursor position in the lower right corner of the Vim window.
Display an incomplete command in the lower right corner of the window
:set showcmd
Simple mappings
:map <F5> i{<Esc>ea}<Esc>
相关阅读 更多 +
排行榜 更多 +