mirror of
https://github.com/jabirali/tmux-tilish.git
synced 2026-09-10 07:06:18 -04:00
clean: minor revisions
This commit is contained in:
parent
8ee11d6913
commit
68e17cd66a
20
README.md
20
README.md
|
|
@ -306,16 +306,15 @@ Alternatively, `tilish` also supports a [Prefix mode](#prefix-mode). This is in
|
|||
less ergonomic than the default `tilish` keybindings. However, it does not require the use
|
||||
of <kbd>Alt</kbd>, and is therefore compatible with the default `i3wm` keybindings.
|
||||
|
||||
## Integration with vim
|
||||
## Integration with vim/neovim
|
||||
|
||||
There are multiple great plugins, [tmux-navigate][10], [vim-tmux-navigator][3],
|
||||
[smart-splits.nvim][11], which both allow seamless navigation between `vim`
|
||||
splits and `tmux` splits.
|
||||
[tmux-navigate][10] has an advantage that it also works over `ssh` connections,
|
||||
and that it plays better with zooming (<kbd>Alt</kbd>+<kbd>z</kbd>). If you
|
||||
use either plugin, you can tell `tilish` to make it setup the keybindings for
|
||||
you. (If you don't, `tilish` will use fallback keybindings that don't integrate
|
||||
with `vim`.)
|
||||
There are multiple great plugins [tmux-navigate][10], [vim-tmux-navigator][3],
|
||||
[smart-splits.nvim][11], which all allow seamless navigation between `vim`
|
||||
splits and `tmux` splits. [tmux-navigate][10] has an advantage that it also
|
||||
works over `ssh` connections, and that it plays better with zooming
|
||||
(<kbd>Alt</kbd>+<kbd>z</kbd>). If you use these plugins, you can tell `tilish`
|
||||
to make it setup the keybindings for you as described below. (If you don't,
|
||||
`tilish` will use fallback keybindings that don't integrate with `vim`.)
|
||||
|
||||
### Navigate
|
||||
|
||||
|
|
@ -381,8 +380,7 @@ A minimal working example of a `~/.tmux.conf` with `tpm` would then be:
|
|||
|
||||
Integration with [smart-splits][11] is achieved through setting the
|
||||
`@tilish-smartsplits` option to `on`. This automatically configures the
|
||||
keybindings so that <kbd>M</kbd>-<kbd>hjkl</kbd> permit navigating around
|
||||
panes.
|
||||
keybindings so that <kbd>M</kbd>-<kbd>hjkl</kbd> permit navigating around panes.
|
||||
|
||||
Prior to that, it requires installing the `smart-splits.nvim` plugin and
|
||||
configuring the following keybindings in e.g. `~/.config/nvim/init.vim`:
|
||||
|
|
|
|||
15
tilish.tmux
15
tilish.tmux
|
|
@ -177,12 +177,10 @@
|
|||
tmux $bind "${mod}${O}" swap-pane -D
|
||||
|
||||
# Switch to pane via Alt + hjkl.
|
||||
if [ "${smartsplits:-}" != "on" ]; then
|
||||
tmux $bind "${mod}${h}" select-pane -L
|
||||
tmux $bind "${mod}${j}" select-pane -D
|
||||
tmux $bind "${mod}${k}" select-pane -U
|
||||
tmux $bind "${mod}${l}" select-pane -R
|
||||
fi
|
||||
tmux $bind "${mod}${h}" select-pane -L
|
||||
tmux $bind "${mod}${j}" select-pane -D
|
||||
tmux $bind "${mod}${k}" select-pane -U
|
||||
tmux $bind "${mod}${l}" select-pane -R
|
||||
|
||||
# Move a pane via Alt + Shift + hjkl.
|
||||
if [ -z "$legacy" ]; then
|
||||
|
|
@ -282,14 +280,13 @@
|
|||
fi
|
||||
elif [ "${smartsplits:-}" = "on" ]; then
|
||||
# If `@tilish-smartsplits` is nonzero, integrate Alt + hjkl with `smart-splits.nvim`.
|
||||
# This assumes that your Vim/Neovim is setup to use Alt + hjkl bindings as well.
|
||||
|
||||
# This assumes that your Vim/Neovim is setup to use Alt + hjkl bindings as well.
|
||||
tmux $bind "${mod}${h}" if -F "#{@pane-is-vim}" 'send M-h' 'select-pane -L'
|
||||
tmux $bind "${mod}${j}" if -F "#{@pane-is-vim}" 'send M-j' 'select-pane -D'
|
||||
tmux $bind "${mod}${k}" if -F "#{@pane-is-vim}" 'send M-k' 'select-pane -U'
|
||||
tmux $bind "${mod}${l}" if -F "#{@pane-is-vim}" 'send M-l' 'select-pane -R'
|
||||
|
||||
# Smart pane resizing with awareness of Neovim splits. tmux escape then C-hjkl to resize
|
||||
# Smart pane resizing with awareness of Neovim splits. tmux escape then C-hjkl to resize.
|
||||
tmux bind -r C-h if -F "#{@pane-is-vim}" 'send-keys C-h' 'resize-pane -L 7'
|
||||
tmux bind -r C-j if -F "#{@pane-is-vim}" 'send-keys C-j' 'resize-pane -D 7'
|
||||
tmux bind -r C-k if -F "#{@pane-is-vim}" 'send-keys C-k' 'resize-pane -U 7'
|
||||
|
|
|
|||
Loading…
Reference in a new issue