Sway & Tmux & Nvim : Use WASD to swap and hjkl to resize.

This commit is contained in:
Dmitry Voronin 2024-04-01 06:18:07 +03:00
parent 3ea461f5e3
commit 1e15f33be7
6 changed files with 24 additions and 36 deletions

View file

@ -17,7 +17,13 @@ rekey_normal("<Leader>=", "<C-w>=") -- Equalize split sizes.
rekey_normal("<Leader>c", "<C-w>q") -- Close split. rekey_normal("<Leader>c", "<C-w>q") -- Close split.
-- Resize splits. -- Resize splits.
rekey_normal("<Leader>A", "4<C-w><") rekey_normal("<Leader>h", "4<C-w><")
rekey_normal("<Leader>D", "4<C-w>>") rekey_normal("<Leader>l", "4<C-w>>")
rekey_normal("<Leader>S", "2<C-w>+") rekey_normal("<Leader>j", "2<C-w>+")
rekey_normal("<Leader>W", "2<C-w>-") rekey_normal("<Leader>k", "2<C-w>-")
-- Move splits.
rekey_normal("<Leader>A", "<C-w>A")
rekey_normal("<Leader>D", "<C-w>D")
rekey_normal("<Leader>S", "<C-w>S")
rekey_normal("<Leader>W", "<C-w>W")

View file

@ -31,10 +31,12 @@ set -g pane-active-border-style "fg=#504945"
bind -n M-\\ split-window -h -c "#{pane_current_path}" bind -n M-\\ split-window -h -c "#{pane_current_path}"
bind -n M-- split-window -v -c "#{pane_current_path}" bind -n M-- split-window -v -c "#{pane_current_path}"
bind -n M-= select-layout tiled bind -n M-= select-layout tiled
bind -n M-W resize-pane -U 1 bind -n M-k resize-pane -U 1
bind -n M-S resize-pane -D 1 bind -n M-j resize-pane -D 1
bind -n M-A resize-pane -L 1 bind -n M-h resize-pane -L 1
bind -n M-D resize-pane -R 1 bind -n M-l resize-pane -R 1
bind -n M-A swap-pane -U
bind -n M-D swap-pane -D
unbind '"' unbind '"'
unbind % unbind %

View file

@ -14,9 +14,6 @@ bindsym $mod+space exec $menu
# mouse button for dragging. # mouse button for dragging.
floating_modifier $mod normal floating_modifier $mod normal
# Reload the configuration file.
bindsym $mod+Shift+c reload
# Exit sway (logs you out of your Wayland session). # Exit sway (logs you out of your Wayland session).
bindsym $mod+z exec '_twice 1 swaylock -F -c 000000 -k --font "SF Pro Display Medium" --font-size 14' bindsym $mod+z exec '_twice 1 swaylock -F -c 000000 -k --font "SF Pro Display Medium" --font-size 14'
bindsym $mod+Shift+z exec '_twice 1 swaymsg exit' bindsym $mod+Shift+z exec '_twice 1 swaymsg exit'

View file

@ -1,21 +1,4 @@
mode "resize" { bindsym $mod+j resize grow height 10px
# Left will shrink the containers width. bindsym $mod+h resize shrink width 10px
# Right will grow the containers width. bindsym $mod+l resize grow width 10px
# Up will shrink the containers height. bindsym $mod+k resize shrink height 10px
# Down will grow the containers height.
bindsym $down resize grow height 10px
bindsym $left resize shrink width 10px
bindsym $right resize grow width 10px
bindsym $up resize shrink height 10px
bindsym Down resize grow height 10px
bindsym Left resize shrink width 10px
bindsym Right resize grow width 10px
bindsym Up resize shrink height 10px
# Return to default mode
bindsym Escape mode "default"
bindsym Return mode "default"
}
bindsym $mod+r mode "resize"

View file

@ -3,11 +3,11 @@
# NOTE: Get id with `swaymsg -t get_tree`. # NOTE: Get id with `swaymsg -t get_tree`.
# Move the currently focused window to the scratchpad # Move the currently focused window to the scratchpad
bindsym $mod+shift+return move scratchpad bindsym $mod+shift+c move scratchpad
# Show the next scratchpad window or hide the focused scratchpad window. # Show the next scratchpad window or hide the focused scratchpad window.
# If there are multiple scratchpad windows, this command cycles through them. # If there are multiple scratchpad windows, this command cycles through them.
bindsym $mod+return scratchpad show bindsym $mod+c scratchpad show
# Fix for a goddamn Firefox WebRTC indicator. # Fix for a goddamn Firefox WebRTC indicator.
for_window [app_id="firefox" title="Firefox — Sharing Indicator"] { for_window [app_id="firefox" title="Firefox — Sharing Indicator"] {

View file

@ -1,5 +1,5 @@
# Toggle tiling. # Toggle tiling.
bindsym $mod+Tab floating toggle bindsym $mod+return floating toggle
# Swap focus between the tiling area and the floating area # Swap focus between the tiling area and the floating area
# bindsym $mod+space focus mode_toggle # bindsym $mod+space focus mode_toggle
@ -12,7 +12,7 @@ bindsym $mod+backslash splith
bindsym $mod+minus splitv bindsym $mod+minus splitv
# Switch the current container between different layout styles. # Switch the current container between different layout styles.
bindsym $mod+c layout toggle split tabbed bindsym $mod+Tab layout toggle split tabbed
# Fullscreen. # Fullscreen.
bindsym $mod+f fullscreen bindsym $mod+f fullscreen