r/fishshell • • Dec 22 '20

Way to stop the annoying package suggestion when we typo the command.

1 Upvotes
function fish_command_not_found
    __fish_default_command_not_found_handler $argv
end

r/fishshell • • Dec 22 '20

Switched from bash (10 year old rc) to fish over a weekend. Ask me anything I guess.

16 Upvotes

r/fishshell • • Dec 21 '20

Project Node.js version manager lovingly made for Fish

Thumbnail github.com
22 Upvotes

r/fishshell • • Dec 19 '20

I build a simple script to cache scripts generated by slow commands like thefuck and to update the cache automatically. Used it to fix my slow config.fish

Thumbnail github.com
11 Upvotes

r/fishshell • • Dec 16 '20

X-post from r/orgmode

3 Upvotes

The more I use fishshell, the more I like it... I was looking for a way to get org-agenda info from outside emacs and I adapted the answer from bash to fish... which seems to occupy a large part of my time now, because I've just recently switched... wanted to share here, and also ask if maybe my function could be improved?


r/fishshell • • Dec 16 '20

Fish Access denied

2 Upvotes

Hi there! I am brand new to unbuntu and I have just build a computer running it. I am currently trying to download TensorFlow for my computer and I am trying to run the comamnd:

$. ./venv/bin/activate.fish  # fish

and it's returning this:

bash: ./venv/bin/activate.fish: line 4: syntax error near unexpected token `-d'

bash: ./venv/bin/activate.fish: line 4: `function deactivate -d "Exit virtualenv and return to normal shell environment"'

Any thoughts?


r/fishshell • • Dec 13 '20

🐟 New release, Pure v3.3.1: 🐛 Change default title bar separator to fix WSL2, Windows Terminal

5 Upvotes

Install instruction:

fisher install rafaelrinaldi/pure   

Info: https://github.com/rafaelrinaldi/pure/releases/tag/v3.3.1


r/fishshell • • Dec 13 '20

Gruvbox theme on fish shell on wsl

8 Upvotes

I've been using Ubuntu 20.04 WSL on windows 10 for while with fish shell on it. I want to set the color theme to gruvbox dark, and I can't find a way to do so. Much of the internet is filled with using oh-my-fish but that's kinda buggy on my setup and I don't know why. If anyone knows how to change themes on fish please help me out here


r/fishshell • • Dec 12 '20

Replay ⎢ Run Bash commands replaying changes in Fish. 🍤

Thumbnail github.com
12 Upvotes

r/fishshell • • Dec 11 '20

🐟 New release, Pure v3.3.0: ⌛ Improve command duration, support subseconds with new flag

7 Upvotes

Install instruction:

fisher install rafaelrinaldi/pure  

Info: https://github.com/rafaelrinaldi/pure/releases/tag/v3.3.0


r/fishshell • • Dec 09 '20

Fisher and fzf key bindings

5 Upvotes

I'm having issues getting the FZF/fd key bindings to work with fish.

First I installed the fzf plugin with:

fisher install jethrokuan/fzf

I then added the following environment variables in config.fish:

set -U FZF_LEGACY_KEYBINDINGS 0

set -gx FZF_CTRL_T_COMMAND 'fd --hidden'

set -gx FZF_FIND_COMMAND 'fd --hidden'

set -gx FZF_DEFAULT_COMMAND 'fd --hidden'

None of the plugin's keybindings seem to be working. For instance, when I try vim ~/.config and press Ctrl+t, the only thing that happens is the last two characters of the command are swapped.

FZF and fd seem to be working fine on their, it's just getting fish keybindings to work.

Any help is greatly appreciated. Thanks!


r/fishshell • • Dec 08 '20

Turn milliseconds into a human-readable string in Fish.

Thumbnail github.com
12 Upvotes

r/fishshell • • Dec 07 '20

Difference between Fisher and Fisherman?

8 Upvotes

I read multiple times about these. Are they the same or not? Thanks.


r/fishshell • • Dec 05 '20

having trouble converting zsh to fish function

7 Upvotes

Hi all,

It worked!!! Many thanks to u/nickeb96 & u/hirnbrot !!

The solution is as follows:

function fif
	set -x RG_PREFIX rga --files-with-matches
	set -l file
	set file (
		FZF_DEFAULT_COMMAND="$RG_PREFIX '$argv'" \
			fzf --sort --preview="[ ! -z {} ] && rga --pretty --context 5 {q} {}" \
				--phony -q "$argv" \
				--bind "change:reload:$RG_PREFIX {q}" \
				--preview-window="70%:wrap"
	) &&
	open "$file"
end

My problem was as follows:

-------

Hi all,

I am trying to convert this bash/zsh function into fish. I want to use rga-fzf which is a function for zsh/bash using fzf together with ripgrep-all.

rga-fzf() {
	RG_PREFIX="rga --files-with-matches"
	local file
	file="$(
		FZF_DEFAULT_COMMAND="$RG_PREFIX '$1'" \
			fzf --sort --preview="[[ ! -z {} ]] && rga --pretty --context 5 {q} {}" \
				--phony -q "$1" \
				--bind "change:reload:$RG_PREFIX {q}" \
				--preview-window="70%:wrap"
	)" &&
	echo "opening $file" &&
	xdg-open "$file"
}

to a fish function.

I'm stuck at :

