Launch TC from WSL and Vim

English support forum

Moderators: white, Hacker, petermad, Stefan2

Post Reply
llinfeng
Junior Member
Junior Member
Posts: 6
Joined: 2014-10-03, 02:18 UTC
Location: Ann Arbor

Launch TC from WSL and Vim

Post by *llinfeng »

  • In WSL, the following will open the current directory in the right-pane of an existing TC, or open a new one and update the right-pane accordingly.

    Code: Select all

    "$(wslpath "c:\Program Files\totalcmd\TOTALCMD.EXE")" -c /O /R=$(wslpath -w "$PWD")
    Caveat: this command only works in "Windows" folders, but not "Linux" folder created within WSL. More conditions are necessary to make a full-scale launcher that opens up PWD in TC for all folders accessible through WSL.
  • In Gvim on Windows, the following mapping shall enable F6 to launch current directory in TC in the right-pane.

    Code: Select all

    nnoremap <F6> :!start "c:\Program Files\totalcmd\TOTALCMD.EXE" /O /R=%:p:h<CR>
    
    Caveat: more conditions can be added so that things work universally, say, for vims launched within WSL as well. This is for future work.
User avatar
Stefan2
Power Member
Power Member
Posts: 4158
Joined: 2007-09-13, 22:20 UTC
Location: Europa

Re: Launch TC from WSL and Vim

Post by *Stefan2 »

Question or How-To :?: :D





 
llinfeng
Junior Member
Junior Member
Posts: 6
Joined: 2014-10-03, 02:18 UTC
Location: Ann Arbor

Re: Launch TC from WSL and Vim

Post by *llinfeng »

I guess this is a How-To, now that I have lived with the caveats for a good number of months. One can mount WSL shares as a network drive, but it is advised not to manipulate files that way.
Post Reply