You've already forked dotfiles
feat: Starting the cleanup on DAP plugins and adding a basic statusline
to futz around with potential replacement of more external plugins.
This commit is contained in:
26
nvim/lua/statusline.lua
Normal file
26
nvim/lua/statusline.lua
Normal file
@@ -0,0 +1,26 @@
|
||||
local function lsp_status()
|
||||
local attached_clients = vim.lsp.get_clients({ bufnr = 0 })
|
||||
if #attached_clients == 0 then
|
||||
return ''
|
||||
end
|
||||
local names = vim.iter(attached_clients)
|
||||
:map(function (client)
|
||||
local name = client.name:gsub('language.server', 'ls')
|
||||
return name
|
||||
end)
|
||||
:totable()
|
||||
return '[' .. table.concat(names, ', ') .. ']'
|
||||
end
|
||||
|
||||
function _G.statusline()
|
||||
return table.concat({
|
||||
'%f',
|
||||
'%h%w%m%r',
|
||||
'%=',
|
||||
lsp_status(),
|
||||
' %-14(%l,%c%V%)',
|
||||
'%P',
|
||||
}, ' ')
|
||||
end
|
||||
|
||||
vim.o.statusline = '%{%v:lua._G.statusline()%}'
|
||||
Reference in New Issue
Block a user