From c01a1f91ad3d5bd68ae8e72e9db5fba1f4280e11 Mon Sep 17 00:00:00 2001 From: Evie Litherland-Smith Date: Thu, 16 Feb 2023 14:02:41 +0000 Subject: [PATCH] Add some more keymaps, fix wezterm status spacing and clean up linter errors --- config/nvim/lua/keymaps.lua | 2 ++ config/wezterm/status.lua | 16 +++++++--------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/config/nvim/lua/keymaps.lua b/config/nvim/lua/keymaps.lua index e99b1443..41e1aa05 100644 --- a/config/nvim/lua/keymaps.lua +++ b/config/nvim/lua/keymaps.lua @@ -19,6 +19,8 @@ vim.keymap.set("n", "fz", "Telescope current_buffer_fuzzy_find" -- Neotree vim.keymap.set("n", "n", "Neotree toggle") +vim.keymap.set("n", "g", "Neotree git_status") +vim.keymap.set("n", "b", "Neotree buffers") vim.keymap.set("n", "\\", "Neotree reveal") -- Trouble diff --git a/config/wezterm/status.lua b/config/wezterm/status.lua index da1c4205..b77989a1 100644 --- a/config/wezterm/status.lua +++ b/config/wezterm/status.lua @@ -3,11 +3,11 @@ local wezterm = require("wezterm") -- Equivalent to POSIX basename(3) -- Given "/foo/bar" returns "bar" -- Given "c:\\foo\\bar" returns "bar" -function basename(s) - return string.gsub(s, "(.*[/\\])(.*)", "%2") -end +-- function basename(s) +-- return string.gsub(s, "(.*[/\\])(.*)", "%2") +-- end -wezterm.on("update-right-status", function(window, pane) +wezterm.on("update-right-status", function(window, _) local scheme = wezterm.color.get_builtin_schemes()["Catppuccin Macchiato"] -- Each element holds the text for a cell in a "powerline" style << fade local cells = {} @@ -34,10 +34,8 @@ wezterm.on("update-right-status", function(window, pane) table.insert(cells, string.format("%.0f%%", b.state_of_charge * 100)) end - -- The powerline ( symbol - local LEFT_SEP = utf8.char(0xe0b7) - -- The filled in variant of the ( symbol - local SOLID_LEFT_SEP = utf8.char(0xe0b6) + -- The filled in variant of the powerline ( symbol + local SOLID_LEFT_SEP = require("utf8").char(0xe0b6) -- Foreground color for the text across the fade local text_fg = scheme.foreground @@ -61,7 +59,7 @@ wezterm.on("update-right-status", function(window, pane) local cell_no = num_cells + 1 table.insert(elements, { Foreground = { Color = text_fg } }) table.insert(elements, { Background = { Color = colours[cell_no] } }) - table.insert(elements, { Text = " " .. text .. " " }) + table.insert(elements, { Text = text .. " " }) if not is_last then table.insert(elements, { Foreground = { Color = colours[cell_no + 1] } }) table.insert(elements, { Text = SOLID_LEFT_SEP })