-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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?
Changes from 91 commits
5aa22d4
79eab96
64d5ace
6011574
785bc07
30d1d45
a4ef417
5236752
4b8fef0
3bd895c
15314f4
b2b25b2
e4ceecb
3e0d3a8
da97e61
20bb07c
c39e328
bde90bc
456cf2a
6289a28
77d0b56
d1a6120
1f66d6e
7ec4d98
95f636f
e9ac742
8c2183d
90d2331
ef66bd7
535ff16
581e2b3
5bee4c5
b3d751e
5ff54eb
40094b7
fc23c6e
f4f73a2
8c6c0e2
b0608cb
c834dd1
10bc522
7ab8d25
032bde7
5742835
55de1bf
4f10ad7
e3fa04b
2c9234c
a8aaf42
77f28e4
f624009
54aa577
bf9eb9e
c596a06
557e5e7
97529ab
03a14e1
828b782
a55fc6f
4012253
12aa334
0ad7787
969327b
1174f3d
58cce52
ed241f1
cea66b2
28d154b
3868e40
1761e10
f23d70f
df702d0
b2650de
5836bc6
3bf3bfc
5f68a8b
10787b8
2efe7b8
196a148
37c86f0
732c1e8
8d405a7
8963f38
17b194e
f3f904c
0ec52ca
452d42e
95a0ff5
691dfa3
305a650
adbd8e7
a56922c
8057be9
e127c4e
95416c8
0025d22
ddf7025
1901af7
3c1bfb6
b4e1992
6f1ed5a
4ec77b9
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -40,7 +40,7 @@ Highlights | |
| - **Portable** -- Distributed as a single binary for easy installation | ||
| - **Fast** -- Optimized to process millions of items instantly | ||
| - **Versatile** -- Fully customizable through an event-action binding mechanism | ||
| - **All-inclusive** -- Comes with integrations for Bash, Zsh, Fish, Vim, and Neovim | ||
| - **All-inclusive** -- Comes with integrations for Bash, Zsh, Fish, Nushell, Vim, and Neovim | ||
|
|
||
| Table of Contents | ||
| ----------------- | ||
|
|
@@ -81,6 +81,7 @@ Table of Contents | |
| * [Supported commands (bash)](#supported-commands-bash) | ||
| * [Custom fuzzy completion](#custom-fuzzy-completion) | ||
| * [Fuzzy completion for fish](#fuzzy-completion-for-fish) | ||
| * [Fuzzy completion for Nushell](#fuzzy-completion-for-nushell) | ||
| * [Vim plugin](#vim-plugin) | ||
| * [Advanced topics](#advanced-topics) | ||
| * [Customizing for different types of input](#customizing-for-different-types-of-input) | ||
|
|
@@ -210,10 +211,18 @@ Add the following line to your shell configuration file. | |
| # Set up fzf key bindings | ||
| fzf --fish | source | ||
| ``` | ||
| * Nushell — Nushell does not support piping into `source`, so the install | ||
| script generates a file in the autoload directory. If you didn't use the | ||
| install script, you can manually set it up: | ||
| ```nu | ||
| # Generate the integration script | ||
| mkdir ($nu.default-config-dir | path join "autoload") | ||
| fzf --nushell | save -f ($nu.default-config-dir | path join "autoload" "fzf.nu") | ||
|
junegunn marked this conversation as resolved.
|
||
| ``` | ||
|
|
||
| > [!NOTE] | ||
| > `--bash`, `--zsh`, and `--fish` options are only available in fzf 0.48.0 or | ||
| > later. If you have an older version of fzf, or want finer control, you can | ||
| > `--bash`, `--zsh`, `--fish`, and `--nushell` options are only available in | ||
| > recent versions of fzf. If you have an older version of fzf, or want finer control, you can | ||
| > source individual script files in the [/shell](/shell) directory. The | ||
| > location of the files may vary depending on the package manager you use. | ||
| > Please refer to the package documentation for more information. | ||
|
|
@@ -506,7 +515,7 @@ Key bindings for command-line | |
| ----------------------------- | ||
|
|
||
| By [setting up shell integration](#setting-up-shell-integration), you can use | ||
| the following key bindings in bash, zsh, and fish. | ||
| the following key bindings in bash, zsh, fish, and Nushell. | ||
|
|
||
| - `CTRL-T` - Paste the selected files and directories onto the command-line | ||
| - The list is generated using `--walker file,dir,follow,hidden` option | ||
|
|
@@ -574,7 +583,7 @@ More tips can be found on [the wiki page](https://github.com/junegunn/fzf/wiki/C | |
| Fuzzy completion | ||
| ---------------- | ||
|
|
||
| Shell integration also provides fuzzy completion for bash, zsh, and fish. | ||
| Shell integration also provides fuzzy completion for bash, zsh, fish, and Nushell. | ||
|
|
||
| ### Files and directories | ||
|
|
||
|
|
@@ -823,6 +832,23 @@ function _fzf_post_complete_foo | |
| end | ||
| ``` | ||
|
|
||
| ### Fuzzy completion for Nushell | ||
|
|
||
| Fuzzy completion in Nushell works via the | ||
| [external completer](https://www.nushell.sh/cookbook/external_completers.html) | ||
| mechanism. There are some differences compared to bash and zsh: | ||
|
|
||
| - On Nushell >= 0.103.0, the external completer is no longer called for | ||
| built-in commands (e.g. `cd`, `ls`). Fuzzy completion with `**<TAB>` only | ||
| works for external commands. | ||
| - Custom completion extensibility (e.g. `_fzf_complete_COMMAND` in bash/zsh) | ||
| is not available. Custom completions are defined via a `match` statement | ||
| in `completion.nu`. | ||
|
Comment on lines
+846
to
+848
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Would it be possible to implement this scheme? A hard-coded match statement feels quite limiting. It could easily turn into a "kitchen sink", with users continually requesting more commands to be added. For what it's worth, I'm on macOS and don't use tools like pacman or pass, so having them in the default list feels a bit off. I imagine this concern will only grow as more items get added over time. |
||
| - The following environment variables are supported: | ||
| `FZF_COMPLETION_TRIGGER`, `FZF_COMPLETION_OPTS`, | ||
| `FZF_COMPLETION_PATH_OPTS`, `FZF_COMPLETION_DIR_OPTS`, | ||
| `FZF_COMPLETION_DIR_COMMANDS`. | ||
|
|
||
| Vim plugin | ||
| ---------- | ||
|
|
||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.