Commit Graph

5225 Commits

Author SHA1 Message Date
Johannes Altmanninger
dea7841611 Fix Vi replace mode regression not being able to append to command line
Regressed in d51f66964 (Vi mode: avoid placing cursor beyond last
character, 2024-02-14).
2024-10-26 08:21:12 +02:00
Johannes Altmanninger
c2cde317f2 Remove stale FISH_UNIT_TESTS_RUNNING workaround
This exists to make sure our assertions pass independent of the
terminal but now we unconditionally print __fish_cursor_xterm.
2024-10-26 08:21:12 +02:00
Johannes Altmanninger
ae7b401029 completions/set: show innermost scope in variable description
Some checks are pending
make test / ubuntu (push) Waiting to run
make test / ubuntu-32bit-static-pcre2 (push) Waiting to run
make test / ubuntu-asan (push) Waiting to run
make test / macos (push) Waiting to run
Rust checks / rustfmt (push) Waiting to run
Rust checks / clippy (push) Waiting to run
A side effect of cd9e50c2c (completions/set: Complete variables of all scopes
when setting, 2024-10-03) is that

    HOME=$(mktemp -d) fish
    fish_config choose ayu\ Light
    set -S fish_color_

gives only completions that have the "Universal variable" description even
though most colors are also defined in the global scope which usually takes
precedence.

Fix this by reordering the completions. (The last-added completion is shown
first which is very surprising, we should change that).

