repositories / dotfiles

dotfiles

bugabingas dorkfiles

owned by bugabinga

neovim: fix loading current session wezterm: better status infos

2be0fb3e736d797c7a2a3dd9fe69283ae6ce0815

Oliver Jan Krylow <oliver@bugabinga.net> ·

unsigned

Browse filesCompare with HEAD

Changed files (6)

README.md

Modified
39 39 # todo
41 -* kill lush
41 +* add fonts to dotfiles (how to keep size under control?)
42 42 * write plugin to parse lsp settings locally and apply them
43 43 * is there a use case for a plugin that parses local plugin configuration overrides?
44 44 * kill custom lsp stuff in favor of lspconfig and try neoconf + nvim-java

neovim/lua/bugabinga/sessions.lua

Modified
2 2 local map = require 'std.map'
3 3 local auto = require 'std.auto'
5 5 local sessions = vim.fs.normalize( vim.fn.stdpath 'data' .. '/sessions' )
6 +vim.fn.mkdir( sessions, 'p' )
7 8 -- FIXME: this needs to live somewhere in std
8 9 local file_exists = function ( path )
48 49 local load_current_session = function ()
50 + local cwd = vim.uv.cwd()
51 + local session = encode( cwd )
52 + load_session( session )
51 55 local load_any_session = function ()

wezterm/.lsp.settings.lua

Added
new file mode 100644
1 +return {
2 + LuaLS = {
3 + Lua = {
4 + runtime = { version = 'Lua 5.4', },
5 + },
6 + },
7 +}

wezterm/bugabinga/auto_dark_mode.lua

Modified
3 3 local wez = require 'wezterm'
5 5 -- wezterm.gui is not available to the mux server, so take care to
6 6 -- do something reasonable when this config is evaluated by the mux
7 7 local get_appearance = function()
8 - if wez.gui then
9 - return wez.gui.get_appearance()
10 - end
11 - return 'Dark'
8 + if wez.gui then
9 + return wez.gui.get_appearance()
10 + end
11 + return 'Dark'
14 14 local scheme_for_appearance = function(appearance)
15 - if appearance:find 'Dark' then
16 - return 'nugu-dark'
17 - else
18 - return 'nugu-light'
19 - end
15 + if appearance:find('Dark',1, true) then
16 + return 'nugu-dark'
17 + else
18 + return 'nugu-light'
19 + end
22 -wez.on('window-config-reloaded', function(window)
23 - local overrides = window:get_config_overrides() or {}
24 - local appearance = window:get_appearance()
25 - local scheme = scheme_for_appearance(appearance)
26 - if overrides.color_scheme ~= scheme then
27 - overrides.color_scheme = scheme
28 - window:set_config_overrides(overrides)
29 - end
30 -end)
22 +-- wez.on('window-config-reloaded', function(window)
23 +-- local overrides = window:get_config_overrides() or {}
24 +-- local appearance = window:get_appearance()
25 +-- local scheme = scheme_for_appearance(appearance)
26 +-- if overrides.color_scheme ~= scheme then
27 +-- overrides.color_scheme = scheme
28 +-- window:set_config_overrides(overrides)
29 +-- end
30 +-- end)
32 32 return scheme_for_appearance(get_appearance())

wezterm/bugabinga/key_binds.lua

Modified
137 137 mods = 'LEADER',
138 138 action = wez.action.ActivateCommandPalette,
141 + key = 'p',
142 + mods = 'LEADER|SHIFT',
143 + action = wez.action.ShowLauncherArgs {
144 + flags = 'FUZZY|WORKSPACES',
145 + },
146 + },
141 148 key = '/',
142 149 mods = 'LEADER',

wezterm/bugabinga/status.lua

Modified
20 20 -- Show which key table is active in the status area
21 21 wez.on('update-status', function(window, pane)
22 - local name = window:active_key_table()
22 + local key_table = window:active_key_table()
23 23 local current_workspace = window:active_workspace()
24 24 local zoomed_state = zoomed(pane)
25 25 local leader = nil
27 27 leader = 'LEADER'
29 29 local fonts = {}
30 - for _, font in pairs(window:effective_config().font.font) do
31 - table.insert(fonts, font.family)
30 + local config = window:effective_config()
31 + local font_size = config.font_size
32 + for _, font in pairs(config.font.font) do
33 + table.insert(fonts, string.format('%s:%s', font.family, font_size))
33 35 local font = wez.format {
34 36 { Text = ' Font ' },
40 42 local status = { ' ' }
43 + if leader then table.insert(status, leader) end
44 + if key_table then table.insert(status, key_table) end
41 45 if zoomed_state then table.insert(status, zoomed_state) end
42 46 if current_workspace then table.insert(status, current_workspace) end
43 - if leader then table.insert(status, leader) end
44 47 if font then table.insert(status, font) end
46 49 window:set_right_status(table.concat(status, DELIMITER))