-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
shell: nushell integration scripts #4630
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
Fixes some path issues. There are still some other things to fix
Pass~[1] is a command line password storage utility. Possible queries are deduced from the file GPG hierarchy under ~/.password-store. [1]: https://www.passwordstore.org/
Not sure why it doesn't work in this context, but if those are not removed, the completion process doesn't substitute the selected value to '**'.
…typo fix typo shell/key-bindinds.nu → shell/key-bindings.nu
…alls shell/completion-external.nu: remove bad "return" calls
…y-closure shell/completion-external.nu: use command flag for optional closure
As @sim590 said to do this change when merging. imsys#2 (comment)
shell/completion-external.nu: add pass completion
…gnment shell/completion-external.nu: just some alignment
* remove preview, which is not useful for command history * maximum height 40% * separate all commandlines by \0 char and use --read0 with fzf
I'm not even sure how to use those and they miserably fail.
|
@imsys: just letting you know that I disabled some of the completion cases (in 5742835) as they don't work for me and produce bad output:
So, I decided it was best to just comment them out. I left the implementations untouched if anybody wants to fix them at some point. I frankly was not sure how to use those either, so I didn't bother fixing them. |
|
I'm going to put this in draft because I just realized something else is broken. |
|
You guys might be interested into that: https://git.sr.ht/~jochumdev/gists/tree/main/item/nu/show/README.md |
| export-env { | ||
| $env.FZF_TMUX_OPTS = $env.FZF_TMUX_OPTS? | default "--height 40%" | ||
| $env.FZF_CTRL_T_COMMAND = $env.FZF_CTRL_T_COMMAND? | default "fd --type file --hidden" | ||
| $env.FZF_CTRL_T_OPTS = $env.FZF_CTRL_T_OPTS? | default "--preview 'bat --color=always --style=full --line-range=:500 {}' " |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jochumdev are you suggesting to integrate this as the preview program for the FZF view? Like, for the CTRL-T binding, here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, now that I'm thinking about it, I don't know why we'd use bat or any other external program as default since there's a builtin command in nushell that does a good job just like bat: the command open... I think I'm going to change bat to open here.
As for the script you linked, I'm not sure about using it as a default for the same reason as bat. I think that best is built-in first for compatibility sake.
Please, tell me if I'm missing the point of the suggestion.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is true though that open doesn't actually give the same output. I thought for a second that it did something similar, but it doesn't (excuse my noobness).
I'm not sure anymore I want open as a default. I like the argument of "built-in is best", but at the same time, this is an opt-in script... And bat does a way better job.
So, may be we could consider your script after all!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So, based on your comment here, I guess that you're suggesting to merge show.nu as fzf-preview.nu may be under bin/ directory? Anyway, I'll stop trying to figure out, and just wait on your answer. 😄
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey :)
First: I integrated your work into my nushell, you did a wonderful job.
Second: I refactored my "show" script. For now I think the best is to link it somewhere as an alternative to the bat usage, I don't know how you wanna let people install your "nu" integration, yet.
Third:
I did some work based on yours, I added support for "sudo" , having no trigger at all and preview of pacman packages, are you interested in a follow up PR on your repo?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
New findings :)
Use open with https://git.sr.ht/~jochumdev/gists/blob/main/nu/show/hook.nu
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did some work based on yours, I added support for "sudo" , having no trigger at all and preview of pacman packages, are you interested in a follow up PR on your repo?
That's awesome. I also noticed today that it didn't work correctly with sudo. Please, make a PR and I'll pull your commits on this one!
New findings :)
Use
openwith https://git.sr.ht/~jochumdev/gists/blob/main/nu/show/hook.nu
The link is broken. 😕
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's awesome. I also noticed today that it didn't work correctly with sudo. Please, make a PR and I'll pull your commits on this one!
Coming.
The link is broken. 😕
Removed hook.nu it messes with open --raw ,if you still want it:
Please also revisit show it got major new features:
- Support for "--jump-to-line"
- Integrates a variant of https://junegunn.github.io/fzf/tips/ripgrep-integration/#wrap-up into it.
|
Hi, this is interesting. I don't use nushell and have no experience with it, so it will take me some time to get started on reviewing this. Also, to incorporate this to the project, we need to address a few more things:
There is ongoing work to add fish fuzzy completion in #4605. You might want to take a look at the discussion there. |
|
Hey @junegunn Many, many thanks for fzf, I use it a lot! For nushell there's a plugin https://github.com/idanarye/nu_plugin_skim which adds deep integration into the shell (structured data in -> structured data out). I'll switch to that for my use with nushell. Thank you again! |

alt_c,ctrl_randctrl_t**completionCloses: #4122