Commit graph

2121 commits

Author SHA1 Message Date
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