Questions tagged [fish]

The friendly interactive shell (fish) is a Unix shell that focuses on interactive use, discoverability, and user friendliness.

The friendly interactive shell (fish) is a Unix shell that focuses on interactive use, discoverability, and user friendliness. The design goal of fish is to give the user a rich set of powerful features in a way that is easy to discover, remember, and use.

187 questions
21
votes
3 answers

How do I change EDITOR to be Pico in fish shell?

I can’t get Mercurial (hg) to use pico as my EDITOR when I’m using fish shell. I’ve tried using this and other variations, but nothing seems to help: set -U EDITOR pico hg commit will always open vi as the editor, and I do not want that. UPDATE:…
17
votes
3 answers

How to do command substitution in fish shell?

How would a Bash (or other POSIX shell) command like this have to be expressed in fish? ls -l $(which vim) # or ls -l `which vim`
Raffael
  • 1,211
6
votes
1 answer

Fish Shell - can't find where "la" is defined as "ls -la"

On both my Mac and Ubuntu when I type "la" in Fish Shell I receive output identical to that from "ls -la". I thought I might have defined it as a function. However, I can not find "la" being defined as a alias, abbr, or function. I've checked…
rkv
  • 63
5
votes
2 answers

Change prompt on command line?

My prompt is quite verbose - which is good most of the time - but now I would like to switch it temporarily because I want to make a screen shot of the terminal. For that purpose I would prefer not to delve into config files but to set the prompt…
Raffael
  • 1,211
5
votes
1 answer

How to combine the output of multiple commands in fish?

Say I want to send the output of to commands into another. cat a.txt && ls I can do this: fish -c "cat a.txt && ls" | another_command But it seems clunky, is there a way to do this without running a new instance?
3
votes
1 answer

How can I setup fish shell prompt to be in a different color?

I've seen a screenshot of zsh configured to have prompt with a different color and background, and it looks like a very usable tweak:
3
votes
1 answer

Is there a fish way of doing zsh's noglob builtin?

From https://linux.die.net/man/1/zshmisc : noglob Filename generation (globbing) is not performed on any of the words. zsh example: $ ls /* $ noglob ls /* ls: cannot access '/*': No such file or directory $ ls "/*" ls: cannot…
snapshoe
  • 1,156
2
votes
1 answer

How to sync fish's universal variables across different computers?

If you change some universal variables, how do you sync them across computers? The comments on the fishd.* files make it seem like a bad idea to sync those files. And fishd's man pages don't seem to indicate it's user serviceable.
Xster
  • 2,895
2
votes
1 answer

Is there a Fish equivalent to "bash --rcfile ~/.bashrc"

I've just moved over to fish shell after years of Bash. I've ported all of my functions over pretty easily except for a very simple one I have called mkroot: mkroot () { sudo bash --rcfile ~/.bashrc; } I use it to open a root shell which…
2
votes
1 answer

Fish Shell: remapping VI-mode keybindings

I want to remap some of the default movement bindings in fish's vi-mode (I'm using version 3.0). Specifically I want to change the $ and ^ key mappings to be E and B respectively to match what I use in vim - but I cannot find any documentation on…
2
votes
1 answer

Wrap command with options in fish function

Is there a way to wrap a command with options in a function, so that completions for that command with the options are shown? For example, I want to be able to do this: function remove --wraps='pikaur -R' pikaur -R $argv; end so that using…
2
votes
2 answers

In fish shell, how to select with the cursor while shift is held?

In all gui text editing, ctrl-arrow moves the cursor by word, and holding shift selects as the cursor moves. Thus ctrl-shift-left selects the previous word. Fish already has the former but I want to implement the latter. I tried doing something like…
Sam S
  • 23
1
vote
3 answers

Can a fish script distinguish between being sourced and executed?

I have a fish script that exports some variables and launches a command at the end. I'd like to be able to source this file to bring these variables into the current shell session, but without executing the command at the end. The question: Can I…
mkaito
  • 2,062
1
vote
2 answers

How does one inspect command history in fish in vi mode?

I'm a new user to Fish. I use vi command line bindings. I understand from various places (like here and the issue comments here, for instance) that history search and recall can lack certain bindings and functionality that people like myself may…
firebush
  • 429
1
vote
0 answers

Is there a way to search token history rather than entire commands

The default fish or fzf implementations for ctrl-R is very helpful for looking through and replacing the prompt buffer with lines in history. Is there something similar to alt-up/down, history-token-search-backward but that lists all previous…
Xster
  • 2,895
1
2 3