Creating Functions In The Fish Shell

  Рет қаралды 36,649

DistroTube

DistroTube

Күн бұрын

In this video, I will briefly go over some of the settings that I have in my Fish configuration file (config.fish). I will also discuss some cool functions that you can add to your config. And everything I do here is done without using oh-my-fish.
REFERENCED:
► gitlab.com/dwt... - DT's config.fish
► github.com/isa... - Sashimi prompt
► github.com/jor... - Spark.fish
► github.com/oh-... - The Bang Bang plugin
► github.com/raz... - Razzius's Fish Functions
WANT TO SUPPORT THE CHANNEL?
💰 Patreon: / distrotube
💳 Paypal: www.paypal.com...
🛍️ Amazon: amzn.to/2RotFFi
👕 Teespring: teespring.com/...
SOCIAL PLATFORMS:
🗨️ Mastodon: mastodon.techn...
💬 IRC: irc://freenode #distrotube
👫 Reddit: / distrotube
📽️ LBRY: lbry.tv/$/invi...
DT ON THE WEB:
🕸️ Website: distrotube.com/
🐿️ Gopherhole: gopher://distro.tube
📁 GitLab: gitlab.com/dwt1
🔊 Audio Podcasts: www.buzzsprout...
FREE AND OPEN SOURCE SOFTWARE THAT I USE:
🌐 Brave Browser - brave.com/dis872
📽️ Open Broadcaster Software: obsproject.com/
🎬 Kdenlive: kdenlive.org
🎨 GIMP: www.gimp.org/
🎵 Audacity: www.audacityte...
💻 VirtualBox: www.virtualbox...
🗒️ Doom Emacs: github.com/hli...
Your support is very much appreciated. Thanks, guys!

