sponsor Vim development Vim logo Vim Book Ad

shell.vim : Improved integration between Vim and its environment (fullscreen, open URL, etc)

 script karma  Rating 150/51, Downloaded by 4249    Comments, bugs, improvements  Vim wiki

created by
Peter Odding
script type
This plug-in aims to improve the integration between Vim and its environment by providing functions to switch to full-screen (see the screenshots at http://peterodding.com/code/vim/shell/screenshots), open URLs in the user's default web browser and execute external commands in the background without opening a command prompt window. A DLL is included to perform these things on Windows, while on UNIX external commands are used.

For more information about the plug-in please refer to its homepage or the project page on GitHub:


If you have questions, bug reports, suggestions, etc. the author can be contacted at peter@peterodding.com. If you like this plug-in please vote for it below!

After publishing this plug-in I found that vimscript #687 and vimscript #2596 also implement full-screen on Windows using a similar approach. I prefer the effect of my plug-in because it seems to hide window decorations more effectively. Also note that my plug-in was developed independently of the other two.
install details
Please note that the vim-shell plug-in requires my vim-misc plug-in which is separately distributed (see vimscript #4597).

Unzip the most recent ZIP archives of the vim-shell and vim-misc plug-ins inside your Vim profile directory (usually this is ~/.vim on UNIX and %USERPROFILE%\vimfiles on Windows), restart Vim and execute the command :helptags ~/.vim/doc (use :helptags ~\vimfiles\doc instead on Windows). Now try it out:

Press <F11> or execute :Fullscreen to switch to full-screen mode and back;

Press <F6> or execute :Open to open files, directories, URLs and e-mail addresses using their associated default programs. By default the filename/URL/etc. under the text cursor is used, but you can also give an argument to the :Open command, for example:

    :Open http://www.vim.org/scripts/script.php?script_id=3123

If you prefer you can also use Pathogen, Vundle or a similar tool to install & update the vim-shell and vim-misc plug-ins using a local clone of the git repository.

rate this script Life Changing Helpful Unfulfilling 
script versions (upload new version)

Click on the package to download.

package script version date Vim version user release notes
shell.zip 0.13.2 2013-09-02 7.0 Peter Odding Remove duplicate help tag (reported by Yaofeng Peng):
shell.zip 0.13.1 2013-08-19 7.0 Peter Odding Make sure vim-misc is installed, politely complain if it isn't:
shell.zip 0.13 2013-06-12 7.0 Peter Odding MakeWithShell triggering QuickFixCmdPre & QuickFixCmdPost (contributed by Marc Montu):

Improvements on pull request #16 (the change above):
shell.zip 0.12.10 2013-06-03 7.0 Peter Odding Improve quoting in execute_with_dll() (suggested by Ingo Karkat):
shell.zip 0.12.9 2013-05-28 7.0 Peter Odding Bug fixes for 64 bit Windows backend of xolox#shell#execute_with_dll() (contributed by Ingo Karkat):
shell.zip 0.12.7 2013-05-25 7.0 Peter Odding Make reporting in s:library_call() user friendly:

Document vim-misc as external dependency (needs to be installed separately from now on):

Improve integration between vim-shell & vim-session (issue #11):
shell.zip 0.12.5 2013-05-20 7.0 Peter Odding Updated miscellaneous scripts:
shell.zip 0.12.4 2013-05-19 7.0 Peter Odding Updated miscellaneous scripts:
shell.zip 0.12.2 2013-05-14 7.0 Peter Odding Provide v:shell_error equivalent (g:xolox#shell#make_exit_code):
shell.zip 0.12.1 2013-05-13 7.0 Peter Odding This release contains a big internal refactoring that makes most of what was
previously called xolox#shell#execute() available as xolox#misc#os#exec() for
use by all of my plug-ins, even when the vim-shell plug-in is not installed.

As a bonus xolox#misc#os#exec() reliably reports exit codes both on Windows
using the compiled DLL and on other platforms using plain system().


Move xolox#shell#execute() -> xolox#misc#os#exec():

Updated miscellaneous scripts:
shell.zip 0.11.3 2013-05-06 7.0 Peter Odding Bug fix: Insufficient arguments for printf():
shell.zip 0.11.2 2013-05-03 7.0 Peter Odding Bug fix for changes to "always on top" behavior:
shell.zip 0.11 2013-05-02 7.0 Peter Odding Make it possible to disable "always on top" on Windows:
shell.zip 0.10 2013-05-01 7.0 Peter Odding Make integration (:make without console window):
shell.zip 0.9.25 2013-04-28 7.0 Peter Odding Updated miscellaneous scripts:
shell.zip 0.9.24 2013-04-21 7.0 Peter Odding Make compatibility with miscellaneous scripts explicit:
shell.zip 0.9.23 2011-11-26 7.0 Peter Odding Updated miscellaneous scripts:
shell.zip 0.9.22 2011-11-21 7.0 Peter Odding Rename xolox#shell#escape() to xolox#misc#escape#shell():
shell.zip 0.9.21 2011-11-11 7.0 Peter Odding Make the full screen window top most (shell.c patch contributed by Guo Yu):
shell.zip 0.9.20 2011-10-28 7.0 Peter Odding Workaround &shellslash option on Windows (issue #6):
shell.zip 0.9.18 2011-10-28 7.0 Peter Odding Use HTTP HEAD to disambiguate URLs with trailing punctuation (issue #4):
shell.zip 0.9.17 2011-10-18 7.0 Peter Odding Bug fix: Restore regex to match e-mail addresses:

Workaround for E488 (bug in Vim or my understanding of Vim?):

Add debugging statements (should make it easier to debug issues like #5):

Debugging statements for execution of external commands:
shell.zip 0.9.13 2011-09-25 7.0 Peter Odding Updated miscellaneous scripts:
shell.zip 0.9.12 2011-09-17 7.0 Peter Odding Extract :Maximize from :Fullscreen (suggested by Benjamin Bergman):
shell.zip 0.9.11 2011-09-04 7.0 Peter Odding Updated miscellaneous scripts:
shell.zip 0.9.10 2011-08-31 7.0 Peter Odding Version bump because of miscellaneous scripts:
shell.zip 0.9.9 2011-08-31 7.0 Peter Odding Option handling with xolox#misc#option#get({name}, {default}):

Move version variable to autoload script:

Document xolox#shell#fullscreen(), xolox#shell#is_fullscreen()
shell.zip 0.9.7 2011-06-18 7.0 Peter Odding Define version as variable, include version in messages:
shell.zip 0.9.6 2011-06-17 7.0 Peter Odding Bug fix: Rename xolox#open -> xolox#misc#open (reported by Tim Dahlin):
shell.zip 0.9.5 2011-06-17 7.0 Peter Odding Don't check existence of temporary files, just try to read them:
shell.zip 0.9.2 2011-02-04 7.0 Peter Odding Use Vim's "shell" and "shellcmdflag" options:

Also the character encoding of the included help file was changed to ASCII to accommodate users that don't have Unicode support (enabled).
shell.zip 0.9.1 2010-12-18 7.0 Peter Odding Restore window position/size on leaving full-screen (this fixes issue #2 reported by dionysiac- on GitHub):
shell.zip 0.9 2010-12-04 7.0 Peter Odding Support for Windows x64, improved error handling (thanks to Stan Angeloff for getting me to build an x64 DLL and helping me test the DLL and automatic bitness detection):
shell.zip 0.8.2 2010-09-19 7.0 Peter Odding Bug fix: %s/xolox#open#shell/xolox#open#file/:

Truncate expand() result to one pathname:

Bug fix: Open either file or directory, but never both!
shell.zip 0.8 2010-09-18 7.0 Peter Odding http://github.com/xolox/vim-shell/commit/4d2313b6508c26a1a843:
Moved openurl() & open_with() to dedicated plug-in (included in ZIP archive)
Simplified Mac OS X support
Support command line web browsers in s:open_at_cursor()
shell.zip 0.7.3 2010-08-30 7.0 Peter Odding Bug fix: Only toggle active window using `wmctrl' and report errors from libcall('fullscreen'):
shell.zip 0.7.2 2010-08-15 7.0 Peter Odding Bug fix for E33: No previous substitute regular expression:

The packages for version 0.7 and 0.7.1 below should have included the "shell.dll" dynamic link library but I failed to include it. This has been fixed now. Sorry about that!
shell.zip 0.7.1 2010-08-10 7.0 Peter Odding Enable passing stdin to xolox#shell#execute():
shell.zip 0.7 2010-08-09 7.0 Peter Odding Full-screen mode now hides Vim's menu/toolbar/tabline by default. This makes it useful even when the actual full-screen state of Vim's GUI window can't be changed because the DLL/wmctrl is unavailable.

Full-screen mode should now work in most graphical terminal emulators like xterm and gnome-terminal (though <F11> won't work in the latter).

Included user friendly :Open and :Fullscreen commands plus default key mappings so the plug-in is more useful out of the box.

The xolox#shell#execute() function now returns the output of the shell command if it was executed in synchronous mode (this enables integration with my easytags.vim plug-in).

I've merged my unreleased `hyperlink.vim' plug-in into `shell.vim' which improves the openurl() functionality and includes automatic highlighting for URLs and e-mail addresses in comments and strings.

All from http://github.com/xolox/vim-shell/commit/2f6414109fa52b20c1a86faff215fe1329ba6eb8
shell.zip 0.6.1 2010-06-14 7.0 Peter Odding Bug fix: Updated instructions to match new execute() implementation. Sorry about that!
shell.zip 0.6 2010-06-14 7.0 Peter Odding * Improved test instructions for execute()

* Better DLL detection, synchronous command execution

* Improved README, added screenshots, fixed typo
shell.zip 0.5.2 2010-06-14 7.0 Peter Odding Bug fix for execute() implementation in DLL
shell.zip 0.5.1 2010-06-13 7.0 Peter Odding Fixed typo in NMAKE makefile and references to Vim scripts page.
shell.zip 0.5 2010-06-13 7.0 Peter Odding Initial upload
ip used for rating:

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 the maillist. Help Bram help Uganda.
SourceForge.net Logo