GithubHelp home page GithubHelp logo

gazorby / fish-abbreviation-tips Goto Github PK

View Code? Open in Web Editor NEW
281.0 281.0 7.0 163 KB

πŸ’‘ Help you remembering your abbreviations

License: MIT License

Shell 100.00%
abbreviation abbreviations abbreviations-tips fish fish-plugin fisher

fish-abbreviation-tips's Introduction

Hey! πŸ‘‹

I'm Matthieu. Good to see you. I'm a software engineer at @drinn and work on some open source projects, take a look! 🀞

Anurag's github stats

Python GraphQl React


Contact

I'm always happy to meet people, send me a message!

Linkedin Linkedin

fish-abbreviation-tips's People

Contributors

adipurnamk avatar benjamineskola avatar gazorby avatar jorgebucaran avatar kanhaiya38 avatar kidonng avatar matiasjrossi avatar soraxas avatar vladdoster avatar zhylmzr avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

fish-abbreviation-tips's Issues

Doesn't work at all for me

I don't know how to make it work, I type an expanded form of an abbreviation I have already added or I just add a new abbr and type its expanded form and I see no tips

I read the readme and it said "just install and use as normal"

https://asciinema.org/a/I2mNHkzCJDwONf11EtxOivMd9 (first time i use asciinema sorry, the second command should have a tip, I prove it afterwards)

Don't show tips when history is used

I usually use the history a lot. (E.g. the up arrow key or CTRLR from fzf)

But when using the history I don't want to see the tips.

Is that already possible and if so how?

[Feature] : Add support for aliases

Is your feature request related to a problem? Please describe.
Currently, the plugin only provide tips for fish abbreviations.

Abbreviation are meant for creating shortcuts for long commands, but some can be both long and frequently used, in this case an alias might be more convenient to avoid the abbreviation expanding to the full command all the time

Describe the solution you'd like
Support tips for aliases too

Describe alternatives you've considered
None at this time

`__abbr_tips_init` not running automatically

Question

Hello! First of all, thanks for this plugin for Fish, really appreciated. Helps when using lots of aliases.

I have a question about __abbr_tips_init because it seems that it's not running automatically when I modify my aliases:

I've added an abbreviation: abbr -a -U -- g 'git' and running git doesn't show abbr:

(...)
See 'git help git' for an overview of the system.

After running __abbr_tips_init, it's shown:

See 'git help git' for an overview of the system.

πŸ’‘ g => git

My Fish version:

fish, version 3.3.1

System version:

Manjaro 21 Ornara

neofetch 
β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ  β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ   ...
β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ  β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ   ----------------- 
β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ  β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ   OS: Manjaro Linux x86_64 
β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ  β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ   Host: ...
β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ            β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ   Kernel: 5.10.59-1-MANJARO 
β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ  β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ  β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ   Uptime: 2 days, 22 hours, 4 mins 
β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ  β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ  β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ   Packages: 1283 (pacman) 
β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ  β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ  β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ   Shell: fish 3.3.1 
β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ  β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ  β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ   Resolution: 1920x1080, 1920x1080 
β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ  β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ  β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ   DE: Plasma 5.22.4 
β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ  β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ  β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ   WM: KWin 
β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ  β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ  β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ   Theme: Breath2 2021 Dark [Plasma], Breath [GTK2/3] 
β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ  β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ  β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ   Icons: [Plasma], breath2 [GTK2/3] 
β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ  β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ  β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ   Terminal: vscode

Fisher plugins:

jorgebucaran/fisher
PatrickF1/fzf.fish
jethrokuan/z
gazorby/fish-abbreviation-tips
danhper/fish-ssh-agent

I haven't seen anything in documentation about running this above command manually and I am wondering if there's some problem on my end.

Lots of output when I use command line

Question

Whenever I type any work followed by a space I get this output:

abbr: Unknown option '-q'
/usr/local/Cellar/fish/3.0.2/share/fish/functions/abbr.fish (line 7): 
    argparse -n abbr $options -- $argv
    ^
