Love zsh, but going on a Fishing holiday

I’m interested to get into Fish terminal - though I’m aware that there are some differences which will give me headaches.

I already have zsh set up very nicely - so I’m curious to get tips and if anyone else is trying this stuff out, maybe share some ideas.

The first thing I wanted to work out (and looking at documents - it looks pretty complicated) was the basic cheats. Starting with ALIAS commands, and the ability to EXPAND the alias commands.

Anyway, right now I’m doing some ‘alias’ type commands:

alias lx='exa --icons --group-directories-first' from zsh

Bear with me. I hope I’m not getting confused here… but the firest advice we get is to add this as a ‘function’.

To do this in fish we can do this:
alias c='clear'
Followed by funcsave c

Now if you type c it will do clear.
However, in zsh I always have my alias commands expand - so now we will abandon ‘alias’ and use ‘abbr’.

This is an attractive side of fish.
From zsh I have:

alias convertmkv-mp4='for i in *.mkv; do ffmpeg -i "$i" -c:a copy -c:v copy "${i%.*}.mp4"; done'

Which is easy to remember, gets me the sentence so that I can tweak/edit before executing.

This can’t be added as a function in fish - but now I decided to quit alias.

Now we have alias alias='abbr'
then funcsave alias.

This turns 'alias ’ into the zsh feature, an abbreviation which you type to paste the whole sentence.

Now - we paste the original zsh alias:

alias convertmkv-mp4='for i in *.mkv; do ffmpeg -i "$i" -c:a copy -c:v copy "${i%.*}.mp4"; done'

Then we delete the = and hit <enter>
Now it’s moved to fish as an abbreviation.

So all in all it is pretty nice for adding ‘alias’ commands.

It’s the ‘tab’ completion - which has the magic talent of accessing the man pages and bringing up options with explanations which makes it a sexy option to me…

I have been on several fishing trips - always fun …

I got so used to editing zshconfig…

Just that I can enter a whole sentence for conversion abbr convert is already amazing.

Do not use chsh -s fish for interactive login shell because it is not compatible with POSIX.

Set fish in the profile of konsole is fine.

1 Like

Yes, I realised this - it’s the most annoying part of Fish which is quite wonderful in itself.

I already have enough trouble composing my scripts in !#Bash.

KiTTY and Dolphin terminals open with Fish now, system (Konsole) remains with zsh.

Silly things like alias="name" take figuring out - it’s like reverting to OLD conky style removing the = to make sh1t work.
Fishy-Kitty

So I have a question for you - how can I set fish only to open in KiTTY?

Hi,

About your convertmkv alias, I doubt it will work in fish, because of "${i%.*}.mp4" => This is a stritcly POSIX thing and it doesn’t exist in fish. They say to use the string function in the documentation, which I never never really understood how it works, I personally just switch to bash whenever I need that feature

Yes, my default shell is zsh and I don’t want to change that…

With Konsole it’s so easy - just a context menu/profile/command>/bin/fish

I just want `fish’ in KiTTY but I don’t know how to do that.

How can I use fish with KiTTY?

I don’t use kitty, I use ST and ran chsh -s fish over 2 years ago, but there seem to be a shell variable in the config file, I guess you simply need to modify it

Haha not ‘simply’ I’m afraid. Many entries about shell-integration in KiTTY config (I’m reading 9 of 59 instances now on my second run through).

Ha - maybe this is it…

shell .

#: The shell program to execute. The default value of . means to use
#: whatever shell is set as the default shell for the current user.
#: Note that on macOS if you change this, you might need to add
#: --login and --interactive to ensure that the shell starts in
#: interactive mode and reads its startup rc files.

Tidy it up and bingo!

shell /bin/fish

#: The shell program to execute. The default value of . means to use
#: whatever shell is set as the default shell for the current user.
``