Compare commits

..

No commits in common. "100eedc8cd937444403f6704a11e568917421e21" and "7128cd8d0dcb7ceb7e99e8058ed81f75048bb39a" have entirely different histories.

View File

@ -102,183 +102,135 @@
}; };
}; };
extraConfig = '' extraConfig = ''
local wezterm = require("wezterm") return {
local config = wezterm.config_builder() color_scheme = "myTheme",
config.check_for_updates = false
config.color_scheme = "myTheme"
-- Scrollback -- Scrollback
config.scrollback_lines = 10000 scrollback_lines = 10000,
-- Window -- Window
config.window_padding = { window_padding = {
left = 10, left = 10,
right = 10, right = 10,
top = 10, top = 10,
bottom = 10, bottom = 10,
}
config.font = wezterm.font('${font}', { weight = 'Bold'})
config.font_size = ${if pkgs.stdenv.isLinux then "14.0" else "18.0"}
-- Fix color blocks instead of text
config.front_end = "WebGpu"
-- Tab Bar
config.hide_tab_bar_if_only_one_tab = true
config.window_frame = {
font = wezterm.font('${font}', { weight = 'Bold'}),
font_size = ${if pkgs.stdenv.isLinux then "12.0" else "16.0"},
}
config.colors = {
tab_bar = {
active_tab = {
bg_color = '${config.theme.colors.base00}',
fg_color = '${config.theme.colors.base04}',
}, },
},
}
-- Disable audio font = wezterm.font('${font}', { weight = 'Bold'}),
config.audible_bell = "Disabled" font_size = ${if pkgs.stdenv.isLinux then "14.0" else "18.0"},
config.initial_rows = 80 -- Fix color blocks instead of text
config.initial_cols = 200 front_end = "WebGpu",
config.unix_domains = { -- Tab Bar
{ hide_tab_bar_if_only_one_tab = true,
name = 'unix', window_frame = {
}, font = wezterm.font('${font}', { weight = 'Bold'}),
} font_size = ${if pkgs.stdenv.isLinux then "12.0" else "16.0"},
-- This causes `wezterm` to act as though it was started as
-- `wezterm connect unix` by default, connecting to the unix
-- domain on startup.
-- If you prefer to connect manually, leave out this line.
config.default_gui_startup_args = { 'connect', 'unix' }
config.leader = {
key = 'a',
mods = 'CTRL',
timeout_milliseconds = 2000,
}
config.keys = {
-- Attach to muxer
{
key = 'a',
mods = 'LEADER',
action = wezterm.action.AttachDomain 'unix',
},
-- Detach from muxer
{
key = 'd',
mods = 'LEADER',
action = wezterm.action.DetachDomain { DomainName = 'unix' },
},
-- sends completion string for fish autosuggestions
{
key = 'Enter',
mods = 'SHIFT',
action = wezterm.action.SendString '\x1F'
},
-- ctrl-shift-h was "hide"
{
key = 'H',
mods = 'SHIFT|CTRL',
action = wezterm.action.DisableDefaultAssignment
},
-- alt-enter was "fullscreen"
{
key = 'Enter',
mods = 'ALT',
action = wezterm.action.DisableDefaultAssignment
},
-- make super-f "fullscreen"
{
key = 'f',
mods = 'SUPER',
action = wezterm.action.ToggleFullScreen
},
-- super-t open new tab in new dir
{
key = 't',
mods = ${if pkgs.stdenv.isDarwin then "'SUPER'" else "'ALT'"},
action = wezterm.action.SpawnCommandInNewTab {
cwd = wezterm.home_dir,
}, },
},
-- shift-super-t open new tab in same dir
{
key = 't',
mods = 'SUPER|SHIFT',
action = wezterm.action.SpawnTab 'CurrentPaneDomain'
},
-- project switcher
{
key = 'P',
mods = 'SUPER',
action = wezterm.action_callback(function(window, pane)
local choices = {}
wezterm.log_info "working?" colors = {
tab_bar = {
active_tab = {
bg_color = '${config.theme.colors.base00}',
fg_color = '${config.theme.colors.base04}',
},
},
},
function scandir(directory) -- Disable audio
local i, t, popen = 0, {}, io.popen audible_bell = "Disabled",
local pfile = popen('${pkgs.fd}/bin/fd --search-path "'..directory..'" --type directory --exact-depth 2 | ${pkgs.proximity-sort}/bin/proximity-sort "'..os.getenv("HOME").."/dev/work"..'"')
for filename in pfile:lines() do initial_rows = 80,
i = i + 1 initial_cols = 200,
t[i] = filename
keys = {
-- sends completion string for fish autosuggestions
{
key = 'Enter',
mods = 'SHIFT',
action = wezterm.action.SendString '\x1F'
},
-- ctrl-shift-h was "hide"
{
key = 'H',
mods = 'SHIFT|CTRL',
action = wezterm.action.DisableDefaultAssignment
},
-- alt-enter was "fullscreen"
{
key = 'Enter',
mods = 'ALT',
action = wezterm.action.DisableDefaultAssignment
},
-- make super-f "fullscreen"
{
key = 'f',
mods = 'SUPER',
action = wezterm.action.ToggleFullScreen
},
-- super-t open new tab in new dir
{
key = 't',
mods = ${if pkgs.stdenv.isDarwin then "'SUPER'" else "'ALT'"},
action = wezterm.action.SpawnCommandInNewTab {
cwd = wezterm.home_dir,
},
},
-- shift-super-t open new tab in same dir
{
key = 't',
mods = 'SUPER|SHIFT',
action = wezterm.action.SpawnTab 'CurrentPaneDomain'
},
-- project switcher
{
key = 'P',
mods = 'SUPER',
action = wezterm.action_callback(function(window, pane)
local choices = {}
wezterm.log_info "working?"
function scandir(directory)
local i, t, popen = 0, {}, io.popen
local pfile = popen('${pkgs.fd}/bin/fd --search-path "'..directory..'" --type directory --exact-depth 2 | ${pkgs.proximity-sort}/bin/proximity-sort "'..os.getenv("HOME").."/dev/work"..'"')
for filename in pfile:lines() do
i = i + 1
t[i] = filename
end
pfile:close()
return t
end end
pfile:close()
return t
end
for _, v in pairs(scandir(os.getenv("HOME").."/dev")) do for _, v in pairs(scandir(os.getenv("HOME").."/dev")) do
table.insert(choices, { label = v }) table.insert(choices, { label = v })
end end
window:perform_action( window:perform_action(
wezterm.action.InputSelector { wezterm.action.InputSelector {
action = wezterm.action_callback(function(window, pane, id, label) action = wezterm.action_callback(function(window, pane, id, label)
if not id and not label then if not id and not label then
wezterm.log_info "cancelled" wezterm.log_info "cancelled"
else else
window:perform_action( window:perform_action(
wezterm.action.SpawnCommandInNewTab { wezterm.action.SpawnCommandInNewTab {
cwd = label, cwd = label,
}, },
pane pane
) )
end end
end), end),
fuzzy = true, fuzzy = true,
title = "Select Project", title = "Select Project",
choices = choices, choices = choices,
}, },
pane pane
) )
end), end),
}, },
},
} }
-- print the workspace name at the upper right
wezterm.on("update-right-status", function(window, pane)
window:set_right_status(window:active_workspace())
end)
-- load plugin
local workspace_switcher = wezterm.plugin.require("https://github.com/MLFlexer/smart_workspace_switcher.wezterm")
-- set path to zoxide
workspace_switcher.zoxide_path = "${pkgs.zoxide}/bin/zoxide"
-- keymaps
table.insert(config.keys, { key = "s", mods = "CTRL|SHIFT", action = workspace_switcher.switch_workspace() })
-- table.insert(config.keys, { key = "t", mods = "CTRL|SHIFT", action = wezterm.action.ShowLauncherArgs({ flags = "FUZZY|WORKSPACES" }) })
table.insert(config.keys, { key = "[", mods = "CTRL|SHIFT", action = wezterm.action.SwitchWorkspaceRelative(1) })
table.insert(config.keys, { key = "]", mods = "CTRL|SHIFT", action = wezterm.action.SwitchWorkspaceRelative(-1) })
return config
''; '';
}; };
}; };