Re: Getting out of netrw
Hi, On 11/3/06, Jean-Rene David [EMAIL PROTECTED] wrote: Say I open vim7's new super duper file explorer netrw to browse some local directory. Say then I decide I don't want to open any new file and just want to go back to what I was doing. What would be the standard way to do that? I can use C-O to eventually land up where I was but I need to backtrack all the motion commands I did in the netrw buffer. I thought of using :q but that closes vim if only one window is open. Am I missing something obvious? You can try using CTRL-^ to jump to the alternate buffer. But for some reason, this doesn't work right after starting up Vim. It works after that. $ vim xyz.txt :e . If you press CTRL-^ now to jump to the alternate buffer, it says, E23: No alternate file. But if you do the following, then it works. $ vim xyz.txt :e . :e xyz.txt Now, you can use CTRL-^ to jump between netrw buffer and xyz.txt file. This looks like a bug in netrw. - Yegappan
Re: Getting out of netrw
Bill McCarthy wrote: On Sat 4-Nov-06 5:40pm -0600, A.J.Mechelynck wrote: Vim's :quit, :close or :exit commands will close any window, including special windows like the netrw, options, quickfix, ... windows. So where's the problem? Reading the thread, it appears the OP was editing a file and then started the explorer with something like :edit . - i.e. he was in a single window. In that case, :quit or :exit would close down Gvim - not what he wanted. :close would generate an error message. Perhaps simply :bd is more like what he wants? Well, let him learn split-window commands then: :new . opens the explorer in a separate window; or, if you want a File-Explorer-like display on the side, :topleft vsplit .; later, :q will close that extra window. Best regards, Tony.
Re: Getting out of netrw
On Sat 4-Nov-06 6:10pm -0600, A.J.Mechelynck wrote: Bill McCarthy wrote: On Sat 4-Nov-06 5:40pm -0600, A.J.Mechelynck wrote: Vim's :quit, :close or :exit commands will close any window, including special windows like the netrw, options, quickfix, ... windows. So where's the problem? Reading the thread, it appears the OP was editing a file and then started the explorer with something like :edit . - i.e. he was in a single window. In that case, :quit or :exit would close down Gvim - not what he wanted. :close would generate an error message. Perhaps simply :bd is more like what he wants? Well, let him learn split-window commands then: :new . opens the explorer in a separate window; or, if you want a File-Explorer-like display on the side, :topleft vsplit .; later, :q will close that extra window. Good point. And if wants to work in a full window, then :tabe . will do that and still close down with :q. -- Best regards, Bill
Re: Getting out of netrw
* Gary Johnson [2006.11.04 18:30]: When you open file A, then open file B, then want to go back to A, you don't do so by quitting B--you explicitly open A. Looking at it that way, it makes good sense. Thanks again for all the suggestions. -- JR
Getting out of netrw
Say I open vim7's new super duper file explorer netrw to browse some local directory. Say then I decide I don't want to open any new file and just want to go back to what I was doing. What would be the standard way to do that? I can use C-O to eventually land up where I was but I need to backtrack all the motion commands I did in the netrw buffer. I thought of using :q but that closes vim if only one window is open. Am I missing something obvious? -- JR
Re: Getting out of netrw
Jean-Rene David wrote: Say I open vim7's new super duper file explorer netrw to browse some local directory. Say then I decide I don't want to open any new file and just want to go back to what I was doing. What would be the standard way to do that? I can use C-O to eventually land up where I was but I need to backtrack all the motion commands I did in the netrw buffer. You can use the jumplist to get a listing of locations where you've been: :ju The left hand column is a count that you can use to precede c-o. For example: jump line col file/line 3 10 some text 2 700 another line 1 1154 23 end. and 3c-o will jump to entry #3. Regards, Chip Campbell
Re: Getting out of netrw
On 11/3/06, Jean-Rene David [EMAIL PROTECTED] wrote: I thought of using :q but that closes vim if only one window is open. Am I missing something obvious? I use :Sexplore (or :Vexplore) to open the explorer. Then it's not a problem using :q. Or if you really want to be fancy, put this in your .vimrc: function MyExplore() tabnew Explore nmap buffer leaderq :qcr endfunction nmap F2 :call MyExplore()cr Then F2 opens explorer in a new tab, and leaderq closes the tab, and you should be back where you were before pressing F2. Marius
Re: Getting out of netrw
Marius Roets wrote: On 11/3/06, Jean-Rene David [EMAIL PROTECTED] wrote: I thought of using :q but that closes vim if only one window is open. Am I missing something obvious? Then F2 opens explorer in a new tab, and leaderq closes the tab, and you should be back where you were before pressing F2. Or you could use :Texplore to open a netrw-browser in a new tab! Regards, Chip Campbell