all repos

init.lua @ 4fa6aad

my nvim config

init.lua/lua/plugins/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
58
59
60
61
local c = {
  mode = {
    function()
      return " "
    end,
    padding = 0,
  },
  diagnostic = { "diagnostics", sources = { "nvim_diagnostic" } },
  location = { "location", padding = 1, colored = false },
  lsp = {
    function()
      local clients = vim.lsp.get_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,
  },
  harpoon_status = {
    require("scratch.harpoon_status").status,
    cond = require("scratch.harpoon_status").exists,
  },
}

---@type LazySpec
return {
  "nvim-lualine/lualine.nvim",
  event = "VeryLazy",
  opts = {
    options = {
      theme = "tokyonight",
      globalstatus = true,
      component_separators = { left = "", right = "" },
      section_separators = { left = "", right = "" },
      disabled_filetypes = {
        "NvimTree",
        "TelescopePrompt",
        "NeogitStatus",
        "harpoon",
        "lazy",
      },
    },
    sections = {
      lualine_a = { c.mode },
      lualine_b = {},
      lualine_c = { c.harpoon_status, "filename", "branch", c.diagnostic },
      lualine_x = { c.lsp, "diff" },
      lualine_y = {},
      lualine_z = { c.location },
    },
  },
}