summaryrefslogtreecommitdiff
path: root/lua/config/99-lualine-config.lua
blob: 37b882197dfc813208afc2bcfb04498787c1721f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
-- Based on the original lua/lualinesetup.lua.
local function clients_lsp()
  local clients = vim.lsp.get_clients({ bufnr = 0 })
  if #clients == 0 then return '' end
  local names = {}
  for _, client in ipairs(clients) do names[#names + 1] = client.name end
  return '\u{f085}  ' .. table.concat(names, ',')
end

require('lualine').setup({
  options = {
    -- The old 'meltdown' theme needs a lualine/themes/meltdown.lua file.
    -- 'auto' works even if that theme is absent.
    theme = 'auto',
    component_separators = '',
    section_separators = { left = '', right = '' },
  },
  sections = {
    lualine_a = { 'mode' },
    lualine_b = { 'branch', 'diff', 'diagnostics' },
    lualine_c = { 'filename' },
    lualine_x = {},
    lualine_y = {
      { clients_lsp, color = { fg = '#80a0ff' } },
      { 'encoding', color = { fg = '#80a0ff' } },
      { 'fileformat', color = { fg = '#ffb700' } },
      { 'filetype', color = { fg = '#80a0ff' } },
      'progress',
    },
    lualine_z = { 'location' },
  },
})