Initial commit

This commit is contained in:
Oscar Wallberg
2024-07-14 13:55:45 +02:00
commit 24430a42fb
75 changed files with 6638 additions and 0 deletions
+112
View File
@@ -0,0 +1,112 @@
local wezterm = require 'wezterm'
local act = wezterm.action
local M = {}
M.keys = {
{ key = 'Enter', mods = 'ALT', action = act.ToggleFullScreen },
{ key = '=', mods = 'CTRL', action = act.IncreaseFontSize },
{ key = '-', mods = 'CTRL', action = act.DecreaseFontSize },
{ key = '0', mods = 'CTRL', action = act.ResetFontSize },
{ key = 'C', mods = 'SHIFT|CTRL', action = act.CopyTo("Clipboard") },
{ key = 'V', mods = 'SHIFT|CTRL', action = act.PasteFrom("Clipboard") },
{ key = 'P', mods = 'SHIFT|CTRL', action = act.ActivateCommandPalette },
{ key = 'R', mods = 'SHIFT|CTRL', action = act.ReloadConfiguration },
{ key = 'F12', mods = 'NONE', action = act.ShowDebugOverlay },
}
M.mouse_bindings = {
-- Open links
{
event = { Up = { streak = 1, button = 'Left' } },
mods = 'CTRL',
action = act.OpenLinkAtMouseCursor,
},
-- Select text
{
event = { Down = { streak = 1, button = 'Left' } },
mods = 'CTRL',
action = act.SelectTextAtMouseCursor("Cell"),
},
{
event = { Drag = { streak = 1, button = 'Left' } },
mods = 'CTRL',
action = act.ExtendSelectionToMouseCursor("Cell"),
},
{
event = { Down = { streak = 1, button = 'Left' } },
mods = 'CTRL|SHIFT',
action = act.ExtendSelectionToMouseCursor("Cell"),
},
-- Select text in block mode
{
event = { Down = { streak = 1, button = 'Left' } },
mods = 'CTRL|ALT',
action = act.SelectTextAtMouseCursor("Block"),
},
{
event = { Drag = { streak = 1, button = 'Left' } },
mods = 'CTRL|ALT',
action = act.ExtendSelectionToMouseCursor("Block"),
},
{
event = { Down = { streak = 1, button = 'Left' } },
mods = 'CTRL|ALT|SHIFT',
action = act.ExtendSelectionToMouseCursor("Block"),
},
}
M.key_tables = wezterm.gui.default_key_tables()
-- table.insert(M.key_tables.copy_mode, {
-- key = 'y',
-- mods = 'NONE',
-- action = act.Multiple({
-- act.CopyTo("Clipboard"),
-- act.CopyMode("ClearSelectionMode"),
-- })
-- })
function M.enable_multiplexing()
table.insert(M.keys, { key = "c", mods = "LEADER", action = act.SpawnTab("CurrentPaneDomain") })
table.insert(M.keys, { key = '%', mods = "LEADER|SHIFT", action = act.SplitPane({ direction = "Down" }) })
table.insert(M.keys, { key = '"', mods = "LEADER|SHIFT", action = act.SplitPane({ direction = "Right" }) })
table.insert(M.keys, { key = "x", mods = "LEADER", action = act.CloseCurrentPane({ confirm = true }) })
table.insert(M.keys, { key = "n", mods = "LEADER", action = act.ActivateTabRelative(1) })
table.insert(M.keys, { key = "p", mods = "LEADER", action = act.ActivateTabRelative(-1) })
table.insert(M.keys, { key = "h", mods = "LEADER", action = act.ActivatePaneDirection('Left') })
table.insert(M.keys, { key = "l", mods = "LEADER", action = act.ActivatePaneDirection('Right') })
table.insert(M.keys, { key = "k", mods = "LEADER", action = act.ActivatePaneDirection('Up') })
table.insert(M.keys, { key = "j", mods = "LEADER", action = act.ActivatePaneDirection('Down') })
table.insert(M.keys, { key = "[", mods = "LEADER", action = act.ActivateCopyMode })
table.insert(M.keys, { key = '?', mods = 'LEADER|SHIFT', action = act.Search("CurrentSelectionOrEmptyString") })
for i = 1, 9 do
table.insert(M.keys, { key = tostring(i), mods = "LEADER", action = act.ActivateTab(i - 1) })
end
table.insert(M.mouse_bindings, {
event = { Down = { streak = 1, button = { WheelUp = 1 } } },
mods = 'NONE',
action = act.ScrollByLine(-3)
})
table.insert(M.mouse_bindings, {
event = { Down = { streak = 1, button = { WheelDown = 1 } } },
mods = 'NONE',
action = act.ScrollByLine(3)
})
table.insert(M.mouse_bindings, {
event = { Down = { streak = 1, button = { WheelUp = 1 } } },
mods = 'ALT',
action = act.ScrollByPage(-1)
})
table.insert(M.mouse_bindings, {
event = { Down = { streak = 1, button = { WheelDown = 1 } } },
mods = 'ALT',
action = act.ScrollByPage(1)
})
end
return M
+75
View File
@@ -0,0 +1,75 @@
local my_colors = {
foreground = '#b2b2b2',
background = '#000000',
cursor_fg = '#000000',
cursor_bg = '#b2b2b2',
cursor_border = '#b2b2b2',
selection_fg = '#000000',
selection_bg = '#b2b2b2',
scrollbar_thumb = '#000000',
split = '#000000',
ansi = {
'#2e3436', -- black
'#cc5555', -- red
'#4e9a06', -- green
'#c4a000', -- yellow
'#6465a4', -- blue
'#75507b', -- magenta
'#06989a', -- cyan
'#b2b2b2', -- white
},
brights = {
'#555753', -- black
'#ff5555', -- red
'#8ae234', -- green
'#fce94f', -- yellow
'#739fcf', -- blue
'#ad7fa8', -- magenta
'#34e2e2', -- cyan
'#d3d7cf', -- white
},
compose_cursor = 'orange',
tab_bar = {
-- The color of the strip that goes along the top of the window
-- (does not apply when fancy tab bar is in use)
background = '#000000',
-- The active tab is the one that has focus in the window
active_tab = {
-- The color of the background area for the tab
bg_color = '#000000',
-- The color of the text for the tab
fg_color = '#c0c0c0',
},
-- Inactive tabs are the tabs that do not have focus
inactive_tab = {
bg_color = '#000000',
fg_color = '#808080',
},
-- You can configure some alternate styling when the mouse pointer
-- moves over inactive tabs
inactive_tab_hover = {
bg_color = '#000000',
fg_color = '#c0c0c0',
-- The same options that were listed under the `active_tab` section above
-- can also be used for `inactive_tab_hover`.
},
-- The new tab button that let you create new tabs
new_tab = {
bg_color = '#000000',
fg_color = '#808080',
},
new_tab_hover = {
bg_color = '#000000',
fg_color = '#c0c0c0',
},
},
}
return my_colors
@@ -0,0 +1,38 @@
[metadata]
name = "moonfly"
origin_url = "https://github.com/bluz71/vim-moonfly-colors"
[colors]
background = "#080808"
foreground = "#bdbdbd"
cursor_bg = "#9e9e9e"
cursor_fg = "#080808"
cursor_border = "#9e9e9e"
selection_bg = "#b2ceee"
selection_fg = "#080808"
scrollbar_thumb = "#9e9e9e"
split = "#9e9e9e"
ansi = [
"#323437",
"#ff5454",
"#8cc85f",
"#e3c78a",
"#80a0ff",
"#cf87e8",
"#79dac8",
"#c6c6c6",
]
brights = [
"#949494",
"#ff5189",
"#36c692",
"#c2c292",
"#74b2ff",
"#ae81ff",
"#85dc85",
"#e4e4e4",
]
compose_cursor = "#e3c78a"
visual_bell = "#e3c78a"
+26
View File
@@ -0,0 +1,26 @@
local wezterm = require("wezterm")
local M = {}
function M.setup()
wezterm.on(
'format-tab-title',
function(tab, _, _, _, _, _)
local title = tab.tab_title
if not title or #title <= 0 then
title = tab.active_pane.title
end
title = " " .. tab.tab_index + 1 .. ": " .. title
if tab.is_active then
title = title .. "*"
else
title = title .. " "
end
return {
{ Text = title },
}
end
)
end
return M
+53
View File
@@ -0,0 +1,53 @@
local wezterm = require("wezterm")
local fonts = {}
local family = "Iosevka Custom"
-- Automatically includes fallback for nerd font symbols,
-- so it doesn't require a patched font.
fonts.regular = wezterm.font({
family = family,
weight = "Regular",
stretch = "Normal",
style = "Normal"
})
fonts.italic = wezterm.font({
family = family,
weight = "Regular",
stretch = "Normal",
style = "Italic"
})
fonts.bold = wezterm.font({
family = family,
weight = "Bold",
stretch = "Normal",
style = "Normal"
})
fonts.bolditalic = wezterm.font({
family = family,
weight = "Bold",
stretch = "Normal",
style = "Italic"
})
fonts.rules = {
italic = {
intensity = "Normal",
italic = true,
font = fonts.italic
},
bold = {
intensity = "Bold",
italic = false,
font = fonts.bold
},
bolditalic = {
intensity = "Bold",
italic = true,
font = fonts.bolditalic
},
}
return fonts
+72
View File
@@ -0,0 +1,72 @@
local wezterm = require("wezterm")
local config = wezterm.config_builder()
local ENABLE_MULTIPLEXING = false
-- quickstart: https://wezfurlong.org/wezterm/config/files.html
-- spec: https://wezfurlong.org/wezterm/config/lua/general.html
-- General settings
config.window_padding = {
left = 6,
right = 6,
top = 6,
bottom = 6,
}
config.audible_bell = "Disabled"
-- Settings below get overriden if multiplexing is enabled
config.window_decorations = "TITLE|RESIZE"
config.enable_tab_bar = false
config.enable_scroll_bar = false
config.check_for_updates = false
if string.find(wezterm.target_triple, "windows") then
-- config.default_prog = { "wsl", "--cd", "~" }
config.default_prog = { "pwsh" }
else
config.default_prog = { "zsh" }
end
-- Colors
config.color_scheme = "moonfly"
-- Fonts
local fonts = require("fonts")
config.font = fonts.regular
config.font_size = 11
config.font_rules = {
fonts.rules.italic,
fonts.rules.bold,
fonts.rules.bolditalic,
}
config.harfbuzz_features = { 'calt=0' }
-- Keybinding
local bindings = require("bindings")
if ENABLE_MULTIPLEXING then
config.window_decorations = "INTEGRATED_BUTTONS|RESIZE"
config.enable_tab_bar = true
config.enable_scroll_bar = true
config.use_fancy_tab_bar = false
config.show_new_tab_button_in_tab_bar = false
config.leader = { key = "b", mods = "CTRL", timeout_milliseconds = 1000 }
bindings.enable_multiplexing()
end
config.disable_default_key_bindings = true
config.keys = bindings.keys
config.key_tables = bindings.key_tables
config.disable_default_mouse_bindings = true
config.mouse_bindings = bindings.mouse_bindings
require("events").setup()
return config