Skip to content

Commit

Permalink
Better resize keybinds tmux panes
Browse files Browse the repository at this point in the history
  • Loading branch information
alex-bue committed Dec 1, 2024
1 parent f9a3df7 commit 85b946b
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 28 deletions.
7 changes: 7 additions & 0 deletions home/dot_config/tmux/tmux.conf
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,12 @@ set-option -g renumber-windows on
bind | split-window -h -c "#{pane_current_path}"
bind - split-window -v -c "#{pane_current_path}"

# Better resizing
bind-key -n C-M-j resize-pane -D 5
bind-key -n C-M-k resize-pane -U 5
bind-key -n C-M-h resize-pane -L 5
bind-key -n C-M-l resize-pane -R 5

# Clear with Ctrl-l
bind C-l send-keys 'C-l'

Expand All @@ -34,6 +40,7 @@ set -g @plugin 'tmux-plugins/tmux-sensible'
set -g @plugin 'christoomey/vim-tmux-navigator'
set -g @plugin 'dreamsofcode-io/catppuccin-tmux'
set -g @plugin 'tmux-plugins/tmux-yank'
set -g @plugin 'sainnhe/tmux-fzf'
set -g @plugin 'tmux-plugins/tpm'

# Plugins options
Expand Down
55 changes: 27 additions & 28 deletions home/dot_config/wezterm/keybinds.lua
Original file line number Diff line number Diff line change
@@ -1,36 +1,35 @@
local wezterm = require 'wezterm'
local wezterm = require("wezterm")
local act = wezterm.action

local module = {}

function module.apply_to_config(config)
config.keys = {

-- Move scrollback
{ key = 'K', mods = 'CTRL|SHIFT', action = act.ScrollByLine(-1) },
{ key = 'J', mods = 'CTRL|SHIFT', action = act.ScrollByLine(1) },
{ key = 'U', mods = 'CTRL|SHIFT', action = act.ScrollByPage(-1) },
{ key = 'D', mods = 'CTRL|SHIFT', action = act.ScrollByPage(1) },

-- Pane:
-- Rotate panes
{ key = 'J', mods = 'CTRL|SHIFT|SUPER', action = act.RotatePanes 'Clockwise' },
{ key = 'K', mods = 'CTRL|SHIFT|SUPER', action = act.RotatePanes 'CounterClockwise' },

-- Resize panes
{ key = 'H', mods = 'CTRL|SHIFT|ALT|SUPER', action = act.AdjustPaneSize{ 'Left', 1 } },
{ key = 'L', mods = 'CTRL|SHIFT|ALT|SUPER', action = act.AdjustPaneSize{ 'Right', 1 } },
{ key = 'K', mods = 'CTRL|SHIFT|ALT|SUPER', action = act.AdjustPaneSize{ 'Up', 1 } },
{ key = 'J', mods = 'CTRL|SHIFT|ALT|SUPER', action = act.AdjustPaneSize{ 'Down', 1 } },

-- New panes
{ key = 'Enter', mods = 'CTRL|SHIFT', action = wezterm.action.SplitVertical { domain = 'CurrentPaneDomain' }, },
{ key = 'Enter', mods = 'CTRL|SHIFT|SUPER', action = wezterm.action.SplitHorizontal { domain = 'CurrentPaneDomain' }, },

-- Close pane
{ key = 'w', mods = 'CTRL|SHIFT', action = wezterm.action.CloseCurrentPane { confirm = true } },

}
config.keys = {
-- -- Move scrollback
-- { key = 'K', mods = 'CTRL|SHIFT', action = act.ScrollByLine(-1) },
-- { key = 'J', mods = 'CTRL|SHIFT', action = act.ScrollByLine(1) },
-- { key = 'U', mods = 'CTRL|SHIFT', action = act.ScrollByPage(-1) },
-- { key = 'D', mods = 'CTRL|SHIFT', action = act.ScrollByPage(1) },
--
-- -- Pane:
-- -- Rotate panes
-- { key = 'J', mods = 'CTRL|SHIFT|SUPER', action = act.RotatePanes 'Clockwise' },
-- { key = 'K', mods = 'CTRL|SHIFT|SUPER', action = act.RotatePanes 'CounterClockwise' },
--
-- -- Resize panes
-- { key = 'H', mods = 'CTRL|SHIFT|ALT|SUPER', action = act.AdjustPaneSize{ 'Left', 1 } },
-- { key = 'L', mods = 'CTRL|SHIFT|ALT|SUPER', action = act.AdjustPaneSize{ 'Right', 1 } },
-- { key = 'K', mods = 'CTRL|SHIFT|ALT|SUPER', action = act.AdjustPaneSize{ 'Up', 1 } },
-- { key = 'J', mods = 'CTRL|SHIFT|ALT|SUPER', action = act.AdjustPaneSize{ 'Down', 1 } },
--
-- -- New panes
-- { key = 'Enter', mods = 'CTRL|SHIFT', action = wezterm.action.SplitVertical { domain = 'CurrentPaneDomain' }, },
-- { key = 'Enter', mods = 'CTRL|SHIFT|SUPER', action = wezterm.action.SplitHorizontal { domain = 'CurrentPaneDomain' }, },
--
-- -- Close pane
-- { key = 'w', mods = 'CTRL|SHIFT', action = wezterm.action.CloseCurrentPane { confirm = true } },
--
}
end

return module

0 comments on commit 85b946b

Please sign in to comment.