diff --git a/.config/fontconfig/fonts.conf.cgt b/.config/fontconfig/fonts.conf.cgt new file mode 100644 index 0000000..fb150a2 --- /dev/null +++ b/.config/fontconfig/fonts.conf.cgt @@ -0,0 +1,22 @@ + +<% "<" .. [[!DOCTYPE fontconfig SYSTEM "urn:fontconfig:fonts.dtd">]] %> + + + sans-serif + + <% opt.font %> + + + + serif + + <% opt.font %> + + + + monospace + + <% opt.term_font %> + + + diff --git a/.config/wezterm/wezterm.lua.cgt b/.config/wezterm/wezterm.lua.cgt index 8264e07..077bbbb 100644 --- a/.config/wezterm/wezterm.lua.cgt +++ b/.config/wezterm/wezterm.lua.cgt @@ -1,5 +1,86 @@ local wt = require "wezterm" +local keys = { + -- splitting + { + key = "h", + mods = "LEADER", + action = wt.action.SplitVertical {}, + }, + { + key = "v", + mods = "LEADER", + action = wt.action.SplitHorizontal {}, + }, + + -- tabs + { + key = "t", + mods = "CTRL|SHIFT", + action = wt.action.SpawnTab "CurrentPaneDomain", + }, + { + key = "t", + mods = "CTRL", + action = wt.action.ActivateTabRelative(1), + }, + + -- font size + { + key = "+", + mods = "CTRL", + action = wt.action.IncreaseFontSize, + }, + { + key = "-", + mods = "CTRL", + action = wt.action.DecreaseFontSize, + }, + + -- moving panes + { + key = "r", + mods = "LEADER", + action = wt.action.RotatePanes "Clockwise", + }, + { + key = "m", + mods = "LEADER", + action = wt.action.PaneSelect { + mode = "SwapWithActive", + }, + }, +} + +local directions = { + { "h", "Left" }, + { "j", "Down" }, + { "k", "Up" }, + { "l", "Right" }, +} + +for _, dir in pairs(directions) do + local dir_key = dir[1] + local dir_name = dir[2] + + -- switching panes + table.insert(keys, { + key = dir_key, + mods = "ALT", + action = wt.action.ActivatePaneDirection(dir_name), + }) + + -- resize double in horizontal directions so the absolute amounts are constant + local resize_amount = (dir_name == "Up" or dir_name == "Down") and 2 or 4 + + -- resizing panes + table.insert(keys, { + key = dir_key, + mods = "ALT|SHIFT", + action = wt.action.AdjustPaneSize { dir_name, resize_amount }, + }) +end + return { color_scheme = "Dracula (Official)", font = wt.font "<% opt.term_font %>", @@ -7,63 +88,5 @@ return { disable_default_key_bindings = true, leader = { key = "a", mods = "CTRL", timeout_milliseconds = 2000 }, - keys = { - -- splitting - { - key = "h", - mods = "LEADER", - action = wt.action.SplitVertical {}, - }, - { - key = "v", - mods = "LEADER", - action = wt.action.SplitHorizontal {}, - }, - - -- switching panes - { - key = "h", - mods = "ALT", - action = wt.action.ActivatePaneDirection "Left", - }, - { - key = "j", - mods = "ALT", - action = wt.action.ActivatePaneDirection "Down", - }, - { - key = "k", - mods = "ALT", - action = wt.action.ActivatePaneDirection "Up", - }, - { - key = "l", - mods = "ALT", - action = wt.action.ActivatePaneDirection "Right", - }, - - -- tabs - { - key = "t", - mods = "CTRL|SHIFT", - action = wt.action.SpawnTab "CurrentPaneDomain", - }, - { - key = "t", - mods = "CTRL", - action = wt.action.ActivateTabRelative(1), - }, - - -- font size - { - key = "+", - mods = "CTRL", - action = wt.action.IncreaseFontSize, - }, - { - key = "-", - mods = "CTRL", - action = wt.action.DecreaseFontSize, - }, - }, + keys = keys, } diff --git a/confgen.lua b/confgen.lua index 2e832b1..9fea300 100644 --- a/confgen.lua +++ b/confgen.lua @@ -28,3 +28,8 @@ cg.opt.system = function(cmd) end return handle:read("*a"):gsub("%s+", "") end + +-- Compile the input as lua. Meant to be used as a post-processor. +cg.opt.luaCompile = function(lua) + return string.dump(loadstring(lua), true) +end diff --git a/mzte-nv/conf/queries/java/highlights.scm b/mzte-nv/conf/queries/java/highlights.scm index 3e519c0..83b7195 100644 --- a/mzte-nv/conf/queries/java/highlights.scm +++ b/mzte-nv/conf/queries/java/highlights.scm @@ -2,7 +2,7 @@ ;; Keywords (("abstract" @keyword) (#set! conceal "")) -(("class" @keyword) (#set! conceal "📦")) +(("class" @keyword) (#set! conceal "")) (("enum" @keyword) (#set! conceal "")) (("extends" @keyword) (#set! conceal "")) (("final" @keyword) (#set! conceal "")) @@ -11,7 +11,7 @@ (("if" @keyword) (#set! conceal "")) (("implements" @keyword) (#set! conceal "")) (("import" @keyword) (#set! conceal "")) -(("package" @keyword) (#set! conceal "")) +(("package" @keyword) (#set! conceal "📦")) (("public" @keyword) (#set! conceal "")) (("return" @keyword) (#set! conceal "")) (("static" @keyword) (#set! conceal ""))