in function 'abbr'
	called on line 93 of file ~/.config/fish/conf.d/abbr_tips.fish
	with parameter list '-q fisher add gazorby/fish-abbreviation-tips'

in function '__abbr_tips'
	called on standard input
	with parameter list 'fisher add gazorby/fish-abbreviation-tips'

in event handler: handler for generic event 'fish_postexec'


       abbr - manage fish abbreviations

   Synopsis
       abbr --add [SCOPE] WORD EXPANSION
       abbr --erase word
       abbr --rename [SCOPE] OLD_WORD NEW_WORD
       abbr --show
       abbr --list

abbr: Type 'help abbr' for related documentation

I have very few plugins installed
image

I have tried this with no abbr set and with no abbr set. No configuration can get this issue to not work.
I am new to fish so I am unsure how to debug.

$ fish -v
fish, version 3.0.2

Weird buggy behavior

Upon a fresh install with fisher, I get a strange behaviour:

~
❯ fisher install gazorby/fish-abbreviation-tips
fisher install version 4.3.0
Fetching https://codeload.github.com/gazorby/fish-abbreviation-tips/tar.gz/HEAD
Installing gazorby/fish-abbreviation-tips
           /Users/simon.mandlik/.config/fish/functions/__abbr_tips_bind_newline.fish
           /Users/simon.mandlik/.config/fish/functions/__abbr_tips_bind_space.fish
           /Users/simon.mandlik/.config/fish/functions/__abbr_tips_init.fish
           /Users/simon.mandlik/.config/fish/conf.d/abbr_tips.fish
Installed 1 plugin/s

~
❯


~
❯ git status
fatal: not a git repository (or any of the parent directories): .git

─────
Hint: ga => git

~
❯ git commit
fatal: not a git repository (or any of the parent directories): .git

─────
Hint: ga => git

~
❯ echo $__ABBR_TIPS_KEYS
g ga gaa gap gapa gau gb gbD gba gban gbd gbl gbs gbsb gbsg gbsr gbss gc gc! gca gca! gcam gcan! gcav gcav! gcb gcf gcfx gcl gclean gclean! gclean!! gcm gcn! gco gcod gcom gcount gcp gcpa gcpc gcv gd gdca gds gdsc gdto gdw gdwc gf gfa gfb gfbs gfbt gff gffs gfft gfh gfhs gfht gfm gfo gfp gfr gfrs gfrt gfs gfss gfst ggp! gignore gl glg glgg glgga gll glo glod glog glom gloo glr gm gmom gmt gp gp! gpo gpo! gpu gpv gpv! gr gra grb grba grbc grbd grbdi grbdia grbi grbm grbmi grbmia grbs grev grh grhh grhpa grm grmc grmv grrm grs grset grss grst grup grv gscam gsd gsh gsr gss gst gsta gstd gstl gstp gsts gsu gsur gsuri gsw gswc gts gtv gunignore gup gupa gupav gupv gwch a__cat a__fish_key_reader a__juliap a__rm a__vim

