Commit graph

5300 commits

Author SHA1 Message Date
Branch Vincent
7970ca55af
completions: add fish-lsp (#11017) 2025-01-08 11:25:36 -06:00
Klaus Hipp
4def0ac616
Revert "Fix typo in npm completions: isntall -> install" (#11014)
* Revert "Fix typo in npm completions: isntall -> install"

This reverts commit f4b01bb638.

* Add comments about typos in `npm` completions
2025-01-07 12:32:16 -06:00
Steve Walker
b574a5e4f6 fix python completion #10943 2025-01-07 23:30:27 +08:00
Klaus Hipp
ea4e4a4279
Fix completion typos for apt-build, htop and wget (#11016) 2025-01-06 19:39:47 -06:00
Johannes Altmanninger
704b911168 Back out "Bind ctrl-l to clear-screen again for now"
As of the parent commits this should no longer cause breakage.

This backs out commit 07dd088d76.
2025-01-06 06:24:13 +01:00
Johannes Altmanninger
109ef88831 Add menu and printscreen keys
These aren't typically used in the terminal but they are present on
many keyboards.

Also reorganize the named key constants a bit.  Between F500 and
ENCODE_DIRECT_BASE (F600) we have space for 256 named keys.
2025-01-06 05:43:22 +01:00
Lzu Tao
f9b79926f1 Add more convenient key bindings for VI mode
To make it more familiar to vi/vim users.

In all mode, ctrl-k is bind to kill-line.

In Vi visual mode:
* press v or i turn into normal or insert mode respectively.
* press I turn to insert mode and move the cursor to beginning of line.
* because fish doesn't have upcase/locase-selection, and most people reach for
  g-U rather than g-u, g-U binds to togglecase-selection temporarily.
2025-01-05 23:00:21 +08:00
Johannes Altmanninger
07dd088d76 Bind ctrl-l to clear-screen again for now
Testing has revealed some problems on BSD and Windows terminals and
the Linux Console, let's revert to the old implementation until these
are fixed.  Leaving the changelog entry for now since it shouldn't
take long.

See #11003
2025-01-05 08:20:53 +01:00
cornmander
d842a6560e
Add completions for Google Cloud commands. (#11005)
The `gcloud` and `gsutil` Google Cloud commands use argcomplete, so integrating them is easy with the `__fish_argcomplete_complete` function.
2025-01-04 19:45:05 -06:00
Lzu Tao
7eb254f2ba Add completion for gem-fetch 2025-01-04 21:26:03 +08:00
idealseal
2e12a2b6c4 feat(comp): Update completions for resolvectl 2025-01-04 20:42:31 +08:00
idealseal
a780e4da15 feat(comp): Update completion for md5sum 2025-01-04 20:39:33 +08:00
Thayne McCombs
33dd823f45 fix[completions]: Add set-timeout to bootctl 2025-01-04 20:15:53 +08:00
Johannes Altmanninger
870a8f77a0 completions/scp: replace version detection
Version detection seems unreliable (see
https://github.com/fish-shell/fish-shell/issues/10445#issuecomment-2566232705
) so let's test for the actual feature.  On modern versions,"scp -O"
means "Use  the legacy SCP protocol for file transfers instead",
so presence of this feature indicates we are good.
2025-01-03 12:57:00 +01:00
David Adam
670541eec8 fish_jj_prompt: don't error if jj not installed 2025-01-03 12:38:14 +08:00
Johannes Altmanninger
0debddc9e5 Add a simple fish_jj_prompt
jj is often colocated with Git so the Git prompt also works, but
jj is always in a detached HEAD state, which is atypical for Git.
The jj prompt improves things by showing the revision ID which is
usually more useful than the commit ID.

This prompt is mostly adapted from the defaults for "jj log -r @".

Showing conflicting/empty commits seems useful.
Also perhaps bookmarks and tags, not sure.

The main problem with this prompt is that due to --ignore-working-copy,
the information may be stale.  That will be rectified after every jj
command, so hopefully this doesn't cause issues.
2025-01-03 00:03:58 +01:00
Alexei Mikhailov
9b26fff278 completions/exercism: use generate script
Exercism ships with it's own completions and a generation script, so let's use
that one instead.
2025-01-02 21:57:17 +08:00
Klaus Hipp
2b46d97c68 Update code completions 2025-01-02 14:11:24 +08:00
Fabian Boehm
d5efef1cc5 __fish_complete_subcommand: Just complete -C for a given commandline
Fixes #10980.

This would, if a commandline was given, still revert to checking
the *real* commandline if it was empty.

Unfortunately, in those cases, it could have found a command and tried
to complete it.

If a commandline is given, that is what needs to be completed.

(note this means this is basically useless in completions that use it
like `sudo` and could just be replaced with `complete -C"$commandline"`)
2024-12-30 21:01:21 +01:00
Fabian Boehm
e715c3e3ff help: Add special error for $BROWSER/$fish_help_browser being wrong 2024-12-30 21:01:21 +01:00
Johannes Altmanninger
83b0294fc9 ctrl-l to scroll content instead of erasing screen
On ctrl-l we send `\e[2J` (Erase in Display).  Some terminals interpret
this to scroll the screen content instead of clearing it. This happens
on VTE-based terminals like gnome-terminal for example.

The traditional behavior of ctrl-l erasing the screen (but not the
rest of the scrollback) is weird because:

1. `ctrl-l` is the easiest and most portable way to push the prompt
   to the top (and repaint after glitches I guess). But it's also a
   destructive action, truncating scrollback. I use it for scrolling
   and am frequently surprised when my scroll back is missing
   information.
2. the amount of lines erased depends on the window size.
   It would be more intuitive to erase by prompts, or erase the text
   in the terminal selection.

Let's use scrolling behavior on all terminals.

The new command could also be named "push-to-scrollback", for
consistency with others. But if we anticipate a want to add other
scrollback-related commands, "scrollback-push" is better.

This causes tests/checks/tmux-history-search.fish to fail; that test
seems pretty broken; M-d (alt-d) is supposed to delete the current
search match but there is a rogue "echo" that is supposed to invalidate
the search match.  I'm not sure how that ever worked.

Also, pexepect doesn't seem to support cursor position reporting,
so work around that.

Ref: https://codeberg.org/dnkl/foot/wiki#how-do-i-make-ctrl-l-scroll-the-content-instead-of-erasing-it
as of wiki commit b57489e298f95d037fdf34da00ea60a5e8eafd6d

Closes #10934
2024-12-30 10:50:38 +01:00
Johannes Altmanninger
6043644f52 completions/status: add buildinfo 2024-12-30 10:50:01 +01:00
Ilya Grigoriev
b1064ac3a0
completions/tmux: add skeleton "Windows and Panes" bindings (#10854)
These are quite mechanical, but include all the commands (as of tmux
3.5a) in the "Windows and Panes" section of `man tmux`. For these
commands, I included the target-pane/session/client/window flags and the
-F formatstring flags (but not the less generic flags specific to
individual commands).

Nice completion is implemented for those flags where the helper
functions were already implemented previously.

After this, tmux pane<tab> will hopefully be useful.

A few TODOs mention low-hanging fruit for somebody who better
understands fish's `complete` command syntax (or a future me).

Another piece of low-hanging fruit would be completion for all the
target-window flags. This PR merely lists them.
2024-12-29 15:37:21 +01:00
EmilyGraceSeville7cf
1bda6043c8 feat(completion) support batsh command 2024-12-29 15:36:00 +01:00
EmilyGraceSeville7cf
d8d5913159 feat(completion): support folderify command 2024-12-29 15:35:25 +01:00
Benjamin Kellermann
2ac1523e54
add completion for btrbk (#10752)
* add completion for btrbk

completions for btrbk https://github.com/digint/btrbk/

* change indent + spaces
2024-12-29 15:33:29 +01:00
Dmitry Gerasimov
c473aa60a7 completions/dnf: Fix completions for DNF5 (#9862)
Since DNF5 there's no implicit \n in repoquery output. For DNF4 this change
leaves blank lines in the output, but they are ignored anyway.
2024-12-26 12:01:49 -08:00
phanium
94dfe1b053
Fix alt-e cursor position restore on Vim <= 8 (#10946) 2024-12-26 06:35:37 +01:00
Mahmoud Al-Qudsi
46072e0fd6 completions/llm: Add completions for all subcommands 2024-12-23 13:50:10 -06:00
Mahmoud Al-Qudsi
c09a9246a1 completions/llm: Fix broken completion 2024-12-23 13:47:19 -06:00
Johannes Altmanninger
5de6f4bb3d Provide old implementation of cancel-commandline as fallback
__fish_cancel_commandline was unused (even before) and has some issues
on multiline commandlines. Make it use the previously active logic.

Closes #10935
2024-12-23 14:34:59 +01:00
Johannes Altmanninger
7e5af914be Remove interactive-only completion hacks
I don't think these characters cause problems in filenames?
2024-12-23 08:40:02 +01:00
David Adam
541f8b47bf Revert "Add completions for dust"
This reverts commit 27c7578760.

dust generates its own completions (which are shipped in the wrong spot
in the Debian packages, but which are also more up-to-date).

Closes #10922.
2024-12-19 19:49:01 +08:00
metamuffin
9abec243a4
Completions for mksquashfs (#10909) 2024-12-18 10:36:30 -06:00
Ilya Grigoriev
7162822486 rclone.fish: assume a recent version if the version cannot be parsed
The version of rclone is set during compilation and could be any crazy string depending on the packager, whether it's a dev build, etc. If it cannot be parsed, let's assume a recent version.

Follows up on cc8fa0f7
2024-12-18 15:31:51 +01:00
Klaus Hipp
25534bf657 Add tex-fmt completions 2024-12-18 02:21:57 +08:00
Klaus Hipp
67fa71a94d
Update zed completions (#10907)
Add uninstall option.
2024-12-16 19:42:57 -06:00
Johannes Altmanninger
ac951427af Fix alt-l on multiline tokens
This would invoke test with extra arguments.
2024-12-16 06:33:47 +01:00
Fabian Boehm
cc8fa0f780 completions/rclone: Make version check more lenient
This has been observed to be "rclone 1.68.2" instead of "rclone
v1.68.2", missing the "v".
2024-12-14 11:20:29 +01:00
Fabian Boehm
99b5e6e0e7 completions/cargo: Complete packages to uninstall 2024-12-08 09:13:20 +01:00
Fabian Boehm
7c73c5fec0 Make fish installable
When built with the default "installable" feature, the data files (share/) are
included in the fish binary itself.

Run `fish --install` or `fish --install=noconfirm` (for
non-interactive use) to install fish's data files into ~/.local/share/fish/install

To figure out if the data files are out of date, we write the current version
to a file on install, and read it on start.

CMake disables the default features so nothing changes for that, but this allows installing via `cargo install`,
and even making a static binary that you can then just upload and have extract itself.

We set $__fish_help_dir to empty for installable builds, because we do not have
a way to generate html docs (because we need fish_indent for highlighting).
The man pages are found via $__fish_data_dir/man
2024-12-06 22:12:26 +01:00
Johannes Altmanninger
3ed031c149 Update Kakoune completions 2024-11-27 08:44:36 +01:00
Fabian Boehm
8dcde27e0b functions/history: Put back some checks for clear{,-session}
Mostly we pass on the options - otherwise they would be ignored.

For `clear`, we do need the full checks, because that will
prompt *before* running the builtin.

But this makes it easier to eventually move that logic into the builtin
2024-11-21 18:55:03 +01:00
Fabian Boehm
6fe192606a functions/history: Set variables in function-scope explicitly
```fish
set -g LESS foo

history search bar
```

changes the global $LESS and exports it.
2024-11-21 18:27:10 +01:00
Fabian Boehm
11f11e27a1 functions/history: Remove unnecessary code
These things are all handled in the builtin
2024-11-21 18:26:47 +01:00
Kid
31b15405e9
Add completion for path basename -E/--no-extension (#10863) 2024-11-20 15:06:53 -06:00
Fabian Boehm
7a667b4f6d Add basic completions for firejail
These are pretty basic, but get us roughly up to the level of the
official completions (that are also incomplete and offer disabled
options).

Fixes #10858
2024-11-18 16:16:07 +01:00
Unbelievable Mystery
262e2d5fe6
Update completions for: wine (#10789)
* feat(function): move cmd completion function to a separate file

* feat(completion): support wine cmd subcommand

* feat(completion): support wine control subcommand

* feat(completion): support wine eject subcommand

* feat(completion): support wine explorer subcommand

* feat(completion): support wine explorer subcommand for desktops

* feat(completion): support wine start subcommand

* feat(completion): support wine winemenubuilder subcommand

* feat(completion): support wine winepath subcommand

* fix(function): rename function for cmd argument completion

* feat(function): implement function to complete registry keys

* feat(completion): support wine regedit subcommand

* feat(function): add top-level key descriptions

* fix(completion): remove redundant comment

* feat(completion): support wine msiexec subcommand

* refactor(completion): group code into functions

* feat(completion): enhance subcommand descriptions
2024-11-17 14:58:21 -08:00
Unbelievable Mystery
93aa5a9376
Add completions for: guile, guild (#10792)
* feat(completion): support guile command

* feat(completion): support guild command

* feat(completion): support guild subcommand

* feat(completion): squeeze code
2024-11-17 14:08:19 -08:00
Next Alone
723e5a8417 completions(ollama): ollama need no files as i know (#10851)
Closes #10851.

Signed-off-by: Next Alone <12210746+NextAlone@users.noreply.github.com>
2024-11-17 10:05:42 -06:00