sponsor Vim development Vim logo Vim Book Ad

tcmdbar.vim : Script for use with Total Commander's button bar

 script karma  Rating 53/20, Downloaded by 1165    Comments, bugs, improvements  Vim wiki

created by
Andy Wokula
 
script type
utility
 
description
This script is only for users of Total Commander and Win32 (maybe Win16).

After proper installation:
Start Total Commander, select one or more files, then click the GVim button.
GVim will create an argument list from the selected files so you can edit them.
Sounds trivial, but it is not.

Works with Ctrl-B (show flattened file list).


Customization for _vimrc (optional)

Open files in windows, tab pages or in diff mode:
    :let Tcmdbar_OpenIn = "Windows"
    :let Tcmdbar_OpenIn = "Tabs"        " ignored in Vim6
    :let Tcmdbar_OpenIn = "Diff Mode"

Values may be abbreviated to "win", "tab" and "diff".


You will get an error if you want to open too many files.  In this case
Vim will only open windows/tabs for as many files as possible.

-- Please report errors if the script does not work for you! --

2007 Sep 17
If the first argument is always the file list, the plugin actually isn't needed!
You can define the button this way:
    Command: <path>\gvim.exe "+n `=readfile(argv(0))`"
    Parameters: %L
In the help:
    :h `=
    :h next_f
 
install details
1. Put script in any directory where it is _not_ sourced automatically
    for example, ~\vimfiles is a good choice
2. Create a button for GVim in TC's button bar (see inside script for details)
    Command: <path>\gvim.exe -S ~\vimfiles\tcmdbar.vim
    Parameters: %L dummy

Notes:
-   The "dummy" argument is a required dummy file name, its name is fixed!
    You should not run into problems if this is an existing file.
-   You can also set a variable in the Command Textbox:
    <path>\gvim.exe +"let Tcmdbar_OpenIn='Tabs'" -S ~\vimfiles\tcmdbar.vim
 

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
tcmdbar.vim 9 2013-09-09 7.0 Andy Wokula fix: make it work with file list from "Find Files" dialog + more than one selected "Search in" directories + "Feed to listbox"
fix: proper file name escaping with fnameescape()
new preferred name for config variable: "tcmdbar_open_in" (old variable names still work)
tcmdbar.vim 8 2012-01-28 6.0 Andy Wokula added  :let Tcmdbar_OpenIn='Ask'  to query the user with a dialog; when selecting two files, the dialog contains a "diff" button
tcmdbar.vim 7 2007-08-02 6.0 Andy Wokula added option to open two files in diff mode
tcmdbar.vim 6 2007-02-02 6.0 Andy Wokula Added option to open files in windows or tabpages
tcmdbar.vim 5 2007-01-28 6.0 Andy Wokula Bugfixes: issues with 'gd', order of buffers
ip used for rating: 54.167.207.16

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