- 论坛徽章:
- 0
|
To 14, 我觉得不能在insert mode下使用:set命令。参考楼上几位朋友的提示,我又查了一下vi设置方面的资料。
1,查看当前vi设置,使用:set all命令,它显示的是当前vi的是设置,下面是我的VI设置:
noaltwerase noextended mesg report=5 term="xterm"
noautoindent filec="" nomodeline noruler noterse
autoprint flash msgcat="./" scroll=11 notildeop
noautowrite hardtabs=0 noprint="" nosearchincr timeout
backup="" noiclower nonumber nosecure nottywerase
nobeautify noignorecase nooctal shiftwidth=8 noverbose
cdpath=":" keytime=6 open noshowmatch warn
cedit="" noleftright optimize showmode window=23
columns=80 lines=24 path="" sidescroll=16 nowindowname
nocomment nolisp print="" noslowopen wraplen=0
noedcompatible nolist prompt nosourceany wrapmargin=0
escapetime=3 lock noreadonly tabstop=8 wrapscan
noerrorbells magic noredraw taglength=0 nowriteany
noexrc matchtime=7 remap tags="tags"
directory="/tmp"
paragraphs="IPLPPPQPP LIpplpipbp"
recdir="/var/tmp/vi.recover"
sections="NHSHH HUnhsh"
shell="/bin/bash"
shellmeta="~{[*?$`'"\"
Press any key to continue [: to enter more ex commands]:
这些参数有两种赋值方法,一是,通过=赋值,二是布尔赋值。比如:
:set tabstop=8 #设置tab键宽度为8.
:set noshowmode #不显示当前模式
:set showmode #显示当前模式
2, 在vi启动是进行设置,有两种方法:
a. 在当前的用户目录,创建.exrc文件,写入你想要的命令,比如
set showmode
set tabstop=4
b. 设置环境变量EXINIT(可在.bashrc, .profile等文件中配置),比如
EXINIT='set showmode | tapstop=8'
export EXINIT
reference:
http://www.eng.hawaii.edu/Tutor/vi.html |
|