Hi Mark,

On Sat, Oct 28, 2017 at 2:14 PM, Mark Volkmann <r.mark.volkm...@gmail.com>
wrote:

>
>
>> Default Shell:
>>
>> If you can't change /etc/shells, you should be able to arrange to have
>> your shell execute fish as a login shell via the -l switch. For example, if
>> your shell is bash, then add the following to the top of your
>> ~/.bash_profile:
>>
>> # fish installed to $HOME/local/bin/fish
>> [ -x $HOME/local/bin/fish ] && exec $HOME/local/bin/fish -l
>>
>
> Can you tell me why the installer or a person would not be able to edit
> /etc/shells? I imagine you're referring to a permission issue. I'm not sure
> how common that is. Should I really mention this approach of keeping bash
> as the default shell, but having it immediately switch to fish?
>

That's a good question. I guess it partly depends on how many people use
fish on shared systems, or systems where /etc/shells is other
difficult/awkward/scary to change. (Two out of ~five systems where I have
fish installed are in this state, but perhaps that's not common.)

For example, fish will not only complete environment variables and command
>> line switches, but also git aliases (~/.gitconfig is parsed) and the npm
>> scripts (package.json is parsed).
>>
>
> I can't get autosuggestions to work with npm scripts. I have to press tab
> to get those completions. Does it really suggest those for your without
> pressing tab?
>

Huh, you're right, I thought it did but yes, I need to press tab. Sorry!


> PATH environment variable
>>
>> > fish_user_paths should only be set in a terminal, not in config.fish.
>>
>> Why is this?
>>
>
> I got that from https://fishshell.com/docs/current/tutorial.html where is
> says this:
>
> A faster way is to modify the $fish_user_paths universal variable
> <https://fishshell.com/docs/current/tutorial.html#tut_universal>, which
> is automatically prepended to $PATH. For example, to permanently add
> /usr/local/bin to your $PATH, you could write:
>
> > set -U fish_user_paths /usr/local/bin $fish_user_paths
>
> The advantage is that you don't have to go mucking around in files: just
> run this once at the command line, and it will affect the current session
> and all future instances too. (Note: you should NOT add this line to
> config.fish. If you do, the variable will get longer each time you run
> fish!)
>
Ah, I see. I think the documentation is slightly confusing here.
fish_user_paths can be a universal variable, but it doesn't need to be, and
the code that processes it doesn't care whether it is or not:

https://github.com/fish-shell/fish-shell/blob/fb8ae04f80c3a129f789e7b718464d014508315f/share/config.fish#L175-L198
http://fishshell.com/docs/2.6/#variables-special

Personally, I try to avoid universal variables, because I don't like to
have fish state stored outside a git repo. However, I think it's safe to
set fish_user_paths in fish/config.fish, as long as it's not a universal
variable. At least, that's what I do! See

https://github.com/ithinkihaveacat/dotfiles/blob/master/fish/config.fish






Michael
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Fish-users mailing list
Fish-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/fish-users

Reply via email to