Page 1 of 1

Erase whole words when renaming files

Posted: 2010-07-26, 09:29 UTC
by maglet
In many programs (Word, InDesign) it is common that you can erase whole words by holdinig down Ctrl when pressing backspace.

I'd like to be able to do this in Total Commander when renaming files. It works in the F6 and F5 dialog when moving/copying files. But not with Shift +F6 rename function i.e. when you edit the file name in the file list.

Does this have something to do with WinXP? Because Ctrl + Backspace does not work there either when renaming files (F2)?

Posted: 2010-07-26, 17:03 UTC
by Balderstrom
If you are inclined to utilize AutoHotKey at all,
Then, this will do what you ask:
::
:: Preserves the files extension if it has one.
:: If you use a different key for rename-in-place you would need to add that.
:: E.G if you use, shift+F7 for rename-in-place:
:: +~F7:: renameFileTC := 0
::

Code: Select all

#ifWinActive, TTOTAL_CMD
{
	LButton Up:: renameFileTC := 0
	+~F6::	renameFileTC := 0
	~F2::	renameFileTC := 0

	^Backspace::
	{
		renameFileTC++
		ControlGetFocus, aControl, A
		if( aControl == "TInEdit1" )
		{
			Send, ^{Left}+^{Right}
			if( renameFileTC == 1 )
			{
				ClipBoard := ""
				Send, ^c
				ClipWait
				RegExMatch( ClipBoard, "(.*)\.([^.]+)$", tmpExt )
				extSz := strlen(tmpExt2) + 1
				Loop, %extSz%
					Send, {Left}
				Send, +^{Left}
			}
			Send, {Delete}
		}
	return
	}

}

Posted: 2010-07-27, 20:52 UTC
by maglet
:D

Well, I'm not ready to go AutoHotKey just yet. I hold my thumbs Ghisler will add this feature some day.

I can see how AutoHotKey might come in handy, better bookmark it just in case ...

Posted: 2010-07-28, 09:33 UTC
by ts4242
2maglet

With Shift +F6 rename function you can press <Ctrl+Shift+Left arrow> to select a word in each press then delete.

Posted: 2010-08-04, 07:32 UTC
by Motorocker
maglet
Support. It is standard function for text editors.