Commit graph

2562 commits

Author SHA1 Message Date
Fabian Homborg
eb0dd1ea78 sample_prompts/robbyrussell: Clean
- Remove use of `eval`
- Use `git rev-parse` instead of `git status` as its faster,
- especially in large repos. (in qt5: 600ms vs 1ms)

- Use return status instead of test -n

This should change nothing about the output.
2018-11-29 19:35:13 +01:00
Fabian Homborg
8ee2e54c9b sample_prompts/acidhub: Improve git parsing
Same as the sorin changes - don't parse "git branch" output.
2018-11-29 19:21:07 +01:00
Fabian Homborg
b18693f3c1 sample_prompts/sorin: Improve git parsing
This uses some more string, but the main improvement is using "git
rev-list" instead of parsing "git branch" output that happens to be localized.

[ci skip]
2018-11-29 17:38:18 +01:00
Fabian Homborg
bd1ceefb17 sample_prompts/user_host_path: Remove
I can't see the value in this, given that we have a bunch of minimalist ones.
The "escaping" here is gnarly enough that I don't want to attempt to clean it up.
2018-11-29 16:35:52 +01:00
Fabian Homborg
b794a5e476 sample_prompts/debian_chroot: Clean
- Remove begin/end in if-conditions - this used to be necessary in
  fish < 2.3.0

- Quote a `test`
2018-11-29 16:35:52 +01:00
Fabian Homborg
bcfef9268d sample_prompts/classic_status: Clean
- Remove unused variable
- Use `test` instead of `[ ]`
2018-11-29 16:35:52 +01:00
Fabian Homborg
19bcf9fc36 sample_prompts/acidhub: Clean
- Remove useless helper functions
- Remove `sed` call
- Cut down on `git` calls

The status display still needs a bit of work.
2018-11-29 16:35:52 +01:00
Fabian Homborg
ad5d400319 fixup! Fix variable names
Missed an underscore, sorry!
2018-11-29 15:36:13 +01:00
Bjorn Neergaard
958e46882f Slightly restructure man.fish for clarity
man.fish can be clarified a bit, by removing a superfluous early return. Additionally, performance can be
(ever so slightly) improved, by using the empty string to suffix an extra colon when `$MANPATH` is empty, as
described in `manpath(1)`. As `man` will internally call `manpath` as it starts, this eliminates a redundancy.
2018-11-29 15:29:18 +01:00
Fabian Homborg
2713265b01 webconfig: Improve Solarized schemes
Fixes #5315.
2018-11-29 15:18:13 +01:00
Fabian Homborg
be1c022861 webconfig: Allow setting pager colors 2018-11-29 15:18:00 +01:00
Fabian Homborg
a02eac5a7a webconfig: Update color lists
This adds the color variables from the docs to both the python script
and the js controller.

Among others, this includes "search_match", i.e.
"fish_color_search_match".

It still does not include the pager colors because the variable names
wouldn't match.
2018-11-29 15:17:44 +01:00
Fabian Homborg
20099774a0 fish_clipboard_copy: Use selection, if any
See #5368.
2018-11-25 17:33:14 +01:00
Aaron Gyes
d065ff840d Fix switch statement 2018-11-25 07:50:10 -08:00
Aaron Gyes
4ceb21cf09 rm completions: update BSD options
lined up with {Open|Net|Free}BSD & Solaris manuals.
2018-11-25 06:08:24 -08:00
Aaron Gyes
a2212876a9 add a simple 'math' completion 2018-11-25 05:13:14 -08:00
Aaron Gyes
62c6a09f1c ls.fish: simplify the logic a little. 2018-11-25 03:43:53 -08:00
Aaron Gyes
c2ae163bfe ls completions: fix mistake. 2018-11-25 03:12:44 -08:00
Aaron Gyes
e89035d76c ls completions: Solaris too. BSD vs POSIX -o conflict fixes
- Solaris is super annoying
- Also, use ls not command ls:
  if I wrapped `gls` in a `ls` function, I'd want this.
2018-11-25 03:07:16 -08:00
Aaron Gyes
c1af29f641 __fish_config_interactive: tell complete that [ wraps test
We want to show our completions for the `[` (`test`) builtin, but
we don't want to create a [.fish.
2018-11-25 02:04:56 -08:00
Aaron Gyes
a4f27bea36 cp completions: Give not-GNU cp the floam treatment 2018-11-25 01:45:45 -08:00
Aaron Gyes
7d79d326b5 test completions: we accept floats now 2018-11-25 00:15:11 -08:00
Aaron Gyes
8d0e1f3bcc test completions: don't complete files for string tests, wrap [
also removed --help - test doesn't do that.
2018-11-25 00:08:59 -08:00
Aaron Gyes
cc3fd9cf8f mv completions: Correctness improvements and updates for GNU, BSD, Solaris mv
Reflect GNU mv from this decade,  and the options handled
by specific non-GNU OSes.
2018-11-24 23:32:44 -08:00
Aaron Gyes
ca46c556c3 ls completions: BSD fixes
`ls` was suggesting options that are are not valid for my system,
omitting options that are on my system. Different BSD OSes have
different option extensions, and some of them do conflict with eachother.

I carefully checked the manuals of netbsd, macos, freebsd, and openbsd
`ls` and made the completions show the right completions in full for them.

Some verbiage tweaks as well.
2018-11-23 10:31:51 -08:00
Fabian Homborg
60fa9da3a7 Rewrite __fish_complete_proc
- No longer uses sed, sort, uniq, uname
- Stop doing too-clever filtering (e.g. the kernel thread stuff never
- really worked)
- Don't truncate for all OSen, instead just use the (correctly
- truncated) comm field.
2018-11-22 15:23:05 +01:00
Fabian Homborg
3a835ebd61 Make --help work
See #5361.
2018-11-22 12:43:35 +01:00
Fabian Homborg
b383e29a24 type: Make "--help" work
This tripped over argparse --min-args=1, but we already return 1 above
if there really is no argument.

Fixes #5361.
2018-11-22 12:27:25 +01:00
Aaron Gyes
007d794b6e history: improve interactive pager experience
- Colorize history search output when interactive, using
  fish_indent. This is the same way we colorize `type` output.

- Ask less to act like `cat` if the output will fit in the
  terminal window, so it's less jaring with short output.

- history is viewed in a pager when interactive, but pagers
  typically strip escape codes. We accomplish the above by
  doing exactly what `git` does[1] when it has colored output
  for a pager:
        if $LESS is unset, set it to enable -R, -F, and -X options.
	if $LV is unset, set it to -c.

[1]: 398dd4bd03/pager.c (L87)
2018-11-20 05:01:12 -08:00
Mahmoud Al-Qudsi
59197d12e0 Better handling of cases where man is not installed
Thanks to @floam, adapted to reduce nesting.

Works around override of command-not-found handler in previous solution
(c.f. 13e025bdb0).
2018-11-17 22:05:48 -06:00
Fabian Homborg
7b21f1c3cb Revert "mount completions: don't truncate mounts with spaces in them"
This does not work with util-linux mount, because that prints a "type" in between.

This reverts commit 1c364722a7.
2018-11-17 14:06:15 +01:00
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