An attempt to imitate vim marks in tmux.
Mark a pane with prefix + key
. This prefix
is different from your tmux prefix
and is used for marks only.
The default prefix
is ALT+m
Check configuration for how to customize the prefix
ALT+key navigates to the pane marked by key. In addition you can set a jump prefix
and navigate with prefix + key
Using Tmux Plugin Manager
Add the following to your list of TPM plugins in .tmux.conf
:
set -g @plugin 'jmsdrh/tmux-pane-marks'
Hit prefix + I to fetch and source the plugin. You should now be able to use the plugin!
Clone the repo:
➜ git clone https://github.com/jmsdrh/tmux-pane-marks ~/.tmux/plugins/tmux-pane-marks
Source it in your .tmux.conf
:
run-shell ~/.tmux/plugins/tmux-pane-marks/tmux-pane-marks.tmux
Reload TMUX conf by running:
➜ tmux source-file ~/.tmux.conf
NB: Any options below must be set before sourcing the plugin
As to not conflict with other key bindings in tmux or TUIs, the keys that can be used for marks must be specified.
Set the option @tmux_pane_marks_keys
to specify the keys.
Example:
Make asdfg available as keys to be used as marks.
set -g @tmux_pane_marks_keys 'asdfg'
A full config with TPM might look something like this:
#
# some other configurations
#
# make asdfgqwerty available as keys to be used for marks.
set -g @tmux_pane_marks_keys 'asdfgqwerty'
#
# some other configurations
#
# List of plugins for TMUX plugin manager
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'jmsdrh/tmux-pane-marks'
# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
run '~/.tmux/plugins/tpm/tpm'
A full config for a manual install might look something like this:
#
# some other configurations
#
# make asdfgqwerty available as keys to be used as marks.
set -g @tmux_pane_marks_keys 'asdfgqwerty'
#
# some other configurations
#
run-shell ~/.tmux/plugins/tmux-pane-marks/tmux-pane-marks.tmux
Set the option @tmux_pane_marks_prefix
. Default is ALT+m
Examples:
Make CTRL+h the prefix. CTRL-h + p
marks the current pane with p
set -g @tmux_pane_marks_prefix 'C-h'
Make ALT+s the prefix. ALT-s + p
marks the current pane with p
set -g @tmux_pane_marks_prefix 'M-s'
Set the option @tmux_pane_marks_jumps_mod
. Default is ALT
Example:
Make CTRL the modifier. CTRL + p
jumps to pane marked p
set -g @tmux_pane_marks_jumps_mod 'C'
Set the option @tmux_pane_marks_jumps_prefix
. No default set.
If this option is set then it is used to jump to marks instead of modifier key
It scopes all jumps to any prefix key combination chosen
Example:
Make ALT+n prefix for jumps. ALT-n + p
jumps to pane marked p
set -g @tmux_pane_marks_jumps_prefix 'M-n'
Set the option @tmux_pane_marks_alternate_mark_key
. No default set.
Example:
Make ; a mark for previously active marked pane.
set -g @tmux_pane_marks_alternate_mark_key '\;'