vim viminfo

来源:互联网 发布:cisco2960g 端口闪黄灯 编辑:程序博客网 时间:2024/05/16 06:04

 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 


原创粉丝点击