Commit Graph

2603 Commits

Author SHA1 Message Date
Aaron Gyes
4c6b4188a0 Drastically improve fish completions
* complete .fish files
* --debug -> --debug-level
* add --init-command/-C
* add --debug-stack-frames/-D
* add --private/-P
* add --features/-f: lists supported features, supports foo,<TAB>
* -c now completes commands
* -d requires argument, describes 0..5
* --profile: require argument, allow file completion
2019-02-10 21:27:26 -08:00
Aaron Gyes
cfd9b52080 string completions: add -e, -f, --no-empty, shorten -d's
I hope this is now complete.

Also, shorten enough descriptions to make `string match --<TAB>`
show a two column pager with 80 cols.

We really should have shown more retraint in the design of `string`,
not all of the flags required both a long and short option created.
2019-02-07 04:20:12 -08:00
Fabian Homborg
28ee5716fb default_command_not_found_handler: Only use $argv[1]
That's probably the nicer fix, otherwise this would print things like

    Unknown command 'aiohsd 1 2 3'

when it should just say

    Unknown command aiohsd
2019-01-26 21:53:32 +01:00
Fabian Homborg
77b7f5513e default_command_not_found_handler: Join arguments
Without it, this would print the error multiple times, like

    Unknown command: echs
    Unknown command: 1
    Unknown command: 2
    Unknown command: 3

Fixes #5588.
2019-01-26 21:22:55 +01:00
Aaron Gyes
b5cbdc9065 fish_config: make clear python 2 or 3 will both work.
A person stuck installing it just for fish on their server
doesn't want to waste time installing the wrong one, so assuage that.

Also tweak to look nicer with 80 columns
2019-01-23 11:59:29 -08:00
Aaron Gyes
3bf702067a fish_config: tell the user some nice things without Python
As discussed in #5492, it would be good if running fish_config without
Python actually told the user to install Python.

Further, let's give the person some hints on how to configure these
things by hand, since they may have to.
2019-01-23 11:59:22 -08:00
Aaron Gyes
5b12d703dd Fix fish_config rendering brights as normal on prompt previews
I noticed our default brgreen for fish_color_user was rendering
as just unstyled white.
2019-01-23 11:58:29 -08:00
Aaron Gyes
e8f340a03d string completions: add missing upper, lower, split0, join0, unescape
and --style=regex
2019-01-23 11:58:12 -08:00
Fabian Homborg
c20187e858 completions/git: Stop offering :/ files so much
Don't do it when the relative path is simple (purely descending),
unless the token starts with ":/".

Also stop offering directories - if they need to be disambiguated, the
normal completion logic will take care of that.

Fixes #5574.

[ci skip]
2019-01-23 14:04:19 +01:00
Johannes Altmanninger
1d80028e24 __fish_complete_man.fish: escape for regex
Previously, using special regex characters or slashes would result in an
error message, when pressing tab in a command-line such as
"man /usr/bin/time ".
2019-01-23 11:59:06 +01:00
Fabian Homborg
72423c517a webconfig: Fix binding tab
This broke when --preset was introduced.

We allow a "--preset" or "--user" to appear right after the "bind",
and save the value, but don't use it yet.

Fixes #5534.

[ci skip]
2019-01-22 14:55:37 -08:00
Fabian Homborg
91ecd3b9b5 completions/git: Skip "!" shell-aliases for wrapping
We can't complete these, and now the user can do

```
set -g __fish_git_alias_$alias $command
```

e.g.

```
set -g __fish_git_alias_co checkout
```

if the arguments in the alias end up going to `git alias`.

Fixes #5412.

[ci skip]
2019-01-22 19:18:00 +01:00
Fabian Homborg
288cfa8fb2 completions/git: Also don't use files for porcelain=2
This was an oversight from the previous commit. Not that it matters
much, because we already removed $files.

Still, this would fail if someone defined a global $files, so let's fix it.

