add zen-mode config for wezterm
This commit is contained in:
@@ -19,6 +19,10 @@ return {
|
|||||||
enabled = true,
|
enabled = true,
|
||||||
font = '16',
|
font = '16',
|
||||||
},
|
},
|
||||||
|
wezterm = {
|
||||||
|
enabled = true,
|
||||||
|
font = '+4',
|
||||||
|
},
|
||||||
kitty = {
|
kitty = {
|
||||||
-- INFO: not working in tmux sessions
|
-- INFO: not working in tmux sessions
|
||||||
-- unable to get $KITTY_LISTEN_ON to update on attach
|
-- unable to get $KITTY_LISTEN_ON to update on attach
|
||||||
@@ -27,4 +31,4 @@ return {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|||||||
+32
-8
@@ -11,15 +11,22 @@ set -g update-environment -r
|
|||||||
setenv -g KITTY_LISTEN_ON $KITTY_LISTEN_ON
|
setenv -g KITTY_LISTEN_ON $KITTY_LISTEN_ON
|
||||||
set -ag update-environment 'KITTY_LISTEN_ON'
|
set -ag update-environment 'KITTY_LISTEN_ON'
|
||||||
|
|
||||||
|
# needed for nvim zen-mode
|
||||||
|
set-option -g allow-passthrough on
|
||||||
|
|
||||||
set -g escape-time 0
|
set -g escape-time 0
|
||||||
set -g default-terminal "xterm-256color"
|
set -g default-terminal "xterm-256color"
|
||||||
set -ag terminal-overrides ",xterm-256color:Tc,xterm-kitty:Tc,alacritty:Tc"
|
set -ag terminal-overrides ",xterm-256color:Tc,xterm-kitty:Tc,alacritty:Tc"
|
||||||
set -g history-limit 150000
|
set -g history-limit 150000
|
||||||
set -g display-time 2500
|
set -g display-time 2500
|
||||||
set -g status-interval 5
|
set -g status-interval 10
|
||||||
set -g focus-events on
|
set -g focus-events on
|
||||||
set -g status-position top
|
set -g status-position top
|
||||||
|
|
||||||
|
# activity
|
||||||
|
set -g monitor-activity off
|
||||||
|
set -g visual-activity off
|
||||||
|
|
||||||
# Start indexes at 1 instead of 0
|
# Start indexes at 1 instead of 0
|
||||||
set -g base-index 1
|
set -g base-index 1
|
||||||
set -g pane-base-index 1
|
set -g pane-base-index 1
|
||||||
@@ -29,8 +36,8 @@ set -g renumber-windows on
|
|||||||
set -g set-titles on
|
set -g set-titles on
|
||||||
set -g set-titles-string "#I: #W"
|
set -g set-titles-string "#I: #W"
|
||||||
|
|
||||||
setw -g automatic-rename off
|
set -g automatic-rename on
|
||||||
set -g allow-rename off
|
set -g allow-rename on
|
||||||
|
|
||||||
# Change prefix from ctrl+b to ctrl+a
|
# Change prefix from ctrl+b to ctrl+a
|
||||||
set -g prefix C-a
|
set -g prefix C-a
|
||||||
@@ -52,12 +59,19 @@ bind-key -N "Reload tmux configuration" R source-file ~/.config/tmux/tmux.conf \
|
|||||||
# Toggle status bar
|
# Toggle status bar
|
||||||
bind-key -N "Toggle the status bar for current session" S set status
|
bind-key -N "Toggle the status bar for current session" S set status
|
||||||
|
|
||||||
|
# switch to last session
|
||||||
|
bind-key BTab switch-client -l
|
||||||
|
|
||||||
# Pane navigation
|
# Pane navigation
|
||||||
bind-key -N "Navigate one pane to the left" -n C-h select-pane -L
|
bind-key -N "Navigate one pane to the left" -n C-h select-pane -L
|
||||||
bind-key -N "Navigate one pane down" -n C-j select-pane -D
|
bind-key -N "Navigate one pane down" -n C-j select-pane -D
|
||||||
bind-key -N "Navigate one pane up" -n C-k select-pane -U
|
bind-key -N "Navigate one pane up" -n C-k select-pane -U
|
||||||
bind-key -N "Navigate one pane to the right" -n C-l select-pane -R
|
bind-key -N "Navigate one pane to the right" -n C-l select-pane -R
|
||||||
|
|
||||||
|
# swap panes
|
||||||
|
bind-key > swap-pane -D
|
||||||
|
bind-key < swap-pane -U
|
||||||
|
|
||||||
# Resize panes
|
# Resize panes
|
||||||
bind-key -N "Resize pane left" -r h resize-pane -L 5
|
bind-key -N "Resize pane left" -r h resize-pane -L 5
|
||||||
bind-key -N "Resize pane down" -r j resize-pane -D 5
|
bind-key -N "Resize pane down" -r j resize-pane -D 5
|
||||||
@@ -81,18 +95,28 @@ bind-key -N "Create a new window within CWD" c new-window -c "#{pane_current_pat
|
|||||||
bind-key -N "Move to previous window" -n C-p previous-window
|
bind-key -N "Move to previous window" -n C-p previous-window
|
||||||
bind-key -N "Move to next window" -n C-n next-window
|
bind-key -N "Move to next window" -n C-n next-window
|
||||||
|
|
||||||
|
# selection mode
|
||||||
|
set -g mouse on
|
||||||
setw -g mode-keys vi
|
setw -g mode-keys vi
|
||||||
setw -g status-keys vi
|
setw -g status-keys vi
|
||||||
|
|
||||||
unbind -T copy-mode-vi Space;
|
unbind -T copy-mode-vi Space;
|
||||||
unbind -T copy-mode-vi Enter;
|
unbind -T copy-mode-vi Enter;
|
||||||
|
|
||||||
bind-key -N "Begin selection" -T copy-mode-vi 'v' send -X begin-selection
|
|
||||||
bind-key -N "Copy selection to buffer" -T copy-mode-vi 'y' send -X copy-selection
|
|
||||||
|
|
||||||
set -g mouse on
|
|
||||||
unbind -T copy-mode-vi MouseDragEnd1Pane
|
unbind -T copy-mode-vi MouseDragEnd1Pane
|
||||||
|
|
||||||
|
bind-key -N "Enter copy mode" -T copy-mode-vi [ copy-mode
|
||||||
|
bind-key -N "Begin selection" -T copy-mode-vi v send -X begin-selection
|
||||||
|
bind-key -N "Copy selection to buffer" -T copy-mode-vi y send -X copy-selection
|
||||||
|
bind-key -N "Copy selection and paste" -T copy-mode-vi Y send -X copy-selection-and-cancel
|
||||||
|
bind-key -N "Select to start of line" -T copy-mode-vi _ send -X start-of-line
|
||||||
|
bind-key -N "Select to end of line" -T copy-mode-vi $ send -X end-of-line
|
||||||
|
bind-key -N "Cancel selection" -T copy-mode-vi Escape send -X cancel
|
||||||
|
|
||||||
|
# paste buffers
|
||||||
|
bind-key b list-buffers # list buffers
|
||||||
|
bind-key p paste-buffer -p # paste from buffer
|
||||||
|
bind-key P choose-buffer # choose a buffer to paste from
|
||||||
|
|
||||||
##########################
|
##########################
|
||||||
# Plugins
|
# Plugins
|
||||||
##########################
|
##########################
|
||||||
|
|||||||
@@ -7,6 +7,30 @@ wezterm.on("gui-startup", function()
|
|||||||
window:gui_window():maximize()
|
window:gui_window():maximize()
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
-- required to allow nvim zen-mode to change the font size
|
||||||
|
wezterm.on("user-var-changed", function(window, pane, name, value)
|
||||||
|
local overrides = window:get_config_overrides() or {}
|
||||||
|
if name == "ZEN_MODE" then
|
||||||
|
local incremental = value:find("+")
|
||||||
|
local number_value = tonumber(value)
|
||||||
|
if incremental ~= nil then
|
||||||
|
while number_value > 0 do
|
||||||
|
window:perform_action(wezterm.action.IncreaseFontSize, pane)
|
||||||
|
number_value = number_value - 1
|
||||||
|
end
|
||||||
|
overrides.enable_tab_bar = false
|
||||||
|
elseif number_value < 0 then
|
||||||
|
window:perform_action(wezterm.action.ResetFontSize, pane)
|
||||||
|
overrides.font_size = nil
|
||||||
|
overrides.enable_tab_bar = true
|
||||||
|
else
|
||||||
|
overrides.font_size = number_value
|
||||||
|
overrides.enable_tab_bar = false
|
||||||
|
end
|
||||||
|
end
|
||||||
|
window:set_config_overrides(overrides)
|
||||||
|
end)
|
||||||
|
|
||||||
config = {
|
config = {
|
||||||
window_close_confirmation = "NeverPrompt",
|
window_close_confirmation = "NeverPrompt",
|
||||||
term = "xterm-256color",
|
term = "xterm-256color",
|
||||||
|
|||||||
Reference in New Issue
Block a user