~
❯ echo $__ABBR_TIPS_VALUES
' git ' 'git add' ' 'git add --all' ' 'git apply' ' 'git add --patch' ' 'git add --update' ' 'git branch -vv' ' 'git branch -D' ' 'git branch -a -v' ' 'git branch -a -v --no-merged' ' 'git branch -d' ' 'git blame -b -w' ' 'git bisect' ' 'git bisect bad' ' 'git bisect good' ' 'git bisect reset' ' 'git bisect start' ' 'git commit -v' ' 'git commit -v --amend' ' 'git commit -v -a' ' 'git commit -v -a --amend' ' 'git commit -a -m' ' 'git commit -v -a --no-edit --amend' ' 'git commit -a -v --no-verify' ' 'git commit -a -v --no-verify --amend' ' 'git checkout -b' ' 'git config --list' ' 'git commit --fixup' ' 'git clone' ' 'git clean -di' ' 'git clean -dfx' ' 'git reset --hard; and git clean -dfx' ' 'git commit -m' ' 'git commit -v --no-edit --amend' ' 'git checkout' ' 'git checkout develop' ' 'git checkout (__git.default_branch)' ' 'git shortlog -sn' ' 'git cherry-pick' ' 'git cherry-pick --abort' ' 'git cherry-pick --continue' ' 'git commit -v --no-verify' ' 'git diff' ' 'git diff --cached' ' 'git diff --stat' ' 'git diff --stat --cached' ' 'git difftool' ' 'git diff --word-diff' ' 'git diff --word-diff --cached' ' 'git fetch' ' 'git fetch --all --prune' ' 'git flow bugfix' ' 'git flow bugfix start' ' 'git flow bugfix track' ' 'git flow feature' ' 'git flow feature start' ' 'git flow feature track' ' 'git flow hotfix' ' 'git flow hotfix start' ' 'git flow hotfix track' ' 'git fetch origin (__git.default_branch) --prune; and git merge FETCH_HEAD' ' 'git fetch origin' ' 'git flow publish' ' 'git flow release' ' 'git flow release start' ' 'git flow release track' ' 'git flow support' ' 'git flow support start' ' 'git flow support track' ' 'ggp --force-with-lease' ' 'git update-index --assume-unchanged' ' 'git pull' ' 'git log --stat' ' 'git log --graph' ' 'git log --graph --decorate --all' ' 'git pull origin' ' 'git log --oneline --decorate --color' ' 'git log --oneline --decorate --color develop..' ' 'git log --oneline --decorate --color --graph' ' 'git log --oneline --decorate --color (__git.default_branch)..' ' git\ log\ --pretty=format:\'\%C\(yellow\)\%h\ \%Cred\%ad\ \%Cblue\%an\%Cgreen\%d\ \%Creset\%s\'\ --date=short ' 'git pull --rebase' ' 'git merge' ' 'git merge origin/(__git.default_branch)' ' 'git mergetool --no-prompt' ' 'git push' ' 'git push --force-with-lease' ' 'git push origin' ' 'git push --force-with-lease origin' ' 'ggp --set-upstream' ' 'git push --no-verify' ' 'git push --no-verify --force-with-lease' ' 'git remote -vv' ' 'git remote add' ' 'git rebase' ' 'git rebase --abort' ' 'git rebase --continue' ' 'git rebase develop' ' 'git rebase develop --interactive' ' 'git rebase develop --interactive --autosquash' ' 'git rebase --interactive' ' 'git rebase (__git.default_branch)' ' 'git rebase (__git.default_branch) --interactive' ' 'git rebase (__git.default_branch) --interactive --autosquash' ' 'git rebase --skip' ' 'git revert' ' 'git reset' ' 'git reset --hard' ' 'git reset --patch' ' 'git rm' ' 'git rm --cached' ' 'git remote rename' ' 'git remote remove' ' 'git restore' ' 'git remote set-url' ' 'git restore --source' ' 'git restore --staged' ' 'git remote update' ' 'git remote -v' ' 'git commit -S -a -m' ' 'git svn dcommit' ' 'git show' ' 'git svn rebase' ' 'git status -s' ' 'git status' ' 'git stash' ' 'git stash drop' ' 'git stash list' ' 'git stash pop' ' 'git stash show --text' ' 'git submodule update' ' 'git submodule update --recursive' ' 'git submodule update --recursive --init' ' 'git switch' ' 'git switch --create' ' 'git tag -s' ' 'git tag' ' 'git update-index --no-assume-unchanged' ' 'git pull --rebase' ' 'git pull --rebase --autostash' ' 'git pull --rebase --autostash -v' ' 'git pull --rebase -v' ' 'git whatchanged -p --abbrev-commit --pretty=medium' ' bat ' /usr/local/Cellar/fish/3.3.1/bin/fish_key_reader ' 'julia --project=@.' ' trash ' nvim