[ci skip]
2019-01-22 19:16:29 +01:00
Fabian Homborg
96f7924661 Fix nim prompt (via web_config)
This had a helper function defined outside of the fish_prompt
function, so `funcsave` missed it (see #736).

Fixes #5490.

[ci skip]
2019-01-21 18:09:39 -08:00
Mahmoud Al-Qudsi
ec77135cf2 Allow more flexibility with file completions for yarn
Closes #5502
2019-01-21 17:41:16 -08:00
Mahmoud Al-Qudsi
d5d80c0742 Fix extra space in fish_title
Closes #5517. Credit goes to @jadenPete.

[skip-ci]
2019-01-21 17:27:35 -08:00
Fabian Homborg
97f0cc9662 Don't wrap functions with themselves
Our weird %-expanding function wrappers around kill et all defined
"--wraps" for the same name.

As it turns out, fish follows that one, and executes the completion
multiple times.

I didn't notice because these tend to be rather quick on linux, but on
macOS that's apparently a real issue.

Fixes #5541.

[ci skip]
2019-01-21 17:24:49 -08:00
Sam Yu
afb9094b4c Fix completion of directories for configure 2019-01-21 17:21:28 -08:00
Fabian Homborg
7a163e8e98 completions/git: Stop limiting to the token
This enables fuzzy-matching outside of the current directory again.

As it turns out, the performance impact here isn't as large as I
thought - it's massively dependent on caching.

Fixes #5476.

(cherry picked from commit 73bae383e0)
2019-01-21 17:51:50 +11:00
Fabian Homborg
40f5dd200b share/config: Don't split /etc/paths entries on spaces
This used `read -la`, which _splits_.

Instead, don't do that, each line is its own entry.

Fixes #5481.

[ci skip]
2019-01-20 18:02:35 -08:00
Fabian Homborg
e07b45f447 Revert "completions/git: Allow aliases with whitespace in the command"
This reverts commit 081e14fd21, which was bogus.
2018-12-15 11:13:38 +01:00
Fabian Homborg
081e14fd21 completions/git: Allow aliases with whitespace in the command
Fixes #5412.
2018-12-13 22:49:12 +01:00
Fabian Homborg
99ba07354a fish_vi_key_bindings: Remove weird argv handling
Instead of maybe adding "-s" and "-M" if "-s" hasn't already been
given, just add "-s" to _every_ bind invocation, and "-M" to those who
need it.

Fixes #5028.
2018-12-13 17:33:48 +01:00
David Adam
79d53a32dc history: drop use of fish_indent
Largely reverts 007d794b6e.

fish_indent is extremely resource-intensive on large inputs and can crash; it also does not handle
invalid characters gracefully.

Work on #5402.
2018-12-13 21:57:24 +08:00
Fabian Homborg
6d4eb96509 completions/git: Don't use status --ignored=something
Fixes it for git < 2.16.

Fixes #5396.

[ci skip]
2018-12-08 20:51:49 +01:00
Phuurl
46db332be5 Basic umask completion, and minor change to ulimit completion 2018-12-07 17:50:48 +01:00
Fabian Homborg
9cfb1394bf sample_prompts/sorin: Add a safe way to determine merge status
Based on what __fish_git_prompt is doing.

See #5388.

[ci skip]
2018-12-06 16:15:11 +01:00
Leonard Hecker
0b63c1f46d Don't run git merge quietly
This can and will mess up git rebases and force pushes.
2018-12-06 15:53:34 +01:00
Aaron Gyes
04795eb8ea webconfig: should know about italics, reverse, dim. 2018-12-05 01:05:33 -08:00
Fabian Homborg
03bca5f7dd webconfig: Fall back onto the default colorscheme
The solarized themes now define pager colors, while other schemes
don't.

So if a user picks one of them, and then another, they'd keep the
pager colors.

Instead, since the default theme is now complete, any theme that does
not define its own pager colors will always get the default ones.

[ci skip]
2018-12-05 09:54:31 +01:00
Fabian Homborg
fa5f3fe9a0 webconfig: Update default colorscheme
This was missing a bunch of variables from __fish_config_interactive.

Ideally we wouldn't have to duplicate this info, but I don't have a
great solution either.
2018-12-05 09:54:31 +01:00
ridiculousfish
6f33c0ccb5 Clean up some language and fix bogus escape in complete.fish 2018-12-03 23:14:01 -08:00
ridiculousfish
8521ce4cd2 Clean up complete completions
Closes #5381

Squashed commit of the following:

commit d70e3451ac
Author: TJ Rana <tj.rana@icloud.com>
Date:   Mon Dec 3 14:31:51 2018 -0500

    Update heading

commit ec44e8ed35
Author: TJ Rana <tj.rana@icloud.com>
Date:   Mon Dec 3 14:29:16 2018 -0500

    Update complete.fish

commit a7178ab163
Author: TJ Rana <tj.rana@icloud.com>
Date:   Mon Dec 3 00:46:42 2018 -0500

    Clean up completion descriptions

commit e6134ceeaa
Author: TJ Rana <tj.rana@icloud.com>
Date:   Mon Dec 3 00:26:42 2018 -0500

    Fix grammar

commit 0a805b1016
Author: TJ Rana <tj.rana@icloud.com>
Date:   Mon Dec 3 00:25:34 2018 -0500

    Add option descriptors

commit 608bb02e41
Author: TJ Rana <tj.rana@icloud.com>
Date:   Sun Dec 2 22:47:17 2018 -0500

    Fix spelling

commit 375593fef4
Author: TJ Rana <tj.rana@icloud.com>
Date:   Sun Dec 2 22:46:19 2018 -0500

    Add heading
2018-12-03 23:12:54 -08:00
Fabian Homborg
d20b3c688b Remove unused portage_print_*_categories functions
These weren't used anywhere, and were only added in
44e2c28255, which isn't in a release yet.

[ci skip]
2018-11-30 21:35:20 +01:00
Fabian Homborg
c242d923c9 sample_prompts/robbyrussell: Use fish_print_hg_root
This removes ~140ms from every single prompt.

When not in a git repo, this prompt now takes ~9ms, as opposed to
~150ms before.

Fixes #5266 harder.

[ci skip]
2018-11-30 20:59:53 +01:00
Fabian Homborg
176c84fb9f Extract code to print hg root from the prompt
This is useful in other prompts, and potentially also to users.

Don't use a dunderscore because we do way too many of them.
2018-11-30 20:57:59 +01:00
Fabian Homborg
60f8eda5c4 webconfig: Hack tmux's reset sequence
This is quite ugly, but in lieu of putting in a proper ansi
parser (i.e. the output part of a terminal), since this is the only
such sequence we have seen until now, let's just match it.

Fixes #5312.

[ci skip]
2018-11-30 20:21:36 +01:00
Fabian Homborg
91a664b9fa webconfig: Use html.escape if available
Just try to import it, on error import the old thing.

Tested with python 3.7.1 and 2.7.15.

Fixes #5125.

[ci skip]
2018-11-30 19:46:00 +01:00
crocket
35db0fb5df Improve the contrast of the pager for solarized dark theme.
By setting fish_pager_color_completion to B3A06D,
the pager gets more visual contrast.
2018-11-30 19:39:45 +01:00
Fabian Homborg
42ec4aa2dd completions/configure: Use first token ending in "configure"
Fixes #5376.

[ci skip]
2018-11-30 11:27:24 +01:00
Fabian Homborg
f0aa63cc11 man: Use new data_dir variable name 2018-11-29 20:28:29 +01:00
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