Page 1 of 2

Remembering sorting mode with directory shortcuts

Posted: 2009-07-25, 17:39 UTC
by wayfinder
I think it would be useful if tc could remember a default sorting/display mode with saved directory shortcuts. Could be optional, too, like remembering the target directory is.

Posted: 2009-07-26, 07:47 UTC
by ZoSTeR
I'm pretty sure this was suggested already but

support++

Btw when you save and reopen tabs the sorting is also restored. You could then load the tab file from the Directory hotlist via the commands OpenTabs or AppendTabs.

Posted: 2009-07-26, 09:05 UTC
by Balderstrom
This can pretty much be currently accomplished by:
1) saving settings.
2) copy wincmd.ini to: mySavedTabs.ini
3) create a TC shortcut
TARGET: "C:\Program Files\TotalCMD\TOTALCMD.EXE" /i=mySavedTabs.ini

Though I agree, a better option instead of having to load a different wincmd.ini, would be the ability to use a line command option to load a savedTabsFile. So your instance of TC can still use your normal wincmd.ini

I.E. Shortcut
TARGET: "C:\Program Files\TotalCMD\TOTALCMD.EXE" /S=T:"C:\Path\to\saved.tabs"

Posted: 2009-07-26, 09:48 UTC
by wayfinder
Wouldn't that restore ALL tabs to a certain snapshot state though? That sounds like a very different behaviour to what I was thinking of...

Posted: 2009-07-26, 10:17 UTC
by Balderstrom
Yeah it would, we'd need a:
cm_SaveSingleTab (toFile) :: save the current active tab only.

currently, we have:
Save Tabs (to file) and
Save Tabs on both sides (to file)

So a command to save a singleTab, and a CommandLine Flag to specify loading a tab file.

This would accomplish your request I believe. Since a directory shortcut itself, would have no where to store the sortmethod/or whether a custom column was active - but a saved tab file would.

Posted: 2009-07-26, 11:19 UTC
by ZoSTeR
Another way would be:
- Open and sort the folder(s) you'd like to save.
- Save the tabs via rightclick "save tabs to file" to eg "c:\mytabs01.tab"
- Create a new "Directory hotlist" entry with command "APPENDTABS c:\mytabs01.tab"

You'd still have to switch to the last opened tab but I think that's as close as you can get to your suggestion (without macros).

Posted: 2009-07-26, 17:39 UTC
by wayfinder
Balderstrom:

Why wouldn't a shortcut have anywhere to store the sorting method? It can store a target directory, after all :)

Posted: 2009-07-26, 20:43 UTC
by Balderstrom
A Folder shortcut is a windows convention, that you can [optionally] tell to open with TC.

Or you make a totalcmd.exe shortcut, and use the command line flags [/S] [/O] [/L=PATH1] [/R=PATH2]

Neither of those conventions has any way to store/or indicate a TABSTOP sort method or an active Custom Column.

Posted: 2009-07-28, 07:23 UTC
by wayfinder
Ah! I wasn't aware that this wasn't a tc internal functionality, but an interface.

I noticed that it's possible to make a shortcut to cm_SrcByDateTime and sort the files in the active window by date (although apparently the directories aren't sorted?)

Is there a way to concatenate commands in the shortcut? I tried "cd c:\ | cm_SrcByDateTime" and it didn't work, and neither did "cd c:\; cm_SrcByDateTime"

Still even if I could get it to work that way, it wouldn't sort directories :(

Posted: 2009-07-28, 09:40 UTC
by petermad
although apparently the directories aren't sorted
You can change that in Configuration -> Display -> Sorting directories: -> Like files (also by time)

If you also want to be able to sort directories by extension (type), then add SortDirExt=1 to the [Configuration] section of you wincmd.ini file.

is there a way to concatenate commands in the shortcut? I
No.

Posted: 2009-07-28, 11:38 UTC
by ZoSTeR
wayfinder wrote:Is there a way to concatenate commands?
Yes, with TCMC. Put TCMC.exe in your TC folder and create a new user command: (eg em_cd_by_date)

Command: "%commander_path%\TCMC.exe"
Parameter: "CDS "c:" "" CMcm_SrcByDateTime"

This will change the source panel to c:\, leave the destpanel alone and sort by date.

Study the TCMC readme for the various options.

You can then use your custom command either as button or in the directory hotlist.

Posted: 2009-07-28, 11:59 UTC
by wayfinder
petermad wrote:
although apparently the directories aren't sorted
You can change that in Configuration -> Display -> Sorting directories: -> Like files (also by time)
No, that option is already on. cm_SrcByDateTime still doesn't sort directories, try it for yourself. BUT! cm_SrcSortByCol does the trick. I'm going to try TCMC, which sounds like it could indeed be the key to providing the functionality I'm looking for.

Edit: it is! splendid.

tcmc CMcm_SrcSortByCol6 cds c:\ ""

This will do exactly what I want.

Thank you!

Posted: 2009-07-28, 13:01 UTC
by Samuel
wayfinder wrote:Is there a way to concatenate commands in the shortcut?
You could also use ButtonBar eXtended.

Posted: 2009-07-28, 15:55 UTC
by Balderstrom
@Zoster,
Interesting, Thanks - I noticed TCMC before but kinda skipped over it, not realizing it allowed passing cm_'s directly to buttonBar "commands".

Note: TCMC.exe will also work as commands within a TC SubBar (ButtonBar), and/or a SubBar that is used as a menu -> [x] Show as a menu option, or MGPSoft's TCMenu.

Also Interesting, TCMC.exe is 2KB hehe.
Though, from that mentioned thread - looks like he packs it. It's not packed w/ UPX so not sure which one.

Posted: 2009-07-28, 16:42 UTC
by petermad
No, that option is already on. cm_SrcByDateTime still doesn't sort directories, try it for yourself.
Well, I did - and it works (as it has for the last 15 years!) :P