A readme explaining how to make neovim work fast
| 1 | local wezterm = require("wezterm") |
| 2 | local act = wezterm.action |
| 3 | local mux = wezterm.mux |
| 4 | local config = wezterm.config_builder() |
| 5 | |
| 6 | -- basic config |
| 7 | config.default_domain = "WSL:Ubuntu" |
| 8 | |
| 9 | -- window config |
| 10 | config.font = wezterm.font("Hack Nerd Font") |
| 11 | config.font_size = 11.0 |
| 12 | config.window_decorations = "RESIZE" |
| 13 | config.window_background_opacity = 0.85 |
| 14 | config.enable_scroll_bar = true |
| 15 | config.colors = { |
| 16 | scrollbar_thumb = "grey", |
| 17 | } |
| 18 | config.color_scheme = "Tokyo Night Storm" |
| 19 | |
| 20 | -- keymap |
| 21 | config.keys = { |
| 22 | -- vim-like pane movement |
| 23 | { key = "h", mods = "CTRL|SHIFT", action = act.ActivatePaneDirection("Left") }, |
| 24 | { key = "j", mods = "CTRL|SHIFT", action = act.ActivatePaneDirection("Down") }, |
| 25 | { key = "k", mods = "CTRL|SHIFT", action = act.ActivatePaneDirection("Up") }, |
| 26 | { key = "l", mods = "CTRL|SHIFT", action = act.ActivatePaneDirection("Right") }, |
| 27 | { key = "h", mods = "CTRL|SHIFT|ALT", action = act.AdjustPaneSize({ "Left", 3 }) }, |
| 28 | { key = "j", mods = "CTRL|SHIFT|ALT", action = act.AdjustPaneSize({ "Down", 3 }) }, |
| 29 | { key = "k", mods = "CTRL|SHIFT|ALT", action = act.AdjustPaneSize({ "Up", 3 }) }, |
| 30 | { key = "l", mods = "CTRL|SHIFT|ALT", action = act.AdjustPaneSize({ "Right", 3 }) }, |
| 31 | |
| 32 | -- debug |
| 33 | { key = "d", mods = "CTRL|SHIFT", action = act.ShowDebugOverlay }, |
| 34 | |
| 35 | -- quit all |
| 36 | { key = "q", mods = "CTRL|SHIFT", action = act.QuitApplication }, |
| 37 | |
| 38 | -- Show the launcher in fuzzy selection mode and have it list all workspaces |
| 39 | -- and allow activating one. |
| 40 | { |
| 41 | key = "9", |
| 42 | mods = "ALT", |
| 43 | action = act.ShowLauncherArgs({ |
| 44 | flags = "FUZZY|WORKSPACES", |
| 45 | }), |
| 46 | }, |
| 47 | { key = "n", mods = "ALT", action = act.SwitchWorkspaceRelative(1) }, |
| 48 | { key = "p", mods = "ALT", action = act.SwitchWorkspaceRelative(-1) }, |
| 49 | -- Prompt for a name to use for a new workspace and switch to it. |
| 50 | { |
| 51 | key = "w", |
| 52 | mods = "CTRL|SHIFT", |
| 53 | action = act.PromptInputLine({ |
| 54 | description = wezterm.format({ |
| 55 | { Attribute = { Intensity = "Bold" } }, |
| 56 | { Foreground = { AnsiColor = "Fuchsia" } }, |
| 57 | { Text = "Enter name for new workspace" }, |
| 58 | }), |
| 59 | action = wezterm.action_callback(function(window, pane, line) |
| 60 | -- line will be `nil` if they hit escape without entering anything |
| 61 | -- An empty string if they just hit enter |
| 62 | -- Or the actual line of text they wrote |
| 63 | if line then |
| 64 | window:perform_action( |
| 65 | act.SwitchToWorkspace({ |
| 66 | name = line, |
| 67 | }), |
| 68 | pane |
| 69 | ) |
| 70 | end |
| 71 | end), |
| 72 | }), |
| 73 | }, |
| 74 | |
| 75 | -- open lazygit |
| 76 | { |
| 77 | key = "g", |
| 78 | mods = "CTRL|SHIFT", |
| 79 | action = act.SpawnCommandInNewWindow({ args = { "lazygit" } }), |
| 80 | }, |
| 81 | } |
| 82 | |
| 83 | -- plugins |
| 84 | local tabline = wezterm.plugin.require("https://github.com/michaelbrusegard/tabline.wez") |
| 85 | tabline.setup() |
| 86 | tabline.apply_to_config(config) |
| 87 | |
| 88 | -- log success on reload |
| 89 | wezterm.on("window-config-reloaded", function(_, _) |
| 90 | wezterm.log_info("Successfully loaded config") |
| 91 | end) |
| 92 | |
| 93 | require("workspaces") |
| 94 | |
| 95 | return config |