galaxy-line.lua 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199
  1. -- require'nvim-web-devicons'.setup()
  2. local gl = require('galaxyline')
  3. local gls = gl.section
  4. gl.short_line_list = {'LuaTree','vista','dbui'}
  5. local colors = {
  6. bg = '#282c34',
  7. yellow = '#fabd2f',
  8. cyan = '#008080',
  9. darkblue = '#081633',
  10. green = '#afd700',
  11. orange = '#FF8800',
  12. purple = '#5d4d7a',
  13. magenta = '#d16d9e',
  14. grey = '#c0c0c0',
  15. blue = '#0087d7',
  16. red = '#ec5f67'
  17. }
  18. local buffer_not_empty = function()
  19. if vim.fn.empty(vim.fn.expand('%:t')) ~= 1 then
  20. return true
  21. end
  22. return false
  23. end
  24. gls.left[1] = {
  25. FirstElement = {
  26. -- provider = function() return '▋' end,
  27. provider = function() return ' ' end,
  28. highlight = {colors.bg,colors.purple}
  29. },
  30. }
  31. gls.left[2] = {
  32. ViMode = {
  33. provider = function()
  34. local alias = {n = 'NORMAL',i = 'INSERT',c= 'COMMAND',V= 'VISUAL', [''] = 'VISUAL'}
  35. return alias[vim.fn.mode()]
  36. end,
  37. separator = ' ',
  38. separator_highlight = {colors.yellow,function()
  39. if not buffer_not_empty() then
  40. return colors.purple
  41. end
  42. return colors.purple
  43. end},
  44. highlight = {colors.grey,colors.purple,'bold'},
  45. },
  46. }
  47. -- gls.left[3] ={
  48. -- FileIcon = {
  49. -- separator = ' ',
  50. -- provider = 'FileIcon',
  51. -- condition = buffer_not_empty,
  52. -- highlight = {require('galaxyline.provider_fileinfo').get_file_icon_color,colors.bg},
  53. -- },
  54. -- }
  55. -- gls.left[4] = {
  56. -- FileName = {
  57. -- provider = {'FileSize'},
  58. -- condition = buffer_not_empty,
  59. -- separator = ' ',
  60. -- separator_highlight = {colors.purple,colors.bg},
  61. -- highlight = {colors.magenta,colors.bg}
  62. -- }
  63. -- }
  64. gls.left[5] = {
  65. GitIcon = {
  66. provider = function() return '  ' end,
  67. condition = buffer_not_empty,
  68. highlight = {colors.orange,colors.bg},
  69. }
  70. }
  71. gls.left[6] = {
  72. GitBranch = {
  73. provider = 'GitBranch',
  74. condition = buffer_not_empty,
  75. highlight = {colors.grey,colors.bg},
  76. }
  77. }
  78. local checkwidth = function()
  79. local squeeze_width = vim.fn.winwidth(0) / 2
  80. if squeeze_width > 40 then
  81. return true
  82. end
  83. return false
  84. end
  85. -- gls.left[7] = {
  86. -- DiffAdd = {
  87. -- provider = 'DiffAdd',
  88. -- condition = checkwidth,
  89. -- icon = ' ',
  90. -- highlight = {colors.green,colors.purple},
  91. -- }
  92. -- }
  93. -- gls.left[8] = {
  94. -- DiffModified = {
  95. -- provider = 'DiffModified',
  96. -- condition = checkwidth,
  97. -- icon = ' ',
  98. -- highlight = {colors.orange,colors.purple},
  99. -- }
  100. -- }
  101. -- gls.left[9] = {
  102. -- DiffRemove = {
  103. -- provider = 'DiffRemove',
  104. -- condition = checkwidth,
  105. -- icon = ' ',
  106. -- highlight = {colors.red,colors.purple},
  107. -- }
  108. -- }
  109. gls.left[10] = {
  110. LeftEnd = {
  111. provider = function() return ' ' end,
  112. separator = ' ',
  113. separator_highlight = {colors.purple,colors.bg},
  114. highlight = {colors.purple,colors.bg}
  115. }
  116. }
  117. gls.left[11] = {
  118. DiagnosticError = {
  119. provider = 'DiagnosticError',
  120. icon = '  ',
  121. highlight = {colors.red,colors.bg}
  122. }
  123. }
  124. gls.left[12] = {
  125. Space = {
  126. provider = function () return '' end
  127. }
  128. }
  129. gls.left[13] = {
  130. DiagnosticWarn = {
  131. provider = 'DiagnosticWarn',
  132. icon = '  ',
  133. highlight = {colors.blue,colors.bg},
  134. }
  135. }
  136. gls.right[1]= {
  137. FileFormat = {
  138. provider = 'FileFormat',
  139. separator = ' ',
  140. separator_highlight = {colors.bg,colors.purple},
  141. highlight = {colors.grey,colors.purple},
  142. }
  143. }
  144. gls.right[2] = {
  145. LineInfo = {
  146. provider = 'LineColumn',
  147. separator = ' | ',
  148. separator_highlight = {colors.darkblue,colors.purple},
  149. highlight = {colors.grey,colors.purple},
  150. },
  151. }
  152. gls.right[3] = {
  153. PerCent = {
  154. provider = 'LinePercent',
  155. separator = ' ',
  156. separator_highlight = {colors.darkblue,colors.purple},
  157. highlight = {colors.grey,colors.darkblue},
  158. }
  159. }
  160. gls.right[4] = {
  161. ScrollBar = {
  162. provider = 'ScrollBar',
  163. highlight = {colors.yellow,colors.purple},
  164. }
  165. }
  166. -- gls.short_line_left[1] = {
  167. -- BufferType = {
  168. -- provider = 'FileTypeName',
  169. -- separator = ' ',
  170. -- separator_highlight = {colors.purple,colors.bg},
  171. -- highlight = {colors.grey,colors.purple}
  172. -- }
  173. -- }
  174. gls.short_line_left[1] = {
  175. LeftEnd = {
  176. provider = function() return ' ' end,
  177. separator = ' ',
  178. separator_highlight = {colors.purple,colors.bg},
  179. highlight = {colors.purple,colors.bg}
  180. }
  181. }
  182. -- gls.short_line_right[1] = {
  183. -- BufferIcon = {
  184. -- provider= 'BufferIcon',
  185. -- separator = ' ',
  186. -- separator_highlight = {colors.purple,colors.bg},
  187. -- highlight = {colors.grey,colors.purple}
  188. -- }
  189. -- }