lualine.lua 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. local status_ok, lualine = pcall(require, "lualine")
  2. if not status_ok then
  3. return
  4. end
  5. local theme = require('lualine.themes.catppuccin')
  6. theme.normal.c.bg = nil
  7. local hide_in_width = function()
  8. return vim.fn.winwidth(0) > 80
  9. end
  10. local diagnostics = {
  11. "diagnostics",
  12. sources = { "coc" },
  13. sections = { "error", "warn", "info" },
  14. symbols = { error = " ", warn = " ", info = " " },
  15. colored = true,
  16. update_in_insert = false,
  17. always_visible = false,
  18. }
  19. local diff = {
  20. "diff",
  21. colored = true,
  22. symbols = { added = " ", modified = " ", removed = " " }, -- changes diff symbols
  23. cond = hide_in_width
  24. }
  25. local mode = {
  26. "mode",
  27. colored = false,
  28. }
  29. local location = {
  30. "location",
  31. fmt = function(str)
  32. return str .. " "
  33. end,
  34. padding = 0,
  35. }
  36. lualine.setup({
  37. options = {
  38. icons_enabled = true,
  39. theme = theme,
  40. component_separators = { left = "", right = "" },
  41. section_separators = { left = "", right = "" },
  42. disabled_filetypes = { "alpha", "dashboard", "NvimTree", "Outline" },
  43. always_divide_middle = true,
  44. },
  45. sections = {
  46. lualine_a = { mode },
  47. lualine_b = { "filetype" },
  48. lualine_c = { diff, diagnostics },
  49. lualine_x = {},
  50. lualine_y = {},
  51. lualine_z = {},
  52. },
  53. inactive_sections = {
  54. lualine_a = { mode },
  55. lualine_b = {},
  56. lualine_c = {},
  57. lualine_x = {},
  58. lualine_y = {},
  59. lualine_z = {},
  60. },
  61. tabline = {},
  62. extensions = {},
  63. })