all repos

init.lua @ 6b7b2e0

my nvim config

init.lua/lua/configs/lualine.lua(view raw)

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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
local c = {
  mode = {
    function()
      return " "
    end,
    padding = 0,
  },
  diagnostic = { "diagnostics", sources = { "nvim_diagnostic" } },
  location = { "location", padding = 1, colored = false },
  sep = {
    function()
      return "|"
    end,
    padding = 0,
  },
  lsp = {
    function()
      local clients = vim.lsp.get_active_clients { bufnr = 0 }
      local client_names = {}
      for _, client in pairs(clients) do
        if client.name ~= "null-ls" then
          table.insert(client_names, client.name)
        end
      end

      local client_names_str = table.concat(client_names, ", ")
      if #client_names_str == 0 then
        return ""
      else
        return "[" .. client_names_str .. "]"
      end
    end,
  },
}

require("lualine").setup {
  options = {
    theme = "tokyonight",
    globalstatus = true,
    component_separators = { left = "", right = "" },
    section_separators = { left = "", right = "" },
    disabled_filetypes = {
      "NvimTree",
      "TelescopePrompt",
      "NeogitStatus",
      "packer",
    },
  },
  sections = {
    lualine_a = { c.mode },
    lualine_b = {},
    lualine_c = { "filename", c.sep, "branch", c.diagnostic },
    lualine_x = { c.lsp, "diff" },
    lualine_y = {},
    lualine_z = { c.location },
  },
}