Commit Graph

1460 Commits

Author SHA1 Message Date
Aaron Gyes
81dee16d69 Add back prompt_pwd to solve empty output problem
..by not manipulating path at all if we do not have
the tools to do so.

Tag changes with better comments.
2016-06-26 20:25:11 -07:00
Aaron Gyes
02f578a82d echo the no-string errors to stderr and return 1.
Fix output on launch

Drop __fish_urlencode.fish

Drop prompt_pwd.fish
2016-06-26 16:25:41 -07:00
Aaron Gyes
dfb4998778 Work around absent `string' in old fishies upgrading.
Improves experience during upgrades, accidentally running
an old fish with a new environment. No errors just from
printing a prompt. Fixes #3057.

Print helpful notice also when launching mismatched fish.

Autoloadable string.fish -- only create function if not builtin.
2016-06-26 16:25:41 -07:00
Fabian Homborg
8070cd81d6 npm completions: Check command npm existence
Really fixes #3158 and #3152.

(cherry picked from commit 10661bb024)
2016-06-21 17:43:55 +02:00
Fabian Homborg
bc8ec46ef9 npm completions: Call command npm
npm is often wrapped by a function.

Fixes #3158.

(cherry picked from commit 3a0d417b9e)
2016-06-21 12:40:23 +02:00
Fahri Cihan Demirci
db0176b884 Add Purge Subcommand Completion for Apt (#3097) 2016-06-20 18:23:12 -07:00
Jens Fredskov
7cf6ef675a correct __fish_contains_opts to __fish_contains_opt (#3102)
Completion throws and error about the command `__fish_contains_opts` beings unknown. It seems to be a simple typo, as all other completions use `__fish_contains_opt`
2016-06-20 18:16:10 -07:00
Fabian Homborg
29664c42a0 git completions: Ignore stderr everywhere
This allows us to run git commands outside of a git repo.

Fixes #3114.
2016-06-20 18:11:26 -07:00
Fabian Homborg
8dc4b0d4b2 Merge pull request #3123 from moverest/completion
Extend autocompletion support
2016-06-20 18:05:01 -07:00
Boris Aranovich
cb74f0f60e Refine reading ssh_config (#3146)
https://www.freebsd.org/cgi/man.cgi?query=ssh_config&sektion=5
1. It is possible to add multiple whitespace characters between the keyword (i.e. Host) and the argument(s).
2. It is allowed to have a single = and whitespace between the keyword and the argument(s).
3. It is possible to add multiple host names under a single Host directive by spacing the names apart.

1. and 3. are actual conventions that we use in our team, and I couldn't get auto-complete working for fish without this modification.

Modification explained:
a. The space between Host(?:name)? and the \w.* was replaced by (?:\s+|\s*=\s*) to match any sequence of whitespace characters, or optional whitespaces with a single =, per spec.
b. Result of first replacement is piped through another string replace to switch duplicate whitespace characters to a single space, and then piped to be split by that space. This allows specifying several aliases or host names in a single Host/Hostname definition, also per spec.
2016-06-20 17:06:45 -07:00
Fabian Homborg
fcbeddc3eb Remove $__fish_vi_mode
This makes fish_mode_prompt rely on $fish_key_bindings instead.

fish_bind_mode is also set in default mode (only always "default"), so
it can't be used as the indicator.

Closes #3067.

(cherry picked from commit 8ab980b793)
2016-06-06 22:21:52 +08:00
Jorge Bucaran
14b953e414 Add missing color definitions to __fish_init_1_50_0 reset. (#2987)
* Add missing color definitions to __fish_init_1_50_0 reset.

The values where determined by inspecting the values of:

* fish_color_end
* fish_color_user
* fish_color_host

after resetting the color theme via fish_config.

* Add documentation for fish_color_user and fish_color_host.

(cherry picked from commit 08c29727e0)
2016-05-20 21:02:56 +00:00
ridiculousfish
768277a312 Remove the errant newline in __fish_cancel_commandline again
(cherry picked from commit 149e601743)
2016-05-13 23:19:53 +01:00
Daniel Bergmann
c53951b9b3 Add tags to completion list for git show. (#2998)
(cherry picked from commit ac47100a7d)
2016-05-08 14:07:32 +02:00
[Redacted]
4d1e77fcae Added completions for rmmod (#3007)
(cherry picked from commit 59c8800c4d)
2016-05-08 14:07:32 +02:00
Vladimír Čunát
4efd0dfd65 docs: fix location of generated_completions (#3010)
(cherry picked from commit 100eef4e42)
2016-05-08 14:07:32 +02:00
Elis Axelsson
8ec81393a3 Change abbr to allow non-letter keys (#2996)
(cherry picked from commit 1c6f6df2b3)
2016-05-06 16:17:01 +02:00
Kurtis Rader
1cd4731c2d don't use colors when writing the ^C indicator
There was an extended discussion in https://github.com/fish-shell/fish-shell/issues/2904 about using a bright yellow background to make the cancelled command indicator, ^C, standout. The upshot was that standout (i.e., reversing fg/bg colors) mode should be used until themes are agumented with proper support for background colors and special characters.

(cherry picked from commit a897ef0025)
2016-04-30 12:31:57 -07:00
Fabian Homborg
05a432da32 Remove using_command from netctl completions
This allows `; and netctl` to work.

First step towards #2705.
2016-04-30 16:51:49 +02:00
Fabian Homborg
404ab5e9ab git completion: Allow optional "+" for push
This signifies a force-push.

To avoid cluttering, only complete branches if a + is already given.

Fixes #2879.

(cherry picked from commit fde26d4049)
2016-04-30 16:35:14 +02:00
Fabian Homborg
901652d5c3 Add repository/refspec completion to git
A few commands (fetch, pull and push at least) take a "repository" (aka
"remote") and then a "refspec" (we currently do branches here).

Fixes #2525 (seems that man is still alive)

(cherry picked from commit b32bf22616)
2016-04-30 16:35:14 +02:00
Kurtis Rader
52731c480c provide a realpath implementation
Not all distros have a `realpath` command. Provide a function that uses the
real command if available else use the fish builtin.

Fixes #2932

(cherry picked from commit 6c329e8a83)
2016-04-29 21:30:26 -07:00
Kurtis Rader
54319435f4 clarify fish_vi_mode deprecation warning
Also, correct the Vi mode default escape timeout. I intended it to be 100 ms
in my previous change but it ended up 10 ms which is far too short. A 10 ms
delay will continue to cause problems for people running fish inside `screen`,
`tmux`, or over high latency connections.

Cherry-picked from 3e24ae80b3
2016-04-29 15:52:10 -07:00
Sanne Wouda
09bb713989 git takes --help even when it needs a command (#2984)
`git --help` is a valid command and fish should complete it as such
2016-04-29 12:59:04 +02:00
Fabian Homborg
6466ffe82d git completion: Only show unmerged branches for cherry-pick 2016-04-29 12:59:04 +02:00
Kurtis Rader
ce41e3468e add way to comment/uncomment a command
Fixes #2375

(cherry picked from commit 2f8d0e9aba)
2016-04-28 14:58:15 +08:00
Fabian Homborg
d0fdc80725 Make busctl completions useful
- More accurate

- Fast enough to be usable (previously, this would sometimes take a few
  seconds)

- A bit smaller
2016-04-27 14:17:29 +02:00
Fabian Homborg
e7599fd18c Allow overriding fish_term24bit on launch
(cherry picked from commit ba1008b750)
2016-04-18 14:20:42 +02:00
Fabian Homborg
8d3eae0d76 Move 24bit setup into config.fish
Fixes #2941.

(cherry picked from commit 8558561650)
2016-04-18 14:20:42 +02:00
Yauhen Kirylau
c2e9cda7b3 Add completions for 'pacaur' (#2934) 2016-04-15 15:10:21 +02:00
Laurence McGlashan
4aa8fc753f Correct typo in valgrind completions 2016-04-15 15:10:21 +02:00
Fabian Homborg
635a1e9dd2 Remove the default self-insert binding in vi-default mode
Fixes #2832.
2016-04-15 15:10:21 +02:00
Fabian Homborg
d7c690b416 Fix "." and ".." paths in cd completions
Previously if a directory called "a" was in $CDPATH, `cd ./a<TAB>` would
complete from there even if it was invalid.
2016-04-08 15:03:49 +02:00
Aaron Gyes
36691df6fe Stringify many completions and functions, with --invert stringification.
I believe apm must have been buggy - example output that I found online
showed `tr` was mangling paths with spaces in it. Should be fixed.

Also, use dscl on OS X in __fish_complete_users.fish like
__fish_print_users.fish already does.
2016-04-08 10:49:29 +08:00
David Adam
200a10e78d Rename "snippets" to "conf" internally, and document them as snippets
Discussed in #2896.
2016-04-06 09:33:09 +08:00
David Adam
484c1484c9 Customisable extra configuration, completion and function directories
- Add options to the autotools build to set the path for the "vendor"
   or "extra" configuration snippets, functions and completions
   directories.

 - Remove the vendor_completions directory from the Xcode build, as
   these are relocatable and compiling the paths in does not make sense.

This allows packaging tools like Homebrew and Nix to use a common
directory outside of the main prefix for third-party completions, and
to make these available for programmatic discovery through `pkg-config`.

Closes #2113
2016-04-04 15:58:13 -07:00
Fabian Homborg
0953590cca cd completion: No description for absolute paths
This also removes the "pushd/popd" dance and only executes the CDPATH
stuff when we need to.
2016-04-04 18:22:48 +02:00
Sam Yu
7e014174b8 __fish_print_packages: use libzypp builtin cache for zypper 2016-03-30 15:03:51 +02:00
Fabian Homborg
aacdaee6a9 Add history --help
This was probably an oversight - the builtin supports it, the function doesn't.
2016-03-30 15:03:51 +02:00
Kurtis Rader
a148b755a6 more fish_indent cleanup for prev commit
Commit dfb23c4fce was supposed to incude
all the edits to make the code compliant with fish_indent.
2016-03-29 16:42:58 -07:00
Kurtis Rader
dfb23c4fce fix regression to vi-mode \cc binding
Commit c0e8ad6 on 2015-10-02 to "Make vi bindings inherit the defaults"
inadvertently reverted commit b6b6de3. Fix that regression. And while I
hate to make "git blame" say I changed the entire file make the function
adhere to fish_indent style.
2016-03-29 15:33:37 -07:00
Josef Gajdusek
0eb3fd6b3f Make modprobe completion more precise
Only match loaded modules when -r is specified.

Also adds /lib/modules/(uname -r)/misc to the search path.
This directory is used by Gentoo for package-provided modules
(such as the app-emulation/virtualbox-modules)
2016-03-28 14:38:19 +02:00
Josef Gajdusek
6663c73eb0 Fix typos: ingnore->ignore 2016-03-28 14:38:19 +02:00
Fabian Homborg
7accadc33f Only read .fish files in the snippets directories
This would allow us to add a README and allows users to easily disable
something temporarily.
2016-03-26 19:20:40 +01:00
Bogdan Sinitsyn
516695ff21 add yaourt completions 2016-03-24 16:17:10 +01:00
Kurtis Rader
9d2b53450a limit size of cd history to 25 directories
The existing implementation grows the $dirprev array without bounds. Besides
causing what would appear to be a memory leak it also makes the nextd and
prevd commands more expensive than they need to be. It also makes it harder to
create a useful "menu" cd command.

In addition to implementing a reasonable limit on the size of the $dirprev
array I've reformatted the code using fish_indent.

Update the documentation to include mentions of the $dirprev and $dirnext
variables as well as the limit on how much directory history is kept.

Fixes 2836
2016-03-23 13:36:00 -07:00
Fabian Homborg
a81bd697a8 Make reading ssh files case-insensitive
Fixes #2843
2016-03-22 11:09:36 +01:00
Federico Ferri
168a156e58 implement swap-selection-start-stop function
The swap-selection-start-stop function goes to the other end of the highlighted text, the equivalent of `o' for vim visual mode.

Add binding to the swap-selection-start-stop function, `o' when in visual
mode.

Document swap-selection-start-stop, begin-selection, end-selection, kill-selection.
2016-03-20 19:22:04 -07:00
Federico Ferri
879ee61a30 fix w, e (with a trick to cope with big-words) 2016-03-20 19:17:15 -07:00
Kurtis Rader
fb0921249f add \r equivalent binding
Add a binding that was overlooked by commit
d65c63322e.

Fixes #2834
2016-03-20 12:08:46 -07:00