-
Notifications
You must be signed in to change notification settings - Fork 3.6k
[fish/en] Various additions and minor fixes #5437
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
+ about searching list of completions + about fish's history and autosuggestions + process substitution example + examples for multiline commands + tiny formatting improvements
|
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) |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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)
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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)
|
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? |
|
@KATANAND Presuming GNU coreutils are available to you, a command like fold -s example.mdwill 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.mdwith Linux' stream editor (AWK surely can do this, too). |
|
@nbehrnd thanks for suggestion. Didn't know about |
This PR adds the following info:
[language/lang-code](example[python/fr]for Python in French or[java]for multiple Java translations)