Пікірлер: 77
@TheGruselmops
@TheGruselmops 3 жыл бұрын
yesterdays DT: There are to many script kiddies out there todays DT: I'm literally a script kiddie
@TheGruselmops
@TheGruselmops 3 жыл бұрын
yup
@marioschroers7318
@marioschroers7318 3 жыл бұрын
Using zsh, and likewise, I never used Oh My zsh. You can configure pretty much anything yourself without any such framework.
@jeetadityachatterjee6995
@jeetadityachatterjee6995 3 жыл бұрын
I used to use oh my zsh but I enjoy the flexibility of a plugin manger. I use zplug now and it's great!
@driden1987
@driden1987 3 жыл бұрын
I never really used zsh without oh my zsh. Don’t know why
@DannyMexen9
@DannyMexen9 3 жыл бұрын
I've dropped ohmyzsh in favour of configuring it myself. This is for learning purposes as I have never had any problems with ohmyzsh. I might try emacs next for similar reasons. Linux is fun.
@marioschroers7318
@marioschroers7318 3 жыл бұрын
@@DannyMexen9 It is! I remember trying out ohmyzsh, but for some reason it didn't work for me, I guess I didn't know how to configure it by the time. I'm trying DOOM Emacs right now for org-mode, taking digital notes for language learning. The table feature is gold. I still use Neovim as my principal text editor though. The learning curve with Emacs is quite stark, but DOOM is worth trying.
@driden1987
@driden1987 3 жыл бұрын
@@DannyMexen9 Yeah, that's definitely something I'm also going to be doing! I never considered doing it myself (for some reason)
@nicholasficara1017
@nicholasficara1017 3 жыл бұрын
DT you are nuts. Every time I learn something in linux, you make a video the day after. THAT DAMN WELCOME MESSAGE
@tridibbiswas3361
@tridibbiswas3361 Жыл бұрын
Hi, thank you for the video. I finally made the switch from zsh to fish today. In my zsh shell I had a .curlrc file in my $HOME dir. Though it’s still there when I am using fish it doesn’t seem to source the .curlrc file. Is there any particular way I need to do this.
@KFPSplayer
@KFPSplayer 3 жыл бұрын
first
@DistroTube
@DistroTube 3 жыл бұрын
Fake news!
@thengakola6217
@thengakola6217 3 жыл бұрын
You ripped off the fish functions and didn't even give stars to that guy ..... feels bad
@KakugenKun
@KakugenKun 3 жыл бұрын
Thank for the video DT! I was thinking, you are putting all you functions in your config.fish . Maybe it would be cleaner to put every function in a different file in .config/fish/function ? (I find the idea of having a folder for all the functions nice)
@jaykstah
@jaykstah 3 жыл бұрын
Started using fish the other day and right away it felt homey. Never used anything other than bash, so for me it's very refreshing. Definitely gonna have to spend some time tonight messing around with configuration and seeing what i can pull off with the info in this vid.
@paulhemebert496
@paulhemebert496 3 жыл бұрын
Try fish combined with fzf :)
@dkay-yt6ml
@dkay-yt6ml 3 жыл бұрын
Nice
@matthewevan5314
@matthewevan5314 3 жыл бұрын
Too late my big brain already ported my 32 Bash functions to Fish. Work faster next time DT ;)
@AvindraGoolcharan
@AvindraGoolcharan 3 жыл бұрын
Hey DT, loving fish myself. I recently switched. Have you tried elv.sh/ Elvish yet? Unlike fish, it supports math as a first class citizen. The other interesting thing I found is all the shells talk to one daemon when in use. Each elvish process seems to use over 10MB apiece, compared to Fish with clocks in at 7MB on my setup. I'm not sure yet if there are cool features enabled via the daemon management, only just did the go get -u github.com/elves/elvish myself
@reesericdotci
@reesericdotci 3 жыл бұрын
I love fish, and I need this vid! Thx, DT!
@WolfDaniel
@WolfDaniel 3 жыл бұрын
Actually, I strongly recommend Fisher. It's minimal and fast plugin manager. You can use plugin from any GitHub repo, and also you can sync your plugins by syncing your fish_plugins file containing all of your plugins.
@WolfDaniel
@WolfDaniel 3 жыл бұрын
Consider removing the -U option from fish_user_paths variable as universal is not meant to be used in config files. Each time you run fish, it appends to your path.
@whyeddy9702
@whyeddy9702 3 жыл бұрын
im glad youre covering fish, its been my favorite shelle ever since i joined linux, and i see little to no talk around it from the big linux youtubers
@sublevel123
@sublevel123 3 жыл бұрын
What i would like is, a usb key i can put in a pc which give me a replica of my main pc, i have 5 diff pc at home and want 1 machine host and all the rest slave, either on harddrive (laptop 3) or small factor no hd, usb key only, sata problem... local os but with my home and / all sync up . running mint 20, any idea
@davidr2421
@davidr2421 3 жыл бұрын
If they're all linux you could just have all your dotfiles hosted on github or gitlab, then just keep the dotfiles synced. Right?
@sublevel123
@sublevel123 3 жыл бұрын
@@davidr2421 yes that would work for the settings of the apps, but not the os and apps installed, i would like everything sync, i boot a usb drive, and it does some kind of stuff to update itself with updates and apps install on main machine, (or boot from a local drive)
@Vegemeister1
@Vegemeister1 3 жыл бұрын
That coln function seems to be spawning a new awk process for every single line. Faster on large files to pipe directly to awk: function coln awk '{print $'$argv[1]'}' end
@Tegatreides
@Tegatreides Жыл бұрын
hi dt thanks for all the content. i checked your repo and i could fix the clear alias cause it sent me an error that using the alias name inside the alias would create an infinite loop. thank for your repos. btw have u find a way to make ctrl+L follow the alias?
@theterri
@theterri 2 жыл бұрын
I can't make it work on Arch. I can't logon when I use fish. I need to use tty2, change it to zsh or bash and then I can logon :(
@lifeless9768
@lifeless9768 3 жыл бұрын
new DistroTube video! :D
@TutoDS2014
@TutoDS2014 2 жыл бұрын
Anyway to change to folder without cd like zsh?
@iainearl6669
@iainearl6669 3 жыл бұрын
DT should do a video on the starship prompt!
@wmgilliland2582
@wmgilliland2582 3 жыл бұрын
Dude you have a voice made for Radio.
@toequantumspace
@toequantumspace 3 жыл бұрын
I like fish but it garbles my characters and altgr fonts, while in bash, in the same alacritty terminal everything is ok... It looks like there is a different font in fish than in alacritty (which is rather impossible) Any ideas?
@tandeshmukh
@tandeshmukh 3 жыл бұрын
The link to you website isn’t working. I tried it in firefox and safari, through the hyperlink and with duckduckgo and nothing worked. If I click one of sublinks, like contact, it works. Just a heads up.
@thingsiplay
@thingsiplay 3 жыл бұрын
Why do you add so many functions and bloat, just to get "!!" functionality? You can always use the arrow key "up" to get the last commands.
@brunoboal9851
@brunoboal9851 3 жыл бұрын
Hello! Just saw the config.fish on GitLab. According to the documentation, you should run the command 'set -U fish_user_paths $fish_user_paths $HOME/.local/bin/' only once and in the terminal. Explanation from the fish official site follows: "The advantage is that you don't have to go mucking around in files: just run this once at the command line, and it will affect the current session and all future instances too. (Note: you should NOT add this line to config.fish. If you do, the variable will get longer each time you run fish!)". Thank you Derek, for all the interesting videos! Best regards to you and to all the community.
@stm3252
@stm3252 3 жыл бұрын
Hi DT, I have a non-related question. I've read the RTFM, but I can't find a way to bind a key to a specific layout in Qtile (example: mod +shift +m switch the layout to Xmonadtall ...)? Thanks
@sage5578
@sage5578 3 жыл бұрын
I am using zsh and I am liking it over bash so far. I use zsh syntax highting plugin and not use ohmyzsh. Here is github page for this plugin: github.com/zsh-users/zsh-syntax-highlighting
@faerryn8708
@faerryn8708 3 жыл бұрын
Fish has a unique way of setting variables that stick around in your config - you use the set -U to set a 'universal' variable, and the variable will appear in ~/.config/fish/fish_variables . So instead of editing config.fish, you could run the command: set -U VARIABLE value and it will stick around for all subsequent shells. I for one want nothing to do with this method, however, since it puts the variables in unreadable escaped form in ~/.config/fish/fish_variables . Fish does advertise this features, however, so it might serve somebody well!
@bahathir_
@bahathir_ 3 жыл бұрын
the skip function is simillar to $ tail +5.bashrc The take function is similar to $ head -5 .bashrc Thank you.
@mohammedzeglam6811
@mohammedzeglam6811 3 жыл бұрын
Hi dt , if you wont alias clear work with arguments remove equal sign and qoution marks that works with me when i create my fish config but with another programs
@balmar3
@balmar3 3 жыл бұрын
In case you do use the vi keybindings (they are indeed cool), then in normal mode [ and ] scroll through your previous arguments. (You can find this and other bindings at github.com/fish-shell/fish-shell/blob/master/share/functions/fish_vi_key_bindings.fish .)
@Flackon
@Flackon 3 жыл бұрын
Pretty neat. I'll have to dig deeper into fish and see if it's worth replacing zsh with it. One of the deal breakers is not being compatible with bash script...
@jwc865
@jwc865 3 жыл бұрын
In normal mode how do I change the command mode from colon to semicolon In Spacevim I looked up the documentation but I wasn’t able to figure it out
@xtnctr
@xtnctr 3 жыл бұрын
Fish is better indeed.
@AwesomeMediaify
@AwesomeMediaify 3 жыл бұрын
Just what i needed. Good timing DT
@DistroTube
@DistroTube 3 жыл бұрын
Hope it helps.
@craterface12
@craterface12 3 жыл бұрын
Thank you for telling us about suppressing the greeting message! It is super annoying.
@Sound_.-Safari
@Sound_.-Safari 3 жыл бұрын
You should check out scuba the fish plug-in manager
@ManuRedd
@ManuRedd 3 жыл бұрын
I have a couple questions: What do you use to edit the config file for fish? I am using text edit on mac and it works but its not ideal. What is the package that allows you to see your ram usage, cpu usage, etc on the top of your terminal? Thanks
@stsam63
@stsam63 3 жыл бұрын
he is using DOOM emacs to edit the file (its a different version of the normal emacs) I am not sure if it is available on mac. I can not remember what panel he is using though. I believe it is the standard panel that is recommended with XMonad
@gordonchan4801
@gordonchan4801 3 жыл бұрын
take 5
@apestogetherstrong341
@apestogetherstrong341 3 жыл бұрын
yo tf dislikes from? 3 like to 2 dislikes?
@DistroTube
@DistroTube 3 жыл бұрын
Bash fanboys. They are worse than the Arch fanboys.
@apestogetherstrong341
@apestogetherstrong341 3 жыл бұрын
@@DistroTube i like to use bash for interactive (i.e. my prompt) buy my scripts are in posix sh
@DistroTube
@DistroTube 3 жыл бұрын
Yea, sh points to the default shell...usually bash on most distros (dash on Ubuntu).
@apestogetherstrong341
@apestogetherstrong341 3 жыл бұрын
@@bigpod it is symlinked to dash, a minimal posix-compliant shell installed on my computer i use for running scripts
@apestogetherstrong341
@apestogetherstrong341 3 жыл бұрын
@@DistroTube i linked sh to dash, i have posix compliant scripts i check with shellcheck :)
@patrickmclaughlin6013
@patrickmclaughlin6013 3 жыл бұрын
So how do I install this Oh My Fish thing? fedora 31 dreading the upgrade to 33
@DistroTube
@DistroTube 3 жыл бұрын
Google "oh-my-fish". The install is a simple one liner in the terminal.
@mohammedzeglam6811
@mohammedzeglam6811 3 жыл бұрын
yesterday i installed fish shell
@sage5578
@sage5578 3 жыл бұрын
Wait, DT also represents the intials of your name.
@TarebossT
@TarebossT 3 жыл бұрын
Wow...! U're a genius!
@FredyHD
@FredyHD 3 жыл бұрын
Why do I need another shell
@caldersheagren
@caldersheagren 3 жыл бұрын
Are you going to make config.fish literate?
@DistroTube
@DistroTube 3 жыл бұрын
I had thought about it. It would be very easy to add a README.org to my .config/fish/ directory and have the source blocks output to the config.fish.
@akshatvats7992
@akshatvats7992 3 жыл бұрын
Cool hoody, that!
@samuelschwager
@samuelschwager 3 жыл бұрын
Neat stuff!
@CrustyAbsconder
@CrustyAbsconder 3 жыл бұрын
GhostBSD uses Fish Shell. I am having trouble getting GhostBSD to work smoothly on my 2020 hardware
@bobgrimes8618
@bobgrimes8618 3 жыл бұрын
Watch DT’s video on GhostBSD. I tried it about two years ago on a Thinkpad, and it was not very good.
@faizanahmad5464
@faizanahmad5464 3 жыл бұрын
Hey how do you get those pretty colors and stuff when you launch your terminal? It looks really pretty
@DistroTube
@DistroTube 3 жыл бұрын
Check out my shell-color-scripts repo on my GitLab: gitlab.com/dwt1/shell-color-scripts
@faizanahmad5464
@faizanahmad5464 3 жыл бұрын
@@DistroTube It works great. Except i installed it from aur and just doing a colorscript -random doesn't work, i have to writ full path for it to run. Do i need to add it in my $PATH?
@Gglsucksbigballz
@Gglsucksbigballz 3 жыл бұрын
Good stuff DT! I'm gonna ditch my OMF and fisher. Right after I Rip off your config.fish
Getting Started With Git and GitLab
24:34
DistroTube
Рет қаралды 42 М.
Essential Keybindings For Bash, Fish and Zsh
16:41
DistroTube
Рет қаралды 28 М.
Win This Dodgeball Game or DIE…
00:36
Alan Chikin Chow
Рет қаралды 38 МЛН
My Fish shell workflow for coding
16:14
devaslife
Рет қаралды 434 М.
The 12 Linux Apps Everyone Should Know About
21:20
DistroTube
Рет қаралды 467 М.
Why Everyone Should Use Slackware at Least Once
9:18
YouTux Channel
Рет қаралды 720
FISH (Friendly Interactive Shell) by Bash Boomer
12:00
Luke Smith
Рет қаралды 233 М.
Fish Shell Tips and Tricks (Can Your Shell Do This?)
14:44
DistroTube
Рет қаралды 67 М.
Arch Linux: Getting Started With Fish
13:21
EF - Linux Made Simple
Рет қаралды 23 М.
A First Look At Zorin OS 17.2
16:36
DistroTube
Рет қаралды 24 М.
Turn Bash Into A Game Of Chance With $RANDOM
11:05
DistroTube
Рет қаралды 13 М.
Let's Share Our Favorite Bash Aliases
16:28
DistroTube
Рет қаралды 31 М.
Learning Awk Is Essential For Linux Users
20:02
DistroTube
Рет қаралды 299 М.