Skip to content

Conversation

@KATANAND
Copy link
Contributor

This PR adds the following info:

  • about searching list of completions
  • about fish's history and autosuggestions
  • examples for multiline commands
  • process substitution example
  • tiny formatting improvements

  • I solemnly swear that this is all original content of which I am the original author
  • Pull request title is prepended with [language/lang-code] (example [python/fr] for Python in French or [java] for multiple Java translations)
  • Pull request touches only one file (or a set of logically related files with similar changes made)
  • Content changes are aimed at intermediate to experienced programmers (this is a poor format for explaining fundamental programming concepts)
  • If you've changed any part of the YAML Frontmatter, make sure it is formatted according to CONTRIBUTING.md

+ about searching list of completions
+ about fish's history and autosuggestions
+ process substitution example
+ examples for multiline commands
+ tiny formatting improvements
@KATANAND
Copy link
Contributor Author

Maybe my newly added sections are too wordy?

fish.md Outdated
set myvar "The files" (ls -a) " are in the directory $PWD"
# Passing the output of a command to another command that only accepts files can be achieved with process substitution. In bash you use <(command):
diff <(ls dir1) <(ls dir2)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if this is not valid fish syntax, it should be commented

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've written the block :293,296 as it is using the existing comparison to bash on lines :273,279 as a reference. It is not commented too

echo "`ls` is in $PWD" # (not valid fish syntax)
# or
echo "$(ls) is in $PWD" # (also valid in fish)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry! The github UI is really confusing with its "pending" comments. I've just realized that comments on my 2 PRs were not visible to anyone just until now! https://github.com/orgs/community/discussions/10369

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i didn’t realise that. Would you mind fixing both then? We do try to keep the files runnable

As with every shell, you can not only execute commands in the shell, but also as files, saved as a `.fish` file.
(You can also execute `.sh` files with fish syntax, but I always use `.fish` for fish-syntax scripts to distinguish them from bash script files)

```fish
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This whole fenced block contains a lot of very long lines that are a nightmare to read on the website because they require from you to scroll left-right. Since my PR is not primarily about fixing style, I wanted to ask whether i should also touch this area? CONTRIBUTING.md suggests 80 chars or fewer.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sure

fish.md Outdated
set myvar "The files" (ls -a) " are in the directory $PWD"
# Passing the output of a command to another command that only accepts files can be achieved with process substitution. In bash you use <(command):
diff <(ls dir1) <(ls dir2)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've written the block :293,296 as it is using the existing comparison to bash on lines :273,279 as a reference. It is not commented too

echo "`ls` is in $PWD" # (not valid fish syntax)
# or
echo "$(ls) is in $PWD" # (also valid in fish)

@vendethiel vendethiel merged commit 7cb6ed6 into adambard:master Dec 13, 2025
1 check passed
@vendethiel
Copy link
Collaborator

Thanks :). Will merge this. Further format changes can be another PR.

@KATANAND
Copy link
Contributor Author

Thanks :). Will merge this. Further format changes can be another PR.

So i just go ahead and format everything strictly under 80 chars per line in another PR, right?

@nbehrnd
Copy link
Contributor

nbehrnd commented Dec 13, 2025

@KATANAND Presuming GNU coreutils are available to you, a command like

fold -s example.md

will break lines at the nearest white space prior or at char 80. This works fine for running text; snippets of code usually require manual intervention (a diffview, and depending on the language in question, manually introduced line breaks by a continuation sign, pairwise use of parentheses, curly braces, square brackets, etc.)

Note this automatism introduces trailing white space. Either your editor trims this off for you, or you remove it with a regular expression. E.g.

sed -i 's/[ \t]*$//' example.md

with Linux' stream editor (AWK surely can do this, too).

@KATANAND
Copy link
Contributor Author

@nbehrnd thanks for suggestion. Didn't know about fold command. Since line-width autoformatting always requires manual intervention, i prefer to use gq in Vim and adjust stuff immediately. Also set tw=$number is also useful to know.
I will submit a PR in a minute

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants