-1

I just started using fish.I have used zsh and bash before. Where do I place the configs in fish?

Sample of configs- https://bpaste.net/show/92f553c9aab8

I tried it in ~/config/fish/config.fish but it gave me errors. Errors I got: https://bpaste.net/show/e136cc91f188

Replacing && with ; removes the errors. But does it do the same thing? If not how can I achieve the same as with &&.

Error with equals:

$ iitpi conda update --all
Unsupported use of '='. To run 'https_proxy=http://10.10.78.21:3128' with a modified environment, please use 'env http_proxy=http://10.10.78.21:3128 https_proxy=http://10.10.78.21:3128…'
in function “iitpi”
        called on standard input
        with parameter list “conda update --all”
Abhishek Bhatia
  • 9,404
  • 26
  • 87
  • 142

2 Answers2

1

A few errors in there. fish has different syntax than zsh and bash

Not this:

alias ipy="(jupyter qtconsole &)"

in fish (...) is the command substitution syntax, like zsh/bash backticks or $(...). Do this:

function ipy
    jupyter qtconsole &
end

because fish aliases are just syntactic sugar for functions

In bash, (...) runs the contents in a subshell. If you really want to do that in fish, you have to be explicit:

function ipy
    fish -c 'jupyter qtconsole' &
end

&& is bash; the and command is fish, so not this:

command1 && command2_if_cmd1_succeeds

but this

command1; and command2_if_cmd1_succeeds
glenn jackman
  • 238,783
  • 38
  • 220
  • 352
1

Fish configs go to ~/.config/fish/ (note the dot). I'd avoid a single config.fish and instead use individual files for every application / subject in conf.d/, i.e. ~/.config.fish/conf.d/10-homebrew.fish.

Matthias Winkelmann
  • 15,870
  • 7
  • 64
  • 76