This is not perfect; if the user has already specified `-U`, then we should
probably not show description of the global version.  But that's still
worth the trade that this commit makes.  Finally, the description could show
something like "Defined in universal and global scope" etc.
2024-10-20 07:55:04 +02:00
Rikuki IX
85801b443a
feat(completion): add lsb_release completion (#10795) 2024-10-19 13:06:06 -05:00
Jason Nader
6082c3f77a
completions/diff: allow file completion for --unified (#10796)
* completions/diff: allow file completion for --unified

* Update diff.fish

* Update diff.fish
2024-10-19 16:58:29 +02:00
Fabian Boehm
81ff6db62d default color scheme: Make commands "normal" color
Some checks failed
Rust checks / rustfmt (push) Has been cancelled
Rust checks / clippy (push) Has been cancelled
make test / ubuntu (push) Has been cancelled
make test / ubuntu-32bit-static-pcre2 (push) Has been cancelled
make test / ubuntu-asan (push) Has been cancelled
make test / macos (push) Has been cancelled
This makes the default colorscheme less colorful for two reasons:

1. It makes it a little less "angry fruit salad"
2. Some terminals (like Microsoft's Windows Terminal) have a terrible
blue default that contrasts badly against a black background

The alternative is to make *parameters* "normal" and give commands the
current parameter color (cyan). But I've seen cyan be quite blue and
quite green depending on the terminal, so I don't want to rely on it.
2024-10-15 21:21:30 +02:00
Fabian Boehm
ebf19c22fd fish_config: Find fish via fish-path 2024-10-15 13:09:02 +02:00
Mahmoud Al-Qudsi
8447c32d65 __fish_indent: Cache fish_indent location
Some checks are pending
make test / ubuntu (push) Waiting to run
make test / ubuntu-32bit-static-pcre2 (push) Waiting to run
make test / ubuntu-asan (push) Waiting to run
make test / macos (push) Waiting to run
Rust checks / rustfmt (push) Waiting to run
Rust checks / clippy (push) Waiting to run
2024-10-14 19:01:41 -05:00
exploide
7bb6ce5156 completions: added arping 2024-10-14 15:34:11 -07:00
EmilyGraceSeville7cf
1148b790bb
feat(completion): support winetricks command 2024-10-14 15:11:45 -07:00
exploide
2f2b4c8e99 completions: updated hashcat completions
Some checks are pending
make test / ubuntu (push) Waiting to run
make test / ubuntu-32bit-static-pcre2 (push) Waiting to run
make test / ubuntu-asan (push) Waiting to run
make test / macos (push) Waiting to run
Rust checks / clippy (push) Waiting to run
Rust checks / rustfmt (push) Waiting to run
2024-10-14 12:12:07 -07:00
Johannes Altmanninger
6af96a81a8 Default bindings for token movement commands
Some checks are pending
make test / ubuntu (push) Waiting to run
make test / ubuntu-32bit-static-pcre2 (push) Waiting to run
make test / ubuntu-asan (push) Waiting to run
make test / macos (push) Waiting to run
Rust checks / rustfmt (push) Waiting to run
Rust checks / clippy (push) Waiting to run
There is no natural default binding for token movements. Add the
alt-{left,right,backspace,delete}, breaking some existing behavior.

For example, backward-delete-word is no longer bound to alt-backspace but
only to ctrl-backspace.  Unfortunately some terminals (particularly tmux)
don't support distinguishing ctrl-backspace from ctrl-h yet, so the loss
of alt-backspace may be tragic.

---

I guess we could also add:

    bind alt-B backward-token
    bind alt-F forward-token
    bind ctrl-W backward-kill-token
    bind alt-D kill-token

Those might be intercepted by the terminal on Linux, but I don't know where
that happens.

Tested on foot, kitty, alacritty, xterm, tmux, konsole and gnome-terminal.

Closes #10766
2024-10-13 14:53:45 +02:00
Johannes Altmanninger
edaf011ab1 Try to use the fish_indent that corresponds to the fish binary
Some checks failed
Rust checks / clippy (push) Has been cancelled
make test / ubuntu (push) Has been cancelled
make test / ubuntu-32bit-static-pcre2 (push) Has been cancelled
make test / ubuntu-asan (push) Has been cancelled
make test / macos (push) Has been cancelled
Rust checks / rustfmt (push) Has been cancelled
Users may install two versions of fish and configure their terminal to run
the one that is second in $PATH.  This is not really what I'd do but it
seems reasonable.  We should not need $PATH for this.

Fixes #10770
2024-10-10 05:18:35 +02:00
Lucas Garron
a7abd83c57 Typo fix: documentaiton → documentation
Closes #10767
2024-10-09 12:36:58 +02:00
EmilyGraceSeville7cf
cd3da62d24 fix(completion): unescape strings for __fish_complete_list 2024-10-05 23:32:59 +02:00
Fabian Boehm
e4c7a522ff webconfig: Add missing highlighting vars
This would otherwise not set these variables.

Tbh I would like if this wasn't hardcoded like that.
2024-10-05 16:30:58 +02:00
Wolfgang Müller
38300a818e completions/portage: Follow symbolic links in repos.conf
Some checks are pending
make test / ubuntu (push) Waiting to run
make test / ubuntu-32bit-static-pcre2 (push) Waiting to run
make test / ubuntu-asan (push) Waiting to run
make test / macos (push) Waiting to run
Rust checks / rustfmt (push) Waiting to run
Rust checks / clippy (push) Waiting to run
Repository configuration files in the repos.conf/ directory may also be symbolic
links, so make sure to follow those.
2024-10-04 10:23:58 +02:00
Fabian Boehm
cd9e50c2cc completions/set: Complete variables of all scopes when setting
Some checks are pending
make test / ubuntu (push) Waiting to run
make test / ubuntu-32bit-static-pcre2 (push) Waiting to run
make test / ubuntu-asan (push) Waiting to run
make test / macos (push) Waiting to run
Rust checks / rustfmt (push) Waiting to run
Rust checks / clippy (push) Waiting to run
This was overly smart and tried to not show you e.g. global variables
unless you were setting without scope or explicitly global.

That is annoying when you do

`set -g fish_col<TAB>`

and don't get colors because they're universal, but you could
overwrite them.

We *could* elide e.g. local variables if we're setting a global, but I
can see someone wanting to set a universal variable on basis of a
global ("save this"), so I would rather not try to find the very
specific cases where this works.
2024-10-03 11:46:17 +02:00
Fabian Boehm
0fea1dae8c __fish_print_help: Make formatting more man-like
1. Leave the indentation
2. Leave the "NAME" header - without the first line would be
unindented
3. Leave the "SYNOPSIS" header

We use $MANPAGER here, so it should be formatted like a manpage.

The alternative is to write special docs for this use-case, which
would be shorter and point towards the full man page.

Fixes #10625
2024-10-03 11:29:24 +02:00
Nikita Bobko
c253aa7a8c fish_vi_key_bindings: add bindings for semicolon and comma in visual mode
They are already presented in normal mode, and I presume were forgotten to be
added in visual mode

I don't add it to ./CHANGELOG.rst because it's a minor change that can be
considered as a bug fix
2024-10-03 09:42:59 +02:00
Peter Ammon
c227233571
fish_apropos: use realpath instead of readlink
readlink -f is not supported on macOS Big Sur (from 2020).
2024-09-29 18:13:36 -07:00
Johannes Altmanninger
2e9de57fd7 Document ctrl-backspace and bind ctrl-delete as well
This has a slightly different behavior than what the CUA user expects:
it fails to eat up trailing spaces.  We should probably fix this.
2024-09-23 14:52:50 +02:00
Johannes Altmanninger
904649c5c5 Bind ctrl-backspace to backward-kill-word
Closes #10741
2024-09-23 14:32:43 +02:00
EmilyGraceSeville7cf
0277fe3ca9 feat(completion): add test-spice support 2024-09-17 19:44:09 +02:00
EmilyGraceSeville7cf
98de7ea14a feat(completion): add validate-spice support 2024-09-17 19:44:09 +02:00
EmilyGraceSeville7cf
63e7608be4 feat(completion): add cascadia completion 2024-09-17 19:43:31 +02:00
mattmc3
9eee1b4499 fish_indent: Cleanup all *.fish files not in tests 2024-09-17 19:11:42 +02:00
Rebecca Turner
a6c8cd6e85 Fix man completions on macOS with symlinked manpath
When `manpath` prints a symlink to a directory, `/usr/libexec/makewhatis`
ignores the entire directory:

```
$ /usr/libexec/makewhatis -o /tmp/whatis \
    (/usr/bin/manpath | string split :)
makewhatis: /Users/wiggles/.nix-profile/share/man: Not a directory
```

This means that the built-in `man` completions will not index any commands in
these directories.

If we pass the directories to `readlink -f` first, `makewhatis` correctly
indexes the `man` pages.

```
$ /usr/libexec/makewhatis -o /tmp/whatis \
    (/usr/bin/manpath | string split : | xargs readlink -f)
```
2024-09-14 13:38:33 -07:00
Kerim
bc55945072 improved vi keybind 2024-09-14 13:33:21 -07:00
Johannes Altmanninger
5b04f221a3 __fish_anypager: remove bat from default choice
As pointed out in
b83f3b0e98 (commitcomment-146189480)
bat is not actually useful. Also its (monochrome) output is unreadable on
my system.
2024-09-14 07:21:56 +02:00
Theodor Tonum
5344576dc6 fix: pacman quiet typo 2024-09-13 09:59:56 +02:00
Abel Chalier
65ab9e7bfc clearer wording on test.fish completions 2024-09-05 17:33:24 +02:00
may
79a9c0e0f2
add completions for git diff --color-moved and --color-moved-ws (#10698) 2024-09-03 18:00:17 -05:00
Fabian Boehm
983746a697 fish_vi_cursor: Remove terminal checks
We keep having to extend these with new terminals, and I can no longer
find a terminal that fails this.

Even emacs' ansi-term can now at least reliably ignore the sequence.
2024-08-30 21:28:15 +02:00
Klaus Hipp
1020d830e5 Add delta completions 2024-08-30 21:02:03 +02:00
exploide
cf6391b8d3 completions: improved xxd completions
- the __fish_seen_any_argument function did not work
- the xxd_exclusive_args specification was not correct
- longer old-style options were missing
- technically short options are also old-style options in xxd
- some options were missing
2024-08-30 20:34:04 +02:00
Nihaal Sangha
5f4bc28008 Add xcodes completions 2024-08-30 20:33:01 +02:00
Nihaal Sangha
02da9fa845 Add warp-cli completions 2024-08-30 20:32:40 +02:00
Nihaal Sangha
695c7a0071 Add OpenTofu completions
This is based on the existing Terraform completions with minimal changes.
2024-08-30 20:32:18 +02:00
EmilyGraceSeville7cf
74a91afa38 feat: add jv completion 2024-08-30 20:28:23 +02:00
Nadir Fejzic
28a5bac560 fix: add ghostty to terminals that support vi cursors 2024-08-26 20:18:59 +02:00
EmilyGraceSeville7cf
0954ec2596
feat: add yajsv completion 2024-08-24 16:30:52 -07:00
Dezhi Wu
04a4e5c4e7 Add completions for jj
Jujutsu (jj) is a powerful version control system for software projects.

More information can be found at https://github.com/martinvonz/jj
2024-08-24 15:26:18 -07:00
Fabian Boehm
569d3cdfff completions/git: Add rev-list
The basics, by eye-balling the options that are the same as log.

Also fixes a typo: ingnore-missing
2024-08-20 20:55:16 +02:00
Fabian Boehm
c9bc04f274 fish_config: Write an empty prompt if necessary
This clears the right prompt if the new preset doesn't have any.

This was supposed to be fixed but was broken again in
f3b950157d.

Fixes #10675.
2024-08-19 17:03:52 +02:00
triallax
ad674c61dc Improve apk completions for apk 3.x
- -q silenced warnings in apk 2.x but not in in 3.x, so redirect stderr
  to /dev/null to avoid seeing warnings while completing (-q is still
  passed to `apk search` as it strips package versions and releases)
- Drop `-q` from `apk info`, as on apk 3.x it prevents apk info from
  outputting anything at all

I've tested these changes on both Chimera Linux (which uses apk 3.x)
and Alpine Linux (which is still using 2.x).
2024-08-18 12:28:36 +02:00
EmilyGraceSeville7cf
7883de6562 feat: add web-ext completion 2024-08-18 12:28:03 +02:00
Fabian Boehm
a23cfd0aa8 Simplify freedesktop icon completions
Use `path` more and skip the `sort` - this is for completions and
they're sorted internally.
2024-08-18 12:22:39 +02:00
kpbaks
f07e6c6667 Add completions for notify-send 2024-08-18 12:18:26 +02:00
Fabian Boehm
7fc58ee7f5 help: Show online URL in case showing it locally doesn't work.
See #10668.
2024-08-13 15:46:22 +02:00