lualine-conf.lua 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. local lualine = require('lualine')
  2. -- Custom component for Wordcount (only text and markdown)
  3. local function wordcount()
  4. if vim.bo.filetype == "markdown" or vim.bo.filetype == "text" then
  5. return tostring(vim.fn.wordcount().words) .. " words"
  6. else
  7. return ""
  8. end
  9. end
  10. -- Custom component for Gradle build status (vim-android)
  11. local function gradle_status()
  12. if vim.fn.exists('*lightline#gradle#running') == 1 then
  13. local status = vim.fn['lightline#gradle#running']()
  14. if status and status ~= '' then
  15. return status
  16. end
  17. end
  18. return ""
  19. end
  20. lualine.setup({
  21. options = {
  22. theme = 'auto',
  23. globalstatus = true,
  24. component_separators = { left = '', right = ''},
  25. section_separators = { left = '', right = ''},
  26. },
  27. sections = {
  28. lualine_a = {'mode'},
  29. lualine_b = {'branch', 'diff', 'diagnostics'},
  30. lualine_c = {'filename'},
  31. lualine_x = {gradle_status, 'encoding', 'fileformat', 'filetype'},
  32. lualine_y = {'progress', wordcount},
  33. lualine_z = {'location'}
  34. },
  35. })