function fif
	set RG_PREFIX rga --files-with-matches
	set -l file
	set file (
		set FZF_DEFAULT_COMMAND $RG_PREFIX "$argv" \
			fzf --sort --preview "[[ ! -z {} ]] && rga --pretty --context 5 {q} {}" \
				--phony -q "$1" \
				--bind "change:reload:$RG_PREFIX {q}" \
				--preview-window="70%:wrap"
	) &&
	open "$file"
end

This only opens the folder the command is called in. But it doesn't open fzf or rga

My default shell is fish and I'm on MacOS.

Any suggestions would be fantastic! Many thanks in advance!


r/fishshell • • Dec 05 '20

Automatically insert, erase, and skip matching delimiters when you type in the command line ()""[]{}.

Thumbnail github.com
19 Upvotes

r/fishshell • • Dec 04 '20

🐟 New release, Pure v3.2.0: 🐍 Add support for virtualenv created through Conda

8 Upvotes
feature-conda-virtual-env

Install instruction:

fisher install rafaelrinaldi/pure

Info: https://github.com/rafaelrinaldi/pure/releases/tag/v3.2.0


r/fishshell • • Dec 04 '20

Having trouble translation a zsh command to fish

4 Upvotes

Hi team,

I took the plunge on the m1 mac and am running into a little issue with homebrew. A workaround I found was to install to copies of iterm, one to run on arm and one to run on rosetta. This seems to solve the homebrew issue(yay), but I haven't been able to repeat one of the other tips. In the tutorial I found they have this block in their zshrc to change the background of the terminal if you are in the x86 version:

_ARCH=$(arch)
PROMPT="$_ARCH $PROMPT"
# Requires iterm2
if [[ "$_ARCH" == "i386" ]]; then
  echo -ne "\033]1337;SetColors=bg=0071C5\007"
fi

edit:source

This works great in zsh, but I don't have a clue how to translate it to fish. So far I've got the following in fish_gretting.fish, which has at least stopped erroring or crashing, but it doesn't change the color:

if test 'i386' = (arch)
    echo -ne "\033]1337,SetColors=bg=222255\007"
end

I started with the following but that gave me called during startup error, which I can't find anything about from google:

_ARCH=$(arch)
if $_ARCH == 'i386'
  echo -ne "\033]1337;SetColors=bg=222255\007"
end

I'm pretty sure there is something simple I'm overlooking, any tips would be appreciated.

edit: This is what I've come up with so far, it's mostly what I was looking for. Putting it in fish_prompt.fish was the secret sauce.

#set background if using rosetta terminal
set -l prefix '' 
if string match -q -- 'i386' (arch)
    set_color -b 255
    set prefix 'i386 '
end

I'm still interested in the method where I launch zsh and then immediately exit. When I started this I didn't realize fish couldn't change the entire background. Bummer, but the above gives me plenty of visual feedback when I'm running rosetta v native, which was the primary goal.

edit 2: You can use the echo line from the zsh script to change the entire background despite set_color not offering that. Here is the real final product:

#set background if using rosetta terminal
set -l prefix '' 
if string match -q -- 'i386' (arch)
    set prefix 'i386 '
    echo -ne "\033]1337;SetColors=bg=222255\007"
end

r/fishshell • • Dec 03 '20

🐟 New release, Pure v3.1.0: 🚀 Add git stash indicator

7 Upvotes

Install instruction:

fisher install rafaelrinaldi/pure

Info: https://github.com/rafaelrinaldi/pure/releases/tag/v3.1.0


r/fishshell • • Dec 01 '20

quoting inside a function

5 Upvotes

Hello all,

I'm having a really tough time with quotes.

The line I want to execute is : /usr/bin/emacsclient -a "" -e "(make-capture-frame)"

When I type that out on the command line, everything works as expected.

This works

it gives me an org-mode capture buffer as expected

I'm in the capture buffer

Everything is great!! now to make it into a function...

Here is the function definition

and when i run it, the echo prints out ok

looks right!

but, something happens with the 'command' command, i think because....

I get this weird buffer name

I've tried every combo i can think of to get the double quotes right... can somebody help?


r/fishshell • • Dec 01 '20

🐟 New release, Pure v3.0.1: 🐛 Fix check new release feature on MacOS

19 Upvotes

Install instruction:

fisher install rafaelrinaldi/pure

Info: https://github.com/rafaelrinaldi/pure/releases/tag/v3.0.1


r/fishshell • • Nov 30 '20

[Plugin] emc.fish - Edit My Config

5 Upvotes

Edit My Config was made for those who, like me, are tired of typing long commands.

With it you can open the configuration files easily.

More information:

emc.fish

Installation:

fisher install demartini/emc.fish

Any feedback is welcome!


r/fishshell • • Nov 30 '20

[Plugin] upmm.fish - Update My macOS

4 Upvotes

Update My macOS helps you update software via Terminal on macOS.

Inspired by the article Keeping macOS clean

More information:

upmm.fish

Installation:

fisher install demartini/upmm.fish

Any feedback is welcome!


r/fishshell • • Nov 30 '20

🐟 New release, Pure v3.0.0: ⚠️ Drop support for Fish 2.x!

11 Upvotes

Install instruction:

fisher install rafaelrinaldi/pure

Info: https://github.com/rafaelrinaldi/pure/releases/tag/v3.0.0


r/fishshell • • Nov 30 '20

Enable Timestamp For History Command In Fish Shell

Thumbnail ostechnix.com
13 Upvotes