Commit graph

696 commits

Author SHA1 Message Date
Anmol Sethi
3c0de01c07 docs: set should have -x for PATH in config.fish 2016-10-13 20:06:54 -07:00
Kurtis Rader
1d418365b5 fix misplaced backtick 2016-10-12 18:04:20 -07:00
Kurtis Rader
a3d0ea5c7f document making abbreviations global
People regularly ask how to make abbreviations global (i.e., private to
a fish session) rather than universal. So explain how to do so in the
`abbr` man page.

Fixes #3446
2016-10-12 15:36:03 -07:00
Kurtis Rader
d35cbb6594 fix string documentation wrt --no-quoted 2016-10-11 20:08:07 -07:00
Aaron Gyes
ea3e144f2d Fix warning: Found unknown command `\args'
The problem was that 'cd' is a builtin.
Thanks @MarkGriffiths

Fixes #3418
2016-10-10 11:50:39 -07:00
Kurtis Rader
f7f39b8c90 make fish's realpath compatible with GNU realpath
After implementing `builtin fish_realpath` it was noticed that it did
not behave like GNU `realpath` without options. Which is super annoying
since that was the whole point of implementing the command. Major
failure on my part since I wrote the unit tests to match the behavior of
the existing `wrealpath()` function that I simply exposed as a builtin
command. Rather than actually verifying it behaved in a manner
compatible with GNU realpath.

Also, while the decision to call the builtin `fish_realpath` seemed to
make sense at the time of the original commit further reflection has
shown that to be a silly, idiosyncratic, thing to have done. So rename
it to simply `realpath`.

Fixes 3400
2016-10-04 20:19:44 -07:00
Kurtis Rader
e9b5505169 add a flag to limit history search results
This adds a flag to the `history search` command to limit the number of
matching entries to the first "n". The default is unlimited. This is
mostly useful in conjunction with aliases (i.e., functions) that are
intended to report the "n" most recent matching history entries without
piping the result through the user's pager.

Fixes #3244
2016-09-23 19:43:58 -07:00
Kurtis Rader
204e79105a allow customizing history --show-time format
It would make fish more friendly if we allowed the user to specify the
format of the history entry timestamps.

Fixes #3361
2016-09-20 20:14:02 -07:00
Kurtis Rader
76c73aa8ce alter history sub-command handling
This deprecates the use of long options for history sub-commands (e.g.,
`history --delete`) in favor of proper sub-commands (e.g., `history
delete`). It also eliminates the short options for those sub-commands.

Also change option processing to allow options anywhere on the command
line to match how the vast majority of fish builtins handle flags.

Replace --with-time with --show-time.

Fixes #3367
2016-09-18 20:09:06 -07:00
Aaron Gyes
af95813514 Merge branch 'master' of https://github.com/fish-shell/fish-shell into colorfix 2016-09-10 15:09:12 -07:00
Aaron Gyes
87fd9bca02 Group history items together with timestamps on separate line (#3333 from floam/historyout) 2016-09-07 07:57:06 -07:00
Aaron Gyes
3d6cb59b31 Use %Y-%m-%d %H:%M:%S format, update tests
Update history docs.

Note - the omission of a mention of timezone was intentional. These were recorded as naive timestamps lacking timezone information in the first place.
2016-09-07 07:52:45 -07:00
Aaron Gyes
6936e64b34 Show history timestamps on seperate lines #-prefixed.
Improves the grouping of multiline history entries
by sepearating the timestamps and history entires onto seperate lines.

Use wcsftime() Saves us a conversion, might as well.
2016-09-07 07:51:32 -07:00
Fabian Homborg
cac3b239e3 Use fish_vi_cursor by default
Fixes #3215.
2016-09-05 01:28:21 +02:00
Fabian Homborg
7ce042ccff Really allow for hybrid bindings
The previous solution would not erase the previous bindings if
fish_vi_key_bindings was called with a mode argument. So if the user
switched to vi with a different initial mode, they'd keep their previous
bindings also.

Supersedes e89057b.
2016-09-05 00:47:37 +02:00
Fabian Homborg
e89057b70c Make hybrid bindings easier to achieve
The vi-bindings function would unconditionally erase all bindings,
making it impossible to call it last. This would disable the
mode-indicator (and in future also the cursor).

Make it so any argument to fish_vi_key_bindings stops it from erasing
bindings.

It would also be possible to demand an argument to erase (or to erase as
a separate step). but the usual case seems to be _switching_ to a set of bindings.
2016-09-03 23:11:36 +02:00
Kurtis Rader
cfefaaf4ee revert the --shadow-builtin flag
Implementing the --shadow-builtin flag has proven to be highly controversial.
Revert the introduction of that flag to the `function` command. If someone
shoots themselves in the foot by redefining a builtin as a function that's
their problem and not our responsibility to protect them from doing so.

Fixes #3319
2016-08-24 22:56:19 -07:00
David Adam
4f596536f5 docs: clarify configuration file locations
Altered the language from 2047351723 to be clearer.
2016-08-25 05:48:19 +08:00
Fabian Homborg
2047351723 Mention variables in doc on config file locations
Fixes #3291.
2016-08-24 23:35:22 +02:00
Martin Pool
386c698d45 Remove optimizeLegibility and display:inline-block
Fixes fish-shell/fish-site/issues/34.

These make the inline commands illegible on Android Chrome:
respectively, overlapped with other text, and smaller than the body
text.
2016-08-14 16:52:27 -07:00
Kurtis Rader
710addde16 fix history --delete regression
The recent change to reconcile the history builtin command and function
broke an undocumented behavior of `history --delete`. This change
reinstates that behavior. It also adds an explicit `--exact` search mode
for the `--search` and `--delete` subcommands.

Fixes #3270
2016-08-10 21:51:01 -07:00
Fabian Homborg
744da2cab2 Add backspace bindings to vi-mode
This was erroneously omitted from the previous commit.

Now backspace in insert mode does backward-delete-char, in default mode
backward-char (i.e. no deleting, just moving). This is consistent with vim.
2016-08-04 20:45:21 +02:00
Fabian Homborg
93b9e7443e Share some bindings between vi- and emacs-mode
This undoes the inheritance since it shared too much.

The idea here is to share bindings that aren't something the editors we're inspired by do - there's no "execute" in vi.
The basic editing and moving bindings are now vi-style in vi-mode and emacs-style in default mode.
2016-08-04 14:03:13 +02:00
Aaron Gyes
3f9bd72bca Revert "add files for the fish logo as used for the fish-shell stickers"
This reverts commit c4cc9f9b8d.

See #3278
2016-08-01 16:30:14 -04:00
Kurtis Rader
b12c413c28 add sources of 3rd-party extensions to the FAQ
Fixes #2103
2016-07-27 20:55:04 -07:00
Aaron Gyes
644ea82c2f Update set_color documentation
Update docs for "brblack", "brwhite"  existing.

We no longer mention colors like grey, brown and purple, which are aliases
for yellow, magenta, white/black. The color names still work but there
isn't a good argument for there being two ways to do that: especially in
the age of 24-bit terminals where one might expect yellow and brown or
magenta and purple to actually be different colors.

Copyedit rest of document for inaccuracies, strange advice, brevity (a lot
of "you" pronouns, for example.)

Document the color fallback feature (set_color 313554 blue) that's been
present quite a while.
2016-07-24 17:50:13 -07:00
ridiculousfish
450d4be88f Shorten an overlong set_color example in the man page
The `set_color normal` text had a comment that caused
the example to wrap to the next line in an 80 column window.
Shorten the comment so the example fits on one line.
2016-07-24 17:04:51 -07:00
Kurtis Rader
b53f42970c correct handling of history args
This fixes several problems with how the builtin `history` command handles
arguments. It now complains and refuses to do anything if the user specifies
incompatible actions (e.g., `--search` and `--clear`). It also fixes a
regression introduced by previous changes with regard to invocations that
don't explicitly specify `--search` or a search term.

Enhances the history man page to clarify the behavior of various options.

This change is already far larger than I like so unit tests will be added
in a separate commit.

Fixes #3224.

Note: This fixes only a couple problems with the interactive `history
--delete` command in the `history` function. The main problem will be
dealt with via issue #31.
2016-07-20 21:18:48 -07:00
Mark Griffiths
eb0d04d7ff Fix imbalanced backticks
Only found one instance, which I’d already identified.
2016-07-16 20:22:41 -07:00
Mark Griffiths
b2be50f081 Fix documentation
Restores erroneous changes to lexicon_filter and changes to doc_src/ pages. Done by hand to ensure version history.

Fixes display of % when misinterpreted by Doxygen.
2016-07-16 20:22:41 -07:00
Fabian Homborg
733e960c11 Document that set_color works with escape sequences
Fixes #2378.
2016-07-08 12:58:39 +02:00
Kurtis Rader
3c4e322ec1 make fish_indent options consistent with fish
Make `fish_indent`, `fish_key_reader` and `fish` recognize and assign
the same meaning to the `-d` and `-D` flags. Also, fix some errors and
stylistic issues in the associated man pages.

Fixes #3191
2016-07-05 20:22:44 -07:00
Aaron Gyes
f839282ac0 fish_key_reader had no -h output 2016-07-03 05:03:32 -07:00
Aaron Gyes
163e16f546 fkr manual improvments. 2016-07-03 03:43:14 -07:00
Aaron Gyes
5a1a25bfbe Fix docs 2016-07-03 02:02:44 -07:00
Aaron Gyes
ca15a22cd1 doc grammar: s/learning/learn 2016-07-03 00:16:05 -07:00
Aaron Gyes
417d53a58f Update fish_key_reader docs
* Document all options
 * Document bind command output
 * Remove session output - it's enough to explain how one exits.
2016-07-03 00:03:39 -07:00
Aaron Gyes
9642fcb589 Update suspend docs. When used, show how to resume
Fixes #3154
2016-07-01 01:18:07 -07:00
Kurtis Rader
cbee315b1b fix the history function and man page
The previous commit to add a `--with-timestamp` flag to the `history` command
caused me to notice the history function didn't recognize the new long option.
Neither did it recognize the short options for the builtin command. This
change fixes both of those issues.
2016-06-30 22:01:59 -07:00
Fabian Homborg
ea71f0b610 Reword variable expansion docs 2016-06-26 11:36:31 +02:00
Fabian Homborg
a3e9e179eb Document fish_mode_prompt 2016-06-26 11:36:31 +02:00
bgeron-g
5d680f6dbc Fix typo 2016-06-23 18:23:10 +02:00
Fabian Homborg
f9edcbbbe2 Document clipboard bindings. 2016-06-21 16:25:11 +02:00
Aaron Gyes
f04644f749 Lossless recompress of images with pngcrush+zopfli
And tweak RTF.
2016-06-18 10:03:26 -07:00
Fabian Homborg
8829bb1364 Expand string documentation
Explain that globs need to match the entire string and a bit about our
regular expressions.
2016-06-08 15:04:54 +02:00
David Adam
bb11999bf7 license.hdr: remove strlcat license information
Function and code removed in 5bf1b0e5f

[ci skip]
2016-05-30 16:00:23 +08:00
Fabian Homborg
ffe5736abb History docs: Move descriptions to the corresponding options
This should clarify `--delete`s behavior without `--prefix` or
`--contains` a bit.

Fixes #3054.
2016-05-28 14:22:16 +02:00
Fabian Homborg
d55b226f19 Document the rest of the electric/ro vars
Fixes #3072.
2016-05-26 18:27:39 +02:00
Fabian Homborg
1bad956633 docs: Remove section about clipboard integration 2016-05-25 16:10:16 +02:00
Dennis Ideler
0a40dcdb44 Fix documentation links to or and and command 2016-05-24 17:16:30 -07:00
Fabian Homborg
dc470bcad3 Document noclobber redirections
Fixes #2812.
2016-05-23 11:29:38 +02:00
Camille Scholtz
2606cfe72d add option to modify script being restyled
This change allows the user to specify the script name on the CLI in addition
to being redirected from stdin. It also adds a `-w` flag to write the modified
script to the original file.
2016-05-22 20:00:23 -07:00
James Campos
432c0058a9 [doc] move regex example (#3045)
this example uses regex, so it should not be in the glob examples
2016-05-20 15:57:29 +02:00
ridiculousfish
30ea7cc3f8 Update docs to reflect new if/while condtion chaining
Documents new behavior in #1428
2016-05-19 13:01:12 -07:00
Kurtis Rader
73f2992a2e make debug() output more useful
This change does several things. First, and most important, it allows
dumping the "n" most recent stack frames on each debug() call. Second,
it demangles the C++ symbols. Third, it prepends each debug() message
with the debug level.

Unrelated to the above I've replaced all `assert(!is_forked_child());`
statements with `ASSERT_IS_NOT_FORKED_CHILD()` for consistency.
2016-05-17 14:52:55 -07:00
Kurtis Rader
51468b7646 add function --shadow-builtin flag
It's currently too easy for someone to bork their shell by doing something
like `function test; return 0; end`. That's obviously a silly, contrived,
example but the point is that novice users who learn about functions are
prone to do something like that without realizing it will bork the shell. Even
expert users who know about the `test` builtin might forget that, say, `pwd`
is a builtin.

This change adds a `--shadow-builtin` flag that must be specified to
indicate you know what you're doing.

Fixes #3000
2016-05-14 20:38:32 -07:00
Kurtis Rader
b055b8440c enhance the key_reader program
The original `key_reader` program was useful but didn't do much that `xxd`
or `od -tx1z` didn't do. Furthermore, it wasn't built and installed by
default. This change adds features that make it superior to those programs
for decoding interactive key presses and makes it a first-class citizen
like the `fish_indent` program that is always available.

Fixes #2991
2016-05-10 14:11:30 -07:00
Vladimír Čunát
100eef4e42 docs: fix location of generated_completions (#3010) 2016-05-08 13:51:30 +02:00
Fabian Homborg
1d101ef3d0 docs: Mention cartesian product in variable-expansion section
See #3002.
2016-05-07 19:49:15 +02:00
Alexey Alekhin
01e5ca5c96 Changed the code to add fish to /etc/shells to the one that is mentioned in the Readme 2016-05-06 18:47:57 -07:00
Kurtis Rader
d97c22df2d add floating point output to math command
This makes it easy for the user to request floating point output with the
desired number of digits after the decimal point (not to be confused with
significant digits).

Note that this is just a thin wrapper so someone can say `math -s3 10 / 3`
rather than `math "scale=3; 10 /3"`.

Resolves #1643
2016-05-03 19:29:04 -07:00
Jorge Bucaran
08c29727e0 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.
2016-05-01 11:58:43 +02:00
Kurtis Rader
6c329e8a83 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
2016-04-28 16:03:27 -07:00
Fabian Homborg
ba5a22e2ce Deprecate fish_vi_mode
This was never mentioned in the documentation as the way to switch to
vi-mode, and now does nothing of value anymore.
2016-04-26 15:21:15 +02:00
Kurtis Rader
dcef1a5593 more doxygen lexicon changes to eliminate errors
I noticed that Doxygen was also complaining about the "<asis>" and "<bs>"
tags. So convert those to the backslash form like we did for "<outp>" in the
previous commit.
2016-04-24 15:02:52 -07:00
Kurtis Rader
5df8fab463 replace <outp> command with \outp in docs
Doxygen has been warning that `<outp>` and `</outp>` are not valid XML/HTML commands since commit cb6d5d76 on 20016-04-04. That's primarily because there is at present no way to tell Doxygen to recognize new XML/HTML tags. The actual errors look like this:

```
.../string.doxygen:187: warning: Unsupported xml/html tag </outp> found
```

I hate build errors since they a) cause needless concern, and b) make it harder to notice when I've introduced a new error. So switch from XML/C## style markup to Doxygen style markup for the "outp" annotation.
2016-04-23 21:19:58 -07:00
Kurtis Rader
b8817215dc trivial fixes to make doxygen happy 2016-04-23 12:26:57 -07:00
Fabian Homborg
6c5f923a47 Remove non-existing functions in bind docs
At least delete-line was previously a thing, but none of these are still available.

First part of #2914
2016-04-08 16:35:12 +02:00
Aaron Gyes
790c7f80c7 Implement an --invert/-v for string match, like grep -v.
Only lines that do not match the pattern are shown.
2016-04-08 10:49:29 +08:00
Fabian Homborg
8477126ae4 Correct true-color statement in set_color docs
- OSX Terminal does not support it

- We do some detection
2016-04-07 18:27:34 +02:00
Kurtis Rader
35e282928a clarify documentation for the source command
Make it clear that fish 2.3.0 changed how `$argv` is initialized.
2016-04-06 17:18:06 -07:00
Kurtis Rader
4ff8e6e781 change how redirections are formatted
Modify `fish_indent` to emit redirections without a space before the target of
the redirection; e.g., "2>&1" rather than "2>& 1" as the former is clearer to
humans.

Fixes #2899
2016-04-05 19:29:23 -07: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
Mark Griffiths
9e93ddc097 Fix a couple of minor issues in string examples
Print correct return code in 2nd example
Remove syntax colouring in \cg

Signed-off-by: Mark Griffiths <mark@thebespokepixel.com>
2016-04-05 10:57:32 -07:00
Kurtis Rader
3435e94994 make the string man page more readable
I didn't notice when I merged commit cb6d5d76c8
by thebespokepixel.com that it removed the explicit wrapping in the `string`
man page. That makes `man string` harder to read so reinstate the explicit
wrapping.
2016-04-04 21:32:03 -07: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
Mark Griffiths
cb6d5d76c8 update lexicon for latest docs
Closes #2699

Fixes issues with:
* 'string' function synopsis
* Redirection display issues
* Better file & path detection
* Rendering of % & @ chars in both html and man
* @ symbol in tutorial

Improves robustness by implementing an @EOL marker to prevent hold buffer dumping extra chars after the end of an expression.

Added new '{{' and '}}' meta-chars for when you want curly braces in a regexp that was previously tripping up the lexicon.

Improve man/html presentation consistency for
* string
* printf
* prompt_pwd
* type

Use cli-styling for 'practical' examples.

Add <bs> tag for presenting content with preceding backslash.

Signed-off-by: Mark Griffiths <mark@thebespokepixel.com>
2016-04-04 15:23:56 -07:00
Kurtis Rader
35cee1e39c remove "doc" make target and rename "user_doc"
Fixes #2874
2016-03-30 19:20:23 -07:00
Kurtis Rader
0e18e2ba78 clarify behavior of ** glob
Fixes #2680
2016-03-29 16:44:44 -07:00
Fabian Homborg
d30f8fffc8 Reword: Always call suggestions sugggestions
Not completions.
2016-03-29 15:55:42 +02:00
Fabian Homborg
19dd28e400 Document pager search
Fixes #2866.
2016-03-29 15:55:42 +02:00
Fabian Homborg
daf94e14d4 Document more keybindings
Fixes #2866.
2016-03-29 15:55:42 +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
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
Nyanpasu
2e0205a746 Add missing "Universal Variables" to tutorial.hdr 2016-03-22 06:52:11 +08: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
Fabian Homborg
5e09411340 Document more bind functions
Fixes #2534 as backward-kill-path-component is now documented.
2016-03-06 15:23:55 +01:00
Fabian Homborg
333415f42a Fix stylistic nit in glob documentation
The test is unnecessary.
2016-03-03 10:30:53 +01:00
Fabian Homborg
0e8a8a7c80 Migrate abbrs from =-separated to space-separated
We silently upgrade existing abbreviations and change the separator when
saving.

This does not yet warn when the user is using the old syntax.

Resolves #2051
2016-03-02 10:59:12 -08:00
Kurtis Rader
f2246dfb34 reduce number of Unicode private-use characters
This narrows the range of Unicode codepoints fish reserves for its own
use from U+E000 thru U+F8FE (6399 codepoints) to U+F600 thru U+F73F (320
codepoints). This is still not ideal since fish shouldn't be using any
Unicode private-use codepoints but it's a step in the right direction.

This partially addresses issue #2684.
2016-02-28 18:36:34 -08:00
Fabian Homborg
b41b962336 Clarify example in $PATH tutorial
See #2777
2016-02-29 00:12:26 +01:00
Fabian Homborg
60bd3c809a Try to clarify test documentation for newbies
See #2773
2016-02-28 17:52:42 +01:00
Fabian Homborg
c1b384e5d3 Add functions and configuration snippets hierarchy
This allows "vendors" (i.e. third-party upstreams interested in
supporting fish) to add auto-loaded functions and eager-loaded
configuration "snippets", while still allowing both the user and the administrator to
fully override all of that.

This has been inspired by systemd's configuration hierarchy, and implements a similar scheme
whereby files with the same name in higher-ranking directories override files in lower-ranking ones.

Fixes #1956
2016-02-26 12:14:55 +01:00
Adam Dymitruk
2f52f073da Update index.hdr.in
simple grammar correction
2016-02-22 13:36:35 -08:00
Steve Stagg
c4cc9f9b8d add files for the fish logo as used for the fish-shell stickers 2016-02-22 12:27:39 -08:00
Fabian Homborg
585c03db72 docs: Remove duplicate color variable listing 2016-02-21 13:58:15 +01:00
Fabian Homborg
8703c5bc00 Add fish_color_autosuggestion to docs
Fixes #2741.
2016-02-19 15:20:34 +01:00
Andreas Nordal
62b76b26b4 Reinstate failglob behaviour for most commands
Expand globs to zero arguments (nullglob) only for set, for and count.

The warning about failing globs, and setting the accompanying $status,
now happens regardless of mode, interactive or not.

It is assumed that the above commands are the common cases where
nullglob behaviour is desirable.
More importantly, doing this with `set` is a real feature enabler,
since the resulting empty array can be passed on to any command.

The previous behaviour was actually all nullglob (since commit
cab115c8b9), but this was undocumented;
the failglob warning was still printed in interactive mode,
and the documentation was bragging about failglob behaviour.
2016-02-15 13:13:28 -08:00
Fabian Homborg
00cd01c89e Soften abbr-in-config.fish wording
This isn't as necessary anymore and having abbrs in config.fish is nice
for e.g. storing it in git.
2016-02-13 17:08:19 +01:00
ridiculousfish
218843b9e4 Simplify escape character documentation in doc_src/bind.txt 2016-02-04 14:18:12 -08:00