Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 21 lines (13 sloc) 2.015 kb
6083735 Version 1: Initial upload
Geoff Wood authored
1 This is a mirror of http://www.vim.org/scripts/script.php?script_id=4214
2
3 gvimt.bat is a script for Windows to open new files in gvim in new tabs, splits or vertical splits. It starts gvim if it is not running already.
4
5 Call it from SendTo menu, from Context menu entries or from the command line.
6
3991926 Version 9
Geoff Wood authored
7 It ignores command line vim, and gvims where the --servername parameter has changed the name to not include "GVIM"
8
9 It prefers to use vim.exe (command line vim, not gvim) to check if gvim is already running. If that's not available it will use the tasklist command (which exists from Windows XP, but not in Windows 2000). On Windows 2000 you'll need to have an instance of gvim running already. Tasklist is not always reliable when using several remote desktop sessions on a machine (because for some reason %SESSIONNAME% parameter is not always populated in the batch file's environment).
6083735 Version 1: Initial upload
Geoff Wood authored
10
11 It creates gvimt.tmp while it is running, if it crashes or goes wrong for some reason, delete this file.
12
13 Why use this instead of simpler methods?
14 ========================================
15 There are simpler ways to call gvim directly passing file names to new tabs. There is the --remote-tab parameter, for example. Some methods are discussed here: http://vim.wikia.com/wiki/Launch_files_in_new_tabs_under_Windows
16
17 There are some problems doing this with many files from the Windows context menu:
3c6e982 Version 2
Geoff Wood authored
18 - There is no --remote-split parameter so a different approach is needed for opening files in a new split window. --remote-send can be used to send an arbitary command for this, but unlike --remote-tab it will not open a new instance of gvim if one doesn't already exist.
6083735 Version 1: Initial upload
Geoff Wood authored
19 - If you select multiple files and use the Windows context menu, each file gets its own invocation of the command. gvim does not handle several simultaneous --remote-tab commands well.
20 - The SendTo menu does pass all the selected files to one command, but it is an extra click on the right menu to get there, so it is nice to use the Context menu.
Something went wrong with that request. Please try again.