sponsor Vim development Vim logo Vim Book Ad

basic Tip #413: Drag and Drop file names into VIM's command line

 tip karma   Rating 20/18, Viewed by 1371 

created:   January 29, 2003 23:55      complexity:   basic
author:   Thomas Ramming      as of Vim:   6.0

You can open files in VIM by Drag&Drop; of selected file names from Windows Explorer. (not very surprising).
This also works by dropping into the VIM command line, so you can e.g. type
':split '
then drag&drop; a selected file to VIM window
and hit <CR>

The complete path and filename is transferred to commandline and the file is opened in a new VIM buffer/window.

 rate this tip  Life Changing Helpful Unfulfilling 

<<Easy menu-style switch between files with a simple map | Change guifont to see more of your file. >>

Additional Notes

[email protected], January 30, 2003 23:47
This also works in an X-Windows environment, such as Linux uses.

:edit <drag file on to Gvim window> <Return> also works as you would expect.
Anonymous, January 16, 2004 13:27
In X, you don't even need to type ":edit" first.  Just grab a file from your file manager (like Rox) and drag/drop it into Vim.
If you have questions or remarks about this site, visit the vimonline development pages. Please use this site responsibly.
Questions about Vim should go to [email protected] after searching the archive. Help Bram help Uganda.
Sponsored by Web Concept Group Inc. SourceForge Logo