mirror of
https://github.com/LunarVim/LunarVim.git
synced 2025-08-01 08:35:36 +02:00
new galaxyline
This commit is contained in:
parent
95635dbe43
commit
edabd42359
3 changed files with 160 additions and 206 deletions
|
@ -55,14 +55,13 @@ go get github.com/mattn/efm-langserver@HEAD
|
||||||
**HIGH PRIORITY**
|
**HIGH PRIORITY**
|
||||||
- formatting using efm server for prettier/eslint
|
- formatting using efm server for prettier/eslint
|
||||||
- learn what opt is
|
- learn what opt is
|
||||||
- better install script
|
- better install script, support both nvim and nvcode paths
|
||||||
- learn nvim-dap in depth
|
- learn nvim-dap in depth
|
||||||
- snippet support
|
- snippet support
|
||||||
- for vsnip :h vim-vsnip, also figure out what integr does
|
- for vsnip :h vim-vsnip, also figure out what integr does
|
||||||
|
|
||||||
**LOW PRIORITY**
|
**LOW PRIORITY**
|
||||||
- redo barbar highlight groups
|
- redo barbar highlight groups
|
||||||
- more handsome/modern galaxyline
|
|
||||||
- make java code actions prettier
|
- make java code actions prettier
|
||||||
- figure out how to customize java formatting
|
- figure out how to customize java formatting
|
||||||
- setup junit tests for java
|
- setup junit tests for java
|
||||||
|
|
2
init.lua
2
init.lua
|
@ -39,7 +39,6 @@ else
|
||||||
|
|
||||||
-- LSP
|
-- LSP
|
||||||
require('lsp')
|
require('lsp')
|
||||||
require('lsp.efm-general-ls')
|
|
||||||
require('lsp.lua-ls')
|
require('lsp.lua-ls')
|
||||||
require('lsp.bash-ls')
|
require('lsp.bash-ls')
|
||||||
require('lsp.js-ts-ls')
|
require('lsp.js-ts-ls')
|
||||||
|
@ -51,5 +50,6 @@ else
|
||||||
require('lsp.css-ls')
|
require('lsp.css-ls')
|
||||||
require('lsp.docker-ls')
|
require('lsp.docker-ls')
|
||||||
require('lsp.html-ls')
|
require('lsp.html-ls')
|
||||||
|
require('lsp.efm-general-ls')
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -1,226 +1,181 @@
|
||||||
-- require'nvim-web-devicons'.setup()
|
|
||||||
|
|
||||||
local gl = require('galaxyline')
|
local gl = require('galaxyline')
|
||||||
local gls = gl.section
|
-- get my theme in galaxyline repo
|
||||||
gl.short_line_list = {'LuaTree','vista','dbui'}
|
-- local colors = require('galaxyline.theme').default
|
||||||
|
|
||||||
local colors = {
|
local colors = {
|
||||||
bg = '#282c34',
|
bg = '#282c34',
|
||||||
yellow = '#fabd2f',
|
yellow = '#fabd2f',
|
||||||
cyan = '#008080',
|
cyan = '#008080',
|
||||||
darkblue = '#081633',
|
|
||||||
green = '#608B4E',
|
green = '#608B4E',
|
||||||
orange = '#FF8800',
|
orange = '#FF8800',
|
||||||
purple = '#5d4d7a',
|
purple = '#C586C0',
|
||||||
magenta = '#d16d9e',
|
magenta = '#d16d9e',
|
||||||
grey = '#c0c0c0',
|
grey = '#abb2bf',
|
||||||
blue = '#569CD6',
|
blue = '#569CD6',
|
||||||
red = '#D16969'
|
red = '#D16969'
|
||||||
}
|
}
|
||||||
|
local condition = require('galaxyline.condition')
|
||||||
|
local gls = gl.section
|
||||||
|
gl.short_line_list = {'NvimTree', 'vista', 'dbui', 'packer'}
|
||||||
|
|
||||||
local buffer_not_empty = function()
|
gls.left[1] = {
|
||||||
if vim.fn.empty(vim.fn.expand('%:t')) ~= 1 then
|
|
||||||
return true
|
|
||||||
end
|
|
||||||
return false
|
|
||||||
end
|
|
||||||
|
|
||||||
gls.left[2] = {
|
|
||||||
ViMode = {
|
ViMode = {
|
||||||
provider = function()
|
provider = function()
|
||||||
-- auto change color according the vim mode
|
-- auto change color according the vim mode
|
||||||
local mode_color = {n = colors.purple,
|
local mode_color = {
|
||||||
|
n = colors.blue,
|
||||||
i = colors.green,
|
i = colors.green,
|
||||||
v = colors.blue,
|
v = colors.purple,
|
||||||
[''] = colors.blue,
|
[''] = colors.purple,
|
||||||
V = colors.blue,
|
V = colors.purple,
|
||||||
c = colors.purple,
|
c = colors.magenta,
|
||||||
no = colors.magenta,
|
no = colors.blue,
|
||||||
s = colors.orange,
|
s = colors.orange,
|
||||||
S = colors.orange,
|
S = colors.orange,
|
||||||
[''] = colors.orange,
|
[''] = colors.orange,
|
||||||
ic = colors.yellow,
|
ic = colors.yellow,
|
||||||
R = colors.red,
|
R = colors.red,
|
||||||
Rv = colors.red,
|
Rv = colors.red,
|
||||||
cv = colors.red,
|
cv = colors.blue,
|
||||||
ce=colors.red,
|
ce = colors.blue,
|
||||||
r = colors.cyan,
|
r = colors.cyan,
|
||||||
rm = colors.cyan,
|
rm = colors.cyan,
|
||||||
['r?'] = colors.cyan,
|
['r?'] = colors.cyan,
|
||||||
['!'] = colors.red,
|
['!'] = colors.blue,
|
||||||
t = colors.red}
|
t = colors.blue
|
||||||
vim.api.nvim_command('hi GalaxyViMode guibg='..mode_color[vim.fn.mode()])
|
}
|
||||||
return ' NVCode '
|
vim.api.nvim_command('hi GalaxyViMode guifg=' .. mode_color[vim.fn.mode()])
|
||||||
end,
|
return '▊ '
|
||||||
separator = ' ',
|
end,
|
||||||
separator_highlight = {colors.yellow,function()
|
highlight = {colors.red, colors.bg, 'bold'}
|
||||||
if not buffer_not_empty() then
|
}
|
||||||
return colors.bg
|
}
|
||||||
end
|
|
||||||
return colors.bg
|
gls.left[2] = {
|
||||||
end},
|
GitIcon = {
|
||||||
highlight = {colors.grey,colors.bg,'bold'},
|
provider = function()
|
||||||
},
|
return ' '
|
||||||
|
end,
|
||||||
|
condition = condition.check_git_workspace,
|
||||||
|
separator = ' ',
|
||||||
|
separator_highlight = {'NONE', colors.bg},
|
||||||
|
highlight = {colors.orange, colors.bg, 'bold'}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
-- gls.left[3] ={
|
|
||||||
-- FileIcon = {
|
|
||||||
-- separator = ' ',
|
|
||||||
-- provider = 'FileIcon',
|
|
||||||
-- condition = buffer_not_empty,
|
|
||||||
-- highlight = {require('galaxyline.provider_fileinfo').get_file_icon_color,colors.bg},
|
|
||||||
-- },
|
|
||||||
-- }
|
|
||||||
-- gls.left[4] = {
|
|
||||||
-- FileName = {
|
|
||||||
-- provider = {'FileSize'},
|
|
||||||
-- condition = buffer_not_empty,
|
|
||||||
-- separator = ' ',
|
|
||||||
-- separator_highlight = {colors.purple,colors.bg},
|
|
||||||
-- highlight = {colors.magenta,colors.bg}
|
|
||||||
-- }
|
|
||||||
-- }
|
|
||||||
|
|
||||||
gls.left[3] = {
|
gls.left[3] = {
|
||||||
GitIcon = {
|
|
||||||
provider = function() return ' ' end,
|
|
||||||
condition = buffer_not_empty,
|
|
||||||
highlight = {colors.orange,colors.bg},
|
|
||||||
}
|
|
||||||
}
|
|
||||||
gls.left[4] = {
|
|
||||||
GitBranch = {
|
GitBranch = {
|
||||||
provider = 'GitBranch',
|
provider = 'GitBranch',
|
||||||
|
condition = condition.check_git_workspace,
|
||||||
separator = '',
|
separator = '',
|
||||||
separator_highlight = {colors.purple,colors.bg},
|
separator_highlight = {'NONE', colors.bg},
|
||||||
condition = buffer_not_empty,
|
highlight = {colors.grey, colors.bg, 'bold'}
|
||||||
highlight = {colors.grey,colors.bg},
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
local checkwidth = function()
|
gls.left[4] = {
|
||||||
local squeeze_width = vim.fn.winwidth(0) / 2
|
|
||||||
if squeeze_width > 40 then
|
|
||||||
return true
|
|
||||||
end
|
|
||||||
return false
|
|
||||||
end
|
|
||||||
|
|
||||||
gls.left[5] = {
|
|
||||||
DiffAdd = {
|
DiffAdd = {
|
||||||
provider = 'DiffAdd',
|
provider = 'DiffAdd',
|
||||||
condition = checkwidth,
|
condition = condition.hide_in_width,
|
||||||
-- separator = ' ',
|
icon = ' ',
|
||||||
-- separator_highlight = {colors.purple,colors.bg},
|
highlight = {colors.green, colors.bg}
|
||||||
icon = ' ',
|
}
|
||||||
highlight = {colors.green,colors.bg},
|
}
|
||||||
|
gls.left[5] = {
|
||||||
|
DiffModified = {
|
||||||
|
provider = 'DiffModified',
|
||||||
|
condition = condition.hide_in_width,
|
||||||
|
icon = ' 柳',
|
||||||
|
highlight = {colors.orange, colors.bg}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
gls.left[6] = {
|
gls.left[6] = {
|
||||||
DiffModified = {
|
|
||||||
provider = 'DiffModified',
|
|
||||||
condition = checkwidth,
|
|
||||||
-- separator = ' ',
|
|
||||||
-- separator_highlight = {colors.purple,colors.bg},
|
|
||||||
icon = ' ',
|
|
||||||
highlight = {colors.blue,colors.bg},
|
|
||||||
}
|
|
||||||
}
|
|
||||||
gls.left[7] = {
|
|
||||||
DiffRemove = {
|
DiffRemove = {
|
||||||
provider = 'DiffRemove',
|
provider = 'DiffRemove',
|
||||||
condition = checkwidth,
|
condition = condition.hide_in_width,
|
||||||
-- separator = ' ',
|
icon = ' ',
|
||||||
-- separator_highlight = {colors.purple,colors.bg},
|
highlight = {colors.red, colors.bg}
|
||||||
icon = ' ',
|
|
||||||
highlight = {colors.red,colors.bg},
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
gls.left[8] = {
|
|
||||||
LeftEnd = {
|
gls.right[1] = {
|
||||||
provider = function() return ' ' end,
|
|
||||||
separator = ' ',
|
|
||||||
separator_highlight = {colors.purple,colors.bg},
|
|
||||||
highlight = {colors.purple,colors.bg}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
gls.left[9] = {
|
|
||||||
DiagnosticError = {
|
DiagnosticError = {
|
||||||
provider = 'DiagnosticError',
|
provider = 'DiagnosticError',
|
||||||
icon = ' ',
|
icon = ' ',
|
||||||
highlight = {colors.red, colors.bg}
|
highlight = {colors.red, colors.bg}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
gls.left[10] = {
|
gls.right[2] = {
|
||||||
Space = {
|
|
||||||
provider = function () return '' end
|
|
||||||
}
|
|
||||||
}
|
|
||||||
gls.left[11] = {
|
|
||||||
DiagnosticWarn = {
|
DiagnosticWarn = {
|
||||||
provider = 'DiagnosticWarn',
|
provider = 'DiagnosticWarn',
|
||||||
icon = ' ',
|
icon = ' ',
|
||||||
highlight = {colors.yellow,colors.bg},
|
highlight = {colors.yellow, colors.bg}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
gls.left[12] = {
|
|
||||||
|
gls.right[3] = {
|
||||||
DiagnosticHint = {
|
DiagnosticHint = {
|
||||||
provider = 'DiagnosticHint',
|
provider = 'DiagnosticHint',
|
||||||
icon = ' ',
|
icon = ' ',
|
||||||
highlight = {colors.blue,colors.bg},
|
highlight = {colors.blue, colors.bg}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
gls.left[13] = {
|
|
||||||
|
gls.right[4] = {
|
||||||
DiagnosticInfo = {
|
DiagnosticInfo = {
|
||||||
provider = 'DiagnosticInfo',
|
provider = 'DiagnosticInfo',
|
||||||
icon = ' ',
|
icon = ' ',
|
||||||
highlight = {colors.orange,colors.bg},
|
highlight = {colors.blue, colors.bg}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
gls.right[1]= {
|
|
||||||
FileFormat = {
|
gls.right[5] = {
|
||||||
provider = 'FileFormat',
|
ShowLspClient = {
|
||||||
separator = ' ',
|
provider = 'GetLspClient',
|
||||||
separator_highlight = {colors.bg,colors.bg},
|
condition = function()
|
||||||
highlight = {colors.grey,colors.bg},
|
local tbl = {['dashboard'] = true, [' '] = true}
|
||||||
|
if tbl[vim.bo.filetype] then return false end
|
||||||
|
return true
|
||||||
|
end,
|
||||||
|
icon = ' ',
|
||||||
|
highlight = {colors.grey, colors.bg, 'bold'}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
gls.right[2] = {
|
|
||||||
|
gls.right[6] = {
|
||||||
LineInfo = {
|
LineInfo = {
|
||||||
provider = 'LineColumn',
|
provider = 'LineColumn',
|
||||||
separator = ' | ',
|
separator = ' ',
|
||||||
separator_highlight = {colors.darkblue,colors.bg},
|
separator_highlight = {'NONE', colors.bg},
|
||||||
highlight = {colors.grey,colors.bg},
|
highlight = {colors.grey, colors.bg}
|
||||||
},
|
|
||||||
}
|
}
|
||||||
gls.right[3] = {
|
}
|
||||||
|
|
||||||
|
gls.right[7] = {
|
||||||
PerCent = {
|
PerCent = {
|
||||||
provider = 'LinePercent',
|
provider = 'LinePercent',
|
||||||
separator = ' |',
|
separator = ' ',
|
||||||
separator_highlight = {colors.darkblue,colors.bg},
|
separator_highlight = {'NONE', colors.bg},
|
||||||
highlight = {colors.grey,colors.bg},
|
highlight = {colors.grey, colors.bg, 'bold'}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
gls.right[4] = {
|
|
||||||
ScrollBar = {
|
|
||||||
provider = 'ScrollBar',
|
|
||||||
highlight = {colors.yellow,colors.purple},
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
-- gls.short_line_left[1] = {
|
|
||||||
-- BufferType = {
|
|
||||||
-- provider = 'FileTypeName',
|
|
||||||
-- separator = ' ',
|
|
||||||
-- separator_highlight = {colors.purple,colors.bg},
|
|
||||||
-- highlight = {colors.grey,colors.purple}
|
|
||||||
-- }
|
|
||||||
-- }
|
|
||||||
|
|
||||||
gls.short_line_left[1] = {
|
gls.short_line_left[1] = {
|
||||||
LeftEnd = {
|
BufferType = {
|
||||||
provider = function() return ' ' end,
|
provider = 'FileTypeName',
|
||||||
separator = ' ',
|
separator = ' ',
|
||||||
separator_highlight = {colors.purple,colors.bg},
|
separator_highlight = {'NONE', colors.bg},
|
||||||
highlight = {colors.purple,colors.bg}
|
highlight = {colors.grey, colors.bg, 'bold'}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
gls.short_line_left[2] = {
|
||||||
|
SFileName = {
|
||||||
|
provider = 'SFileName',
|
||||||
|
condition = condition.buffer_not_empty,
|
||||||
|
highlight = {colors.grey, colors.bg, 'bold'}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
gls.short_line_right[1] = {
|
||||||
|
BufferIcon = {provider = 'BufferIcon', highlight = {colors.grey, colors.bg}}
|
||||||
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue