Skip to content

Conversation

@johnmarco123
Copy link

@johnmarco123 johnmarco123 commented Nov 3, 2024

Added the following flags:

tmux-sessionizer -add, -a
tmux-sessionizer -delete, -d
tmux-sessionizer -list -l

It also now has dynamic addition and removal of filepaths using stdin and ensures no duplicates are added. All of this is saved in the users HOME under tmux-sessionizer.txt, but this path can be changed.

@johnmarco123 johnmarco123 force-pushed the master branch 2 times, most recently from 454ab98 to dc632ff Compare November 7, 2024 02:00
@johnmarco123
Copy link
Author

Doing a big refactor, to make this easier to use and making it so you never have to enter a file to edit contents

@johnmarco123
Copy link
Author

Should be good for usage now, add directories to your list by using tmux-sessionizer -a PATH_GOES_HERE.

You can also add the word "all" afterwards like so:

tmux-sessionizer -a PATH_GOES_HERE all

which would be equivelant to original tmux-sessionizer "find PATH -type d -maxdepth 1".

By default it only adds the exact directory you provide it unless provided the extra "all" option after your directory. It also supports relative paths such as '~', '.', and absolute paths '/'. It will automatically expand them and save them to your list

@johnmarco123
Copy link
Author

The filepaths are stored in two separate files, basic paths are stored in .tmux-sessionizer.txt, and the "all" paths are stored in .tmux-sessionizer_wild.txt. I removed its capability to accept standard in for now as it would of been a pain to re-create after the refactor.

…one from regular add and one from the "all" option add) that you only see one when picking a path
@johnmarco123
Copy link
Author

You can add the following in ur tmux config to quickly add, delete, and manage your tmux-sessionizer list files:
bind f run-shell "tmux neww tmux-sessionizer"
bind d send-keys C-u 'tmux-sessionizer -d' C-m
bind a send-keys C-u 'tmux-sessionizer -a .' C-m
bind A send-keys C-u 'tmux-sessionizer -a . all' C-m

@johnmarco123 johnmarco123 changed the title Added dynamic addition and removal of filepaths Added dynamic addition and removal of filepaths using FZF Nov 10, 2024
@johnmarco123 johnmarco123 changed the title Added dynamic addition and removal of filepaths using FZF Feature: Added dynamic addition and removal of filepaths using FZF Nov 14, 2024
tmux-sessionizer Outdated
@@ -1,4 +1,53 @@
#!/usr/bin/env bash
#/usr/bin/env bash

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

correct shebang else this will not run.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

added missing shebang
@johnmarco123
Copy link
Author

My current tmux conf:

bind f run-shell "tmux neww tmux-sessionizer"
bind d send-keys C-u 'tmux-sessionizer -d' C-m
bind a send-keys C-u 'tmux-sessionizer -a .' C-m
bind A send-keys C-u 'tmux-sessionizer -a . all' C-m
bind h send-keys C-u "cd $(tmux display-message -p '#{pane_start_path}')" C-m

The last command when run will take you to where you originally opened your tmux session, so if you deviate from your home path, you can simply return there

@johnmarco123
Copy link
Author

Correction, don't use bind h as that moves panes in a vim style, rebind it to b or something
bind f run-shell "tmux neww tmux-sessionizer"
bind d send-keys C-u 'tmux-sessionizer -d' C-m
bind a send-keys C-u 'tmux-sessionizer -a .' C-m
bind A send-keys C-u 'tmux-sessionizer -a . all' C-m
bind b send-keys C-u "cd $(tmux display-message -p '#{pane_start_path}')" C-m

@johnmarco123
Copy link
Author

@ThePrimeagen Kindly pinging to merge mr prime

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants