tmux-sessionx
tmux-sessionx copied to clipboard
Added an option to ignore prefix
This pull request adds an option @sessionx-prefix (on by default) which when set to off, will ignore tmux's prefix key when binding a key to launch sessionx popup. The following configuration maps Ctrl+s to launch sessionx popup.
set -g @sessionx-bind 'C-s'
set -g @sessionx-prefix off
@alihmm @alihammad-gist Cool! Can you add this to the readme please and I'll merge? Thanks!
@omerxx Added a little description for the option @session-prefix in read me.
Thanks! Lots of markdown auto fixed it seems like title line breaks and cleaning empty spaces. Are you using a plugin / LSP of some sort for that?
Yes, using prettier as a vim filter for formatting. These formatters use some sort of standard formatting so you don't have to memorize what goes where. Prettier is pretty handy cuz it supports a lot of filetypes including markdown. It's available on npm. Btw great plugin, especially the revised design is a lot better.
@alihammad-gist Gotcha. Care to fix the conflicts so I could merge?
I was looking at this PR and I liked the idea but I saw that it wasn't merged due to the conflicts, is there a plan to fix this? If necessary, I can open a new pr implementing this
@the-spanish-guy all done. @alihammad-gist thank you! I'd be happy if you can review the changes (although merged) just to see I didn't miss anything when fixing the additional conflicts.
I reviewed the changes on my machine. Here are my findings. When @session-prefix setting is not set or it is set to 'on' (lowercase) only, the tmux prefix key must be pressed before @sessionx-bind key to trigger sessionx. For all other values of @session-prefix the prefix is not needed. Should this be the other way around? Only ignore tmux prefix when @session-prefix is set to off for all other values it should be required?
You haven't missed anything, I added a few lines of code and a paragraph of documentation which is included in the commit. I have a few suggestions. Wouldn't it be more appropriate to have configuration values in the documentation be set to the 'default' values? For example (below) @sessionx-filter-current should be set to true in the documentation.
# By default, the current session will not be shown on first view
# This is to support quick switch of sessions
# Only after other actions (e.g. rename) will the current session appear
# Setting this option to 'false' changes this default behavior
set -g @sessionx-filter-current 'false'
@omerxx I can submit PRs for these changes if you want.