The only relevant thing I have in my config.fish is `set -x ABBR_TIPS_PROMPT "...".

Error on alias -s

Describe the bug
fish-abbreviation-tips doesn't handle alias -s well (or any other alias flags) , prints out the following error but creates the alias:

❯ alias -s rmi="rm -i"
string match: Unknown option β€œ-s”

~/.config/fish/conf.d/abbr_tips.fish (line 47):
        if string match -q '*=*' "$command[2]"
           ^
in function '__abbr_tips' with arguments 'alias\ -s\ rmi=\"rm\ -i\"'
in event handler: handler for generic event β€œfish_postexec”

(Type 'help string' for related documentation)

To Reproduce
Run the following command alias -s rmi="rm -i"

Expected behavior
I'd expect not to see that error.

Screenshots
image

image

System (please complete the following information):

❯ fish --version
fish, version 3.1.2
❯ cat /etc/os-release
NAME="Arch Linux"
PRETTY_NAME="Arch Linux"
ID=arch
BUILD_ID=rolling
ANSI_COLOR="38;2;23;147;209"
HOME_URL="https://www.archlinux.org/"
DOCUMENTATION_URL="https://wiki.archlinux.org/"
SUPPORT_URL="https://bbs.archlinux.org/"
BUG_REPORT_URL="https://bugs.archlinux.org/"
LOGO=archlinux
❯ uname -r
5.9.14-arch1-1

Additional context
Add any other context about the problem here.

Regex matching

Question

If the default regex tries to match the first three words besides other things, why the following doesn't work for me?

~
❯ git pull origin
fatal: not a git repository (or any of the parent directories): .git

─────
Hint: gll => git pull origin

~
❯ git pull origin master
fatal: not a git repository (or any of the parent directories): .git

Considerations

I have changed nothing in config.fish, apart from

set -x ABBR_TIPS_PROMPT "\n─────\nHint: \e[1m{{ .abbr }}\e[0m => {{ .cmd }}"

Getting abbr: invalid option -- -q as installing with fisher

I'm getting this as I type n fish

gitabbr: invalid option -- -q                        4975ms ξ‚³ Tue 28/07 18:29
commandline: Unknown input function 'expand-abbr'~/.config/fish/functions/__abbr_tips_bind_space.fish (line 10):
    commandline -f 'expand-abbr'
    ^
in function β€œ__abbr_tips_bind_space”
        called on standard input
       commandlinecommandline - set or get the current command line buffer
        -

   Synopsis
       commandline [OPTIONS] [CMD]

commandline: Type β€œhelp commandline” for related documentation

Doesn't do anything on fresh install

Steps to reproduce on Macos Big Sur M1:

  1. Run fisher install gazorby/fish-abbreviation-tips
  2. Restart the terminal
  3. Run a command like npm run dev
  4. Expect to have a tip such as npm run dev -> nrd, but nothing happens

Is there something I am missing?

Fish version 3.2.0
Fisher version 4.3.0

Does not work for aliases defined inside fish scripts

Describe the bug

#29 for #27 made abbr -a y ls -l && ls -l show πŸ’‘ y => ls -l - thank you @gazorby!

It also DOES work for an alias (which is just a Fish function --wraps), as long as I type that alias on the prompt, for example this is great:

$ alias c="bat "
$ functions c
# Defined via `source`
function c --wraps='bat ' --description 'alias c=bat '
  bat  $argv

end

$ bat ~/.gitconfig
(...)
πŸ’‘ c => bat

What I'm struggling with is to get this to work for aliases defined inside a Fish script....

To Reproduce

Steps to reproduce the behavior:

$ functions --erase c
$ echo 'alias c="bat "' >repro.fish
$ source repro.fish
$ functions c
# Defined via `source`
function c --wraps='bat ' --description 'alias c=bat '
  bat  $argv

end

$ bat repro.fish
(...)
# Does *NOT* print πŸ’‘ c => bat

Expected behavior

πŸ’‘ c => bat

System (please complete the following information):

  • fish, version 3.6.0
  • Fedora 37 Workstation

Didn't show tips for plugin-git

Describe the bug
Didn't show tips for plugin-git

To Reproduce
Install these two plugin and run git add . ?

Expected behavior
Show ga =>> git add .

Screenshots
Screen Shot 2021-11-10 at 10 21 47 AM

System (please complete the following information):
fish, version 3.3.1
MacOS 12.0.1

Tips are shown even though abbreviation is used

Describe the bug

suggestions/tips are shown to use a certain abbreviation even though the abbrevations was used.

To Reproduce

Using the following abbreviations derived from Prezto git aliases for zsh:

abbr -a -U -- g git
abbr -a -U -- gCa git\ add\ \(git\ status\ \\\|\ sed\ -n\ \\\"s\\/\\\^.\\\*both\ \[a-z\]\\\*ed:\ \\\*\\/\\/p\\\"\)
abbr -a -U -- gCl 'git status | sed -n "s/^.*both [a-z]*ed: *//p"'
abbr -a -U -- gCo 'git checkout --ours --'
abbr -a -U -- gCt 'git checkout --theirs --'
abbr -a -U -- gR 'git remote'
abbr -a -U -- gRa 'git remote add'
abbr -a -U -- gRb git-hub-browse
abbr -a -U -- gRl 'git remote --verbose'
abbr -a -U -- gRm 'git remote rename'
abbr -a -U -- gRp 'git remote prune'
abbr -a -U -- gRs 'git remote show'
abbr -a -U -- gRu 'git remote update'
abbr -a -U -- gRx 'git remote rm'
abbr -a -U -- gS 'git submodule'
abbr -a -U -- gSI 'git submodule update --init --recursive'
abbr -a -U -- gSa 'git submodule add'
abbr -a -U -- gSf 'git submodule foreach'
abbr -a -U -- gSi 'git submodule init'
abbr -a -U -- gSl 'git submodule status'
abbr -a -U -- gSm git-submodule-move
abbr -a -U -- gSs 'git submodule sync'
abbr -a -U -- gSu 'git submodule foreach git pull origin master'
abbr -a -U -- gSx git-submodule-remove
abbr -a -U -- gaa 'git add -A'
abbr -a -U -- gb 'git branch'
abbr -a -U -- gbL 'git branch -av'
abbr -a -U -- gbM 'git branch -M'
abbr -a -U -- gbS 'git show-branch -a'
abbr -a -U -- gbX 'git branch -D'
abbr -a -U -- gbc 'git checkout -b'
abbr -a -U -- gbl 'git branch -v'
abbr -a -U -- gbm 'git branch -m'
abbr -a -U -- gbs 'git show-branch'
abbr -a -U -- gbx 'git branch -d'
abbr -a -U -- gc 'git commit --verbose'
abbr -a -U -- gcF 'git commit --verbose --amend'
abbr -a -U -- gcO 'git checkout --patch'
abbr -a -U -- gcP 'git cherry-pick --no-commit'
abbr -a -U -- gcR 'git reset HEAD^'
abbr -a -U -- gca 'git commit --verbose --all'
abbr -a -U -- gcf 'git commit --amend --reuse-message HEAD'
abbr -a -U -- gcl git-commit-lost
abbr -a -U -- gcm 'git commit --message'
abbr -a -U -- gco 'git checkout'
abbr -a -U -- gcp 'git cherry-pick --ff'
abbr -a -U -- gcr 'git revert'
abbr -a -U -- gcs 'git show'
abbr -a -U -- gd 'git ls-files'
abbr -a -U -- gdc 'git ls-files --cached'
abbr -a -U -- gdi 'git status --porcelain --short --ignored | sed -n "s/^!! //p"'
abbr -a -U -- gdk 'git ls-files --killed'
abbr -a -U -- gdm 'git ls-files --modified'
abbr -a -U -- gdu 'git ls-files --other --exclude-standard'
abbr -a -U -- gdx 'git ls-files --deleted'
abbr -a -U -- gf 'git fetch'
abbr -a -U -- gfc 'git clone'
abbr -a -U -- gfm 'git pull'
abbr -a -U -- gfr 'git pull --rebase'
abbr -a -U -- gg 'git grep'
abbr -a -U -- ggL 'git grep --files-without-matches'
abbr -a -U -- ggi 'git grep --ignore-case'
abbr -a -U -- ggl 'git grep --files-with-matches'
abbr -a -U -- ggv 'git grep --invert-match'
abbr -a -U -- ggw 'git grep --word-regexp'
abbr -a -U -- giA 'git add --patch'
abbr -a -U -- giD 'git diff --no-ext-diff --cached --word-diff'
abbr -a -U -- giR 'git reset --patch'
abbr -a -U -- giX 'git rm -rf --cached'
abbr -a -U -- gia 'git add'
abbr -a -U -- gid 'git diff --no-ext-diff --cached'
abbr -a -U -- gir 'git reset'
abbr -a -U -- giu 'git add --update'
abbr -a -U -- gix 'git rm -r --cached'
abbr -a -U -- gl 'git log --topo-order --pretty=format:"%C(bold)Commit:%C(reset) %C(green)%H%C(red)%d%n%C(bold)Author:%C(reset) %C(cyan)%an <%ae>%n%C(bold)Date:%C(reset) %C(blue)%ai (%ar)%C(reset)%n%+B"'
abbr -a -U -- glb 'git log --topo-order --pretty=format:"%C(green)%h%C(reset) %s%n%C(blue)(%ar by %an)%C(red)%d%C(reset)%n"'
abbr -a -U -- glc 'git shortlog --summary --numbered'
abbr -a -U -- gld 'git log --topo-order --stat --patch --full-diff --pretty=format:"%C(bold)Commit:%C(reset) %C(green)%H%C(red)%d%n%C(bold)Author:%C(reset) %C(cyan)%an <%ae>%n%C(bold)Date:%C(reset) %C(blue)%ai (%ar)%C(reset)%n%+B"'
abbr -a -U -- glg 'git log --topo-order --all --graph --pretty=format:"%C(green)%h%C(reset) %s%C(red)%d%C(reset)%n"'
abbr -a -U -- glo 'git log --topo-order --pretty=format:"%C(green)%h%C(reset) %s%C(red)%d%C(reset)%n"'
abbr -a -U -- gls 'git log --topo-order --stat --pretty=format:"%C(bold)Commit:%C(reset) %C(green)%H%C(red)%d%n%C(bold)Author:%C(reset) %C(cyan)%an <%ae>%n%C(bold)Date:%C(reset) %C(blue)%ai (%ar)%C(reset)%n%+B"'
abbr -a -U -- gm 'git merge'
abbr -a -U -- gmC 'git merge --no-commit'
abbr -a -U -- gmF 'git merge --no-ff'
abbr -a -U -- gma 'git merge --abort'
abbr -a -U -- gmc 'git merge --continue'
abbr -a -U -- gmt 'git mergetool'
abbr -a -U -- gp 'git push'
abbr -a -U -- gpA 'git push --all && git push --tags'
abbr -a -U -- gpa 'git push --all'
abbr -a -U -- gpf 'git push --force'
abbr -a -U -- gpt 'git push --tags'
abbr -a -U -- gr 'git rebase'
abbr -a -U -- gra 'git rebase --abort'
abbr -a -U -- grc 'git rebase --continue'
abbr -a -U -- gri 'git rebase --interactive'
abbr -a -U -- grs 'git rebase --skip'
abbr -a -U -- gs 'git stash'
abbr -a -U -- gsL git-stash-dropped
abbr -a -U -- gsS 'git stash save --patch --no-keep-index'
abbr -a -U -- gsX git-stash-clear-interactive
abbr -a -U -- gsa 'git stash apply'
abbr -a -U -- gsd 'git stash show --patch --stat'
abbr -a -U -- gsl 'git stash list'
abbr -a -U -- gsp 'git stash pop'
abbr -a -U -- gsr git-stash-recover
abbr -a -U -- gss 'git stash save --include-untracked'
abbr -a -U -- gsw 'git stash save --include-untracked --keep-index'
abbr -a -U -- gsx 'git stash drop'
abbr -a -U -- gwC 'git clean -f'
abbr -a -U -- gwD 'git diff --no-ext-diff --word-diff'
abbr -a -U -- gwR 'git reset --hard'
abbr -a -U -- gwS 'git status --ignore-submodules=all'
abbr -a -U -- gwX 'git rm -rf'
abbr -a -U -- gwc 'git clean -n'
abbr -a -U -- gwd 'git diff --no-ext-diff'
abbr -a -U -- gwr 'git reset --soft'
abbr -a -U -- gws 'git status --ignore-submodules=all --short'
abbr -a -U -- gwx 'git rm -r'

When acting uppon a tip

  1. when executing git status --ignore-submodules=all --short it shows the suggestion to use gws sofar so good.
  2. when executing gws it expands to the above. When pressing enter it still suggests to use gws even though I did use that abbreviation.

When using an abbreviation straight away

  1. when executing glg
  2. tip is shown to use glg instead of the expanded version

Expected behavior
When using an abbreviation, don't re-suggest to use the abbreviation.

Screenshots
image

System (please complete the following information):
fish, version 3.1.2
image

Problems with install

Describe the bug
When I run fisher add Gazorby/abbr-tips I get the following error:

linking ~/.config/fish/conf.d/abbr_tips.fish
test: Missing argument at index 2

~/.config/fish/conf.d/abbr_tips.fish (line 65): 
   and ! test $_abbr_tips_is_spawned = 1
       ^
from sourcing file ~/.config/fish/conf.d/abbr_tips.fish
	called on line 294 of file /usr/share/fish/config.fish
from sourcing file /usr/share/fish/config.fish
	called during startup

(Type 'help test' for related documentation)

Plugin is not working after that too.

System (please complete the following information):

  • fish version 3.1.0
  • Distribution NAME="openSUSE Tumbleweed" # VERSION="20190310"

print abbr list

Is your feature request related to a problem? Please describe.
I know I have set an abbreviation but id like to print the list of abbr before I attempt to type a long command

Describe the solution you'd like
something like fzf to print my abbrs so that I can search through them I added a feature request to fzf.fish plugin but it was deemed too difficult to support so maybe this project would like to help?

Describe alternatives you've considered
I currently have an abbr named gabb (get abbr) that gets replaced by this
bat .config/fish/conf.d/abbreviations.fish | rg abbr | fzf

so print my abbreviations, grep for abbr and pipe to fzf

Additional context
We dont have to use bat or ripgrep the normal version work just fine as well

Only works for abbr but not for alias & function?

Describe the bug
It seems to this only works for abbr, but not for alias & function? Or I'm too dumb...

To Reproduce

So it works for me for e.g. abbr -a x lsd -l, when I type lsd -l it suggests πŸ’‘ x => lsd -l.

Even for abbr -a y ls -l it doesn't seem to work and ls -l won't show y => lsd -l,

but more importantly e.g. for my https://github.com/vorburger/vorburger-dotfiles-bin-etc/blob/main/dotfiles/fish/conf.d/ssh.fish, if I do ssh localhost it doesn't show the πŸ’‘ hint,

nor for any of my l* in https://github.com/vorburger/vorburger-dotfiles-bin-etc/blob/main/dotfiles/fish/conf.d/alias.fish

System (please complete the following information):

  • fish version = 3.5.1
  • Distribution cat /etc/os-release = Fedora 37

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.