From 99a16e2c187b3df4a1957961b933aff07f7b848c Mon Sep 17 00:00:00 2001 From: Henry Bley-Vroman Date: Sat, 4 Apr 2020 13:43:22 -0400 Subject: [PATCH] feat(list): reinstate option to list abbreviations without expansions --- man/abbr.txt | 30 +++++++++++++++++++----------- man/man1/abbr.1 | 7 +++++++ zsh-abbr.zsh | 3 +++ 3 files changed, 29 insertions(+), 11 deletions(-) diff --git a/man/abbr.txt b/man/abbr.txt index f27e5546..18580f6f 100644 --- a/man/abbr.txt +++ b/man/abbr.txt @@ -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] @@ -92,6 +94,12 @@ 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. @@ -99,14 +107,14 @@ Options 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. @@ -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. @@ -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. @@ -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. @@ -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. diff --git a/man/man1/abbr.1 b/man/man1/abbr.1 index 93eb98d4..0723e283 100644 --- a/man/man1/abbr.1 +++ b/man/man1/abbr.1 @@ -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) @@ -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 diff --git a/zsh-abbr.zsh b/zsh-abbr.zsh index 82448eed..7678528f 100755 --- a/zsh-abbr.zsh +++ b/zsh-abbr.zsh @@ -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"