Skip to content

Commit

Permalink
feat(list): reinstate option to list abbreviations without expansions
Browse files Browse the repository at this point in the history
  • Loading branch information
olets committed Apr 5, 2020
1 parent ababcfd commit 99a16e2
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 11 deletions.
30 changes: 19 additions & 11 deletions man/abbr.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,11 @@ SYNOPSIS

abbr --import-git-aliases [scope]

abbr --list

abbr --list-abbreviations | -l

abbr (--list-commands | -L | -s)
abbr --list-commands | -L | -s

abbr (--rename | -R) [scope] <old_abbreviation> <new_abbreviation>

Expand Down Expand Up @@ -92,21 +94,27 @@ Options
fixed with "g", expansions are prefixed with "git ".


o abbr --list

Lists the available abbreviations without their expansions.
Equivalent to fish's `abbr --list`.


o --list-abbreviations or -l

Lists all abbreviations.


o --list-commands or -L (or -s as in fish)

Lists all abbreviations as commands suitable for export and
Lists all abbreviations as commands suitable for export and
import.


o --rename old_abbreviation new_abbreviation or -R old_abbrevia-
o --rename old_abbreviation new_abbreviation or -R old_abbrevia-
tion new_abbreviation

Renames an abbreviation, from old_abbreviation to new_abbrevia-
Renames an abbreviation, from old_abbreviation to new_abbrevia-
tion.


Expand All @@ -124,7 +132,7 @@ Options

o --user or -U

Abbreviations available to all current and future ses-
Abbreviations available to all current and future ses-
sions.


Expand All @@ -134,15 +142,15 @@ Options

o --global or -g

Abbreviation will expand anywhere on a line, rather than
Abbreviation will expand anywhere on a line, rather than
only in command (first word) position.


All except for --clear-session, --expand, --export-aliases, --list-
All except for --clear-session, --expand, --export-aliases, --list-
abbreviations, and --list-commands can be tried without making changes:


o --dry-run Show whats the result of the command would be.
o --dry-run Show whats the result of the command would be.


See INTERNALS for more information.
Expand All @@ -151,7 +159,7 @@ Options
EXAMPLES
abbr gco="git checkout"

"gco" will be expanded as "git checkout" when it is the first
"gco" will be expanded as "git checkout" when it is the first
word in the command, in all open and future sessions.


Expand All @@ -169,9 +177,9 @@ EXAMPLES

abbr -e -S -g gco;

Erase the global session abbreviation "gco". Note that because
Erase the global session abbreviation "gco". Note that because
expansion is triggered by [SPACE] and [ENTER], the semicolon (;)
is necessary to prevent expansion when operating on global
is necessary to prevent expansion when operating on global
abbreviations.


Expand Down
7 changes: 7 additions & 0 deletions man/man1/abbr.1
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ zsh\-abbr \- manage zsh abbreviations

\fBabbr \-\-import\-git\-aliases\fR [\fIscope\fR]

\fBabbr \-\-list\fR

\fBabbr \-\-list\-abbreviations\fR | \fB\-l\fR

\fBabbr\fR (\fB\-\-list\-commands\fR | \fB\-L\fR | \fB\-s\fR)
Expand Down Expand Up @@ -79,6 +81,11 @@ Adds abbreviations exported from fish.

Adds abbreviations for all git aliases. Abbreviations are prefixed with "g", expansions are prefixed with "git ".

.IP \(bu
\fBabbr \-\-list\fR

Lists the available abbreviations without their expansions. Equivalent to fish's `abbr --list`.

.IP \(bu
\fB\-\-list\-abbreviations\fR or \fB\-l\fR

Expand Down
3 changes: 3 additions & 0 deletions zsh-abbr.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -635,6 +635,9 @@ _zsh_abbr() {
"--import-git-aliases")
_zsh_abbr:util_set_once "action" "import_git_aliases"
;;
"--list")
_zsh_abbr:util_set_once "action" "list"
;;
"--list-abbreviations"|\
"-l")
_zsh_abbr:util_set_once "action" "list_abbreviations"
Expand Down

0 comments on commit 99a16e2

Please sign in to comment.