-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathwezterm.lua
More file actions
91 lines (74 loc) · 3.19 KB
/
wezterm.lua
File metadata and controls
91 lines (74 loc) · 3.19 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
-- Pull in the wezterm API
local wezterm = require 'wezterm'
local act = wezterm.action
-- wezterm.gui is not available to the mux server, so take care to
-- do something reasonable when this config is evaluated by the mux
local function get_appearance()
if wezterm.gui then
return wezterm.gui.get_appearance()
end
return 'Dark'
end
local function scheme_for_appearance(appearance)
if appearance:find 'Dark' then
return 'ayu'
else
return 'Ayu Mirage'
end
end
-- This table will hold the configuration.
local config = {}
-- In newer versions of wezterm, use the config_builder which will
-- help provide clearer error messages
if wezterm.config_builder then
config = wezterm.config_builder()
end
-- This is where you actually apply your config choices
-- For example, changing the color scheme:
config.color_scheme = scheme_for_appearance(get_appearance())
config.font = wezterm.font_with_fallback {
{ family = 'Iosevka NF', weight = 'Medium', italic = false },
{ family = 'Iosevka', weight = 'Medium', italic = false },
'Fira Code'
}
config.font_size = 13
config.native_macos_fullscreen_mode = true
-- Keyboard shortcuts
config.keys = {
-- command palette
{ key = 'p', mods = 'CMD', action = act.ActivateCommandPalette },
-- New tab in home directory
{ key = 't', mods = 'CMD', action = act.SpawnCommandInNewTab { domain = 'CurrentPaneDomain', cwd = "~" } },
-- New tab in current working directory
{ key = 't', mods = 'CMD|SHIFT', action = act.SpawnTab 'CurrentPaneDomain' },
-- close panes rather than tabs
{ key = 'w', mods = 'CMD', action = act.CloseCurrentPane { confirm = true } },
{ key = 'w', mods = 'CMD|SHIFT', action = act.CloseCurrentTab { confirm = true } },
-- This will create a new split and run your default program inside it
{
key = 'd',
mods = 'CMD',
action = act.SplitHorizontal { domain = 'CurrentPaneDomain' },
},
-- This will create a new split and run your default program inside it
{
key = 'd',
mods = 'CMD|SHIFT',
action = act.SplitVertical { domain = 'CurrentPaneDomain' },
},
-- This will rotate panels but keep the sizes
{ key = 'b', mods = 'CMD', action = act.RotatePanes 'Clockwise' },
{ key = 'b', mods = 'CMD|SHIFT', action = act.RotatePanes 'CounterClockwise' },
-- Make Option-Left equivalent to Alt-b which many line editors interpret as backward-word
{ key = "LeftArrow", mods = "OPT", action = act { SendString = "\x1bb" } },
-- Make Option-Right equivalent to Alt-f; forward-word
{ key = "RightArrow", mods = "OPT", action = act { SendString = "\x1bf" } },
-- Make CMD-Left move the cursor to the beginning of the line
{ key = "LeftArrow", mods = "CMD", action = act.SendKey { key = 'a', mods = 'CTRL' } },
-- Make CMD-Right move the cursor to the end of the line
{ key = "RightArrow", mods = "CMD", action = act.SendKey { key = 'e', mods = 'CTRL' } },
-- full screen
{ key = 'Enter', mods = 'CMD|SHIFT', action = act.ToggleFullScreen },
}
-- and finally, return the configuration to wezterm
return config