This may be my favorite CLI tool ever
Vložit
- čas přidán 17. 07. 2024
- 50% Off Typecraft! typecraft.dev
X: x.com/typecraft_dev
Discord: / discord
FZF is my favorite tool for linux and unix systems. It has amazing features, its simple to use, and its fun! it works amazing and I think this is an essential tool for you to learn. This is a must have in your toolbox. You can fuzzily find anything on your machine, and you can also pipe output from other programs to FZF. it truly is amazing. - Věda a technologie
Thanks, nerd
well... in this side of internet its actually a compliment lol 😂
this is getting funnier and funnier lol
You are one of the few devs who actually understands his tooling and is willing to take the time and effort required to properly learn them to make your workflow faster. More devs need to follow this mentality.
If you use the `--bind "enter:become(nvim {})"` flag then it will open the selected file(s) in nvim for you (without needing to prepend your command with `nivm ...`), which means that you can cancel out of the fzf finder without neovim from being entered. With the command listed, escaping fzf will still open nvim, which might not be what you want if you're trying to escape the search.
For completeness, this is my alias.
alias nf='fzf -m --preview="bat --color=always {}" --bind "enter:become(nvim {})"'
I was having issues with your listed alias, it showed me STDIN where the bat preview should have been, probably a "me problem"...
Anyways, I found a small fix for anyone encountering the same issue:
alias nf='fzf -m --preview="bat --color=always {}" --bind "enter:become(nvim {})"'
Difference is that fzf passes the file path to bat with the little '{}' after "bat --color=always ..."
@@domjan3859 Thanks for pointing that out - that was an issue on my end. I've edited my comment to make it clear it needs `{}` in both parts!
Nice!! Thanks for this
For some reason with this alias, selecting multiple files didn’t work for me and only the last file selected was actually passed to nvim
Sweet, now i got my day planned. Don't know how I missed this program
Some of the stuff fzf gives (like kill -9 **) was unknown to me as well, even though I've been using fzf for a WHILE
@@typecraft_dev Kind of feels like that when using Linux tbh, learning new things constantly :)
Also nice:
1. nvim Ctrl + t ( opens fzf. Of course works for any command ).
2. Ctrl + r opens shell command history
"Ctrl + r opens shell command history"
Honestly I have no idea how anyone can use reverse-i-search after discovering this. 100x better on every level.
Exactly always works like a charm
Never knew this w comment
ctrl-r with fzf is the main reason I install fzf on every pc I touch (if I'm allowed to of course)
Amazing tool! I should start using it
i used it before but learned new things today i hadn't figured out earlier
Why do you keep giving us great weekend projects?? Thanks for showing us this. Now I can't wait to get home and install it.
0:42 The pacman frontend name almos killed me
🤣
Now, this is a really good trick!
thanks nerd, your video + coffee = great day
hell yeah, just made coffee myself!
fzf is very nice as is your video and guide. Thanks. I picked up some very useful things I hadn't used. I also use cntrl r in bash and search history that way which is kind of similar but where fsf is not present
Yes FZF with history search is amazing I forgot to add it in this video!
I use fzf every day for work. It’s probably the best CLI tool out there!
Thank you, Chris.
My pleasure!
Take a shot every time he says, “Fuzzily findable.”
That kill command looks insanely useful. Giving fzf a try!
Regarding kill, just make sure you take a look at this article so you use kill safely! learn.typecraft.dev/tutorial/kill-choices/
i did not know i need it. thanks O_O
with fzf on my shell i can press ctrl+r then it will fuzzy find any commands on my bash history, i use it quite often
yup! thats one of the best. I've used it so often I actually forgot about it for this video. lol
Amazing content. Subscribed!! By the way can you tell me where you got your desktop wallpaper from?
github.com/typecraft-dev/dotfiles/tree/master/backgrounds
Fzf is one of my favorite tools, I have a few videos covering it on my channel. I made videos showing how I use it to make my menus, my app launcher, I even made a terminal file manager out of it. Great tool.
awesome!
I didn’t know about the ** stuff. Cheers for that!
love the arch btw
haha
@@typecraft_dev cant live without btw thx so much for this video i had no idea how fzf works
Your videos are awesome! 👌
You are awesome
Thanks, Nerd
For those of us stuck with bash (eg from git for windows) and don't have the zsh history autocomplete, fzf integrates with bash history. So hit CTRL+R and you'll be able to fuzzily find past commands you run. Very handy for me.
I think people should only use fzf when you need multi selections or “fuzzy” search. When you know what you’re searching, it doesn’t make sense to use fzf, since it’s much faster to use fd, grep, glob, etc. It slow down your process and just add an interface that make u feel fast 😂
Great vid!
Thanks!
Wait, how did you know i was searching for this...
can you make a video on best cli development lang or framworks
unalias does not remove the alias from your .zshrc, it only removes it from the environment of the current session. When you open a new terminal or source your zshrc, the alias will be added again.
yes that is correct. was just showing off the feature for FZF
Really enjoy every video of yours, thanks nerd!!
Thank you, nerd!
Hello again 👋🏻 Where can I get that background wallpaper it's so calming 😸
Pretty cool
I've seen people use this but never knew what it was called. Thanks so much for the great video!
Glad you liked the video!
Using it with a preview is new to me. Thanks for the awesome tip!
yeah, big part of the reason I made the video. that was new to me as well!
So is it like Raycast or Alfred but for CLI? This is pretty cool!
I was very appriciated for your neovim video. I want to use ftp-sync in neovim like vscode(sftp or ftp-simple), but I couldn't find out how to set for it. Please help us!
I actually have to change my terminal to Alacritty at some point, since Warp does not support fzf at the moment
ah yes. warp kinda implements its own fuzzy find stuff.
You can use nl instead cat to have the preview numbered
Oohhhh
or cat -n
Quick tip for those who use fish shell
** will not work
instead, just CTRL+T to get the same functionality
you can find more information here github.com/junegunn/fzf?tab=readme-ov-file#fish-shell
How do you feel about oh-my-zsh? Adding fzf means I just add it to my plugins list, instead of a list of actions cluttering my .zshrc for fzf, nvm, whatever.
That’s a great approach as well
I'm still learning so feel free to flame but isn't yay used for the arch user repo? what is meant by calling it a front end for pacman then which is used for the Arch package repo? aren't they kind different tools to get packages from different places? (I do now yay is installed from pacman)
Instantly in love with how it works with shell history.
Are you using i3 in this video? If so, how did you get the bar at the top of the terminal?
Nah used gnome just for presentation
@@typecraft_dev Yeh that makes sense. Great video, need to look more into integrating fzf into my workflow. Have you looked at the tmux-sessionizer script by primeagen? Its a great script that uses fzf to open a folder in tmux. Had to change part of it to work for me but dont remember exactly what was wrong.
Which keyboard are you using?
Happy hacking keyboard type s
Thanks nerd!! One question: What if i dont wanna write the ** to completion, i just wanna press tab as always? how i can do this?
Solo exporta esta variable de entorno:
export FZF_COMPLETION_TRIGGER=''
Lo probé antes de responder, no me pareció muy cómodo de usar
@@m0r4ag gracias voy a probar, quiero emular de manera "nativa" lo que hace fzf-tab-git qué se puede instalar desde aur, donde igual solo basta poner por ejemplo "cd " en vez de cd **
Come on nerd. You missed the fzf history search. Ctrl+r in bash, probably something similar in Zsh
ah yeah, I've used that for so long I forgot to include it in the video!
This tool is almost as awesome as you
awwwwwww
fzf is awesome, but the latest stable version for Ubuntu is missing some of those cool features. I hope that changes soon. Or I guess I could always swap to Arch :D
another reason for arch!!! lol
what terminal emulator do you use
which theme you are using??
catpuccin
bomb diggity ❤
boomshakalaka
4:39 - that means you didn't checkout broot yet :)
lmao i went to ask for this yesterday but i got distracted. now its here.
OPRAH WAS RIGHT IM MANIFESTING
I always thank oprah
Someone tell me how to ignore specific files and folder while searching through fzf and how to add some specific files and folder to show in fzf , thanks
Follow-up tutorial inbound!
Can you upload setting up nix package manager, home manager and nix profile with flakes guide🙌🙌🙌🙌
that is on the list. the looooonnng list :)
Next one on yazi?? 👀
who needs all of that when you have `find`.
alao make sure to use fd instead of find (it's like 6 times faster). fzf will automatically prefer fd if you have it installed
Is it just me or did this video feel like it was going n 1.25x speed?
Other than that, great vid :)
Preety cool
you are
I swear I've seen a fzf video from this channel before?
nope! this is the first one
it's could be part of a video i think it was one in the neovim series but awesome new comands to find things i've lost trough my pc yhanks nerd 😄
You're the most efficient dev and CZcams content creator I know! Keep it up man, you're awesome. 💪
awesome, will do!
Laptop go Brrr
Only if I had a penny for every time typecraft talked about fzf...
Why did u left arch ?
This video is recorded on arch
@@typecraft_dev in next video don't forgot to mention I use Arch , btw
linux for newbs 4 when
what would you like to see in linux for newbs 4? I want to know!
Your vim and tmux configs for productivity
@@typecraft_dev I'd love to see a full arch + i3 + neovim setup from scratch, maybe live
kill multiple program?
0:41 🏳🌈The gay package manager
Day 4 of asking to make a video on how do you record and stream stuff on arch linux!
the answer: I don't!
@@typecraft_dev then how?
@@ispyu1514 technically I can stream from arch pretty much out of box with OBS. But not all things are supported (like nvidia). So now I stream through a capture card on a PC
@@typecraft_dev ohh but does ur obs on arch works with window capture or just screen capture?
someone can just use locate?
OMG
kill -9 ** is an incredible tip
right? I love it!
For me I probably prefer ranger.
Yazi is better
@@adriansrfr I don’t know that tool, wil look at it tonight.
Be careful using "cat" with huge files, it's not a pager!
Good call
0:34 it's not D-bien, it's Deb-Ian. It was created by Ian Murdock and named after his gf Debra (Deb for short, later ex-wife) and himself.
I always mess it up! Great explanation I didn’t know that
here's like #172 for pronouncing "Zee/Zed Shell correctly". It's not "zeesh". 👌
I think I say it both ways, lol. I'm sure I mis-pronounced "debian" in this video too haha. can't help it!
Those soydevs are missing out
I have soymilk in my coffee right now...... shit
couldnt get my ** to work dunno what that is about
tac is cat backwards.
I don't lose stuff often enough for fuzzy find to be useful.
fair enough
chad dev
I use it to find old ffmpeg and one liner commands that might need some time and overhead.
Even if you don't lose the files, isn't it a very fast way of navigating the file tree regardless?
It's not just to find lost stuff. It's to find stuff faster. When you multiple files in different locations or deeply nested directories, fzf makes it way easy to find them
@6:55, why would you go straight to a `kill -9` - don't teach people bad habits! Use a normal kill (SIGTERM) first and give the process a chance to exit gracefully before reaching for the nuclear option.
Haha I guess I have that bad habit too. Oops!
For anyone reading this thread and want to know more, we cover this here learn.typecraft.dev/tutorial/kill-choices/
@@typecraft_dev thanks, nerd!
Who is learning Unix today?
me
12th
but number 1 in my heart
7th
but #1 in my heart
you told that to everyone atleast i have #
@@kinggrey2511 lol.... you weren't supposed to look
I too feel like I have been cheated 😂
119th
but number 1 in my heart
@@typecraft_dev isn't number 1 your editor ?
fzf amazing but I thing fzy better than it
fzf is useless.. in the video it's nice and quick, but I have ~ 100 github projects on my m1 mac, it takes over a minute to search for a simple term (after it's indexed everything). Sure I have 54 million files in the index but so what.. it's not that many?
"by default it will search for all the files on your machine" no I don't think it does... at least I've never seen or heard of it doing that.
Deb-Ian not Dee-Bian
I know I always do that I can’t help it!
Fzf is great but nothing beats zoxide
every video i see of urs that one mf calls him nerd. i am getting irritated on his behalf