Vim Tips Wiki
(→‎How to: Make it more sexy ;))
m (oops I guess there was already a comments section)
(4 intermediate revisions by 3 users not shown)
Line 1: Line 1:
  +
{{TipProposed
You don't need get back to Terminal to move a file. Vim has a integrated file explorer you can use for this operations.
 
  +
|id=0
The Vim's file explorer can be acessed using <code>:Explore</code> in Normal mode. It should open inside current file path and on current window.
 
  +
|previous=0
  +
|next=0
  +
|created=December 13, 2011
  +
|complexity=basic
  +
|author=Antonio Carlos De Souza
  +
|version=7.0
  +
|subpage=/201112
  +
|category1=
  +
|category2=
  +
}}
  +
You don't need a shell window to move a file. Vim has an integrated file explorer you can use for file operations. Vim's file explorer can be acessed using <code>:Explore</code> in normal mode (or just enter <code>:e.</code> which is a command to edit the current directory). It should list files in the current directory.
   
 
==How to==
 
==How to==
In Normal mode type <code>:Sex</code>, in a Window's file. It should Split current window and open Explore above it. Or <code>:Sex!</code> to split vertically. If you're current window is showing a clean buffer, Explorer'll open current path, as show by <code>:pwd</code>.
+
In normal mode type <code>:Sex</code> to split the current window and open Explore above it. Or <code>:Sex!</code> to split vertically. If the current window has no file, the current directory is opened (as shown by <code>:pwd</code>). (Also see <code>:Hex</code>, <code>:Vex</code>, and <code>:Tex</code> commands for slight variations).
   
Navigate to file name using hjkl, or arrow keys
+
Navigate to a file name using <code>hjkl</code>, or arrow keys.
   
  +
Press <code>R</code> to rename a file.
Press R
 
   
  +
A prompt is shown that the selected file will be moved (renamed), and the original full path for the destination is shown. Change that path as wanted and press Enter to move the file, or Esc to cancel.
Vim'll show a from:original_path to:original_path
 
 
Change the path on to: <enter>
 
 
Done :)
 
   
 
==References==
 
==References==
* http://stackoverflow.com/a/1205382
 
 
*{{help|:Explore}}
 
*{{help|:Explore}}
   
 
==Comments==
 
==Comments==
VimTip
 

Revision as of 05:19, 10 October 2012

Proposed tip Please edit this page to improve it, or add your comments below (do not use the discussion page).

Please use new tips to discuss whether this page should be a permanent tip, or whether it should be merged to an existing tip.
created December 13, 2011 · complexity basic · author Antonio Carlos De Souza · version 7.0

You don't need a shell window to move a file. Vim has an integrated file explorer you can use for file operations. Vim's file explorer can be acessed using :Explore in normal mode (or just enter :e. which is a command to edit the current directory). It should list files in the current directory.

How to

In normal mode type :Sex to split the current window and open Explore above it. Or :Sex! to split vertically. If the current window has no file, the current directory is opened (as shown by :pwd). (Also see :Hex, :Vex, and :Tex commands for slight variations).

Navigate to a file name using hjkl, or arrow keys.

Press R to rename a file.

A prompt is shown that the selected file will be moved (renamed), and the original full path for the destination is shown. Change that path as wanted and press Enter to move the file, or Esc to cancel.

References

Comments