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.
This is already done by fish before calling the completion.
It breaks completion with combiners (#2025) and also with wrappers.
(This does not include git because that's better solved in #2145)
There are two main problems in the existing Fossil autocompletion that this
patch solves:
* Because Fossil lacks an alias system similar to those in Hg and Git,
wrapper scripts are common, and aliasing them to `fossil` is also fairly
common. The lack of the `command fossil` pattern in the completions script
meant that the actual fossil command might not be called, but rather the
alias. This problem has been fixed by introducing a __fish_fossil command,
similar to the __fish_hg and __fish_git commands in those completion shells,
that does this, and converting all explicit fossil calls in the completion
script to use __fish_fossil instead
* Because there's now a centralized location for calling Fossil, I also moved
all of the repetitive stderr redirects that function.
This results in more robust and cleaner code.
This was too simplistic, among other things it completed things that
looked like key ids but weren't, didn't turn "\x3a" back into
colons (which made the argument invalid)....
gpg is weird.
Might fix#2150
Bit one: Make all the fossil command invocations throw away stderr so we don't
get annoying messages when not in a repository.
Also:
- Move checkout into alphabetical order.
- Fix ls to complete against tags for -r option, not no option.
- Add missing option to delete command.
- Make commit complete against modified files.
- Make add only complete against extra files.
- Remove now ununused function to list extra & modified files.
- Add -f option in a number of places where it seemd appropriate.
__fish_complete_mime used in that way is a no-op on current fish anyway,
and emacs is by no means useful for just text files (it can also view
PDFs, images, ...).
Otherwise this completion currently only offers options, not arguments.
For most these are pretty much incompletable (lisp code, for example),
and for others it's just not all that useful.
Signed-off-by: David Adam <zanchey@ucc.gu.uwa.edu.au>
This used to be a function because we didn't have complete -w
Use that and it becomes a bit simpler.
This also simplifies the code in a few other ways (like removing a
useless-use-of-cat)
and adds comments about a few edgecases.
New sample prompt from Acidhub (github.com/acidhub)
This prompt show user|path (full), and a small symbol to
show last command status.
If in a git repository, it's show after the path several
symbols to indicate the branch status and the branch name.
Very handy to me so far.
Signed-off-by: Fernando Manfredi <contact@acidhub.click>
changed `function __trap_handler_EXIT --on-exit %self` to `function __trap_handler_EXIT --on-process-exit %self`
I'm guessing the on-exit syntax was from an older version? Trapping EXIT with that syntax caused errors.
The following behaviour is added:
- an empty pushd exchanges the top two directories in the stack;
- pushd +<n> rotates the stack so that the n-th directory (counting from the left of the list shown by dirs, starting with zero) is at the top;
- pushd -<n> rotates the stack so that the nth directory (counting from the right of the list shown by dirs, starting with zero) is at the top.
1. When run with no arguments, make abbr do the equivalent
of `abbr --show`
2. Enable "implicit add", e.g. `abbr gco git checkout`
3. Teach `abbr --show` to not use quotes for simple cases
4. Teach abbr to output -- when the abbreviation has
leading dashes
Add some basic tests to abbr too.
Add a new function fish_mode_prompt which (if it is defined) has its output
prepended to the left prompt. Rather than replacing the prompt wholesale, make
fish_vi_mode enable this function by setting a variable __fish_vi_mode. This
enables vi mode to interoperate nicely with custom prompts. Users who want
to change how the mode is reported can either redefine this function or
erase it entirely. Fixes#1988.
- Add four new functions: forward-bigword, backward-bigword,
kill-bigword, backward-kill-bigword
- Add new enum move_word_style_whitespace and related state machine
method
- Change vi key bindings to operate on bigwords: B, gE, W, E, dW, diW,
daW, dE, dB, dgE, cW, ciW, caW, cE, cB, cgE, yW, yiW, yaW, yE, yB,
ygE
Notification is sent using an OSC 777 escape sequence as described at
http://known.phyks.me/2014/local-notifications-for-weechat-and-urxvt.
The specific notification is crafted to match that emitted by bash
when running under Fedora 22 with the "vte-profile" RPM installed.
See the code for "__vte_prompt_command" starting at
http://pkgs.fedoraproject.org/cgit/vte291.git/tree/vte291-command-notify.patch#n307
to see exactly what bash produces. My approach is, however, a bit
more paranoid about control characters embedded in commands.
Gnome-terminal 3.16 responds to this escape sequence by posting a
desktop notification if the containing terminal window does not have
focus. This lets the user know that a long-running background command
has completed. Job notification is promoted as a Fedora 22 feature
(http://fedoramagazine.org/terminal-job-notifications-in-fedora-22-workstation/),
so it would be good for fish users to be benefit from it.
Conversely, anyone who does not want this feature can use "functions
--erase __notify_vte_command_completed" to turn it off.
With the fix for #365, fish_command_not_found event handlers
receive the command and all of its arguments. But commands
like /usr/lib/command-not-found expect only the command name.
So when invoking an external command, just pass the command
name, not all of the arguments.