Replace 1st argument on command line

Nov 7, 2015
11
0
I am slowly switching from Windows to Linux where I am using zsh. It is very easy to define a line-editing feature there so that I can replace the first argument of the preceding command with something different (ie I typed "dir \a\a.txt \b\.txt c\" and then want to change "dir" to "copy"). How can I achieve that in tcc? The nearest I have come so far is typing "copy <ctrl-1><ctrl-2><ctrl-3>". But that is rather cumbersome. Perhaps a ctrl-SOMETHING that copies the complete previous command line w/o its first argument.
 

Charles Dye

Super Moderator
Staff member
May 20, 2008
3,797
48
Albuquerque, NM
prospero.unm.edu
If the second command is not longer than the first, there's always good ol' F3. But I'm not aware a keystroke to do exactly what you're asking for. Shouldn't be difficult to add, though.
 
Nov 7, 2015
11
0
Well... that doesn't sound very promising. I am trying hard to keep the two shells as close as possible and so far I found solutions (or at least kludges) for almost everything. This issue is not such a big deal but it's disappointing that it can't be done easily. I will probably resort to writing a keyboard macro with a 3rd party app (another kludge).

EDIT: @charles: our posts crossed. I will look into your plugin but I will probably stick with a macro.