Commit Graph

5043 Commits

Author SHA1 Message Date
Fabian Homborg
be0d9d093c vi-mode: Make \cb do backward-word again
This is mentioned in the documentation, so keep it for now.
2015-10-28 13:20:23 +01:00
Fabian Homborg
bb491742ea vi: Bind \cx to end-of-line in insert mode
This will also accept any autosuggestion completely.
2015-10-28 13:18:27 +01:00
Bheesham Persaud
46fbfaaa83 Add cargo and rustc completion.
rustc.fish makes heavy use of the `string` commands.
2015-10-26 21:39:16 -04:00
Gary Peck
09bd938e25 Add ability to customize the amount of path shortening in prompt_pwd
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.
2015-10-26 13:11:13 +01:00
ridiculousfish
d5f3a09ce9 Make 'set -ql' search up to function scope
Previously 'set -ql' would only look for variables in the
immediate local scope. This was not very useful. It's also
arguably surprising, since a 'set -l' in a function, followed
by a 'set -ql' in a child block, would fail. There was also no
way to check for a function-scoped variable, since omitting the
scope would also pull in global variables.

We could revisit this and introduce an explicit function scope.

Fixes #2502
2015-10-23 15:15:39 -07:00
ridiculousfish
036a29acf5 Revert "reader.cpp: send carriage return after printing the window title"
This fix introduced #2499
This reverts commit 13479fbc2a.
2015-10-21 12:41:07 -07:00
Fabian Homborg
3e7dfd7f5e Switch useradd and chsh to string 2015-10-21 12:38:45 +02:00
David Adam
f21d826850 fish_complete_subcommand: shadow scope to inherit e.g. $PATH
Closes: #2141.
2015-10-21 15:38:20 +08:00
Jan Ernsting
8e3e286577 Update mix completion
Among others `mix escriptize` has not been supported since July 2014:
https://github.com/elixir-lang/elixir/issues/2468

Also explain what mix is.
2015-10-20 17:10:41 +02:00
Fabian Homborg
f4b4e5b41f git: Complete subcommands for git submodule foreach 2015-10-20 15:49:45 +02:00
Fabian Homborg
4a05d56337 git: Disable submodule subcommand completion if one is already given 2015-10-20 15:49:22 +02:00
Fabian Homborg
73708061fc Fix git submodule completions
Fixes #2494
2015-10-20 15:42:48 +02:00
David Adam
55abe105ea tests/bind.expect: re-enable but at human typing speed only
The interactive bind tests work if the keys are treated like there is a
human pressing them.

This reverts commit 0006d23df8.
2015-10-18 21:12:12 +08:00
Fabian Homborg
0006d23df8 Disable the bind test for now
This isn't pretty, but it fails for, as far as I can see, no _real_
reason.

It doesn't seem to be possible to trigger the failure in real usage, no
matter how fast you press the ESC key followed by something else.

So now this is known and constant travis emails don't help it in any way.
2015-10-18 14:14:22 +02:00
Fabian Homborg
df3da55602 git completion: Allow branches with "/" in them as unique remote branches 2015-10-16 17:15:37 +02:00
David Adam
13479fbc2a reader.cpp: send carriage return after printing the window title
Terminals can get confused by all the non-printed characters about the
line position.

Closes #2453.
2015-10-16 11:53:51 +08:00
Jeff Kowalski
226cdc6a28 Fix usage of history_filename 2015-10-16 07:40:04 +08:00
Jeff Kowalski
b13f0701a4 Migrate fish_history from config to data dir
New implementation of migration code within the history_t class will
copy the contents of the old fish_history found in the config directory
to its new location in the data directory.  The old file is left intact.

This is done only in the event that a fish_history is not already found in
the data directory ($XDG_DATA_HOME/fish or ~/.local/share/fish).
2015-10-16 07:40:04 +08:00
Jeff Kowalski
4c2cc384d2 Correct tests for new location of fish_history
The fish_history file is now located in the "data"
directory ($XDG_DATA_HOME/fish or ~/.local/share/fish),
accessible using the function `path_get_data`.

(This commit also cleans trailing whitespace in the source file.)
2015-10-16 07:40:04 +08:00
Jeff Kowalski
2971887bbd Access fish_history from $XDG_DATA_HOME
Add new functions path_get_data and path_create_data which parallel existing
functions path_get_config and path_create_data.  The new functions refer to
XDG_DATA_HOME, if it is defined, or ./local/share if not.

Modify history_filename to use the new function path_get_data.

As a consequence, fish_history will now be located in XDG_DATA_HOME,
not XDG_CONFIG_HOME.

Note that these changes mirror what is already used in
fish-shell/share/tools/create_manpage_completions.py, which stores the
completions in XDG_DATA_HOME

This change matches recommendations in the xdg basedir spec at
http://standards.freedesktop.org/basedir-spec/basedir-spec-0.7.html
($XDG_DATA_HOME defines the base directory relative to which user specific data
files should be stored. If $XDG_DATA_HOME is either not set or empty, a default
equal to $HOME/.local/share should be used.)

It addresses suggestions from the following issues:

1. Don't put history in $XDG_CONFIG_HOME (closes #744)
   https://github.com/fish-shell/fish-shell/issues/744

