Erase whole words when renaming files

Here you can propose new features, make suggestions etc.

Moderators: Hacker, petermad, Stefan2, white

Post Reply
maglet
Junior Member
Junior Member
Posts: 9
Joined: 2010-05-01, 00:46 UTC

Erase whole words when renaming files

Post 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)?
User avatar
Balderstrom
Power Member
Power Member
Posts: 2148
Joined: 2005-10-11, 10:10 UTC

Post 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
	}

}
maglet
Junior Member
Junior Member
Posts: 9
Joined: 2010-05-01, 00:46 UTC

Post 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 ...
User avatar
ts4242
Power Member
Power Member
Posts: 2081
Joined: 2004-02-02, 20:08 UTC
Contact:

Post by *ts4242 »

2maglet

With Shift +F6 rename function you can press <Ctrl+Shift+Left arrow> to select a word in each press then delete.
User avatar
Motorocker
Member
Member
Posts: 105
Joined: 2006-07-19, 10:52 UTC
Location: Perm, Russia
Contact:

Post by *Motorocker »

maglet
Support. It is standard function for text editors.
Graphics Converter – images conversion
KillOK – Cease to press OK!
NSCopy – copy unreadable
Post Reply