irongit

A readme explaining how to make neovim work fast

auto update wezterm from env var and open lazy git with c-M-g

huncholanehuncholaneauthored
parent bc42968commit 1790f4fe9451d4b0ab03940121413650b03faa71Browse files

4 files changed, +122 -6

+7-0bashrc.sh
@@ -13,3 +13,10 @@ alias fzf-hist='fc -nl | fzf'
1313 # Add the go path
1414 export GOPATH=$(go env GOPATH)
1515 export PATH="$GOPATH/bin:$PATH"
16+
17+# wezterm
18+alias wezterm=wezterm.exe
19+function wezterm_osc7_cwd() {
20+ printf "\033]7;file://%s%s\033\\" "$(hostname)" "$PWD"
21+}
22+PROMPT_COMMAND="wezterm_osc7_cwd; $PROMPT_COMMAND"
+7-6lazy-lock.json
@@ -2,7 +2,7 @@
22 "CopilotChat.nvim": { "branch": "main", "commit": "75653259442a8eb895abfc70d7064e07aeb7134c" },
33 "LazyVim": { "branch": "main", "commit": "3f034d0a7f58031123300309f2efd3bb0356ee21" },
44 "LuaSnip": { "branch": "master", "commit": "c9b9a22904c97d0eb69ccb9bab76037838326817" },
5- "SchemaStore.nvim": { "branch": "main", "commit": "ad028f85ec81d58fc5e128c705b8d0f1365898a4" },
5+ "SchemaStore.nvim": { "branch": "main", "commit": "442901b78dca4da1078b32e25e1afb32460e0082" },
66 "Toggleterm": { "branch": "main", "commit": "9a88eae817ef395952e08650b3283726786fb5fb" },
77 "alpha-nvim": { "branch": "main", "commit": "de72250e054e5e691b9736ee30db72c65d560771" },
88 "auto-session": { "branch": "main", "commit": "00334ee24b9a05001ad50221c8daffbeedaa0842" },
@@ -10,12 +10,12 @@
1010 "bufferline.nvim": { "branch": "main", "commit": "655133c3b4c3e5e05ec549b9f8cc2894ac6f51b3" },
1111 "catppuccin": { "branch": "main", "commit": "5b5e3aef9ad7af84f463d17b5479f06b87d5c429" },
1212 "conform.nvim": { "branch": "master", "commit": "372fc521f8421b7830ea6db4d6ea3bae1c77548c" },
13- "copilot.lua": { "branch": "master", "commit": "2f50ec4c16048153a50633053120292c9a7784bb" },
13+ "copilot.lua": { "branch": "master", "commit": "a5c390f8d8e85b501b22dcb2f30e0cbbd69d5ff0" },
1414 "dressing.nvim": { "branch": "master", "commit": "2d7c2db2507fa3c4956142ee607431ddb2828639" },
1515 "firenvim": { "branch": "master", "commit": "c4ab7d2aeb145cd93db8660cb134f771722f2b5e" },
1616 "flash.nvim": { "branch": "main", "commit": "3c942666f115e2811e959eabbdd361a025db8b63" },
1717 "friendly-snippets": { "branch": "main", "commit": "fc8f183479a472df60aa86f00e295462f2308178" },
18- "gitsigns.nvim": { "branch": "main", "commit": "ee7e50dfbdf49e3acfa416fd3ad3abbdb658582c" },
18+ "gitsigns.nvim": { "branch": "main", "commit": "140ac646db125904e456e42ab8b538d28f9607d7" },
1919 "grug-far.nvim": { "branch": "main", "commit": "631331f9c6611b1a47e887f50b92b7cf450f51e7" },
2020 "harpoon": { "branch": "harpoon2", "commit": "ed1f853847ffd04b2b61c314865665e1dadf22c7" },
2121 "hydra.nvim": { "branch": "main", "commit": "f3d4822060376cb253d4cc0d5af2c272c28de2a7" },
@@ -30,11 +30,12 @@
3030 "mini.icons": { "branch": "main", "commit": "397ed3807e96b59709ef3292f0a3e253d5c1dc0a" },
3131 "mini.pairs": { "branch": "main", "commit": "69864a2efb36c030877421634487fd90db1e4298" },
3232 "multicursors.nvim": { "branch": "main", "commit": "72225ea9e4443c3f4b9df91d0193e07c4ee8d382" },
33- "neo-tree.nvim": { "branch": "main", "commit": "b2843296548622937322b19fd602cadaa34432c5" },
33+ "neo-tree.nvim": { "branch": "main", "commit": "299e174c3b8373c9c1f9be0bc3967c852712d0f3" },
34+ "neodev.nvim": { "branch": "main", "commit": "46aa467dca16cf3dfe27098042402066d2ae242d" },
3435 "noice.nvim": { "branch": "main", "commit": "0427460c2d7f673ad60eb02b35f5e9926cf67c59" },
3536 "nui.nvim": { "branch": "main", "commit": "8d5b0b568517935d3c84f257f272ef004d9f5a59" },
3637 "nvim-lint": { "branch": "master", "commit": "9dfb77ef6c5092a19502883c02dc5a02ec648729" },
37- "nvim-lspconfig": { "branch": "master", "commit": "8b0f47d851ee5343d38fe194a06ad16b9b9bd086" },
38+ "nvim-lspconfig": { "branch": "master", "commit": "a9d8e659df04eb48d4224798777eb33992692333" },
3839 "nvim-tree.lua": { "branch": "master", "commit": "be5b788f2dc1522c73fb7afad9092331c8aebe80" },
3940 "nvim-treesitter": { "branch": "master", "commit": "684eeac91ed8e297685a97ef70031d19ac1de25a" },
4041 "nvim-treesitter-textobjects": { "branch": "master", "commit": "205e3369bc83d8cb83f7409c36120e24611f8c5c" },
@@ -42,7 +43,7 @@
4243 "persistence.nvim": { "branch": "main", "commit": "166a79a55bfa7a4db3e26fc031b4d92af71d0b51" },
4344 "plenary.nvim": { "branch": "master", "commit": "857c5ac632080dba10aae49dba902ce3abf91b35" },
4445 "project.nvim": { "branch": "main", "commit": "8c6bad7d22eef1b71144b401c9f74ed01526a4fb" },
45- "render-markdown.nvim": { "branch": "main", "commit": "8103a88198cf17bcefe00f27946f0125b615dc6a" },
46+ "render-markdown.nvim": { "branch": "main", "commit": "78ffe3b0500bbc7e37fabde723d96661538e8b32" },
4647 "snacks.nvim": { "branch": "main", "commit": "bc0630e43be5699bb94dadc302c0d21615421d93" },
4748 "telescope-fzf-native.nvim": { "branch": "main", "commit": "1f08ed60cafc8f6168b72b80be2b2ea149813e55" },
4849 "telescope.nvim": { "branch": "master", "commit": "a4ed82509cecc56df1c7138920a1aeaf246c0ac5" },
+16-0lua/config/autocmds/init.lua
@@ -120,3 +120,19 @@ vim.api.nvim_create_autocmd({ "BufReadPost", "FileType" }, {
120120 vim.opt_local.foldexpr = foldexpr
121121 end,
122122 })
123+
124+-- wezterm config target from ~/.bashrc
125+local WEZTERM_CONFIG_TARGET = os.getenv("WEZTERM_CONFIG_TARGET") or vim.fn.expand("~/.wezterm.lua")
126+
127+-- update wezterm config wheneverver a file ending in .wezterm.lua
128+-- is saved. This uses WEZTERM_TARGET_CONFIG from environment variables
129+vim.api.nvim_create_autocmd("BufWritePost", {
130+ group = general,
131+ desc = "Copies wezterm.lua to the target on save",
132+ pattern = "*wezterm.lua",
133+ callback = function()
134+ vim.notify("Saved wezterm.lua, copying to " .. WEZTERM_CONFIG_TARGET)
135+ local src = vim.fn.expand("%:p")
136+ vim.system({ "cp", src, WEZTERM_CONFIG_TARGET })
137+ end,
138+})
+92-0wezterm.lua
@@ -0,0 +1,92 @@
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+ -- Show the launcher in fuzzy selection mode and have it list all workspaces
36+ -- and allow activating one.
37+ {
38+ key = "9",
39+ mods = "ALT",
40+ action = act.ShowLauncherArgs({
41+ flags = "FUZZY|WORKSPACES",
42+ }),
43+ },
44+ { key = "n", mods = "ALT", action = act.SwitchWorkspaceRelative(1) },
45+ { key = "p", mods = "ALT", action = act.SwitchWorkspaceRelative(-1) },
46+ -- Prompt for a name to use for a new workspace and switch to it.
47+ {
48+ key = "w",
49+ mods = "CTRL|SHIFT",
50+ action = act.PromptInputLine({
51+ description = wezterm.format({
52+ { Attribute = { Intensity = "Bold" } },
53+ { Foreground = { AnsiColor = "Fuchsia" } },
54+ { Text = "Enter name for new workspace" },
55+ }),
56+ action = wezterm.action_callback(function(window, pane, line)
57+ -- line will be `nil` if they hit escape without entering anything
58+ -- An empty string if they just hit enter
59+ -- Or the actual line of text they wrote
60+ if line then
61+ window:perform_action(
62+ act.SwitchToWorkspace({
63+ name = line,
64+ }),
65+ pane
66+ )
67+ end
68+ end),
69+ }),
70+ },
71+
72+ -- open lazygit
73+ {
74+ key = "g",
75+ mods = "CTRL|SHIFT",
76+ action = act.SpawnCommandInNewTab({
77+ args = { "lazygit" },
78+ }),
79+ },
80+}
81+
82+-- plugins
83+local tabline = wezterm.plugin.require("https://github.com/michaelbrusegard/tabline.wez")
84+tabline.setup()
85+tabline.apply_to_config(config)
86+
87+-- log success on reload
88+wezterm.on("window-config-reloaded", function(_, _)
89+ wezterm.log_info("Successfully loaded config")
90+end)
91+
92+return config