/ nvim / lua / plugins / lualine.lua
lualine.lua
 1  --- Statusline. May use trouble for symbols. Customizations from original Lazy spec.
 2  return {
 3    specs = {
 4      { src = 'https://github.com/nvim-lualine/lualine.nvim', name = 'lualine.nvim' },
 5    },
 6    config = function()
 7      local lualine = require('lualine')
 8      if type(lualine) ~= 'table' or not lualine.setup then
 9        return
10      end
11      local opts = {
12        options = { theme = 'auto' },
13        sections = {
14          lualine_a = { 'mode' },
15          lualine_b = { 'branch', 'diff', 'diagnostics' },
16          lualine_c = { 'filename' },
17          lualine_x = { 'encoding', 'fileformat', 'filetype' },
18          lualine_y = { 'progress' },
19          lualine_z = { 'location' },
20        },
21      }
22      local trouble_ok, trouble = pcall(require, 'trouble')
23      if trouble_ok and type(trouble) == 'table' and trouble.statusline then
24        local symbols = trouble.statusline({
25          mode = 'lsp_document_symbols',
26          groups = {},
27          title = false,
28          filter = { range = true },
29          format = '{kind_icon}{symbol.name:Normal}',
30          hl_group = 'lualine_c_normal',
31        })
32        table.insert(opts.sections.lualine_c, { symbols.get, cond = symbols.has })
33      end
34      lualine.setup(opts)
35    end,
36  }