Commit graph

2531 commits

Author SHA1 Message Date
Aaron Gyes
1c364722a7 mount completions: don't truncate mounts with spaces in them 2018-11-17 04:46:25 -08:00
Mahmoud Al-Qudsi
31d17f4559 Rename string escape --style=pcre2 to string escape --style=regex 2018-11-16 20:22:06 -06:00
Mahmoud Al-Qudsi
13e025bdb0 Clean up error message for man wrapper when man isn't installed
Closes #5329
2018-11-16 20:04:43 -06:00
Mahmoud Al-Qudsi
ab0f1d33fe Make use of the new PCRE2 escaping feature
Fixes some potentially unsafe uses of direct substitution into regex
expressions and also switches some completions to regex-based now that
there is a safe way of using it.
2018-11-15 12:37:29 -06:00
Aaron Gyes
7437f82d92 obnam completions: use $hostname instead of (hostname) 2018-11-13 15:49:03 -08:00
Aaron Gyes
920be02fe9 __update_cwd_osc: Use $hostname var instead of hostname command
Changing directories should be a few ms faster.
2018-11-13 15:40:19 -08:00
David Adam
5bd0472682 abbr: tidy description 2018-11-13 21:42:49 +08:00
Fabian Homborg
7257c69979 completions/string: Add escaping styles 2018-11-12 18:56:11 +01:00
Fabian Homborg
7a20e8d64d completions/busctl: Port to argparse
This is much faster!
2018-11-12 18:53:30 +01:00
Fabian Homborg
2d2f7c8fb1 completions/ip: Restyle
Just run `fish_indent` on the entire thing.
2018-11-12 16:28:24 +01:00
Fabian Homborg
15f089897d completions/ip: Add basic ip link set completions 2018-11-12 16:22:43 +01:00
David Adam
4b28e9d2e4 read: update completions to include --lines and --null
Does not include --all-lines pending discussion in #5332.
2018-11-12 23:13:41 +08:00
Mahmoud Al-Qudsi
d6ab3db159 fixup! Extend __fish_complete_suffix to support a virtual $PWD 2018-11-08 16:17:56 -06:00
Mahmoud Al-Qudsi
34440165aa Add completions for openocd 2018-11-07 20:08:16 -06:00
Mahmoud Al-Qudsi
da6937e0cf Extend __fish_complete_suffix to support a virtual $PWD
In writing the completion script for openocd I found the need to
complete paths at the command-line as if they were relative to a
path other than the current $PWD. Given that `$PWD` is currently
global in fish (i.e. no side-effect free `cd` within a subshell)
this is probably good to have for other completions too.

This also fixes a bug in support for explicitly supplying the
description for completions via a `$argv` parameter, which prefixed
the description with `\t` (which is correct) except it did so in
the local scope within an `if` statement, meaning the changes never
had any effect and in the output the description was directly
concatenated to the completions, instead of separated by a tab.
2018-11-07 20:08:16 -06:00
Mahmoud Al-Qudsi
6b7501d715 Correct pandoc data directory path in completions
Incorrectly assumed that pandoc uses XDG_CONFIG_HOME, it turns out the
path is hard-coded as $HOME/.pandoc unless explicitly otherwise
specified in the command-line.
2018-11-07 18:34:50 +00:00
Fabian Homborg
4d4227e57f completions/git: Match files inside directories again
Fixes #5317.
2018-11-05 15:53:06 +01:00
Mahmoud Al-Qudsi
8ebf2b8f70 Improve pandoc completions
* Only suggest PDF engines that are currently installed
* Use XDG_CONFIG_HOME (after a fashion)
* Initialize lists as arrays instead of blind strings
2018-11-04 20:49:57 -06:00
Mahmoud Al-Qudsi
ffb4ab5ca8 Prevent pandoc completions from polluting global namespace 2018-11-04 20:38:59 -06:00
Mahmoud Al-Qudsi
11b0b23587 Add git remote remove completions 2018-11-04 14:36:51 -06:00
Moritz Wilhelmy
9afc4b419e Allow cd . to re-enter the current directory
Closes #4543.
2018-11-04 21:46:24 +08:00
David Sanson
7926b69d15 Add completions for pandoc
Taken from https://github.com/dsanson/fish-completion-pandoc under the
GNU GPL as at 7195da6fc4bcbdd49ea63d47c27e4bfec2135660.

Closes #2937.
2018-11-04 21:22:58 +08:00
Mahmoud Al-Qudsi
b23bda8ed6 Only offer local branches for deletion in git completions 2018-10-30 05:14:20 +00:00
Mahmoud Al-Qudsi
1288877033 Update yarn completions
Don't attempt to complete against package names if the user is trying to
enter a switch to speed things up.

Also work around #5267 by not wrapping unfiltered `all-the-package-name`
calls in a function.
2018-10-29 13:56:40 -05:00
Clément Martinez
13c2b4cdc3 Improve virsh completions 2018-10-29 18:01:52 +01:00
ridiculousfish
e09e1e8e41 Fix funced when using the built-in editor 2018-10-27 17:19:43 -07:00
Fabian Homborg
121d61cf31 Revert "help: Use variable-as-command instead of eval"
We do a bunch of escaping before to make `eval` work, and that needs to be removed as well or fragment-urls don't work.

