vim viminfo

 The viminfo file is designed to store information on marks as well as the following:

Command-line history

Search-string history

Input-line history

Registers

Marks

Buffer list

Global variables



1           The trick is that you have to enable it ,This is done through the following command:

:save viminfo=string

The string specifies what to save.


2             First ,the 'option is used to specify how many files for which you save local marks(a-Z).Pick a nice even number for

this option(1000,for instance).Your viminfo option now looks like this:

:save viminfo='1000


3               The f option controls whether global marks (A-Z 0-9)are stored ,If this option is 0,none are stored ,If it is 1 or you do not specify an 

f option.marks are stored ,You want this feature,so now you have this:

:set viminfo='1000,f1


4                 The r option tells vim about removeable media,Marks for files on removeable media are not stroed ,The idea here is that jump to mark is a 

difficult command to execute if the file is on a flopy disk that you have left in your top desk drawer at home ,You can specify the r option multiple times;

therefore,if you are on Micorsoft Windows system ,you can tell vim that floppy disks A and B are removable with the r option:

:set viminfo='1000,f1,rA:,rB:

On UNIX ,you can use following command:

set viminfo='1000,f1,r/mnt/floppy


5           The \" option controls how many lines are saved for each of registers.By default,all the lines are saved ,If 0,nothing is saved .

You like the default,so you will not be adding a \" specification to the viminfo line.


6              The : option contrals the number of lines of  : history to save .100 is enough for us:

:set viminfo='1000,f1,r/mnt/floppy,:100,


7             The / option defines the size of the search history.Again 100 is plenty:

:set viminfo='1000,f1,r/mnt/floppy,:100,/100



8   Generally ,when Vim starts,if you have the 'hlsearch' option set ,the editor high-lights the previous search string (left over from

the previous editing sessions).To turn off this featurn ,put the h flag in your 'viminfo' option list.(Or you can just start Vim,see the 


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值