From 1413d4e69f33395f932c4bc4d12c5655829677d3 Mon Sep 17 00:00:00 2001 From: Aleksander Cynarski Date: Sat, 5 Apr 2025 18:12:41 +0200 Subject: [PATCH] feat: WezTerm init --- .config/wezterm/modules/mappings.lua | 76 ++++++++++++++++++++++++++++ .config/wezterm/wezterm.lua | 47 +++++++++++++++++ .gitconfig | 30 +++++++++++ README.md | 3 ++ tools/Nabu | 1 + 5 files changed, 157 insertions(+) create mode 100644 .config/wezterm/modules/mappings.lua create mode 100644 .config/wezterm/wezterm.lua create mode 100644 .gitconfig create mode 160000 tools/Nabu diff --git a/.config/wezterm/modules/mappings.lua b/.config/wezterm/modules/mappings.lua new file mode 100644 index 0000000..84fc60f --- /dev/null +++ b/.config/wezterm/modules/mappings.lua @@ -0,0 +1,76 @@ +local wezterm = require("wezterm") +local act = wezterm.action + +return { + leader = { key = "a", mods = "CTRL", timeout_milliseconds = 1002 }, + + keys = { + { + key = "w", + mods = "CMD", + action = act.CloseCurrentPane({ confirm = true }), + }, + + -- activate resize mode + { + key = "r", + mods = "LEADER", + action = act.ActivateKeyTable({ + name = "resize_pane", + one_shot = false, + }), + }, + + -- focus panes + { + key = "k", + mods = "LEADER", + action = act.ActivatePaneDirection("Left"), + }, + { + key = "i", + mods = "LEADER", + action = act.ActivatePaneDirection("Right"), + }, + { + key = "e", + mods = "LEADER", + action = act.ActivatePaneDirection("Up"), + }, + { + key = "n", + mods = "LEADER", + action = act.ActivatePaneDirection("Down"), + }, + + -- add new panes + { + key = "v", + mods = "LEADER", + action = act.SplitVertical({ domain = "CurrentPaneDomain" }), + }, + { + key = "h", + mods = "LEADER", + action = act.SplitHorizontal({ domain = "CurrentPaneDomain" }), + }, + }, + + key_tables = { + resize_pane = { + { key = "LeftArrow", action = act.AdjustPaneSize({ "Left", 5 }) }, + { key = "k", action = act.AdjustPaneSize({ "Left", 5 }) }, + + { key = "RightArrow", action = act.AdjustPaneSize({ "Right", 5 }) }, + { key = "i", action = act.AdjustPaneSize({ "Right", 5 }) }, + + { key = "UpArrow", action = act.AdjustPaneSize({ "Up", 2 }) }, + { key = "e", action = act.AdjustPaneSize({ "Up", 3 }) }, + + { key = "DownArrow", action = act.AdjustPaneSize({ "Down", 2 }) }, + { key = "n", action = act.AdjustPaneSize({ "Down", 2 }) }, + + { key = "Escape", action = "PopKeyTable" }, + }, + }, +} diff --git a/.config/wezterm/wezterm.lua b/.config/wezterm/wezterm.lua new file mode 100644 index 0000000..ececda5 --- /dev/null +++ b/.config/wezterm/wezterm.lua @@ -0,0 +1,47 @@ +local wezterm = require("wezterm") +local mappings = require("modules.mappings") + +-- Show which key table is active in the status area +wezterm.on("update-right-status", function(window, pane) + local name = window:active_key_table() + if name then + name = "TABLE: " .. name + end + window:set_right_status(name or "") +end) + +return { + default_cursor_style = "BlinkingBlock", + color_scheme = "Poimandres", + colors = { + cursor_bg = "#A6ACCD", + cursor_border = "#A6ACCD", + cursor_fg = "#1B1E28", + }, + -- font + font = wezterm.font("JetBrains Mono", { weight = "Medium" }), + font_size = 10, + line_height = 1.0, + window_background_opacity = 0.8, + -- tab bar + use_fancy_tab_bar = true, + tab_bar_at_bottom = false, + hide_tab_bar_if_only_one_tab = true, + tab_max_width = 999999, + window_padding = { + left = 7, + right = 7, + top = 7, + bottom = 7, + }, + window_decorations = "RESIZE", + inactive_pane_hsb = { + brightness = 0.7, + }, + send_composed_key_when_left_alt_is_pressed = false, + send_composed_key_when_right_alt_is_pressed = true, + -- key bindings + leader = mappings.leader, + keys = mappings.keys, + key_tables = mappings.key_tables, +} diff --git a/.gitconfig b/.gitconfig new file mode 100644 index 0000000..4007476 --- /dev/null +++ b/.gitconfig @@ -0,0 +1,30 @@ +# This is Git's per-user configuration file. +[user] +# Please adapt and uncomment the following lines: + name = Aleksander Cynarski + email = aleksander@cynarski.pl + +[interactive] + diffFilter = delta --color-only + +[pager] + diff = delta + log = delta + reflog = delta + show = delta + +# Delta settings +# [delta] +# features = side-by-side line-numbers decorations +# syntax-theme = Dracula +# plus-style = syntax "#003800" +# minus-style = syntax "#3f0001" + +[delta] + plus-style = "syntax #012800" + minus-style = "syntax #340001" + syntax-theme = Monokai Extended + navigate = true + side-by-side = true + + diff --git a/README.md b/README.md index e69de29..040caee 100644 --- a/README.md +++ b/README.md @@ -0,0 +1,3 @@ +# [![dotfiles](https://skillicons.dev/icons?i=apple,arch,plan9)](https://skillicons.dev) dotfiles + + diff --git a/tools/Nabu b/tools/Nabu new file mode 160000 index 0000000..f4ed446 --- /dev/null +++ b/tools/Nabu @@ -0,0 +1 @@ +Subproject commit f4ed4460aa7cb2f9247c34265b91c5c6ac081bc2