feat: display LSP source on statusline

This commit is contained in:
NotAShelf 2023-06-07 02:36:02 +03:00
parent acf14daea2
commit 0c01fbc121
No known key found for this signature in database
GPG key ID: F0D14CCB5ED5AA22
3 changed files with 25 additions and 3 deletions

View file

@ -12,13 +12,14 @@ in {
]; ];
vim.luaConfigRC.lualine = nvim.dag.entryAnywhere '' vim.luaConfigRC.lualine = nvim.dag.entryAnywhere ''
require('lualine').setup { local lualine = require('lualine')
lualine.setup {
options = { options = {
icons_enabled = ${boolToString cfg.icons.enable}, icons_enabled = ${boolToString cfg.icons.enable},
theme = "${cfg.theme}", theme = "${cfg.theme}",
component_separators = {"${cfg.componentSeparator.left}","${cfg.componentSeparator.right}"}, component_separators = {"${cfg.componentSeparator.left}","${cfg.componentSeparator.right}"},
section_separators = {"${cfg.sectionSeparator.left}","${cfg.sectionSeparator.right}"}, section_separators = {"${cfg.sectionSeparator.left}","${cfg.sectionSeparator.right}"},
disabled_filetypes = { 'alpha' }, -- 'NvimTree' disabled_filetypes = { 'alpha' },
always_divide_middle = true, always_divide_middle = true,
globalstatus = ${boolToString cfg.globalStatus}, globalstatus = ${boolToString cfg.globalStatus},
ignore_focus = {'NvimTree'}, ignore_focus = {'NvimTree'},

View file

@ -183,6 +183,25 @@ in {
description = "active config for: | A | B | C (X) | Y | Z |"; description = "active config for: | A | B | C (X) | Y | Z |";
default = '' default = ''
{ {
{
-- Lsp server name .
function()
local msg = 'No Active Lsp'
local buf_ft = vim.api.nvim_buf_get_option(0, 'filetype')
local clients = vim.lsp.get_active_clients()
if next(clients) == nil then
return msg
end
for _, client in ipairs(clients) do
local filetypes = client.config.filetypes
if filetypes and vim.fn.index(filetypes, buf_ft) ~= -1 then
return client.name
end
end
return msg
end,
icon = ' ',
},
{ {
"diagnostics", "diagnostics",
sources = {'nvim_lsp', 'nvim_diagnostic', 'coc'}, sources = {'nvim_lsp', 'nvim_diagnostic', 'coc'},
@ -227,7 +246,6 @@ in {
separator = { separator = {
left = '', left = '',
}, },
}, },
{ {
"location", "location",

View file

@ -15,6 +15,9 @@ in {
vim.luaConfigRC.modes-nvim = nvim.dag.entryAnywhere '' vim.luaConfigRC.modes-nvim = nvim.dag.entryAnywhere ''
require('modes').setup({ require('modes').setup({
set_cursorline = ${boolToString cfg.setCursorline}, set_cursorline = ${boolToString cfg.setCursorline},
line_opacity = {
visual = 0,
},
colors = { colors = {
copy = "${toString cfg.colors.copy}", copy = "${toString cfg.colors.copy}",
delete = "${toString cfg.colors.delete}", delete = "${toString cfg.colors.delete}",