Add some more keymaps, fix wezterm status spacing and clean up linter errors

This commit is contained in:
Evie Litherland-Smith 2023-02-16 14:02:41 +00:00
parent 4b4083656b
commit c01a1f91ad
2 changed files with 9 additions and 9 deletions

View file

@ -19,6 +19,8 @@ vim.keymap.set("n", "<leader>fz", "<cmd>Telescope current_buffer_fuzzy_find<cr>"
-- Neotree
vim.keymap.set("n", "<leader>n", "<cmd>Neotree toggle<cr>")
vim.keymap.set("n", "<leader>g", "<cmd>Neotree git_status<cr>")
vim.keymap.set("n", "<leader>b", "<cmd>Neotree buffers<cr>")
vim.keymap.set("n", "<leader>\\", "<cmd>Neotree reveal<cr>")
-- Trouble

View file

@ -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 })