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
4,495
91
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.
 
Similar threads
Thread starter Title Forum Replies Date
Joe Caverly Documentation Replace internal command with LIBRARY command Support 0
I how to make TCC default/replace cmd.exe? Support 9
x13 TPIPE /REPLACE - Remove line (including EOL) Support 3
T @replace -- what is wrong here Support 2
R How to? Replace in Rename Support 9
C How to? @replace[a comma,_,filename] Support 5
MickeyF Can't get my TPIPE /replace to work Support 4
C @replace and @xreplace problems Support 5
C How to? Replace &'s in filenames / FixNames.dll Support 2
M I'm unable to use @replace[] with a % character in string2 Support 12
MikeBaas Strange prob with %@replace.. Support 4
vefatica Back-refs in TPIPE's /replace's replacement string? Support 2
Frank @replace works case sensitive Support 5
J @replace weirdness Support 1
vefatica TPIPE /replace? Support 3
Stefano Piccardi replace tcc process space? Support 8
vefatica @SUBST ... how replace character with a caret? Support 9
mdwyer @replace - global use in a text file Support 3
B Regex and Replace Support 6
B REPLACE is good news Support 0
J Problem with %var:find=replace% syntax Support 5
twaterloo FolderMonitor for the 1st time not working Support 5
D Keystroke to copy previous argument Support 3
D Can the argument to RETURN be a function expansion? Support 3
Fross TabComplete Argument Issue Support 1
jbanaszczyk @Full and unquoted argument Support 4
rps Fixed Using last argument variable ! Support 5
Jay Sage TCMD 14 Ignores Argument Support 6
A How to? Remove last argument on command line Support 4
D Help says @fileage accepts u argument Support 3
M Just an argument-passing "strangeness" that I didn't expect... Support 19
M A probably stupid question about .btm file argument parsing... Support 6

Similar threads