repositories / dotfiles

dotfiles

bugabingas dorkfiles

owned by bugabinga

neovim: new user command LspInfo (basic only)

50603b3db44ffaec3754ccb4947f9498ff6e76f5

Oliver Krylow <o.krylow@isp-insoft.de> ·

unsigned

Browse filesCompare with HEAD

Changed files (4)

neovim/lua/bugabinga/lsp/clients/lua.lua

Modified
1 1 local project = require'std.project'
3 3 -- TODO: share lua ls settings in shared table
4 -local lua_ls =
4 +local lua_ls =
6 6 name = 'LuaLS',
7 7 filetypes = 'lua',
29 -local nvim_lua_ls =
29 +local nvim_lua_ls =
31 31 name = 'LuaLS(nvim)',
32 32 filetypes = 'lua',

neovim/lua/bugabinga/lsp/init.lua

Modified
8 8 local map = require'std.keymap'
9 9 local auto = require'std.auto'
10 +local deep_concat = require'std.table.deep_concat'
12 +local lsp_client_configs = require'bugabinga.lsp.clients'
11 14 local _ = {}
42 45 -- vim.print( "SEARCHING LSP CLIENT FOR:", match, buffer_path)
44 - local lsp_client_configs = require'bugabinga.lsp.clients'
46 48 local potential_client_configs = vim.iter(lsp_client_configs)
47 49 :map(function(config)
107 109 before_init = config.before_init,
108 110 -- on_init = nil, -- should i send workspace/didChangeConfiguration here?
109 111 on_exit = function(code, signal, client_id) vim.print("LSP CLIENT EXIT", code, signal, client_id) end,
110 - on_attach = function(client, bufnr) vim.print("LSP CLIENT ATTACH", client, bufnr) end,
112 + on_attach = function(client, bufnr) vim.print("LSP CLIENT ATTACH", client.data.client_id, bufnr) end,
111 113 trace = 'off',
112 114 flags = { allow_incremental_sync = true, debounce_text_changes = 50, exit_timeout = 200},
113 115 root_dir = config.root_dir(buffer_path),
155 +local lsp_info = function(command)
156 + local all_or_current = command.args and command.args == 'all' and {} or { bufnr = 0 }
157 + local active_clients = vim.lsp.get_active_clients(all_or_current)
159 + -- basic info is:
160 + -- * id
161 + -- * name
162 + -- * cmd
163 + -- * pid, cpu, mem
164 + -- * root_dir/workspaces
165 + -- * filetypes
166 + -- * single file support
167 + -- * workspaces support
168 + -- * buffers (if 'all')
169 + --
170 + -- TODO extended infos (needs GUI)
171 + -- * client caps
172 + -- * server caps
173 + -- * settings
174 + -- * ...
176 + local infos = vim.iter(active_clients)
177 + :map(function(client)
178 + local name = client.name
179 + local config = vim.iter(lsp_client_configs):find(function(config) return config.name == name end)
180 + assert(config, ( 'How did we not find a config for %s ?!?!' ):format(name))
181 + local basic = {
182 + id = client.id,
183 + name = name,
184 + --TODO: find cmd in (neovim) PATH
185 + cmd = { client.config.cmd, client.config.cmd_cwd, 'TODO:pid', 'TODO:cpu', 'TODO:mem'},
186 + workspace_folders = vim.iter(client.workspace_folders):map(function(w) return vim.fs.normalize(w.name) end):totable(),
187 + filetypes = config.filetypes,
188 + single_file_support = config.single_file_support,
189 + workspaces = config.workspaces,
191 + return basic
192 + end)
193 + :totable()
195 + --TODO replace with GUI
196 + vim.print(deep_concat(infos))
197 +end
199 +vim.api.nvim_create_user_command ('LspInfo',
200 + lsp_info,
202 + nargs = '?',
203 + complete = function() return {"all"} end,
204 + desc = 'Shows basic information about running LSP clients.',
205 + })
154 207 return setmetatable(_ ,{ })

neovim/lua/bugabinga/nugu/init.lua

Modified
73 73 NonText { fg = ui_unfocus }, -- '@' at the end of the window, characters from 'showbreak' and other characters that do not really exist in the text (e.g., ">" displayed when a double-wide character doesn't fit at the end of the line). See also |hl-EndOfBuffer|.
74 74 NormalNC {}, -- normal text in non-current windows
75 75 Pmenu { NormalFloat }, -- Popup menu: normal item.
76 - PmenuSel { fg = ui_focus.readable(), sp = ui_focus.readable(), bg = ui_unfocus, gui = 'underline' }, -- Popup menu: selected item.
76 + PmenuSel { fg = ui_focus, sp = ui_focus.readable(), bg = ui_unfocus, gui = 'underline' }, -- Popup menu: selected item.
77 77 PmenuSbar { bg = ui_unfocus }, -- Popup menu: scrollbar.
78 78 PmenuThumb { bg = ui_minor }, -- Popup menu: Thumb of the scrollbar.
79 79 Question { fg = ui_important_global, gui = 'bold' }, -- |hit-enter| prompt and yes/no questions

wezterm/wezterm.lua

Modified
11 11 local enable_wayland = false
12 12 local window_decorations = 'RESIZE'
13 13 local font_size = 11.0
14 -local font = wez.font'Blex Mono Nerd Font'
15 -local font_rules = {
16 - {
17 - intensity = 'Bold',
18 - italic = true,
19 - font = wez.font {
20 - family = 'VictorMono Nerd Font',
21 - weight = 'Bold',
22 - style = 'Italic',
23 - },
24 - },
25 - {
26 - italic = true,
27 - intensity = 'Half',
28 - font = wez.font {
29 - family = 'VictorMono Nerd Font',
30 - weight = 'DemiBold',
31 - style = 'Italic',
32 - },
33 - },
34 - {
35 - italic = true,
36 - intensity = 'Normal',
37 - font = wez.font {
38 - family = 'VictorMono Nerd Font',
39 - style = 'Italic',
40 - },
41 - },
42 -}
14 +local normal_font_family = 'Blex Mono Nerd Font'
15 +local italic_font_family = 'Victor Mono Nerd Font'
44 16 if hostname == 'x230' then
45 17 font_size = 11
46 18 enable_wayland = true
47 19 elseif hostname == 'pop-os' then
48 - font_size = 16
20 + font_size = 14
49 21 elseif hostname == 'PC-00625' then
50 - font = wez.font'BlexMono Nerd Font'
22 + normal_font_family = 'BlexMono Nerd Font'
23 + italic_font_family = 'VictorMono Nerd Font'
51 24 font_size = 14
27 +local font_rules = {
28 + -- normal
29 + {
30 + intensity = 'Half',
31 + font = wez.font { family = normal_font_family, weight = 'Light', style = 'Normal' }
32 + },
33 + {
34 + intensity = 'Normal',
35 + font = wez.font { family = normal_font_family, weight = 'Book', style = 'Normal' }
36 + },
37 + {
38 + intensity = 'Bold',
39 + font = wez.font { family = normal_font_family, weight = 'Medium', style = 'Normal' }
40 + },
41 + -- italic
42 + {
43 + intensity = 'Half',
44 + italic = true,
45 + font = wez.font { family = italic_font_family, weight = 'DemiBold', style = 'Italic' },
46 + },
47 + {
48 + intensity = 'Normal',
49 + italic = true,
50 + font = wez.font { family = italic_font_family, weight = 'Regular', style = 'Italic' },
51 + },
52 + {
53 + intensity = 'Bold',
54 + italic = true,
55 + font = wez.font { family = italic_font_family, weight = 'Bold', style = 'Italic' },
56 + },
54 59 return {
55 60 -- logs key presses
56 - --debug_key_events = true,
61 + -- debug_key_events = true,
58 63 font = font,
59 64 font_rules = font_rules,
60 65 font_size = font_size,
66 + freetype_load_target = 'Light',
67 + freetype_render_target = 'HorizontalLcd',
61 68 underline_position = "-2pt",
62 69 warn_about_missing_glyphs = false,
63 70 color_scheme = dark_mode,