2. Fish is placing non-config files in $XDG_CONFIG_HOME #1257
   https://github.com/fish-shell/fish-shell/issues/1257

3. Move non-config data out of $XDG_CONFIG_HOME #1669
   https://github.com/fish-shell/fish-shell/issues/1669
2015-10-16 07:39:49 +08:00
David Adam
b776327b9d Revert "prompts: more concise way of getting the hostname."
This reverts commit 233c443694.

See discussion in https://github.com/fish-shell/fish-shell/pull/2489
2015-10-16 07:01:12 +08:00
David Adam
b7e991c4b7 Makefile: only clean PCRE2 directory if it is configured in 2015-10-15 17:18:02 +08:00
David Adam
9788566ba4 Revert "reader.cpp: send smkx/rmkx when entering/leaving interactive mode"
This reverts commit a66d44054c due to
https://github.com/fish-shell/fish-shell/issues/2406 - entering keypad
mode causes various terminals to send undocumented and highly variable
escapes for keys not specified in the terminfo specification.
2015-10-15 16:20:25 +08:00
Michael Fogleman
233c443694 prompts: more concise way of getting the hostname. 2015-10-15 11:59:39 +08:00
Fabian Homborg
35bbc1d7b7 vi: Make \cf do forward-word again in insert mode 2015-10-14 18:34:58 +02:00
Fabian Homborg
4e5e04bfda vi: Readd \cx binding 2015-10-14 18:31:45 +02:00
Fabian Homborg
c0e8ad6f1f Make vi bindings inherit the defaults
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 #2412
Fixes #2472
Fixes #2255
2015-10-13 21:08:55 +02:00
buo
3472a39d07 Add BSD specific arguments for tr command completion 2015-10-13 15:52:14 +02:00
Fabian Homborg
9865a8c807 Also send konsole cursor sequence for iTerm2
Fixes #1403
2015-10-13 15:36:55 +02:00
Matt Steedman
35e769d494 Make fish_vi_cursor check $TERM or use argument
Fixes #2475
2015-10-13 15:33:45 +02:00
Fábio Nogueira
6e3ea5b2ea New pt_BR translations - 25% 2015-10-12 19:54:53 +02:00
Fabian Homborg
54f215294f export: Fix replacing
Also run it through fish_indent
2015-10-12 11:35:45 +02:00
Ashok
f6f982226a Removed misleading space in stderr redirection example 2015-10-11 18:47:26 +05:30
Fabian Homborg
98b33d7b6b Fix pushd completions in the -n case 2015-10-09 20:02:28 +02:00
Fabian Homborg
86471ac21f Remove OSX/Cygwin special cases from prompt_pwd
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.
2015-10-09 17:45:45 +02:00
David Adam
57e22e87c2 functions/man.fish: add fish into MANPATH even if it is already set
Closes #2443.
2015-10-09 21:01:59 +08:00
David Adam
0b3406bdc0 tests/string.in: add tests for string builtin 2015-10-09 11:27:18 +08:00
David Adam
74cd977566 travis: add OS X build, add AddressSanitizer build, stop building docs
Leak checking is disabled for now as it has the potential to produce too
many false positives.
2015-10-08 14:58:10 +08:00
ridiculousfish
d9d2f61ba6 When autoloading a completion, also autoload the function
Fixes a case where a --wraps declaration would be missed
because the function would not be loaded. Fixes #2466.
2015-10-07 18:59:41 -07:00
ridiculousfish
434eabb787 Remove errant slash from the end of cd completions
Fixes #2465
2015-10-07 13:39:42 -07:00
ridiculousfish
e8605cb3ef Fix a dereference-past-the-end bug in read_redirection_or_fd_pipe
Fixes #2464. Credit to zanchey for reporting it and ASAN for finding it!
2015-10-07 11:38:13 -07:00
ridiculousfish
1bdf06836a Factor running the xcode_version_gen.sh
Instead of duplicating the script invocation across targets,
put it into a separate target and add dependencies. This also
requires moving its output into the SHARED_DERIVED_FILE_DIR
(which may be undocumented)?
2015-10-07 11:01:49 -07:00
Fabian Homborg
0a99772572 Rewrite __fish_complete_cd
This no longer uses "eval" (which is scary), and is a bit shorter (which
is nice).

Fixes #2299
Fixes #952

Improves #2300
Improves #562
2015-10-07 10:41:05 +02:00
Fabian Homborg
2ffb47eba2 Add missing \n to pushd completions 2015-10-07 10:26:27 +02:00
Fabian Homborg
b208d752e2 git completion: Complete files relative to repo-root
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.
2015-10-06 14:05:08 +02:00
Fabian Homborg
ec74479d44 Add pushd -n to completions, use string
Also indent with fish_indent
2015-10-05 15:23:05 +02:00
Derek Harland
e75108fc4c Improve pushd completions
Add completions for rotating and swapping the stack.
2015-10-05 15:12:38 +02:00
Fabian Homborg
176e34cf73 Remove ls|__fish_sgrep from apt-proxy-import 2015-10-04 15:45:02 +02:00
Fabian Homborg
65415cb761 Move make completion to string
This also removes a hack that's not needed anymore
2015-10-04 15:41:20 +02:00
Fabian Homborg
45bf843b03 Move python comp away from eval and sed
I have no clue why this used eval.
2015-10-04 15:41:20 +02:00