Renaming files is part of my refactoring attempts to make my code better.
I can do this quickly by having F2 mapped to cm_RenameSingleFile, but then, all history of a file would be lost within a repository.
So I've set up Ctrl+F2 to use a user command:
Code: Select all
[em_gitrename]
button=c:\Program Files\TortoiseGit\bin\TortoiseGitProc.exe,16
cmd=c:\Program Files\TortoiseGit\bin\TortoiseGitProc.exe
param=/command:rename /path:"%P\%N"
My current workaround idea is to write a small tool called by a user command that detects whether the current folder is within a repository (check if in some folder going back to the root, there is a .git/.bzr/.svn folder), and if so, of which type, so I would simply use F2 and the logic would be depending on the location.
It would be even better though if there would be a plugin type where I could simply "overwrite" standard operations - e.g. for file renaming, act either with own code or call the original function. That would probably make it possible to do the above for more than one file at a time
Or is there some kind of hooking option already available that I'm simply missing?