Commit graph

2277 commits

Author SHA1 Message Date
Mahmoud Al-Qudsi
c492d03f51 Overhaul completions for set and add new completions for set -e
Now the description includes the variable scope, `set [-e] -[Ugl]`
completions only provide variables matching that scope, and completions
that shouldn't be modified are hidden from the user. Completions that
are often modified but rarely unset (`fish_*` variables) are omitted
from `set -e` completions.

A new helper function `__fish_seen_argument` has been added that makes
it easy to only provied completions for a specific flag.
2018-04-03 14:42:26 -05:00
Mahmoud Al-Qudsi
99ecaec175 Use system web browser under WSL
Launch `cmd.exe /c "start URL"` under WSL for both `fish_config` and
`help`. This works around #4299 but does not address the underlying
issue (#1132).
2018-04-02 18:36:14 -05:00
ridiculousfish
358e9def5b Fix the git completion
Commit 6e56637cf ran fish_indent on the git completion and mangled some
of it. Manually revert the non-essential changes.
2018-04-02 10:26:40 -07:00
David Adam
61ab3aea8c webconfig: import webbrowser with empty TERM
Re-introduces the changes from 168d25e780
which were inadvertently removed in
20bcbcc252.

Work on #4299. Re-commit of #1132.
2018-04-02 21:35:10 +08:00
David Adam
5c56765d12 hg prompt: fix infinite loop due to incorrect scoping
4b079e16e5 fixed some unintended behaviour
which the hg prompt was apparently relying upon, producing an infinite
loop whenever called.
2018-04-02 21:24:52 +08:00
ridiculousfish
ca13e816ce Make fish more resilient to empty key bindings
If fish_key_bindings gets set to empty, fish will become unusable.
In this case reset it to fish_default_key_bindings.
2018-04-01 16:11:12 -07:00
Peter Ammon
7659554dea Remove use of caret redirection from share/*
This removes the use of caret redirections from share/completions
and share/functions, in preparation for dropping support in fish.
2018-04-01 13:42:38 -07:00
ridiculousfish
6e56637cf0 Remove support for the ? wildcard
Fixes #4520
2018-03-31 16:54:50 -07:00
ridiculousfish
c0f832a743 Invoke path_helper on macOS on all sessions, not just login
fish reads paths out of /etc/paths.d. Prior to adbaddf it did
this on every shell invocation; with adbaddf it does so on only login
shells. This change wasn't justified so let's revert this behavior.
2018-03-31 12:01:29 -07:00
Frederick Akalin
adbaddfaf4 Fix reading of /etc/paths on OS X
(and /etc/paths.d/*)

Do so by emulating the behavior of /usr/libexec/path_helper for login
shells, matching the behavior in /etc/profile.

Also add a path_helper command to reproduce the behavior of
/usr/libexec/path_helper for fish.

This also handles setting MANPATH if necessary.

Fixes issue #4336
2018-03-27 23:38:15 -07:00
Luc J. Bourhis
c116843611 Completion for conda, the package manager (#4837)
* Completion for conda, the package manager

* Make the list of platforms a private variable

* Add commands activate and deactivate

* Avoid clobbering a user-defined function __

* Use Use __fish_seen_subcommand_from to identify subcommand

And treat the case of the first argument as a special case
with function __fish_conda_fist_arg

* Factor out create from loop for option --name

* Fix typo (missing parenthesis in description)

* Start from a blank state by removing completions from conda configuration script
2018-03-26 17:07:23 +02:00
Mahmoud Al-Qudsi
6d80ab8d74 Rename $pid (née %self) to $fish_pid 2018-03-24 11:54:27 -05:00
Daniel Beckwith
7583d57b63 Add Makefile --file detection to completion 2018-03-23 22:45:40 -07:00
Wilke Schwiedop
44e2c28255 revisit gentoo-related completions (#4758)
* revisit gentoo-related completions

- add completion for emaint
- improve completion for emerge
  still incomplete, but an impovement regardless
- improve completion for equery
- add gentoo/portage-related auxiliary functions

* fix spelling

* remove trailing '.'

* remove old '_' invocation and capitalize descriptions

* add number-completion

* remove trailing '.'

* shorter descriptions

* replace sed with fish-builtin and drop deduplication

* batch change capitalization (lower case)

* indent equery descriptions

* batch change capitalization (upper case)
2018-03-23 19:42:30 +01:00
Fabian Homborg
316303d777 [subl completions] Take files with new-window
Fixes #4831.

Thanks @luc-j-bourhis.
2018-03-17 21:06:44 +01:00
Mahmoud Al-Qudsi
5a561bcfce Source : function without any C++ hacks
Thanks, @faho
2018-03-15 18:19:08 -05:00
Laurent Pireyn
5732aeac9a Create completion for JBake 2018-03-15 21:59:23 +08:00
Mahmoud Al-Qudsi
007ae0b15e Add colon.fish for : compatibility with sh and bash
no-op function for compatibility with sh, bash, and others.
Often used to insert a comment into a chain of commands without having
it eat up the remainder of the line, handy in Makefiles.
2018-03-14 17:41:09 -05:00
Fabian Homborg
228c5c1319 [git completions] Filter unreplaced $PWD
Otherwise this'd let the full filename through if it isn't in $PWD.
2018-03-14 10:56:59 +01:00
Lee Dohm
3ec1fab7aa Update to handle latest Atom options (#4801)
* Update to handle latest Atom options

* Fix typo and wording
2018-03-13 14:12:35 +01:00
Fabian Homborg
b2d887860a [git completions] Speed up __fish_git_files with lots of files
- Cache translations instead of calling `gettext` once per file

- Only do the ":/" thing if the file isn't in $PWD/**

For a git repo created like

```fish
git init
touch a(seq 0 1000)b
```

this changes the time from about 2s to 0.3s.
2018-03-13 13:47:17 +01:00
Fabian Homborg
4057cfdce5 [git completions] Minor cleanup 2018-03-13 13:45:37 +01:00
Fabian Homborg
bc976a913c [git completions] Use staged files for rm --cached 2018-03-13 13:45:03 +01:00
Fabian Homborg
8b4ac66349 [git completions] Reremove stray "[" 2018-03-13 13:44:36 +01:00
Mahmoud Al-Qudsi
c24739d3bd Use git ls-files instead of local files for git rm --cached
`git rm --cached` is often used to delete a file that no longer exists
in the working tree but remains in git's index. `git ls-files` will list
files that are in the HEAD, which is exactly what we want. Local files
not in `HEAD` can't be deleted from git anyway.
2018-03-12 19:22:41 -05:00
Mahmoud Al-Qudsi
c51abd04ff Clean up $__fish_*dir variable names
Closes #4429
2018-03-12 08:34:20 -05:00
Mahmoud Al-Qudsi
b42b562d06 Revert prompt_hostname to short hostname only
Hat-tip: @zx8. Closes #4804.
2018-03-12 08:24:42 -05:00
Giovanni Bajo
3b7d759d11 Update completions for go
The tool subcommand had a "-f" flag to disallow file completions which is wrong: most of the tools there require a file/directory argument.

Since we're here, also limit "go tool compile" to only match Go source files.
2018-03-12 20:34:35 +08:00
Daniel Apolinario
cc80951e79 Completions for bb-wrapper and powerpill
Completions for bb-wrapper (bauerbill) and powerpill
2018-03-10 18:31:29 +01:00
George Christou
4ae6843b6b completions: [git] Fix rogue bracket typo (#4799) 2018-03-10 18:30:43 +01:00
Mahmoud Al-Qudsi
18a9aa58cd Add binding for MSFT/WSL paste escape sequence 2018-03-10 10:57:32 -06:00
Mahmoud Al-Qudsi
b3ec069401 Add missing $argv injection in fish_default_key_bindings.fish
These have to be present in all the default rules so that any errors can
be silenced at startup (and so additional arguments can be passed in).
2018-03-10 10:54:29 -06:00
ridiculousfish
9a5afe3913 Clean up and document functions --handlers 2018-03-10 02:27:25 -08:00
Mahmoud Al-Qudsi
410f6fbd44 Switch prompt_hostname over to $hostname 2018-03-09 15:05:43 -06:00
Mahmoud Al-Qudsi
eaa5958b77 Update completions for read builtin
Change short option for `--shell` to `-S` per #4490 and add description for -s/--silent
2018-03-09 11:59:50 -06:00
Mahmoud Al-Qudsi
2a266c4d48 Update fish's only usage of read -s to use read --shell instead 2018-03-09 11:55:12 -06:00
Mahmoud Al-Qudsi
a6f79dcca8 Implement -s for fish_vi_key_bindings
In similar vein to how fish_default_key_bindings works, parameters
passed to the function are automatically passed to bind upstream.
Additionally, -s is automatically added if no parameters had been
specified to prevent startup error messages. See 46d1334.

Closes #4494
2018-03-09 09:29:25 -06:00
Mahmoud Al-Qudsi
0866653a87 Merge branch 'no_percent'
Drops the % notation for process expansion. The existing notation was a
mess and expanded jobs, process ids, and process names via dark magic.
With this change, % is no longer a special character and can be used
unescaped with impunity.

The variables %self and %last, referring to fish's own pid and the pid
of the last backgrounded job respectively, have been replaced with $pid
and $last_pid. These are read-only variables, protected against being
redefined by the user.

Author's note: I would have personally preferred $fish_pid instead of
$pid but since we debated changing $version to $fish_version and then
reverted that change (with much acrimony), it makes no sense to break
with that precedent here. Additionally, $fish_last_pid is quite wordy.

Closes #4230. Closes #1202.
2018-03-09 09:16:31 -06:00
Mahmoud Al-Qudsi
b236ab6e5d Update %self references with $pid instead 2018-03-09 03:56:19 -06:00
George Christou
73f2b444ef completions: [git] Do not decorate reflog 2018-03-07 22:01:23 +01:00
Mahmoud Al-Qudsi
b50541c655 Add comment about checking if jq exists in a future update to yarn completions 2018-03-06 17:03:15 -06:00
Fabian Homborg
88cf7e16c6 [git completions] Sort tags newest-first
This has the nice effect of sorting "2.7.0" before "2.7b1".
2018-03-06 22:06:39 +01:00
Fabian Homborg
5cb3918c1c [git completions] Remove unnecessary helper function 2018-03-06 22:06:39 +01:00
Fabian Homborg
f3c864a9e2 [git completions] Offer unmerged files for add
These occur e.g. when resolving a conflict, which then needs `git add`.
2018-03-06 22:06:39 +01:00
Fabian Homborg
b24971dc9e [git completions] Only offer files for log --
After a "--" separator, `git log` only takes files.
2018-03-06 22:06:39 +01:00
Fabian Homborg
754b52bb26 [git completions] Make branches work on git 2.7.0 again
This used the "--format" option, which was only added in git 2.13.0.
2018-03-06 22:06:39 +01:00
Cesar Andreu
3792fb086a Fix man autocomplete when a section is set 2018-03-06 20:50:20 +01:00
Fabian Homborg
93209ab053 Fix termux path
This is "/data/data/com.termux/files/usr/etc", not just ".../files/etc".
2018-03-06 17:55:25 +01:00
Fabian Homborg
e7f8e58be9 Add more ssh known_hosts paths
Fixes #4759.
2018-03-06 15:27:34 +01:00
Mahmoud Al-Qudsi
a85d2bf27a Add intelligent package completion to yarn
Now parses package.json and uses results to provide a list of possible
completions to `yarn remove`. There may be other subcommands that could
benefit from this.

Could have parsed yarn output, but yarn is slow and packages.json format
is generally standard since it's machine-generated json.
2018-03-05 08:28:19 -06:00