dotfiles
bugabingas dorkfiles
owned by bugabinga
neovim: custom lsp info command
212725f07f9939c2dfd315e28252c979b15d6965
Oliver Jan Krylow <oliver@bugabinga.net> ·
unsigned
Browse filesCompare with HEAD
Changed files (22)
helix/config.toml
Modified 4 4 shell = [
"nu",
"--commands"]
15 15 require'bugabinga.diagnostic' 16 16 require'bugabinga.trim' 17 -require 'bugabinga.lsp' 17 +require'bugabinga.lsp' neovim/lazy-lock.json
Modified 8 8 "heirline.nvim": {
"branch":
"master",
"commit":
"76136ccd93ed608e8109762f032cf1118981ebbd" },
9 9 "hlargs.nvim": {
"branch":
"main",
"commit":
"cfc9beab4e176a13311efe03e38e6b6fed5df4f6" },
10 10 "inc-rename.nvim": {
"branch":
"main",
"commit":
"ed0f6f2b917cac4eb3259f907da0a481b27a3b7e" },
11 - "indent-blankline.nvim": {
"branch":
"master",
"commit":
"b7aa0aed55887edfaece23f7b46ab22232fc8741" },
11 + "indent-blankline.nvim": {
"branch":
"master",
"commit":
"73640233cca0da8e01aced8c1f9e63fd892128b7" },
12 12 "lazy.nvim": {
"branch":
"main",
"commit":
"3ad55ae678876516156cca2f361c51f7952a924b" },
13 - "lush.nvim": {
"branch":
"main",
"commit":
"b10ef2bfff0647e701b691019ade3edd5e44eb50" },
13 + "lush.nvim": {
"branch":
"main",
"commit":
"2d753a67616052064db9b2c3e8c7fb55dc3956a2" },
14 14 "neodev.nvim": {
"branch":
"main",
"commit":
"da1562e1e3df0e994ddc52cb4ba22376a5d7f2fc" },
15 15 "neogen": {
"branch":
"main",
"commit":
"cb1f384df804c1bf729332c4f728253fe17962d4" },
16 16 "noice.nvim": {
"branch":
"main",
"commit":
"894db25ec726d32047799d4d0a982b701bec453b" },
19 19 "nvim-autopairs": {
"branch":
"master",
"commit":
"ae5b41ce880a6d850055e262d6dfebd362bb276e" },
20 20 "nvim-cmp": {
"branch":
"main",
"commit":
"983453e32cb35533a119725883c04436d16c0120" },
21 21 "nvim-colorizer.lua": {
"branch":
"master",
"commit":
"dde3084106a70b9a79d48f426f6d6fec6fd203f7" },
22 - "nvim-genghis": {
"branch":
"main",
"commit":
"9f04102a6f591c231dfb23b58ad3b49cd0a43c03" },
22 + "nvim-genghis": {
"branch":
"main",
"commit":
"13b773cb3935b25962b0e00ff0795cce6be2eb1e" },
23 23 "nvim-gomove": {
"branch":
"main",
"commit":
"2b44ae7ac0804f4e3959228122f7c85bef1964e3" },
24 - "nvim-lastplace": {
"branch":
"main",
"commit":
"aeb0e0bd399288092729da89a9e51dda4ccbc9ec" },
24 + "nvim-lastplace": {
"branch":
"main",
"commit":
"0bb6103c506315044872e0f84b1f736c4172bb20" },
25 25 "nvim-neoclip.lua": {
"branch":
"main",
"commit":
"4e406ae0f759262518731538f2585abb9d269bac" },
26 26 "nvim-notify": {
"branch":
"master",
"commit":
"ea9c8ce7a37f2238f934e087c255758659948e0f" },
27 - "nvim-spectre": {
"branch":
"master",
"commit":
"be7ff1d29ddf2de59b3dc293988d110c2c00ac84" },
28 27 "nvim-surround": {
"branch":
"main",
"commit":
"211eaad7c6d01ef4ac02cba9052b3082ec232101" },
29 - "nvim-treesitter": {
"branch":
"master",
"commit":
"25158a8b3916a354911928942daf185c32b19cce" },
28 + "nvim-treesitter": {
"branch":
"master",
"commit":
"e8648569d82c7bb46dc511cda9dbec687774461f" },
30 29 "nvim-ts-autotag": {
"branch":
"main",
"commit":
"6be1192965df35f94b8ea6d323354f7dc7a557e4" },
31 30 "nvim-ts-context-commentstring": {
"branch":
"main",
"commit":
"e9062e2dfb9854e6a927370f2d720de354c88524" },
32 31 "nvim-web-devicons": {
"branch":
"master",
"commit":
"efbfed0567ef4bfac3ce630524a0f6c8451c5534" },
neovim/lua/bugabinga/diagnostic.lua
Modified 48 + border = vim.g.border_style,
49 49 source =
'if_many',
50 50 header =
'Diagnostic',
51 51 prefix = prefix_format,
neovim/lua/bugabinga/lazy.lua
Modified 36 36 size = {
width =
0.69 ,
heigth =
0.69 },
37 + border = vim.g.border_style,
40 40 task = icon.terminal,
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' 10 +local ui
= require'bugabinga.ui' 11 +local table = require'std.table' 12 13 local lsp_client_configs
= require'bugabinga.lsp.clients' 156 157 local all_or_current
= command.args
and command.args
== 'all' and {}
or {
bufnr =
0 }
157 158 local active_clients
= vim.lsp.get_active_clients(all_or_current)
176 160 local infos
= vim.iter(active_clients)
177 161 :map(
function(client)
178 162 local name
= client.name
179 163 local config
= vim.iter(lsp_client_configs):find(
function(config)
return config.name
== name
end)
180 164 assert(config, (
'How did we not find a config for %s ?!?!' ):format(name))
166 + local full_cmd
= table.deep_copy(client.config.cmd)
167 + full_cmd[
1]
= vim.fn.exepath(full_cmd[
1])
185 - cmd = { client.config.cmd, client.config.cmd_cwd,
'TODO:pid',
'TODO:cpu',
'TODO:mem'},
171 + cmd =
table.
concat(full_cmd,
' '),
186 172 workspace_folders = vim.iter(client.workspace_folders):map(
function(w)
return vim.fs.normalize(w.name)
end):totable(),
187 - filetypes = config.filetypes,
173 + filetypes =
table.
concat(config.filetypes,
', '),
188 174 single_file_support = config.single_file_support,
189 175 workspaces = config.workspaces,
196 - vim.print(deep_concat(infos))
181 + ui.show_tree(infos)
184 +local lsp_info_extended = function(command)
185 + local all_or_current
= command.args
and command.args
== 'all' and {}
or {
bufnr =
0 }
186 + local active_clients
= vim.lsp.get_active_clients(all_or_current)
187 + ui.show_tree(active_clients)
199 190 vim.api.nvim_create_user_command (
'LspInfo',
204 195 desc
= 'Shows basic information about running LSP clients.',
198 +vim.api.nvim_create_user_command (
'LspInfoExtended',
202 + complete =
function()
return {
"all"}
end,
203 + desc =
'Shows detailed information about running LSP clients.',
207 205 return setmetatable(_ ,{ })
neovim/lua/bugabinga/options/ui.lua
Modified 1 - local icon
= require'std.icon' 1 +local icon
= require'std.icon' 63 63 vim.opt.pumblend
= 5 64 64 vim.opt.winblend
= 5 66 +vim.g.border_style
= 'shadow' 67 69 vim.opt.showmode
= false neovim/lua/bugabinga/plugins/heirline.lua
Modified255 255 provider =
function(self)
257 - return self.errors
> 0 and (self.error_icon
.. self.errors
.. " ")
257 + return self.errors
> 0 and (self.error_icon
.. ' ' .. self.errors
.. " ")
259 259 hl =
'DiagnosticError',
262 262 provider =
function(self)
263 - return self.warnings
> 0 and (self.warn_icon
.. self.warnings
.. " ")
263 + return self.warnings
> 0 and (self.warn_icon
.. ' ' .. self.warnings
.. " ")
265 265 hl =
'DiagnosticWarn',
268 268 provider =
function(self)
269 - return self.info
> 0 and (self.info_icon
.. self.info
.. " ")
269 + return self.info
> 0 and (self.info_icon
.. ' ' .. self.info
.. " ")
271 271 hl =
'DiagnosticInfo',
274 274 provider =
function(self)
275 - return self.hints
> 0 and (self.hint_icon
.. self.hints)
275 + return self.hints
> 0 and (self.hint_icon
.. ' ' .. self.hints)
277 277 hl =
'DiagnosticHint',
308 308 condition = is_svn_repo,
310 + update =
'BufEnter',
310 312 init =
function(self)
311 313 self.relative_url
= svn_get_relative_url()
neovim/lua/bugabinga/plugins/neoclip.lua
Modified 2 2 local map
= require'std.keymap' 5 5 'AckslD/nvim-neoclip.lua',
6 + event =
'TextYankPost',
6 7 keys = {
'y',
'<C-v><C-v>' },
8 9 'nvim-telescope/telescope.nvim',
neovim/lua/bugabinga/plugins/noice.lua
Modified 28 28 size
= {
width =
'auto',
height =
'auto'},
31 - border = {
style =
"shadow" },
31 + border = {
style = vim.g.border_style},
34 - border = {
style =
"shadow" },
34 + border = {
style = vim.g.border_style},
37 - border = {
style =
"shadow" },
37 + border = {
style = vim.g.border_style},
38 38 position = {
row =
-2,
col =
2 },
42 42 relative
= "cursor",
43 43 position
= {
row =
0,
col =
0 },
44 44 size
= {
min_width =
42,
width =
'auto',
height =
'auto'},
45 - border
= {
style =
"shadow" },
45 + border
= {
style = vim.g.border_style},
47 47 cmdline_popupmenu
= {
48 48 relative =
"cursor",
49 49 position = {
row =
1,
col =
0 },
50 50 size = {
min_width =
42,
width =
"auto",
height =
'auto' },
51 - border = {
style =
"shadow",
padding = {
0,
1 } },
51 + border = {
style =vim.g.border_style,
padding = {
0,
1 } },
52 52 win_options = {
winhighlight = {
Normal =
"Normal",
FloatBorder =
"NoiceCmdlinePopupBorder" } },
143 143 local shadow_fade = function(
...)
144 144 local opts
= fade[
1](
...)
146 - opts.border
= 'shadow' 146 + opts.border
= vim.g.border_style
147 147 opts.row
= opts.row
- 1 neovim/lua/bugabinga/plugins/oil.lua
Modified29 29 [
"<C-h>"]
= "actions.toggle_hidden",
32 + border = vim.g.border_style,
34 34 win_options = {
winblend =
10 },
neovim/lua/bugabinga/plugins/toggleterm.lua
Modified 32 32 open_mapping
= '<F7>',
33 33 direction
= "float",
35 + border = vim.g.border_style,
38 38 size = function(term)
neovim/lua/bugabinga/ui.lua
Addednew file mode 100644 1 +local want
= require'std.want' 2 +local display
= require'std.display' 14 + local get_nui_popup = function()
15 + local popup
= NuiPopup{
16 + relative =
'editor',
25 + style = vim.g.border_style,
32 + popup:map(
"n",
"q",
function() popup:unmount()
end, {
noremap =
true })
37 + show_tree =
function(tree)
38 + local popup
= get_nui_popup()
39 + local bufnr
= popup.bufnr
40 + local text, _
= display(tree)
42 + local line_number
= 1 43 + for line
in text:gmatch(
'[^\r\n]+')
do 44 + local nui_line
= NuiLine()
45 + nui_line:append(NuiText(line,
'NormalFloat'))
46 + nui_line:render(bufnr,
-1, line_number)
47 + line_number
= line_number
+ 1 neovim/lua/std/display.lua
Addednew file mode 100644 1 +local icon
= require'std.icon' 2 +local table = require'std.table' 4 +local function display(value)
6 + return 'nil',
'Special' 9 + local value_type
= type(value)
11 + if value_type
== 'string' then 12 + return icon.quot_left
.. ' ' .. value
.. ' ' .. icon.quot_right,
'String' 15 + if value_type
== 'number' then 16 + return icon.hash
.. ' ' .. tostring(value),
'Number' 19 + if value_type
== 'boolean' then 20 + local mark
= value
and icon.checkbox_mark
or icon.checkbox_unmark
21 + return mark,
'Boolean' 24 + if value_type
== 'userdata' then 25 + local ud
= icon.user
.. icon.data
26 + return ud
.. ' ' .. tostring(value),
'Identifier' 29 + if value_type
== 'thread' then 30 + local thread
= icon.thread
31 + return thread
.. ' ' .. tostring(value),
'Identifier' 34 + if value_type
== 'function' then 35 + local fn
= icon[
'function']
36 + return fn
.. ' ' .. tostring(value),
'Function' 39 + if value_type
== 'table' then 40 + return table.deep_concat(value, {
render_value = display}),
'Identifier' neovim/lua/std/icon.lua
Modified13 - linehighlight =
'',
18 - carriage_return =
'␍',
11 + checkbox_mark =
'',
12 + checkbox_unmark =
'',
23 + linehighlight =
'',
28 + carriage_return =
'␍',
neovim/lua/std/project.lua
Modified182 182 local find_lua_nvim_project_root = function()
183 - return find_root(
nil, join(lua_markers, nvim_lua_markers))
183 + return find_root(
nil, nvim_lua_markers)
neovim/lua/std/table/deep_concat.lua
Modified 1 -return function(some_table, prefix, suffix, key_value_delimiter, row_delimiter, fill, newline)
1 +return function( some_table, options)
2 + options
= options
or {}
3 5 some_table = { some_table,
'table'},
4 - prefix = {prefix,
'string',
true},
5 - suffix = {suffix,
'string',
true},
6 - fill = {fill,
'string',
true},
7 - key_value_delimiter = {key_value_delimiter,
'string',
true},
8 - row_delimiter = {row_delimiter,
'string',
true},
9 - newline = {newline,
'string',
true},
6 + [
'options.prefix' ] = {options.prefix,
'string',
true},
7 + [
'options.suffix' ] = {options.suffix,
'string',
true},
8 + [
'options.fill' ] = {options.fill,
'string',
true},
9 + [
'options.key_value_delimiter' ] = {options.key_value_delimiter,
'string',
true},
10 + [
'options.row_delimiter' ] = {options.row_delimiter,
'string',
true},
11 + [
'options.newline' ] = {options.newline,
'string',
true},
12 + [
'options.render_key' ] = {options.render_key,
'function',
true},
13 + [
'options.render_value' ] = {options.render_value,
'function',
true},
11 - prefix
= prefix
or '⦃' 12 - suffix
= suffix
or '⦄' 13 - key_value_delimiter
= key_value_delimiter
or ' ≔ ' 14 - row_delimiter
= row_delimiter
or ',' 16 - newline
= newline
or '\n' 16 + local prefix
= options.prefix
or '⦃' 17 + local suffix
= options.suffix
or '⦄' 18 + local key_value_delimiter
= options.key_value_delimiter
or ' ≔ ' 19 + local row_delimiter
= options.row_delimiter
or ',' 20 + local fill
= options.fill
or ' ' 21 + local newline
= options.newline
or '\n' 22 + local render_key
= options.render_key
or function(key)
return type(key)
== 'number' and (
'['..key
..']')
or key
end 23 + local render_value
= options.render_value
or function(value)
return tostring(value):gsub(
'\n',
'')
end 17 24 local string_builder
= {}
18 25 local append = function(thing)
table.
insert(string_builder, thing)
end 19 - local render_key = function(key)
return type(key)
== 'number' and (
'['..key
..']')
or key
end 20 - local render_value = function(value)
return tostring(value):gsub(
'\n',
'')
end 21 27 local function deep_concat_table (tbl, level)
23 29 if newline
then append(fill:rep(level))
end neovim/lua/std/table/deep_copy.lua
Addednew file mode 100644 1 +local function deep_copy(any)
2 + if type(any)
~= 'table' then return any
end 5 + for key, value
in pairs(any)
do 6 + result[key]
= deep_copy(value)
neovim/lua/std/table/human_readable.lua
Deleteddeleted file mode 100644No text changes.
neovim/lua/std/table/init.lua
Modified 5 - human_readable =
require'std.table.human_readable',
6 3 deep_concat =
require'std.table.deep_concat',
4 + deep_copy =
require'std.table.deep_copy',
7 5 join =
require'std.table.join',
9 7 add_reverse_lookup = vim.tbl_add_reverse_lookup,
22 20 values
= vim.tbl_values,
24 22 concat
= table.
concat,
25 - foreach
= table.foreach,
26 - foreachi
= table.foreachi,
27 23 insert
= table.
insert,
29 25 remove
= table.
remove,
9 9 let-env TERM =
if (
$env | get -i TERM_PROGRAM) == WezTerm {
"wezterm" }
else {
"xterm-256color" }
12 -let-env LS_COLORS = ( try { vivid generate nord } catch {
"" } )
wezterm/wezterm.service
Deleteddeleted file mode 100644 2 -Description=Wezterm Multiplexing Server
3 -After=gnome-session.target
6 -ExecStart=/usr/bin/wezterm-mux-server
10 -WantedBy=gnome-session.target