Using functions gives you a few advantages over sourcing a file: You can tab-complete function names, and add custom completions to tab-complete their arguments They can be modified using funced and funcsave There's a standard place for them in ~/.config/fish/functions They can be autoloaded. The one advantage of sourcing a...
Vi mode will be in the next release. If you want to use it now, do the following: Install a nightly build. If you're using Linux, you can get a nightly from here. On OS X using homebrew, use brew install fish --HEAD. You can also build from source following...
Yes, virtualfish is designed for the fish prompt, and so it's assumed you have it installed and are using it. If you want to use bash, you should use virtualenv instead. The fish prompt does not use .bashrc or .bash_profile, as these are of course bash-specific....
The relevant difference is called "word splitting," which is how the result of a variable expansion or command substitution is turned into multiple arguments. In bash and zsh, word splitting occurs on all whitespace. Example: > for i in $(echo 1 2 3) ; do echo $i; done 1 2...
It's perfectly working the way you want with bash and zsh. Still, I found a solution for fish: source b.fish; or exit 1 This will exit a.fish if b.fish exited with exit 1, and will continue otherwise....
AFAIK it's not possible to totally suppress tab completions. If no command-specific completion is available, you will always get files, under the theory that something is better than nothing. What the -f flag does is prevent files from being shown alongside your options: > complete -c test_cmd -a 'alpha beta'...
sudo su executes su as though you were the root user, Which means that the shell that is opened is the shell given in the entry of the user in /etc/passwd in the 6th field. In case of your systems root user it might be /bin/fish. That shell is...
Taken from @Jubobs' answer: basename is just a Unix utility; it's not associated to a particular shell, and should work equally well in Bash and Fish. It appeared I was using basename in the wrong context, and without a suffix. This was solved by using the following: function fish_prompt echo...
bash,shell,command-line,zsh,fish
Okay, so ls is both an alias and a function. That's not gonna work because they'll recurse. On my terminal, with ls being an alias and a function, when I run ls it thinks for two seconds, then I get ls:1: maximum nested function level reached Use either a function,...
Universal variables are automatically persisted between sessions. So when you write this: set -U fish_user_paths $fish_user_paths /opt/local/bin... That the $fish_user_paths variable longer every time you start fish. Eventually it will become so big that it hangs. To fix it, you can either ensure fishd is not running and then edit...
The text you changed does not look like executable code. Probably you just changed a doc string (actually, a bit of googling reveals that this is in the documentation string for grep-find-use-xargs). But Emacs is eminently customizable; all you have to do is to set the value of grep-find-template to...
You are having this problem because pipes will buffer stdout but not stderr, and therefore you are getting stderr output first. The only way to solve this is to not use pipes, and instead redirect your output to a temporary file. Then, work with that file for what you need...
git,shell,tab-completion,fish,completion
In fact -eq and -a are not part of fish syntax. They are ordinary arguments! if [ (count $cmd) -eq 1 -a $cmd[1] = 'git' ] The opening square bracket here is actually a command, like cat or grep. You really do have a file /bin/[. It may be easier...
shell,ubuntu,configuration-files,fish
I think you are using nightly builds? This was a debugging line that made it into a nightly, and should have been fixed the following day. The bug tracking this is https://github.com/fish-shell/fish-shell/issues/1413 ...
Nope. fish has a much smaller feature set than bash, relying on external commands: $ set filename foo.bar.baz $ set rootname (echo $filename | sed 's/\.[^.]*$//') $ echo $rootname foo.bar ...
I commend you for writing up this detailed and thoughtful post, and it deserves an equally detailed and thoughtful response! The tab completion behavior has been rewritten in fish top-of-tree (not yet released), and is referred to as the "new pager." You can see the design goals and discussion here....
You are running into this issue. The short answer is that bash will further split command substitutions into separate arguments on any whitespace, while fish splits them only with newlines. Since docker-machine config dev doesn't output newlines, the outer docker command just gets one giant argument, with embedded spaces. To...
D-side gave this link above in a comment. https://github.com/sstephenson/rbenv/issues/195 adding these shims to my config.fish fixed the problem: set PATH $HOME/.rbenv/bin $PATH set PATH $HOME/.rbenv/shims $PATH rbenv rehash >/dev/null ^&1 ...
The usual trick is to copy the function you want to override, and then invoke the copy from within the override: functions --copy ls saved_ls function ls saved_ls end You can't do this in an autoloading ls.fish file since it would result in an infinite loop, but you can do...
I'm afraid not, local variables are always local to the topmost scope, and there's no way to wrap set without creating a new scope. The best you can do is this: function def --no-scope-shadowing set $argv end This creates a variable in the calling function scope. This is subtly different...
it's complaining about the line: svn log | sed -n "/$argv/,/-----$/p" | more ^here You need to escape the second $, like so: svn log | sed -n "/$argv/,/-----\$/p" | more ...
It's not a bug! The command substitution (driver X) executes the driver function, and then turns each output line into an argument. In the case of (driver 0), there's no output, so you get zero arguments. So the no output case is equivalent to running test -z and test -n....
You need to check the exit status of the test builtin. if test -n (get_ip) echo Yes else echo No end While testing, I found some inconsistency between -n and -z that I will follow up on. Try this: if test -z (get_ip) echo No else echo Yes end According...
python,shell,python-2.7,terminal,fish
The fish-shell was new to me, so I read the documentation - something I really recommend. Look for the title "Initialisation Files": http://fishshell.com/docs/current/index.html#initialization So it looked like you call your python scripts from ~/.config/fish/config.fish So I installed fish on my Macbook and I had to create the config.fish file. In...
osx,virtualenv,osx-mavericks,fish
Duplicate of How to get virtualenv to work with fish shell ? You might also try virtualfish....
Zsh's global alias feature is unique to zsh. fish cannot recognize aliases except where you'd expect a command, as the first word.
The comment sign is #, as glenn jackman suggested.
Setting the variable is not sufficient, you must export it too (as you do in bash). Exporting means that subprocesses (like the Python call) will get the value too. From the fish documentation: -x or --export causes the specified environment variable to be exported to child processes So a direct...
Here you go: pass in a variable name and the number of columns you want $ function columnize -a listvarname -a ncols test (count $ncols) -eq 1; or set ncols 1 printf "%s\n" $$listvarname | \ eval paste (yes - | head -n $ncols | tr '\n' " ") |...