zshで現在入力されているパラメータをどのように繰り返しますか?

zshで現在入力されているパラメータをどのように繰り返しますか?

時々、私たちはそれを使うときに少し異なる名前を入力する必要がありますmv/cp/convert。例えば、

convert IMG-long-number.jpg  IMG-long-number.png

IMG-long-number.pngを入力する前に、IMG-long-number.jpgをどのように繰り返して少し調整すればよいですか?

これは次のようになります。bashコンソールで現在入力されているパラメータをどのように繰り返すのですか?しかし、zsh / zleの場合。

ベストアンサー1

!#$<Tab>私のために動作します。一方:

$ echo a

入力!#$して押すとにTab展開されます。タブの完成には、次のコマンドを使用しようとすると追加のオプションも一覧表示されます。!#$a:

$ echo a !#$:
&  -- repeat substitution
A  -- absolute path resolving symbolic links
Q  -- strip quotes
a  -- absolute path
c  -- PATH search for command
e  -- leave only extension
g  -- globally apply s or &
h  -- head - strip trailing path element
l  -- lower case all words
q  -- quote to escape further substitutions
r  -- root - strip suffix
s  -- substitute string
t  -- tail - strip directories
u  -- upper case all words

おすすめ記事