Smart tmux sessions with zoxide and fzf

Sdílet
Vložit
  • čas přidán 11. 08. 2022
  • All the notes for this video can be found here:
    www.joshmedeski.com/posts/sma...
  • Věda a technologie

Komentáře • 125

  • @jamesmillsnicholas7813
    @jamesmillsnicholas7813 Před rokem +5

    Great stuff! I had watched it before and it served as valuable inspiration to implement my own system. I watched it again and it inspired me again to simplify and streamline things. Thanks Josh!

  • @cris7ea
    @cris7ea Před rokem +2

    I watched this video many time and still haven't implemented everything just yet (but working on it). Its so good!!!! ... All your videos are packed of good info. Keep up the awesome amazing 'jaw dropping' 😁work!

  • @logannday
    @logannday Před 10 měsíci +1

    Just got this up and running..... life changing dude you're best

  • @ahmedash95
    @ahmedash95 Před 28 dny +1

    Didn't know about zoxide before. such a good tool to use. Thanks!

  • @rokometek7394
    @rokometek7394 Před rokem +1

    Thank you for this amazing workflow. I will definitely try this on my workflow.

    • @JoshMedeski
      @JoshMedeski  Před rokem

      You’re welcome! It makes me so productive in the terminal.

  • @Amiron97
    @Amiron97 Před rokem +1

    Love your t-smart-tmux-session-manager plugin. Good stuff!!!

  • @user-id1ho2pk8p
    @user-id1ho2pk8p Před rokem +5

    very good and useful video, thank you

  • @vjuwyy5922
    @vjuwyy5922 Před rokem +2

    Great video, this is something I've been fighting with for so long! I ended up creating a custom Raycast extensions with the same functionality of the popup window since I didn't know the tmux pop-up fzf existed. This is going to be so much better. Thank you

    • @JoshMedeski
      @JoshMedeski  Před rokem +1

      I made it into a tmux plugin to make it even easier to use, check out the blog post in the description!

    • @vjuwyy5922
      @vjuwyy5922 Před rokem +1

      This is awesome, thank you so much

  • @raj.svc.google911
    @raj.svc.google911 Před rokem +7

    You could use `tmux new -As mysession` to either attach or create the session.

    • @JoshMedeski
      @JoshMedeski  Před rokem

      Good to know, I might use that

    • @Milky____
      @Milky____ Před rokem +2

      Guys like you is why I read comments, Thank you!

  • @travispandos7179
    @travispandos7179 Před rokem +3

    Always bringing us such amazing content! Thank you! Looking forward to more of your videos on Vim!

  • @svyatogor
    @svyatogor Před rokem +5

    I really like the format of the video and the way you present things. Would love to see deep dive into you neovim setup!
    As for the tmux I didn't quite get why would you want to have new tmux sessions created for every folder you jump in?
    p.s. lazygit is really cool, thanks for the tip!

    • @JoshMedeski
      @JoshMedeski  Před rokem +4

      My keyboard shortcuts, scripts, and some other tools typically expect the session root to be a git repository. So it allows me to be focused on a single project at a time. I can share more in a future video!

  • @stephenkbolton
    @stephenkbolton Před rokem +16

    You can simplify that sed command with using the basename command

    • @JoshMedeski
      @JoshMedeski  Před rokem +5

      Thanks for the tip!

    • @Subbeh2
      @Subbeh2 Před rokem

      Or even ${PWD##*/}

    • @heinrichskies
      @heinrichskies Před 9 měsíci +1

      ​@@JoshMedeskiand you can avoid issuing a command by using (basename $PWD)

  • @bombrman1994
    @bombrman1994 Před 3 měsíci

    This is amazing

  • @phaberest_
    @phaberest_ Před rokem +2

    This is definitely magnificent, well done mate!

  • @Chalisque
    @Chalisque Před 9 měsíci +1

    I have a simple pair of scripts, tm and tmx, for creating and reattaching (tmx is separate so I can have command completion via querying tmux list-sessions). By doing this I can add various shorthands as I desire them.

  • @toolbelt
    @toolbelt Před 3 měsíci

    Brilliant!

  • @abdoulayebalde2139
    @abdoulayebalde2139 Před rokem

    Thanks for this amazing video. which theme of fish are you using?

  • @zestynotions
    @zestynotions Před rokem +4

    always great stuff Josh, cheers.
    I likely wont need that level of session management in tmux for what I do, but the idea of combining fzf with the results list from zoxide is great and gives me some ideas.

    • @JoshMedeski
      @JoshMedeski  Před rokem +1

      Sweet, please share your ideas! Fzf and zoxide are both great tools on their own.

    • @zestynotions
      @zestynotions Před rokem

      @@JoshMedeski My problem is sometimes remembering the foldername in which case zoxide cant really help me (although to be fair zoxide can also tab completed suggestions) with a fzf or broot over folder structures I atleast get a view of names to remind me. but on mac I find that because there are SO many system directories fzf can be slow as it struggles with all those. Whats great about this idea for me is to have a fzf over an already curated list of folder names that zoxide knows I use and so it can be super fast :) I used to alias broot and zoxide to start in a specific folder to help it not having to index the entire tree each time, but this way I wont have to ;)

    • @zestynotions
      @zestynotions Před rokem

      haha now I just need to figure out how to make fzf always use the zoxide results list. haha

    • @JoshMedeski
      @JoshMedeski  Před rokem +1

      @@zestynotions Feel free to use my t script as inspiration.

    • @zestynotions
      @zestynotions Před rokem +1

      @@JoshMedeski Yes was definitely gonna have a look there first. Thanks for sharing.

  • @the.real.ipatch
    @the.real.ipatch Před rokem

    well done due. 👍
    have you dabbled into nested tmux sessions at all?

  • @eduardoaranda4379
    @eduardoaranda4379 Před rokem +2

    It’s amazing how I made the same solutions as you but using a script called “Z jump around”

    • @JoshMedeski
      @JoshMedeski  Před rokem +1

      Cool, there are lots of smart directory jumping CLIs out there!

  • @MichaelButlerC
    @MichaelButlerC Před 8 měsíci +1

    This seems pretty damn cool! I just started using tmux recently and I keep using the tab left and right techniques which seem very inefficient (I'm too used to web browsers). But creating a session per project sounds a lot better and faster

    • @JoshMedeski
      @JoshMedeski  Před 8 měsíci +1

      Thanks, check out the plugin. It's got lots of cool new features since this video came out: github.com/joshmedeski/t-smart-tmux-session-manager

  • @MyBlancpain
    @MyBlancpain Před rokem +1

    Loving the content, have implemented a bunch of your ideas into my workflow. Can I ask how you set up gitmux with tmux to show git info in the status bar? I am also using fish & alacritty.

    • @JoshMedeski
      @JoshMedeski  Před rokem

      Thanks, here is the repo with instructions github.com/arl/gitmux

  • @ElderESG
    @ElderESG Před rokem +1

    Amazing config ❤

  • @ericraio7145
    @ericraio7145 Před 8 měsíci +1

    If you don't want to use zoxide, you can set the CDPATH variable, it's like PATH but the cd command looks at the CDPATH list to determine what to CD into and the default is your current directory. available on POSIX computers

    • @JoshMedeski
      @JoshMedeski  Před 8 měsíci +1

      Thanks for the tip. I really like zoxide’s algorithm for detecting directories based on frequency and recency, that’s why I use it

  • @Dmitri_Ivanovich
    @Dmitri_Ivanovich Před 6 měsíci

    I found your tmux plugin (in a video from another user) - it works great! You should probably mention it in this video somehow, either in the description or pinned comment. I know it's the first link in your notes document, but still. Thanks for make a great tool.

    • @JoshMedeski
      @JoshMedeski  Před 6 měsíci

      Good idea! I mention it on the blog post but it would be good to mention it here too 🙂

  • @GonzaloStoll
    @GonzaloStoll Před 5 měsíci

    Absolutely amazing and helpful video. Would like to know how to get t into PATH tho 😬 What font were you using in this video by the way? It's not JetBrainsMono right?

    • @JoshMedeski
      @JoshMedeski  Před 5 měsíci

      Thanks! Check out the official tmux plugin for more features and how to set it up github.com/joshmedeski/t-smart-tmux-session-manager

  • @iduran
    @iduran Před rokem +3

    Really nice workflow. Will implement something similar. Perhaps instead of named sessions will use named windows. Thanks for this!

    • @JoshMedeski
      @JoshMedeski  Před rokem +2

      I’ve thought about applying some of the same principles to window names, maybe I’ll share some of what I’ve been doing in an upcoming video!

    • @iduran
      @iduran Před rokem

      @@JoshMedeski That would be great!

  • @seaphd
    @seaphd Před rokem

    Interesting setup. Alot to chew on.
    random question : is this your normal typeface or something you use specifically for presentations? Very readable.

    • @JoshMedeski
      @JoshMedeski  Před rokem +2

      It’s Apple’s SF font patched with Nerd icons github.com/epk/SF-Mono-Nerd-Font

  • @joselima7655
    @joselima7655 Před rokem +1

    Nice!!! Love it. What colorscheme is that?

    • @JoshMedeski
      @JoshMedeski  Před rokem

      Thank, here is what I use github.com/catppuccin/catppuccin

  • @IainSimmons
    @IainSimmons Před rokem

    I know I'm a bit late to the party, but I tend to just use multiple windows on the same tmux session (appearing as tabs, and then each with multiple panes as needed).
    Do you think it would be difficult to modify your plugin to suit that need?

    • @JoshMedeski
      @JoshMedeski  Před rokem +1

      So my script is specifically for session management. Feel free to borrow my ideas for creating a window or pane manager if you think it’s a good idea for your workflow!

  • @mbrochh82
    @mbrochh82 Před rokem

    you have several paths that end with lazygit. what happens if you select one and then another, would you now have two tmux sessions with the same name (if that is even possible)?

    • @JoshMedeski
      @JoshMedeski  Před rokem

      As of right now it would switch back to the existing one.

    • @JoshMedeski
      @JoshMedeski  Před rokem

      You could rename the session manually if you ever needed to open similarly named folders at the same time. But it doesn’t happen to me.

  • @Danielo515
    @Danielo515 Před rokem

    That chair looks nice. Do you recommend it?

    • @JoshMedeski
      @JoshMedeski  Před rokem

      Yeah. It’s a gamer chair from IKEA. It inexpensive and gets the job done.

    • @Danielo515
      @Danielo515 Před rokem +1

      @@JoshMedeski looked a lot like one of those ergonomic office chairs

  • @sebastianmangelsen8056
    @sebastianmangelsen8056 Před rokem +2

    How did you manage to get rid of your window frame in MacOs?

    • @JoshMedeski
      @JoshMedeski  Před rokem

      It’s a terminal emulator called Alacritty, I’ve got a video how to set it up! czcams.com/video/Mu4frtvHPOY/video.html

  • @m_pac4221
    @m_pac4221 Před 8 měsíci

    great content! how does zoxide work with repeating directory structures when directory names occur multiple times?

    • @JoshMedeski
      @JoshMedeski  Před 8 měsíci

      Thanks! Zoxide ranks directories based off recent usage and how much a directory is used. You’ll get used to the ranking system after using it for awhile

    • @m_pac4221
      @m_pac4221 Před 8 měsíci

      @@JoshMedeski ok, if you use a directory name multiple times z changes to that with the most search requests. in this case you only can z to a unique upper level directory.

  • @pascalporedda958
    @pascalporedda958 Před rokem +2

    Really nice video. I like the concept, been using the "tmux sessionizr" ThePrimeagen built sometime ago, which works kinda the same.
    Haven't heard of Zoxide yet. Just installed it and will give it a go today.

  • @PhiHDN
    @PhiHDN Před rokem +1

    hi, thank you for the great plugin and great tutor. I would like fix the theme issue at 10:54 in fzf popup. Could you guide me how to fix that?

    • @JoshMedeski
      @JoshMedeski  Před rokem

      It will be an upcoming blog post and video, stay tuned in! I recommend reading the fzf documentation in the meantime.

    • @PhiHDN
      @PhiHDN Před rokem +1

      @@JoshMedeski Looks like I fixed it by adding `set -Ux FZF_DEFAULT_OPTS "--color=..."`. Anyway, I am still looking forward to see your videos, love them. Thanks

  • @jordanbarlow3788
    @jordanbarlow3788 Před rokem +2

    I notice this doesn't work for paths stored in the zoxide database that include a space.
    Example:
    PATH = "~/Documents/Cool Stuff/project"
    Will create a tmux session named "Cool" and won't zoxide to the folder "project".
    This is probably trivial enough to fix for someone who writes shell scripts on the regular, but that ain't me at the moment haha. Anyone got ideas?

    • @JoshMedeski
      @JoshMedeski  Před rokem +1

      I can make a fix. I don’t ever use spaces in my folder names but I realize some people do.

    • @jordanbarlow3788
      @jordanbarlow3788 Před rokem +1

      @@JoshMedeski That would be great, thanks!
      I don't really use spaces either, only realised once I was in some iCloud folder that had "Mobile Documents" as part of the path.

  • @xueweihuang2508
    @xueweihuang2508 Před rokem

    Thank you!!! 6:07 How did you do that?

    • @JoshMedeski
      @JoshMedeski  Před rokem

      I have my file manager bound to a keyboard shortcut, see czcams.com/video/BLp61-Lq0kQ/video.html

    • @JoshMedeski
      @JoshMedeski  Před rokem

      I’ll be making a video on my file manager soon!

  • @rexroof
    @rexroof Před 4 měsíci

    tmux new-session -A -t name will automatically create the session it doesn't exist or it will attach to it.

    • @JoshMedeski
      @JoshMedeski  Před 4 měsíci

      Yes! Lots of others have shared that tip with me since making this video, thanks :)

  • @razorree
    @razorree Před 5 dny

    how did you open that folders browser at 6m05s ?

    • @JoshMedeski
      @JoshMedeski  Před 5 dny

      I use command+f to launch a file explorer called LF

  • @mbrochh82
    @mbrochh82 Před rokem

    what is that popup that thows up at 11:00 -- seems to be some fuzzy file finder to open files in vim?

    • @JoshMedeski
      @JoshMedeski  Před rokem +2

      It’s called Telescope it’s a Neovim plugin

    • @BohdanMakohin
      @BohdanMakohin Před rokem +1

      @@JoshMedeski and you have shell alias to open it like “nvim +GitFiles”?

  • @vikingthedude
    @vikingthedude Před 5 měsíci

    What file explorer is this at 6:07? I think i should start using one

    • @JoshMedeski
      @JoshMedeski  Před 5 měsíci

      It's call "lf", check it out github.com/gokcehan/lf

  • @rmrvubl8648
    @rmrvubl8648 Před rokem

    How did you make fzf popup like that on 13:01?

    • @JoshMedeski
      @JoshMedeski  Před rokem

      It's built into the `tt` script github.com/joshmedeski/dotfiles/blob/main/mackup/.config/bin/tt and I have it commented to a macOS keyboard shortcut (cmd+j) using Alacritty (see czcams.com/video/BLp61-Lq0kQ/video.html). Hope that helps.

  • @aziz0x00
    @aziz0x00 Před 10 měsíci +1

    fish shell

  • @bhaveshverma8629
    @bhaveshverma8629 Před rokem

    Which snippet expansion do you use?

    • @JoshMedeski
      @JoshMedeski  Před rokem

      What you’re seeing in this video is the fish shell’s built in abbreviation feature

    • @bhaveshverma8629
      @bhaveshverma8629 Před rokem +1

      @@JoshMedeski oh ok thanks for clarifying. I thought of some kind of snippet plugin you use.

    • @bhaveshverma8629
      @bhaveshverma8629 Před rokem +1

      By the way the video is very good. I forgot to appreciate.

  • @howqso2885
    @howqso2885 Před rokem

    Great stuff, but I see you are using fish. It's really a small detail, but is there any reason you didn't choose to make a function for t instead of a script ?

    • @JoshMedeski
      @JoshMedeski  Před rokem +1

      A bash script is easily transferable to other shell environments, I’ve already had some good contributions thanks to the format and people using zsh use the script as well.

  • @alexandredecobert8819

    Why your window look like that ?

    • @JoshMedeski
      @JoshMedeski  Před rokem

      I’m using Alacritty with the borderless configuration

  • @yvng4697
    @yvng4697 Před 8 měsíci

    How did u made your terminal like that?

    • @JoshMedeski
      @JoshMedeski  Před 8 měsíci +1

      I've got a free online guide for how to set up the terminal like mine, check it out!
      www.joshmedeski.com/guides/dev-workflow-intro

    • @yvng4697
      @yvng4697 Před 8 měsíci +1

      I will check it out, thank u so much!!@@JoshMedeski

  • @Yu-qv3qc
    @Yu-qv3qc Před rokem

    What is this file manager at 6:06?

    • @JoshMedeski
      @JoshMedeski  Před rokem +2

      It's called LF github.com/gokcehan/lf

    • @Yu-qv3qc
      @Yu-qv3qc Před rokem

      @@JoshMedeski thanks a lot

  • @nils.8335
    @nils.8335 Před rokem

    imma need that wallpaper

  • @augustepugnet5407
    @augustepugnet5407 Před 9 měsíci

    Do you have the source code ?

    • @JoshMedeski
      @JoshMedeski  Před 9 měsíci

      Yes, check the video description. It’s since been turned into an official tmux plugin with more features!

  • @eyal670
    @eyal670 Před rokem

    nice scripts,
    the scripts are no longer avaliable in your dotfiles repo,
    can you please share the new location in the video description?

    • @JoshMedeski
      @JoshMedeski  Před rokem

      I’ve turned it into an official tmux plugin! github.com/joshmedeski/t-smart-tmux-session-manager

  • @makkusu3866
    @makkusu3866 Před rokem

    Can't make it work on ubuntu

    • @JoshMedeski
      @JoshMedeski  Před rokem +1

      Bummer, can you be more specific? Is it my custom script? I'm happy to take a look at it.

    • @makkusu3866
      @makkusu3866 Před rokem +1

      @@JoshMedeski I'm sorry, seems that it started working after reloading my machine 😅
      great stuff btw

  • @awesomesauce1157
    @awesomesauce1157 Před 7 měsíci

    linux users try getting audio right: impossible difficulty

  • @megasuperlexa2
    @megasuperlexa2 Před rokem

    alacrity? but it cant ssh

    • @JoshMedeski
      @JoshMedeski  Před rokem +1

      What do you mean? This workflow isn’t related to ssh but the ssh command works fine in Alacritty when I need it

  • @TravisBHartwell
    @TravisBHartwell Před rokem +2

    Instead of using sed to get the name of the current directory, you can just use the basename command. For example (in Bash, but it is not a bash-builtin), if I'm in my home directory:
    > basename $PWD
    travisbhartwell

    • @TravisBHartwell
      @TravisBHartwell Před rokem +1

      I see that in your tt script you share later in the video you do use basename, so ignore me. :)

    • @JoshMedeski
      @JoshMedeski  Před rokem

      Thanks for the tip. I learned about basename after publishing the video 😄

    • @TravisBHartwell
      @TravisBHartwell Před rokem +1

      @@JoshMedeski No problem! I actually have a similar set up that I use that includes integration with Alfred, iTerm integration, and opening my session picker whenever a new terminal is opened that isn't already part of a session. I think I'll try to get my stuff cleaned up and at least blog about it.

    • @JoshMedeski
      @JoshMedeski  Před rokem

      @@TravisBHartwell awesome, feel free to share it!

  • @stefandriesner5026
    @stefandriesner5026 Před 8 měsíci +1

    Alternative alias for new session:
    tn='tmux new -s ${PWD##*/}'

  • @abdoulayebalde2139
    @abdoulayebalde2139 Před rokem

    Thanks for this amazing video. which theme of fish are you using?