Creating Functions In The Fish Shell

Ғылым және технология

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/dwt1/dotfiles/-/bl... - DT's config.fish
► github.com/isacikgoz/sashimi - Sashimi prompt
► github.com/jorgebucaran/spark... - Spark.fish
► github.com/oh-my-fish/plugin-... - The Bang Bang plugin
► github.com/razzius/fish-funct... - Razzius's Fish Functions
WANT TO SUPPORT THE CHANNEL?
💰 Patreon: / distrotube
💳 Paypal: www.paypal.com/cgi-bin/webscr...
🛍️ Amazon: amzn.to/2RotFFi
👕 Teespring: teespring.com/stores/distrotube
SOCIAL PLATFORMS:
🗨️ Mastodon: mastodon.technology/@distrotube
💬 IRC: irc://freenode #distrotube
👫 Reddit: / distrotube
📽️ LBRY: lbry.tv/$/invite/@DistroTube:2
DT ON THE WEB:
🕸️ Website: distrotube.com/
🐿️ Gopherhole: gopher://distro.tube
📁 GitLab: gitlab.com/dwt1
🔊 Audio Podcasts: www.buzzsprout.com/1263722
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.audacityteam.org/
💻 VirtualBox: www.virtualbox.org/
🗒️ Doom Emacs: github.com/hlissner/doom-emacs
Your support is very much appreciated. Thanks, guys!

Пікірлер: 77

  • @TheGruselmops
    @TheGruselmops3 жыл бұрын

    yesterdays DT: There are to many script kiddies out there todays DT: I'm literally a script kiddie

  • @TheGruselmops

    @TheGruselmops

    3 жыл бұрын

    yup

  • @nicholasficara1017
    @nicholasficara10173 жыл бұрын

    DT you are nuts. Every time I learn something in linux, you make a video the day after. THAT DAMN WELCOME MESSAGE

  • @jaykstah
    @jaykstah3 жыл бұрын

    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 :)

  • @whyeddy9702
    @whyeddy97023 жыл бұрын

    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

  • @marioschroers7318
    @marioschroers73183 жыл бұрын

    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)

  • @brunoboal9851
    @brunoboal98513 жыл бұрын

    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.

  • @reesericdotci
    @reesericdotci3 жыл бұрын

    I love fish, and I need this vid! Thx, DT!

  • @AwesomeMediaify
    @AwesomeMediaify3 жыл бұрын

    Just what i needed. Good timing DT

  • @DistroTube

    @DistroTube

    3 жыл бұрын

    Hope it helps.

  • @lifeless9768
    @lifeless97683 жыл бұрын

    new DistroTube video! :D

  • @WolfDaniel
    @WolfDaniel3 жыл бұрын

    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.

  • @KakugenKun
    @KakugenKun3 жыл бұрын

    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)

  • @samuelschwager
    @samuelschwager3 жыл бұрын

    Neat stuff!

  • @iainearl6669
    @iainearl66693 жыл бұрын

    DT should do a video on the starship prompt!

  • @akshatvats7992
    @akshatvats79923 жыл бұрын

    Cool hoody, that!

  • @Gglsucksbigballz
    @Gglsucksbigballz3 жыл бұрын

    Good stuff DT! I'm gonna ditch my OMF and fisher. Right after I Rip off your config.fish

  • @dkay-yt6ml
    @dkay-yt6ml3 жыл бұрын

    Nice

  • @stm3252
    @stm32523 жыл бұрын

    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

  • @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.

  • @Flackon
    @Flackon3 жыл бұрын

    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...

  • @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?

  • @Vegemeister1
    @Vegemeister13 жыл бұрын

    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

  • @faerryn8708
    @faerryn87083 жыл бұрын

    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!

  • @WolfDaniel
    @WolfDaniel3 жыл бұрын

    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.

  • @ManuRedd
    @ManuRedd3 жыл бұрын

    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

  • @mohammedzeglam6811
    @mohammedzeglam68113 жыл бұрын

    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

  • @jwc865
    @jwc8653 жыл бұрын

    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

  • @TutoDS2014
    @TutoDS2014 Жыл бұрын

    Anyway to change to folder without cd like zsh?

  • @bahathir_
    @bahathir_3 жыл бұрын

    the skip function is simillar to $ tail +5.bashrc The take function is similar to $ head -5 .bashrc Thank you.

  • @matthewevan5314
    @matthewevan53143 жыл бұрын

    Too late my big brain already ported my 32 Bash functions to Fish. Work faster next time DT ;)

  • @AvindraGoolcharan
    @AvindraGoolcharan3 жыл бұрын

    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

  • @balmar3
    @balmar33 жыл бұрын

    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 .)

  • @toequantumspace
    @toequantumspace3 жыл бұрын

    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?

  • @sublevel123
    @sublevel1233 жыл бұрын

    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)

  • @xtnctr
    @xtnctr3 жыл бұрын

    Fish is better indeed.

  • @patrickmclaughlin6013
    @patrickmclaughlin60133 жыл бұрын

    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.

  • @wmgilliland2582
    @wmgilliland25823 жыл бұрын

    Dude you have a voice made for Radio.

  • @Sound_.-Safari
    @Sound_.-Safari3 жыл бұрын

    You should check out scuba the fish plug-in manager

  • @theterri
    @theterri Жыл бұрын

    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 :(

  • @tandeshmukh
    @tandeshmukh3 жыл бұрын

    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.

  • @mohammedzeglam6811
    @mohammedzeglam68113 жыл бұрын

    yesterday i installed fish shell

  • @caldersheagren
    @caldersheagren3 жыл бұрын

    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.

  • @craterface12
    @craterface123 жыл бұрын

    Thank you for telling us about suppressing the greeting message! It is super annoying.

  • @sage5578
    @sage55783 жыл бұрын

    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

  • @faizanahmad5464
    @faizanahmad54643 жыл бұрын

    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?

  • @thingsiplay
    @thingsiplay3 жыл бұрын

    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.

  • @sage5578
    @sage55783 жыл бұрын

    Wait, DT also represents the intials of your name.

  • @TarebossT

    @TarebossT

    3 жыл бұрын

    Wow...! U're a genius!

  • @KFPSplayer
    @KFPSplayer3 жыл бұрын

    first

  • @DistroTube

    @DistroTube

    3 жыл бұрын

    Fake news!

  • @FredyHD
    @FredyHD3 жыл бұрын

    Why do I need another shell

  • @gordonchan4801
    @gordonchan48013 жыл бұрын

    take 5

  • @apestogetherstrong341
    @apestogetherstrong3413 жыл бұрын

    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 :)

  • @thengakola6217
    @thengakola62173 жыл бұрын

    You ripped off the fish functions and didn't even give stars to that guy ..... feels bad

  • @CrustyAbsconder
    @CrustyAbsconder3 жыл бұрын

    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.

Келесі