The missing abilities of !
for fish. For example the !!
will get the previous command, the !$
will get the last argument of previous command.
The reference manual: https://www.gnu.org/savannah-checkouts/gnu/bash/manual/bash.html#Event-Designators
This plugin has fully implement the reference abilities.
Abbreviation | Description |
---|---|
!! |
refer to the previous command |
!n |
refer to the last n command in history |
!-n |
refer to the fist n command in history |
!string |
refer to the most recent command preceding the current position in the history list start with string |
!?string? |
refer to the most recent command preceding the current position in the history list containing string |
!# |
The entire command line typed so far |
Abbreviation | Description |
---|---|
[:]^ |
The first argument, that is word 1 |
[:]$ |
the last argument |
[:]* |
All of the owrds, except the 0th, equals to 1-$ |
[:]- |
equals to 0- |
[:]% |
The first word matched by the most recent ?string? search |
:0 |
The 0th word, equals to command word |
:n |
The nth word |
:x-y |
A range of words |
:-y |
equals to 0-y |
:x- |
Abbreviates x-$ , but omits the last word |
:x* |
Abbreviates x-$ |
:s^string1^string2^ |
Substitute string2 for the first occurrence of string1 in the event line |
Abbreviation | Description |
---|---|
!^ |
equals to !!^ |
!$ |
equals to !!$ |
!* |
equals to !!* |
!% |
equals to !!% |
^string1^string2 |
equals to !!:s^string1^string2^ |
Install using Fisher(or other plugin manager):
fisher install tenfyzhong/fish-bang