mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-05-31 03:51:14 -03:00
editorconfig / doc_src: trim trailing whitespace
Commit 0893134543 (Added .editorconfig file (#3332) (#3313),
2016-08-25) trimmed trailing whitespace for Markdown file (which do
have significant trailing whitespace) but ReStructuredText does not,
and none of our Markdown files cares about this, so let's clean up
whitespace always.
This commit is contained in:
@@ -46,7 +46,7 @@ Combining these features, it is possible to create custom syntaxes, where a regu
|
||||
|
||||
> abbr >> ~/.config/fish/config.fish
|
||||
> abbr --erase (abbr --list)
|
||||
|
||||
|
||||
Alternatively you can keep them in a separate :ref:`configuration file <configuration>` by doing something like the following::
|
||||
|
||||
> abbr > ~/.config/fish/conf.d/myabbrs.fish
|
||||
|
||||
@@ -46,12 +46,12 @@ The following code will create ``rmi``, which runs ``rm`` with additional argume
|
||||
::
|
||||
|
||||
alias rmi="rm -i"
|
||||
|
||||
|
||||
# This is equivalent to entering the following function:
|
||||
function rmi --wraps rm --description 'alias rmi=rm -i'
|
||||
rm -i $argv
|
||||
end
|
||||
|
||||
|
||||
``alias`` sometimes requires escaping, as you can see here::
|
||||
|
||||
# This needs to have the spaces escaped or "Chrome.app..."
|
||||
|
||||
@@ -33,10 +33,10 @@ The following code sets a number of variables inside of a block scope. Since the
|
||||
|
||||
begin
|
||||
set -l PIRATE Yarrr
|
||||
|
||||
|
||||
...
|
||||
end
|
||||
|
||||
|
||||
echo $PIRATE
|
||||
# This will not output anything, since the PIRATE variable
|
||||
# went out of scope at the end of the block
|
||||
|
||||
@@ -41,7 +41,7 @@ Examples
|
||||
|
||||
cd
|
||||
# changes the working directory to your home directory.
|
||||
|
||||
|
||||
cd /usr/src/fish-shell
|
||||
# changes the working directory to /usr/src/fish-shell
|
||||
|
||||
|
||||
@@ -30,7 +30,7 @@ Example
|
||||
|
||||
count $PATH
|
||||
# Returns the number of directories in the users PATH variable.
|
||||
|
||||
|
||||
count *.txt
|
||||
# Returns the number of files in the current working directory
|
||||
# ending with the suffix '.txt'.
|
||||
|
||||
@@ -27,7 +27,7 @@ The following code first defines an event handler for the generic event named 't
|
||||
function event_test --on-event test_event
|
||||
echo event test: $argv
|
||||
end
|
||||
|
||||
|
||||
emit test_event something
|
||||
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ Synopsis
|
||||
.. synopsis::
|
||||
|
||||
begin
|
||||
[COMMANDS ...]
|
||||
[COMMANDS ...]
|
||||
end
|
||||
|
||||
.. synopsis::
|
||||
|
||||
@@ -13,7 +13,7 @@ Synopsis
|
||||
Description
|
||||
-----------
|
||||
|
||||
``export`` is a function included for compatibility with POSIX shells. In general, the :doc:`set <set>`
|
||||
``export`` is a function included for compatibility with POSIX shells. In general, the :doc:`set <set>`
|
||||
builtin should be used instead.
|
||||
|
||||
When called without arguments, ``export`` prints a list of currently-exported variables, like ``set
|
||||
|
||||
@@ -51,7 +51,7 @@ The following options are available:
|
||||
when :command:`fish` exits, output timing information on all executed commands to the specified file.
|
||||
This excludes time spent starting up and reading the configuration.
|
||||
|
||||
**--profile-startup=PROFILE_FILE**
|
||||
**--profile-startup=PROFILE_FILE**
|
||||
Will write timing for ``fish`` startup to specified file.
|
||||
|
||||
**-P** or **--private**
|
||||
|
||||
@@ -50,6 +50,6 @@ This refuses to store any immediate "vault", "mysql" or "ls" calls. Commands sta
|
||||
and string match -qr "^/home/me/my-secret-project/" -- (pwd -P)
|
||||
return 1
|
||||
end
|
||||
|
||||
|
||||
return 0
|
||||
end
|
||||
|
||||
@@ -23,7 +23,7 @@ Example
|
||||
::
|
||||
|
||||
for i in foo bar baz; echo $i; end
|
||||
|
||||
|
||||
# would output:
|
||||
foo
|
||||
bar
|
||||
|
||||
@@ -85,7 +85,7 @@ will run the ``ls`` command, using the ``-l`` option, while passing on any addit
|
||||
# prints: [DEBUG] foo: bar
|
||||
|
||||
# OR
|
||||
|
||||
|
||||
function debug2 -a var
|
||||
echo [DEBUG] $var: $$var >&2
|
||||
end
|
||||
@@ -106,7 +106,7 @@ will create a ``debug`` command to print chosen variables to `stderr`.
|
||||
if test $status = 0
|
||||
switch $argv[(count $argv)]
|
||||
case '-*'
|
||||
|
||||
|
||||
case '*'
|
||||
cd $argv[(count $argv)]
|
||||
return
|
||||
@@ -124,7 +124,7 @@ This will run the ``mkdir`` command, and if it is successful, change the current
|
||||
function notify
|
||||
set -l job (jobs -l -g)
|
||||
or begin; echo "There are no jobs" >&2; return 1; end
|
||||
|
||||
|
||||
function _notify_job_$job --on-job-exit $job --inherit-variable job
|
||||
echo -n \a # beep
|
||||
functions -e _notify_job_$job
|
||||
|
||||
@@ -82,10 +82,10 @@ Examples
|
||||
|
||||
functions -n
|
||||
# Displays a list of currently-defined functions
|
||||
|
||||
|
||||
functions -c foo bar
|
||||
# Copies the 'foo' function to a new function called 'bar'
|
||||
|
||||
|
||||
functions -e bar
|
||||
# Erases the function ``bar``
|
||||
|
||||
|
||||
@@ -209,7 +209,7 @@ Examples
|
||||
# This is the same as above: "-f" is "--type=file", "-d" is "--type=dir",
|
||||
# "-x" is short for "--perm=exec" and "-w" short for "--perm=write"!
|
||||
/home/me
|
||||
|
||||
|
||||
>_ path filter -fx $PATH/*
|
||||
# Prints all possible commands - the first entry of each name is what fish would execute!
|
||||
|
||||
@@ -306,7 +306,7 @@ Examples
|
||||
>_ path normalize /bin//bash
|
||||
# The "//" is squashed, but /bin isn't resolved even if your system links it to /usr/bin.
|
||||
/bin/bash
|
||||
|
||||
|
||||
>_ path normalize ./my/subdirs/../sub2
|
||||
my/sub2
|
||||
|
||||
@@ -337,7 +337,7 @@ Examples
|
||||
# The "//" is squashed, and /bin is resolved if your system links it to /usr/bin.
|
||||
# sh here is bash (this is common on linux systems)
|
||||
/usr/bin/bash
|
||||
|
||||
|
||||
>_ path resolve /bin/foo///bar/../baz
|
||||
# Assuming /bin exists and is a symlink to /usr/bin, but /bin/foo doesn't.
|
||||
# This resolves the /bin/ and normalizes the nonexistent rest:
|
||||
@@ -381,7 +381,7 @@ Examples
|
||||
|
||||
>_ path change-extension '' ~/.config.
|
||||
/home/alfa/.config
|
||||
|
||||
|
||||
"sort" subcommand
|
||||
-----------------------------
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@ The *FORMAT* argument is re-used as many times as necessary to convert all of th
|
||||
|
||||
Unlike :doc:`echo <echo>`, ``printf`` does not append a new line unless it is specified as part of the string.
|
||||
|
||||
It doesn't support any options, so there is no need for a ``--`` separator, which makes it easier to use for arbitrary input than ``echo``. [#]_
|
||||
It doesn't support any options, so there is no need for a ``--`` separator, which makes it easier to use for arbitrary input than ``echo``. [#]_
|
||||
|
||||
Format Specifiers
|
||||
-----------------
|
||||
|
||||
@@ -44,7 +44,7 @@ Example
|
||||
The following code will count down from a random even number between 10 and 20 to 1:
|
||||
|
||||
::
|
||||
|
||||
|
||||
for i in (seq (random 10 2 20) -1 1)
|
||||
echo $i
|
||||
end
|
||||
@@ -62,5 +62,5 @@ Or, to only get even numbers from 2 to 20::
|
||||
random 2 2 20
|
||||
|
||||
Or odd numbers from 1 to 3::
|
||||
|
||||
|
||||
random 1 2 3 # or 1 2 4
|
||||
|
||||
@@ -46,7 +46,7 @@ Examples
|
||||
# depending on $fish_emoji_width, this is either 4 or 8
|
||||
# in new terminals it should be
|
||||
8
|
||||
|
||||
|
||||
>_ string length --visible abcdef\r123
|
||||
# this displays as "123def", so the width is 6
|
||||
6
|
||||
|
||||
@@ -89,7 +89,7 @@ See Also
|
||||
.. BEGIN SEEALSO
|
||||
|
||||
- :doc:`string pad <string-pad>` does the inverse of this command, adding padding to a specific width instead.
|
||||
|
||||
|
||||
- The :doc:`printf <printf>` command can do simple padding, for example ``printf %10s\n`` works like ``string pad -w10``.
|
||||
|
||||
- :doc:`string length <string-length>` with the ``--visible`` option can be used to show what fish thinks the width is.
|
||||
|
||||
@@ -55,7 +55,7 @@ Example
|
||||
::
|
||||
|
||||
>_ time sleep 1s
|
||||
|
||||
|
||||
________________________________________________________
|
||||
Executed in 1,01 secs fish external
|
||||
usr time 2,32 millis 0,00 micros 2,32 millis
|
||||
|
||||
Reference in New Issue
Block a user