This adds blockdevices (and directories) and fixes the regexes to no
longer include comments but include UUID= and LABEL=, which at least
util-linux mount understands.
It also shouldn't fail on systems without fstab any longer (like default OSX).
Fixes#2606.
* Add missing options to `git clone` in order to make the suggestions as
similar to the manual (https://git-scm.com/docs/git-clone) as
possible.
Signed-off-by: mr.Shu <mr@shu.io>
Unfortunately, there's no standard way to detect support (importantly,
terminfo doesn't encode it), but there's a variety of terminals that
support it that we can detect.
It's better than letting this functionality go to waste.
Check KONSOLE_PROFILE_NAME instead of DBUS_SESSION because Konsole can be compiled without dbus support.
Check ITERM_SESSION_ID's format for 24bit support
This has changed since the last release, just like 24bit support. So if
we check one, we get the other.
* Make sure that the `git remote` subcommands are not repeatedly
suggested (that is do not suggest a subcommand if there already is one).
* Add both long and short options to `git remote` subcommands where
appropriate.
Signed-off-by: mr.Shu <mr@shu.io>
This does a number of things:
- Removing trailing space from suggested repos for hg.
- Use the string builtin for hg completions.
- Add more internal merge tools to hg completion.
- Enable completions for abbreviated hg commands.
- Stop completing a deprecated hg branches option.
- Properly match the hg subcommand when preceeded by global switches.
- Stop completing deprecated hg glog.
- Complete hg config instead of showconfig.
- Properly complete when global switches are before the hg command.
- Properly handle the repository switch for hg completions.
- Properly handle the hg global switch cwd.
Currently if there is a conflict with two manpages having the same
name, one completion will override the other. But if one can be parsed
and the other can't the one with parsed results will always have a
higher priority.
It seems smart to only let files be parsed that are clearly
manpage files. Other files wouldn't be openend by man so
I think it is safe to guess that only these files are man
pages.
Allows the length of each shortened path component to be customized by setting the `fish_prompt_pwd_dir_length` variable to the number of characters to include (plus a leading dot because that's special). Maintains the default behavior of shortening path components to just one character. You can also set `fish_prompt_pwd_dir_length` to an empty or invalid value or 0 to disable shortening completely.
This reduces code duplication and adds some previously unavailable
bindings that don't quite _violate_ the vi-principle (like
prevd-or-backward-word on alt-left) and matches other "impure" bindings
like \cf for forward-word (a quite emacs-ish binding) we already have.
Fixes#2412Fixes#2472Fixes#2255
For cygwin, you can't `cd C:`, so a prompt of "C:/Something" is
misleading.
For OSX, we dereference symlinks elsewhere
This also simplifies prompt_pwd quite a bit.
Not for _everything_ because that causes too many options to be
generated (which is an issue for git as it is), but for modified, staged
and added files - which is where it is most useful.
Fixes#901 as far as I'm concerned.
git has options that can appear before commands, but not all of
them, and some of them need an argument. This means
`__fish_seen_subcommand_from` will give too many false-positives, while
`[ (count $cmd) -eq 2 ]` will give too many false-negatives.
Instead go through all arguments and check if they are in that list of
options that can be before a command and skip the argument for them, if
any.
This is to the benefit of systems with ancient GNU sed, which does not
recognize "-E", but only "-r".
Fixes#2305 - even if it doesn't replace all `sed -E` invocations in the
codebase, the others are unlikely to occur on CentOS and other similarly
crusty systems.
`__fish_apm_using_command` was incorrectly taking lists of commands, new function added to support multiple a command having synonyms.
Simplify switch statement
Also remove superfluous function.
Allow for multiple completions after a command
Useful for removing packages, will complete for more than one.
Code improvements
`sort -u | uniq` is completely redundant, calling grep for every
status-pair is unnecessary, `contains` doesn't take the word "in" as
special.
None of these are critical and there's basically no performance benefit
since this function is utterly dominated by hg calls.
This doesn't add anything except slowing the function down by about
33%. Checking for a branch is just as good and that is displayed in the
prompt anyway.
According to the newer code below:
xdg_data_home = os.getenv('XDG_DATA_HOME', '~/.local/share')
the actual default path is ~/.local/share/fish/generated_completions/
This is used in at least 4 places, all of which have a bug in that they
print "options" as a valid repo. It seems better to fix it once,
especially given that there are tons of AUR helpers and pacman wrappers,
all of which might need this info.
net_tools, which provides `ifconfig` and `netstat`, among other things,
has last been updated in 2013. This means `ifconfig` on linux is
basically dead.
Instead of ifconfig, use `ip` (from iproute2), which is much more powerful and
provides a much more annoying commandline syntax.
Instead of netstat, just look at /sys/class/net.
fish_user_key_bindings is the user's, and they should know if they want
vi-ish bindings or emacs-ish (or nano-ish). If they want to define
multiple, they can also do that (e.g. via checking what
$fish_key_bindings is set to).
Fixes#2254
CC @kballard
This doesn't work with fish_config.
For terlar and pythonista, remove unnecessary color setting.
For informative+git and pythonista, move variable setup into fish_prompt
Fixes#1141
See #1925: This allows users to disable the cnf-logic which can be quite
slow on small hardware (like a raspberry pi).
Squashed commit of the following:
commit 742a59e30d8db24b6bb5067d4204d4b5cc01c1c3
Author: Fabian Homborg <FHomborg@gmail.com>
Date: Sun Aug 30 18:23:41 2015 +0200
Erase startup cnf-handler early
Simplifies the code a bit - in particular it removes the special-casing
from the startup handler.
commit 638a97e7f31f302b65e044c93c638c03a69e31f5
Author: Fabian Homborg <FHomborg@gmail.com>
Date: Mon Aug 24 20:14:46 2015 +0200
Make overriding cnf-handler work
Do this by renaming the __fish_command_not_found_handler used during
startup to __fish_startup_command_not_found_handler. That allows us to
check if __fish_command_not_found_handler has been defined and skip the
setup of the normal one.
Now disabling cnf-handling can be done via defining an empty
__fish_command_not_found_handler in config.fish
This adds a special colorscheme and prompt function guaranteed to work
on a VT and activates them automatically if $TERM = "linux".
set_color is overridden to only allow the 8 colors VTs have (under the
assumption those are always the same) and the color variables are
shadowed with global ones so they don't pollute our nice capable terms.