fish

Make Fish start me in a directory other than HOME

半世苍凉 提交于 2019-12-06 11:20:29
I'm running Fish on a Vagrant-controlled VM. I want to use ~vagrant as the place where VM-specific configuration gets dumped, so that's my $HOME . I have /vagrant as a directory shared with the host, and that's where I want to be all the time. When I log in to the VM, I'd like Fish to dump me into /vagrant/ . In Bash, I'd do this by putting cd /vagrant/ into ~/.bashrc . However, I see there's another question about changing directories in Fish and the comments suggest that putting cd /vagrant/ into ~/.config/fish/config.fish would be a mistake because Fish will implicitly evaluate it on every

fish shell - Showing the current command in the window title of screen

久未见 提交于 2019-12-06 03:51:02
问题 I want the current command to be shown in the title of screen (or tmux). I tried following settings but it doesn't work. How can I make it work? .screenrc shelltitle "$ |fish" shell /usr/local/bin/fish .config/fish/config.fish set -x PS1 '\033k\033\\[\u@\h \W]\$ ' 回答1: For fish version 2.1.0 you only have to edit ~/.config/fish/functions/fish_title.fish function fish_title hostname end For version 1.23.1 this doesn't seem to work. If the directories do not exist, first create them: mkdir -p ~

How can I set PYTHONPATH in fish?

心已入冬 提交于 2019-12-06 03:36:06
问题 The following works in bash: ~$ echo $PYTHONPATH <nothing> ~$ export PYTHONPATH=/path/to/test/folder ~$ echo $PYTHONPATH /path/to/test/folder ~$ python -m test_script hello world But not in fish: Welcome to fish, the friendly interactive shell Type help for instructions on how to use fish ~> echo $PYTHONPATH <nothing> ~> set --universal PYTHONPATH /path/to/test/folder ~> echo $PYTHONPATH /path/to/test/folder ~> python -m test_script /usr/bin/python: No module named test_script I've tried set

Fish command substitution doesn't work like in bash or zsh

淺唱寂寞╮ 提交于 2019-12-05 10:23:08
I have stumbled on a problem with the fish shell (which is my favorite shell) when I am trying to use command substitution: gcc (pkg-config --libs --cflags gtk+-2.0 cairo) -o drawing_widget drawing_widget.c gcc: erreur: unrecognized command line option ‘-pthread -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/pango-1.0 -I/usr/include/atk-1.0 -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/libpng16 -I/usr/include/pango-1.0 -I/usr/include/cairo -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include

Error 'unknown locale: UTF-8' on 'pandas' import (Mac OS X) when running fish shell [duplicate]

爱⌒轻易说出口 提交于 2019-12-05 04:55:50
问题 This question already has answers here : IPython Notebook locale error [duplicate] (4 answers) Closed 3 years ago . I've recently upgraded to Python 3.5 and the newest version of pandas pandas (0.17.1) , but this broke the package for me. I'm on Mac OS X 10.9.5, using the fish shell. What can I do? cls@clsmba ~> python3 Python 3.5.0 (default, Sep 23 2015, 04:41:33) [GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.57)] on darwin Type "help", "copyright", "credits" or "license" for more

Is there a way to detect OS in fish shell akin to the OSTYPE variable in bash?

巧了我就是萌 提交于 2019-12-05 03:06:25
Right now I'm forced to resort to using uname to get the operating system name and it works. But in bash there is the OSTYPE environment variable that is automatically set and I was wondering if there is something similar. From the fish user documentation it seems that the canonical way to execute code conditionally depending on the operating system type is using a switch statement with the uname results. See example: switch (uname) case Linux echo Hi Tux! case Darwin echo Hi Hexley! case FreeBSD NetBSD DragonFly echo Hi Beastie! case '*' echo Hi, stranger! end 来源: https://stackoverflow.com

fish shell. How to check if a variable is set/empty?

点点圈 提交于 2019-12-04 22:24:01
How can I do something like set variable (some_command_that_may_return_a_string) if [ variable is set ] do_something and inversely how do I check if the variable is empty? set -q var (note the missing "$" - this uses the variable name ) can be used to check if a variable has been set. set -q var[1] can be used to check whether the first element of a variable has been assigned (i.e. whether it is non-empty as a list). test -n "$var" [fn0] (or [ -n "$var" ] ) can be used to check whether a variable expands to a non-empty string (and test -z is the inverse - true if it is empty). These will be

Zsh color partial tab completions

左心房为你撑大大i 提交于 2019-12-04 17:23:29
问题 Is it possible to color the completed part of the partial completion results in Zsh? Fish does this by default (in Gentoo at least) as shown in the image below: Full size image: http://i.imgur.com/tN6w3.png 回答1: Yes, you can do it with things like that: zstyle -e ':completion:*:default' list-colors 'reply=("${PREFIX:+=(#bi)($PREFIX:t)(?)*==02=01}:${(s.:.)LS_COLORS}")' Just change the 01 and 02 colors so it matches your taste, for example to match your screenshot: zstyle -e ':completion:*

Fish RVM Use error

拥有回忆 提交于 2019-12-04 12:59:43
So I installed fish and oh-my-fish, and when i want to use rvm I get this error: ➜ avalancha git:(services) ✗ rvm use 2.1.0 Using /home/matias/.rvm/gems/ruby-2.1.0 fish: The '$' character begins a variable name. The character '{', which directly followed a '$', is not allowed as a part of a variable name, and variable names may not be zero characters long. To learn more about variable expansion in fish, type 'help expand-variable'. /home/matias/.config/fish/functions/rvm.fish (line 2): begin; set -xg rvm_bin_path "/home/matias/.rvm/bin" ; set -xg GEM_HOME "/home/matias/.rvm/gems/ruby-2.1.0" ;

fish shell - Showing the current command in the window title of screen

孤街浪徒 提交于 2019-12-04 09:40:46
I want the current command to be shown in the title of screen (or tmux). I tried following settings but it doesn't work. How can I make it work? .screenrc shelltitle "$ |fish" shell /usr/local/bin/fish .config/fish/config.fish set -x PS1 '\033k\033\\[\u@\h \W]\$ ' For fish version 2.1.0 you only have to edit ~/.config/fish/functions/fish_title.fish function fish_title hostname end For version 1.23.1 this doesn't seem to work. If the directories do not exist, first create them: mkdir -p ~/.config/fish/functions/ I think you're looking for fish_title . See documentation here . You could do