This reverts commit e9568069a7.
2018-10-26 10:52:02 +02:00
Fabian Homborg
c78e6a3ccf edit_command_buffer: repaint
Thanks @amosbird on gitter.
2018-10-25 17:34:01 +02:00
Fabian Homborg
fb0c1460a9 __fish_complete_pgrep: Truncate to 15 characters
Fixes #4132.
2018-10-25 12:10:17 +02:00
Mahmoud Al-Qudsi
5ad292328a Add dynamic clang completions via clang --autocomplete
Use clang/clang++'s own autocompletion support to complete arguments. It
is rather convoluted as clang generates autocompletions for a portion of
the current token rather than the entire token, e.g. while `--st` will
autocomplete to `--std=` (which is fine by fish), `--std=g` will
autocomplete to `gnu...` without the leading `--std=` which breaks fish'
support for the completion.

Additionally, on systems where clang/clang++ is the system compiler
(such as FreeBSD), it is very often for users to invoke a newer version
of clang/clang++ installed as clang[++]-NN instead of clang. Using a
monkey-patched version of `complete -p` to support that without breaking
(future) completions for commands like `clang-format`.

Closes #4174.
2018-10-24 23:14:55 -05:00
Mahmoud Al-Qudsi
ebb3a3a16e Set $fish_private_mode and show a message on private mode startup
The message can be localized and is set as a global variable shadowing
the universally-defined $fish_greeting.
2018-10-24 19:33:48 +02:00
Fabian Homborg
b427cd1823 ls.fish: Use gdircolors if available
See #5278.
2018-10-24 19:27:51 +02:00
Fabian Homborg
809998a9a5 completions/git: Use argparse
This is a tiny bit faster, but mostly it's more concise and extendable.
2018-10-24 12:26:01 +02:00
Fabian Homborg
381215ef07 completions/git: Let git glob files
Fixes #5229.
2018-10-24 12:22:31 +02:00
Fabian Homborg
d727e32934 __fish_print_help: Just use $COLUMNS
This had an undocumented internal feature that would pass the tty
width along. Instead, just have it read $COLUMNS, which we always
define anyway.
2018-10-23 15:05:15 +02:00
Fabian Homborg
5efa18da15 fixup! Add /fish to $__fish_config_dir 2018-10-21 17:20:21 +02:00
Fabian Homborg
6c988abe28 Add $__fish_config_dir variable
Contains the path to the user config.fish (e.g. ~/.config/fish)
without having to do the `set -q XDG_CONFIG_HOME` dance.

See #5270.
2018-10-21 15:42:25 +02:00
Fabian Homborg
162af88c9a __fish_parse_configure: Move some comments
This contained a commented-out `eval`, which drew my attention.
2018-10-21 15:38:31 +02:00
Fabian Homborg
3c6844d4f4 edit_command_buffer: Use variable-as-command 2018-10-21 15:34:42 +02:00
Fabian Homborg
3253893923 funced: Use variable-as-command 2018-10-21 15:34:19 +02:00
Fabian Homborg
e9568069a7 help: Use variable-as-command instead of eval 2018-10-21 15:33:29 +02:00
Fabian Homborg
fc51c156cb __fish_config_interactive: Use variable-as-command
This removes a use of eval, and some duplication.
2018-10-21 15:31:49 +02:00
Fabian Homborg
09f77a355f __fish_config_interactive: Remove unused $configdir 2018-10-21 15:31:12 +02:00
Fabian Homborg
3b2be9009e funcsave: Use mkdir -p
It's in POSIX, and simplifies stuff.
2018-10-21 15:24:38 +02:00
Mahmoud Al-Qudsi
ec2659c500 fixup! add makensis (#5242) 2018-10-16 13:50:42 -05:00
Mahmoud Al-Qudsi
c02bf2548f Close the completions pager (if it's open) on ctrl+c
If you're using the old binding that only clears the commandline and
doesn't preserve its contents and start a new line, you can use

```fish
bind \cc "commandline -f cancel; commandline ''"
```

instead.

Closes #4298.
2018-10-15 13:34:34 -05:00
Fabian Homborg
d22446f651 Let funced handle empty $EDITOR
For some weird reason we only used $editor if it wasn't empty, but
then failed to fail if it was.

This will now print an error and use fish, just like if the $EDITOR
value is invalid in any other way.

Fixes #5257.
2018-10-15 10:14:59 +02:00
Mahmoud Al-Qudsi
c140b3c724 Add completions for git config
This includes dynamic completion of existing keys.
2018-10-14 18:17:23 -05:00
Mahmoud Al-Qudsi
9c6bd8b1b4 Add completions for kitty terminal
This is a wrapper that calls kitty to dynamically provide completions,
as generated by kitty itself, via `kitty + complete setup fish`.

ref: https://sw.kovidgoyal.net/kitty/#fish
2018-10-14 16:32:49 -05:00
Xuanwo
5e77689c5a completions: Add systemctl set-property support 2018-10-09 16:51:49 +02:00