cm_ commands codes in command line

English support forum

Moderators: Hacker, petermad, Stefan2, white

Post Reply
Terka
Senior Member
Senior Member
Posts: 326
Joined: 2006-05-24, 09:04 UTC

cm_ commands codes in command line

Post by *Terka »

example:
cm_CopyToClipboard=2008
when writing this command to command line:
cm_CopyToClipboard it works

questions:
1. is there a way how to use just the 2008 number to do the same?
2. is there a auto-completion for a partly written cm_ similar like tab in Linux?
User avatar
Gral
Power Member
Power Member
Posts: 1609
Joined: 2005-01-26, 15:12 UTC

Post by *Gral »

1. Trick - set alias to 2008
2. If you mean auto-completion on command line - no, only on "Choose command" window.
User avatar
MVV
Power Member
Power Member
Posts: 8711
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

1. It would be much easier to assign hotkeys for frequently used commands (but aliases may help too if someone loves typing commands instead). And, BTW too, copy selected files to clipboard is Windows default action that is available on Ctrl+C. :D

2. There is no internal auto-completion for internal commands. However it is very easy to create external tool that will allow executing TC commands with auto-completion because it is very easy to parse totalcmd.inc and to send a message to TC window with desired command index. I've tried to write such tool but didn't finished it.
Terka
Senior Member
Senior Member
Posts: 326
Joined: 2006-05-24, 09:04 UTC

Post by *Terka »

1. i use autohotkey code like eg.:

Code: Select all

f_TC_ctrl_c() {
    Suspend, On
        Input,Text, I L1 T1, {Esc},f,n,p    ;full_names, names, path  ;nesmi tu byt mezery
        If ErrorLevel = Match
        {
            If Text = f ; full names
            {   Send  cm_CopyFullNamesToClip{enter}
            }
            If Text = n ;  names
            {   Send  cm_CopyNamesToClip{enter}
            }
            If Text = p ; path
            {   Send  cm_CopySrcPathToClip{enter}
                clipboard := clipboard . "\"      ;pridam za cestu lomitko
            }
            Suspend, Off
            Return
        }
        else
        {
            Send ^c
            Suspend, Off
            Return
        }
and i wanted to speedup the cm_ writing to the command line


2.thank you,
@MVV Do you know some working solution?
@Gral What is "Choose command" window?
User avatar
Gral
Power Member
Power Member
Posts: 1609
Joined: 2005-01-26, 15:12 UTC

Post by *Gral »

cm_CommandBrowser=2924;Browse internal commands
Terka
Senior Member
Senior Member
Posts: 326
Joined: 2006-05-24, 09:04 UTC

Post by *Terka »

i see, thanks
User avatar
MVV
Power Member
Power Member
Posts: 8711
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

I've doctored my tool, you can try it. Just bind a hotkey for it.

tcinc 1.0.0.36

Tool lists cm-commands and aliases for them and allows filtering list using acronyms (e.g. type apc for cm_AddPathToCmdline).
Enter will execute first item from list or a selected one if you select it with Up/Down arrows.


Added on 2015-09-24 12:08:

Package updated, now last command name character is compared correctly.
Last edited by MVV on 2015-09-24, 09:15 UTC, edited 4 times in total.
Terka
Senior Member
Senior Member
Posts: 326
Joined: 2006-05-24, 09:04 UTC

Post by *Terka »

Great, i will try. Thanks!
User avatar
solid
Power Member
Power Member
Posts: 755
Joined: 2004-08-09, 11:20 UTC

Post by *solid »

Great little tool, MVV. Thank you for sharing it.
Is it possible to add the em_commands from Usercmd.ini?

Mr.Ghisler, you should integrate this into TC, a feature asked long time ago.
User avatar
MVV
Power Member
Power Member
Posts: 8711
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

solid,
I thought about it, it shouldn't be too hard, time is the only thing I need. :)

BTW I've created a topic for tcinc.
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 50918
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

Why not use cm_commandbrowser?
Author of Total Commander
https://www.ghisler.com
User avatar
MVV
Power Member
Power Member
Posts: 8711
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

ghisler(Author),
It doesn't allow execution of selected command, only copying its name.
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 50918
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

Ah, I see - but you can just Ctrl+V and Enter in the command line.

I could add cm_commandbrowserexec or so which would then execute the command.
Author of Total Commander
https://www.ghisler.com
User avatar
MVV
Power Member
Power Member
Posts: 8711
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

ghisler(Author),
Perhaps something like Shift+Enter or Ctrl+Enter for execution in existing command browser would be better.
However acronym filter looks more friendly for filtering commands.
User avatar
solid
Power Member
Power Member
Posts: 755
Joined: 2004-08-09, 11:20 UTC

Post by *solid »

2ghisler(Author)
I'm using it like that, but too many steps. Opening the browser, finding the command, copy name, paste it in cmd, execute it. And previous clipboard value gets trashed.
With MVV's tool is much faster and acronym searching helps a lot. Missing is only support for em_commands. Also searching in the description.

Modifier+Enter for executing should be fine solution too. Also acronym searching in the command browser.
Post Reply