comparison runtime/doc/usr_21.txt @ 39:c16898406ff2

synchorinize version 7.3.081
author one@zeus.cr.ie.u-ryukyu.ac.jp
date Fri, 17 Dec 2010 17:43:06 +0900
parents e170173ecb68
children
comparison
equal deleted inserted replaced
38:e06a1cd7230d 39:c16898406ff2
1 *usr_21.txt* For Vim version 7.2. Last change: 2007 May 01 1 *usr_21.txt* For Vim version 7.3. Last change: 2008 Nov 09
2 2
3 VIM USER MANUAL - by Bram Moolenaar 3 VIM USER MANUAL - by Bram Moolenaar
4 4
5 Go away and come back 5 Go away and come back
6 6
151 When you run Vim multiple times, the last one exiting will store its 151 When you run Vim multiple times, the last one exiting will store its
152 information. This may cause information that previously exiting Vims stored 152 information. This may cause information that previously exiting Vims stored
153 to be lost. Each item can be remembered only once. 153 to be lost. Each item can be remembered only once.
154 154
155 155
156 GETTING BACK TO WHERE YOU WERE 156 GETTING BACK TO WHERE YOU STOPPED VIM
157 157
158 You are halfway editing a file and it's time to leave for holidays. You exit 158 You are halfway editing a file and it's time to leave for holidays. You exit
159 Vim and go enjoy yourselves, forgetting all about your work. After a couple 159 Vim and go enjoy yourselves, forgetting all about your work. After a couple
160 of weeks you start Vim, and type: 160 of weeks you start Vim, and type:
161 > 161 >
164 And you are right back where you left Vim. So you can get on with your work. 164 And you are right back where you left Vim. So you can get on with your work.
165 Vim creates a mark each time you exit Vim. The last one is '0. The 165 Vim creates a mark each time you exit Vim. The last one is '0. The
166 position that '0 pointed to is made '1. And '1 is made to '2, and so forth. 166 position that '0 pointed to is made '1. And '1 is made to '2, and so forth.
167 Mark '9 is lost. 167 Mark '9 is lost.
168 The |:marks| command is useful to find out where '0 to '9 will take you. 168 The |:marks| command is useful to find out where '0 to '9 will take you.
169
170
171 GETTING BACK TO SOME FILE
172
173 If you want to go back to a file that you edited recently, but not when
174 exiting Vim, there is a slightly more complicated way. You can see a list of
175 files by typing the command: >
176
177 :oldfiles
178 < 1: ~/.viminfo ~
179 2: ~/text/resume.txt ~
180 3: /tmp/draft ~
181
182 Now you would like to edit the second file, which is in the list preceded by
183 "2:". You type: >
184
185 :e #<2
186
187 Instead of ":e" you can use any command that has a file name argument, the
188 "#<2" item works in the same place as "%" (current file name) and "#"
189 (alternate file name). So you can also split the window to edit the third
190 file: >
191
192 :split #<3
193
194 That #<123 thing is a bit complicated when you just want to edit a file.
195 Fortunately there is a simpler way: >
196
197 :browse oldfiles
198 < 1: ~/.viminfo ~
199 2: ~/text/resume.txt ~
200 3: /tmp/draft ~
201 -- More --
202
203 You get the same list of files as with |:oldfiles|. If you want to edit
204 "resume.txt" first press "q" to stop the listing. You will get a prompt:
205
206 Type number and <Enter> (empty cancels): ~
207
208 Type "2" and press <Enter> to edit the second file.
209
210 More info at |:oldfiles|, |v:oldfiles| and |c_#<|.
169 211
170 212
171 MOVE INFO FROM ONE VIM TO ANOTHER 213 MOVE INFO FROM ONE VIM TO ANOTHER
172 214
173 You can use the ":wviminfo" and ":rviminfo" commands to save and restore the 215 You can use the ":wviminfo" and ":rviminfo" commands to save and restore the