Commit Graph

2220 Commits

Author SHA1 Message Date
Tony Wang
7d055a120e fix patch completion
patch -i should be followed by a filename, and patch -d should be
followed by a directory
2017-11-29 12:15:43 +01:00
Ron Gebauer
a4fced2a8b Create jhipster.fish
Add completion for jhipster
2017-11-26 19:21:46 -08:00
Ron Gebauer
ce4fdbaf7c Create bd.fish
Add completion for bd, per https://github.com/0rax/fish-bd
2017-11-26 19:21:37 -08:00
David Guyot
b917f168d3 Improved french translations; minor completion corrections 2017-11-23 11:02:32 +01:00
Aaron Gyes
fa57565c42 Fix fish_opt --help showing nextd manpage. 2017-11-14 01:56:58 -08:00
WEBER Logan
11cebe9483 feat(share:git-prompt): be able to truncate the branch name with a defined max length 2017-11-13 10:57:42 +01:00
Laurent Pireyn
b46b0310f3 Create Hugo completion (#4529) 2017-11-12 21:03:11 -08:00
Andrew Schulman
ed0a57ff6d Update cygport completions 2017-11-08 22:19:52 +01:00
Fabian Homborg
60248e895f Use __fish_complete_user_at_hosts
for various completions.

This makes the code a bit nicer, removes one of the
__fish_print_hostnames calls (which are slow) and a sed call, thereby
improving performance by about 33% (600ms to 400ms).

Fixes #4511.
2017-11-08 12:59:31 +01:00
Judson
37e0fbb5e4 Paginating last command
Often, I want to paginate the command I just ran.

Easy enough to <up><alt-p>, but this patch saves a keystroke.
2017-11-01 07:35:26 +08:00
Fabian Homborg
1cd43a371b Add "chsh -l" completion for util-linux chsh
AFAICT, the FreeBSD and macOS option of the same name isn't useful
with chsh, so we skip that.

Fixes #4497.
2017-10-25 20:55:05 +02:00
Laurent Pireyn
3781862346 Fix typo in gradle completion (#4500) 2017-10-23 20:04:47 -07:00
Fabian Homborg
720f4ad742 Also allow "sles" as OS-ID for command-not-found-handler
"Suse Linux Enterprise Server".

Fixes #4447.
2017-10-19 19:09:29 +02:00
Mahmoud Al-Qudsi
80b658e247 Work around OS X issue with dropped #fragment in launched URLs
The previous hack used to work around an OS X issue/bug where launching
a URL with a #fragment appended would drop the fragment by using
`osascript` does not seem to work any more. Append the section name as a
query string (in addition to, not instead of #section) and then use some
basic javascript appended to the user doc HTML template to parse that
and jump to the correct section (if the section was dropped).

Closes #4480
2017-10-18 12:11:20 -05:00
Mahmoud Al-Qudsi
e1c90cac88 Prevent error output on invocation of rustc completions
fish was indiscriminately calling `rustc -Z help` in the autocompletion
script for `rustc`, but `-Z` (and its `-Z help` output completions) is
only available when using the nightly compiler.

Note that this isn't a perfect fix since if you try to use those command
line options now added to the autocompletions list without using the
nightly toolchain, `rustc` will still throw an error. But at least this
way we don't cause random errors about `-Z` not being available to
appear any time someone tries to use `rustc` from the fish command prompt.
2017-10-18 11:49:40 -05:00
Fabian Homborg
5196354176 git completions: Allow files for git rm
Fixes #4485.
2017-10-18 13:37:13 +02:00
Fabian Homborg
d18b0be518 Revert "Fix cd completions if a directory exists in $CDPATH and $PWD"
That's not what happens - I had set CDPATH to start with ".".

See #4484.

This reverts commit 1af38d69a8.
2017-10-16 19:33:38 +02:00
Aaron Gyes
fb8ae04f80 Rename $FISH_VERSION back to the original $version.
Order is restored in the universe. Fixes #4414
2017-10-14 08:33:02 -07:00
Fabian Homborg
1af38d69a8 Fix cd completions if a directory exists in $CDPATH and $PWD
E.g. if "foo" is in CDPATH, and both "foo/bar" and "./bar" exist, `cd
bar` will go to ./bar.

The completions described "bar" as going to "foo/bar" ("CDPATH foo").

This fixes it by checking for ./bar's existence.

See #4475.
2017-10-13 18:32:36 +02:00
madblobfish
649e244092 fish_update_completions: error when python not found (#4454) 2017-10-12 06:00:50 -07:00
evuez
6d350409b3 Add --follow-tags completion for git push (#4462) 2017-10-12 05:59:52 -07:00
Aaron Gyes
68527ff20c completions: --description -> -d
This ends up saving a surprising number of bytes.
2017-10-11 10:17:35 -07:00
Aaron Gyes
020f8097f0 uniq completions: fix spelling
it's -> its
2017-10-11 10:08:05 -07:00
Mahmoud Al-Qudsi
1a3adf086d Coalesce string trim and string match in flatpak completions 2017-10-11 06:23:02 +02:00
Aaron Gyes
59dbc7ca6a Tweak ninja completions 2017-10-09 01:22:20 -07:00
Mahmoud Al-Qudsi
21473b20ec Update flatpak completions to work with latest flatpak
Closes #4456
2017-10-09 07:30:19 +02:00
Mahmoud Al-Qudsi
b61c4f1cbc Correct string replace usage in pip2/3 completions
\b does not match "end of spaces" but rather "start of a-z/0-9" and so
does not match the start of string '-c'. Match (and then re-insert) a
literal ' ' as part of the pattern instead.
2017-10-05 13:54:47 +02:00
Mahmoud Al-Qudsi
04bde6cf5b Document reasons for commmand name replacement in pip2/3 completions
(cherry picked from commit 429bdce4f1)
2017-10-05 13:33:45 +02:00
Mahmoud Al-Qudsi
78fe53406e Fix copy-and-paste pip3 -> pip2 typo
Thanks @floam. See #4448
2017-10-05 13:26:56 +02:00
Mahmoud Al-Qudsi
7e48f5cc4f Use string replace instead of sed with better regex for pip completions
(cherry picked from commit d74d3f2ca4)
2017-10-05 13:25:14 +02:00
Mahmoud Al-Qudsi
af12bcb117 fixup! Force correct names for pip2/pip3 command in completions 2017-10-05 13:11:14 +02:00
Mahmoud Al-Qudsi
b11ca2c01c Force correct names for pip2/pip3 command in completions
Work around bug pypa/pip#4755
Don't expect all users to be running a version of pip2/3 that includes
the fix (once it's upstreamed). Will continue to work if/when pip2/3
emit the correct output. pip is already very slow at printing the
completions (see #4448) so the `sed` call overhead is neglible.
2017-10-05 13:03:24 +02:00
Gabriel Birke
6ce03a4a36 Add script completion for composer
When no command is given or when using "run-script" parse composer.json
and look for the "scripts" section. Complete script names.
2017-10-05 10:47:34 +02:00
Aaron Gyes
d740b2a473 pip completions: use builtin source rather than eval function. 2017-10-04 21:50:09 -07:00
Cristian Prieto
1770e47eb0 Python's pip and pipenv completions (#4448)
* Add pip completion

 * We call native pip completion for fish if pip is installed

* Add pipenv completion

 * We call pipenv native completion if pipenv is installed

* Applied changes as requested by @floam

 * Changed usage of `test (command -v)` for just `command -sq`

* Add completions for pip2/3

 * In some systems pip is not aliased and we have pip2 and pip3
 * In those cases, we just load the completions for those commands

* Separate pip2/3 completions in their own file as requested by @floam
2017-10-04 21:15:41 -07:00
Mahmoud Al-Qudsi
2dd2867a61 Implement limits for __history_completions in j completions 2017-10-04 17:52:58 +02:00
Mahmoud Al-Qudsi
46d1334f95 Silence bind errors in default key bindings
This silences binding errors due to keys not found in the current
termcap config in the default fish bindings.

Closes #4188, #4431, and obviates the original fix for #1155

It was necessary to re-implement builtin_bind as a class in order to
avoid passing around the options array from function to function and
as adding an opts parameter to `get_terminfo_sequence` would require
otps to be passed to all other builtin_bind_ functions so they could, in
turn, pass it to `get_terminfo_sequence`.
2017-10-03 11:20:17 +02:00
Aaron Gyes
1ef310c3a8 Fix export returning 1 on success
Fixes #4435
2017-10-01 01:11:17 -07:00
Fabian Homborg
281d468285 Rewrite systemctl completion with argparse
This

- Offers more candidates

- Is more reactive (it'll always incorporate "--state=" and "--type="

- Is faster (about 800ms to about 120ms)

- Needs fewer function files

All __fish_systemctl_* functions except __fish_systemctl_services have
been removed.
2017-09-29 20:07:18 +02:00
Mahmoud Al-Qudsi
338311af1e Install custom LSS script to /usr/local/share/fish on make install
Decided to move doc_src/fish.lss to share/lynx.lss, which just makes
more sense all around. Accordingly, now using {$__fish_datadir} instead
of {$__fish_help_dir} in help.fish.

Makefile now installs the custom lss on make install
2017-09-26 14:31:11 -05:00
Mahmoud Al-Qudsi
8b858f2fcc Use a custom Lynx style sheet (LSS file) to work around Lynx bug
Lynx uses a very naïve method of applying styles to HTML elements by
hashing the element type and the class name to generate a map of
hash:style. After the hash is calculated, Lynx does not go back and
check whether or not the actual string values match the LSS properties.

See the following links on the Links mailing list:
 * http://lists.gnu.org/archive/html/lynx-dev/2015-12/msg00037.html
 * http://lists.gnu.org/archive/html/lynx-dev/2015-12/msg00039.html

This patch copies the default Lynx stylesheet but removes highlighting
and other styles that would result in unreadable text (due to not enough
contrast with the background color), and if the `help` builtin detects
that the best web browser to use is Lynx, it instructs it to use this
modified stylesheet.
2017-09-26 13:44:19 -05:00
Mahmoud Al-Qudsi
2b425ad221 Don't use xdg-open if running in terminal mode (i.e. no Xorg)
If the $DISPLAY environment variable is not set, xdg-open should not be
used to load the web browser. Just because it is installed does not mean
that the user exclusively runs in an X session.

Needed for Lynx detection to work around #4170
2017-09-26 13:42:40 -05:00
Mahmoud Al-Qudsi
3b3bcc998e Speed up __fish_print_hostnames for faster completions
Thanks to @ThomasAH, as per #4378. Tested on many platforms (OS X,
FreeBSD, Linux, and Solaris). Works with IPv4 and IPv6 as well as
host names and loopback addresses.
2017-09-26 09:21:16 -05:00
Mahmoud Al-Qudsi
6513db35c1 Support colored ls output on Solaris 11
Closes #1223
2017-09-26 08:55:28 -05:00
oddwheel
a05bcc6a63 Suppress git prompt CRLF warnings noise
Drawing prompt in repo with text=auto attribute and mixed line endings in files was spawning crlf conversion warnings to terminal from unsilenced stderr of git diff
2017-09-22 18:57:36 +02:00
Aaron Gyes
25d83ed0d7 seq fallback speedup
Using `string match` instead of `grep -E` resulted in a 2x-3x speedup according
to $CMD_DURATION.
2017-09-22 00:30:26 -07:00
Mahmoud Al-Qudsi
fa9e445342 Add history-based completions for autojump's j command
j does not have any "logical" source of completions, but it almost often
called with arguments that have been seen before (since it is used to
jump to favorite/recent directories). We can search the history for
possible completions and use those.

This is an example of the behavior mentioned in #4344 as a possible
enhancement for fish 3.0, where completions can be provided from history
if none are otherwise found.
2017-09-20 20:50:10 -05:00
Kurtis Rader
67946b5509 Drop deprecated history search --with-time flag (#4403)
This flag was only documented for a few weeks before being renamed
`--show-time` and has been deprecated for a long time. Fish 3.0 is a good
opportunity to remove it.
2017-09-15 19:28:44 -07:00
Kurtis Rader
ee1d310651 Implement history search --reverse (#4375)
* Implement `history search --reverse`

It should be possible to have `history search` output ordered oldest to
newest like nearly every other shell including bash, ksh, zsh, and csh.
We can't make this the default because too many people expect the
current behavior. This simply makes it possible for people to define
their own abbreviations or functions that provide behavior they are
likely used to if they are transitioning to fish from another shell.

This also fixes a bug in the `history` function with respect to how it
handles the `-n` / `--max` flag.

Fixes #4354

* Fix comment for format_history_record()
2017-09-14 15:44:17 -07:00
Mahmoud Al-Qudsi
864a1893bc Squashed commit of the following:
commit e07f1d59c06094846db8ce59f65d4790b222fffa
Author: Mahmoud Al-Qudsi <mqudsi@neosmart.net>
Date:   Sun Sep 10 21:54:45 2017 -0500

    Use git branch and git branch --remote for checkout completions

commit 9e1632236be065e051e306b11082ca4e9c7a0ee1
Author: Mahmoud Al-Qudsi <mqudsi@neosmart.net>
Date:   Sun Sep 10 11:27:30 2017 -0500

    Correct classification of remote and local branches

    To prevent any breakage, no changes were made to __fish_git_branches,
    instead its output was filtered into __fish_git_remote_branches and
    __fish_git_local_branches, the two of which are now used to provide
    completions for "git checkout ..."

    Fixes #4395

Closes #4396
2017-09-14 13:42:06 -05:00
Mahmoud Al-Qudsi
856c9cf8a1 Make s3cmd completions compatible with python3 environment
It seems that under python3, s3cmd emits its output as a long list (like
ls -l) with or without the --long parameter to "s3cmd ls s3://...".

This patch includes only s3://* paths from that output as completions.
2017-09-14 13:39:12 -05:00
David Adam
725febb669 Revert "convert popd and pushd to use argparse"
This reverts commit 05aae4764b.

Closes #4398.
2017-09-14 12:36:37 +08:00
Mahmoud Al-Qudsi
5175d82a80 fixup! Remove workaround for long-since-fixed neovim 24-bit bug 2017-09-10 10:01:43 -05:00
Mahmoud Al-Qudsi
13fd9be1d9 Remove workaround for long-since-fixed neovim 24-bit bug
Closes #2792 and addresses the (closed) #2768
Tested against neovim 0.2.1-dev
2017-09-10 10:00:59 -05:00
ridiculousfish
a5fd0b317e Revert "Switch to bare vars in our math invocations"
This reverts commit bd18736ee5.

Bare variables should only be used in commands that must
manipulate the variable stack, such as `set`.
2017-09-09 23:35:47 -07:00
ridiculousfish
c2a5e7ae27 Revert "Remove workaround for long-since-fixed neovim 24-bit bug"
This reverts commit bb419d4f5e.
2017-09-09 23:28:27 -07:00
Mahmoud Al-Qudsi
bb419d4f5e Remove workaround for long-since-fixed neovim 24-bit bug
Closes #2792 and addresses the (closed) #2768
Tested against neovim 0.2.1-dev
2017-09-09 23:59:40 -05:00
Mahmoud Al-Qudsi
bca17db96e Preserve git's own ordering of branch/tag completions for checkout
Addresses the main concern of #3830 by preserving the internal ordering
of tag/branch listings generated by git. Fixes mixing of remote and
local branches in completions.

Does not address the concern of having local branches on top, remote
branches after, and tags at the bottom - I don't believe we have that
functionality available to us yet. #361 only implemented sort within a
category of completions, but there is no category "weight" unless I'm
mistaken.
2017-09-09 23:35:04 -05:00
Fabian Homborg
b00daebec2 __fish_print_hostnames: Use string replace -f
Saves one `string match` invocation.

Also removes a useless-use-of-cat.

(cherry picked from commit 4437e8d8d6)
2017-09-07 16:30:17 +02:00
Moritz
6145b4a770 Add completions for git checkout --ours/--theirs (#4380)
* Add completions for git checkout --ours/--theirs

* Change description for `git checkout --ours/--theirs´ completions
2017-09-07 16:24:05 +02:00
Fabian Homborg
c2f0a45d60 git completions: Use modified files in the index for reset
Fixes #4329.
2017-09-06 10:25:58 +02:00
Marcel Bischoff
c0c33b3605 Add basic ezjail-admin completion 2017-09-06 09:55:14 +02:00
Sam Yu
81becc5f6b Add repo completion for zypper (#4325)
* Add repo completion for zypper

* Replace sed with string in __fish_print_zypp_repos

* Move function into completion script

* Update zypper completion

add subcommand packages to __fish_zypper_repo_commands
2017-09-06 09:53:49 +02:00
Fabian Homborg
76609de4da pacman-ish completions: Complete files for -Qo and -Qp
These were explicitly suppressed, which was wrong.

(cherry picked from commit 908063d830)
2017-09-05 16:56:47 +02:00
Benjamin Reitzammer
72244dee5b add --force-with-lease completion for git push (#4368) 2017-08-30 19:59:49 -07:00
modula t. worm
fa3ca4dc3d Add completions for kdeconnect-cli (KDE Connect) 2017-08-30 00:07:07 -07:00
Alexey Alekhin
a43da0163a Added sbt completions 2017-08-29 23:57:21 -07:00
daniel-surename
ed475ab24b fix: git status in __fish_git_prompt_informative_status (#4365)
Added and staged files weren't shown in the prompt,
had a missing $ to denote variables
2017-08-29 23:50:27 -07:00
Kurtis Rader
bd18736ee5 Switch to bare vars in our math invocations
Using bare vars is more efficient because it makes the builtin `math`
expression cache more useful. That's because if you prefix each var with
a dollar-sign then the fish parser expands it before `math` is run.
Something like `math x + 1` can be cached since the expression is the
same each time it is run. But if you do `math $x + 1` and x==1 then you're
effectively executing `math 1 + 1`. And if x==2 the next time then you're
running `math 2 + 1`. Which makes the expression cache much less effective.
2017-08-24 12:38:10 -07:00
Kurtis Rader
d10decabda Make builtin math the default implementation
Remove our `math` function that wraps `bc`. Our math builtin is now good
enough that it can be the default implementation.

Another step in resolving #3157.
2017-08-23 17:32:49 -07:00
Radek SPRTA
04bd4c4b4e Fix apt subcommand option completions
(cherry picked from commit 27d7feaf95)
2017-08-22 21:47:04 -07:00
Mahmoud Al-Qudsi
97dd46306e Replace custom s3cmd completion functions with standard __fish_* functions
Per the discussion with @faho in #4332, replaced some custom completion
state detection functions with standard __fish_* functions used in other
completion sources.

(cherry picked from commit f706081ea4)
2017-08-19 13:06:42 -07:00
Mahmoud Al-Qudsi
f8f954bd5c fixup! Provide completions for s3cmd
(cherry picked from commit 7fe3cb7b29)
2017-08-19 13:06:35 -07:00
Mahmoud Al-Qudsi
dbc67c6a4b Provide completions for s3cmd
No longer auto-generated. Everything has been summarized. Supressing
file completions for initial command, providing list of valid initial
commands, filtering --options by subcommand.

(cherry picked from commit 539acd9fc5)
2017-08-19 13:06:26 -07:00
Kurtis Rader
6e02ec83d1 Fix typo in xdg-mime completion functions 2017-08-17 10:54:05 -07:00
MoritzKn
5eb0b34da1 Update xdg-mime helper
This will respect the `/usr/local/share/applications/` directory when
fetching mime infos.

Update xdg-mime helper to comply with the xdg spec.

This also makes sure __fish_print_xdg_applications_directories only prints
directories that exist.

Relevant specs:
https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html
https://specifications.freedesktop.org/desktop-entry-spec/latest/ape.html
2017-08-17 10:50:06 -07:00
Matus Goljer
c611943cc2 Add completion for packages in update subcommand
This patch adds completion for the update subcommand, that is, when the
user types in `composer update <tab>`.

The code depends on python for the json parsing.  I'm not sure if this
is appropriate or if there is a fish-native way to parse json data.

Use suggestions for remove subcommand.

Add suggestions for why, why-not and depends.

Add why/why-not suggestion.
2017-08-17 10:32:15 -07:00
sentriz
72173a93a7 Accept return as a valid answer to 'Edit the file again?'
Also, check for affirmative answer so a random string isn't taken as a
"yes" response.
2017-08-14 18:18:41 -07:00
Fabian Homborg
4e2b11f2e0 help: Fix error if no argument is given 2017-08-14 18:18:10 -07:00
Mahmoud Al-Qudsi
fa4cf77aff Ignore more invalid arguments from parsed man pages
Specifically closes #4313.
Not being as agressive in what we ignore/blacklist, but can be revisited
easily in the future to add more characters to the argument blacklist.
2017-08-14 18:18:09 -07:00
Kurtis Rader
3a506543b6 Merge branch 'master' into major 2017-08-07 18:52:00 -07:00
Radek SPRTA
74cac0f86f completions for snap command 2017-08-07 18:47:37 -07:00
Kurtis Rader
55bef3cd2e remove deprecated . (dot) command
Fixes #4294
2017-08-07 18:31:20 -07:00
Mahmoud Al-Qudsi
0ebff8c516 Addresses #4292 by removing custom completions for source builtin
The source builtin should use the default path completion and isn't
restricted to *.fish files by wrapping ..fish
2017-08-07 17:49:28 -07:00
Kurtis Rader
1e67baf00e Merge branch 'master' into major 2017-08-07 17:49:02 -07:00
Alexey Alekhin
326f2affa4 Fixed functions -D/--details completion 2017-08-07 17:43:05 -07:00
Sam Yu
d87c0424d8 Speedup git prompt
Fix __fish_git_prompt too slow under repo with lots of untracked
files when __fish_git_prompt_showuntrackedfiles enabled.
2017-08-06 13:24:33 -07:00
Sam Yu
0988f53c70 Speedup git prompt
Fix __fish_git_prompt too slow under repo with lots of untracked
files when __fish_git_prompt_showuntrackedfiles enabled.
2017-08-04 20:43:07 -07:00
Kurtis Rader
8b79f4e5c9 use the new set -a and set -p in our scripts 2017-08-04 18:02:24 -07:00
Kurtis Rader
d4fb75e9f3 fix bug in abbr function
I introduced a bug in the `abbr` function with commit 17dff8c by
referencing the undefined `$cmd` variable. This fixes that.
2017-08-03 23:52:07 -07:00
Kurtis Rader
17dff8c569 rewrite abbr function
Rewrite the `abbr` function to store each abbreviation in a separate
variable. This greatly improves the efficiency. For the common case
it is 5x faster. For pathological cases it is upwards of 100x faster.
Most people should be able to unconditionally define abbreviations in
their config.fish without a noticable slow down.

Fixes #4048
2017-08-03 14:35:06 -07:00
Kurtis Rader
7e0833c1e0 Merge branch 'master' into major 2017-07-31 22:15:44 -07:00
Raoul Wols
8e3a9c9585 Add Sublime Text 3 completions 2017-07-31 22:09:06 -07:00
Kurtis Rader
1a55e9ba60 Merge branch 'master' into major 2017-07-29 21:58:15 -07:00
Daniel K
d68b631919 fix check for existing variable 2017-07-29 21:18:44 -07:00
Kurtis Rader
4e026588f4 modify prev commit to use builtin cd
Using the `cd` function can have undesirable side effects like mucking
with the directory history. So force the use of the builtin cd.
2017-07-27 14:36:32 -07:00
Kurtis Rader
defdc92b57 fix ssh config Include file handling
Fixes #4253
2017-07-27 14:36:32 -07:00
Mahmoud Al-Qudsi
34c2bf0f55 Using new complete --keep-order option for __fish_git_recent_commits
The primary motivation for --keep-order for `complete` was to support
something like commit history completions, which are returned by git in
reverse chronological order and make no sense alphabetically (they are
SHA1 hashes).

See https://github.com/fish-shell/fish-shell/issues/361 for more info.
2017-07-26 13:18:34 -07:00
Thales Mello
a071deaf61 Make npm run-script completion faster with jq (#4241)
* Make npm run-script completion faster with `jq`

When jq is available, it's actually faster to invoke jq and parse the `package.json`
invoking the `npm` command.

Also, prior to this commit, both `__fish_complete_npm` and `__fish_npm_run` were being run
whenever completions for `npm run` subcommand was being used, which was actually making
repetitive work (invoking npm command twice). This pull request is supposed to make completion
without `jq` faster as well

* Refactor npm.fish for code reutilization

Created function to handle both cases of npm run completion parse, with or without `jq` completion.

* Remove unecessary blank line
2017-07-26 13:31:35 +02:00
Kurtis Rader
92f39f7b89 fix bug introduced by commit 86af63cd3 2017-07-25 14:03:40 -07:00