summaryrefslogtreecommitdiff
path: root/neovim/.config/nvim/lua/plugins/galaxyline.lua
diff options
context:
space:
mode:
authorMichaël Ball <michael.ball@krotosaudio.com>2024-07-19 14:16:35 +0100
committerMichaël Ball <michael.ball@krotosaudio.com>2024-07-19 14:16:35 +0100
commit1616a0741806e74aaf85f6b3539de374c3ca3249 (patch)
tree91393b3a3222877e58da27f4b2d8d8f33ebac3ca /neovim/.config/nvim/lua/plugins/galaxyline.lua
parent457ce9e6017c081e02a566895fa1fe488cd87b9c (diff)
Refactor neovim config
Diffstat (limited to 'neovim/.config/nvim/lua/plugins/galaxyline.lua')
-rw-r--r--neovim/.config/nvim/lua/plugins/galaxyline.lua136
1 files changed, 87 insertions, 49 deletions
diff --git a/neovim/.config/nvim/lua/plugins/galaxyline.lua b/neovim/.config/nvim/lua/plugins/galaxyline.lua
index 9f58157..f2edff6 100644
--- a/neovim/.config/nvim/lua/plugins/galaxyline.lua
+++ b/neovim/.config/nvim/lua/plugins/galaxyline.lua
@@ -10,11 +10,33 @@ return {
'arzg/vim-colors-xcode',
lazy = false,
priority = 1000,
- config = function()
- vim.cmd[[colorscheme xcode]]
- end
+ config = function ()
+ local colorscheme_rules_augroup = vim.api.nvim_create_augroup('Colors', {})
+ vim.api.nvim_create_autocmd( { 'ColorScheme' }, {
+ pattern = { '*' },
+ group = colorscheme_rules_augroup,
+ callback = function()
+ vim.api.nvim_set_hl(0, 'WinSeparator', { link='VertSplit', force=1, default=1 })
+ end,
+ })
+ end,
+ dependencies = {
+ {
+ 'f-person/auto-dark-mode.nvim',
+ opts = {
+ update_interval = 1000,
+ set_dark_mode = function ()
+ vim.api.nvim_set_option('background', 'dark')
+ end,
+ set_light_mode = function ()
+ vim.api.nvim_set_option('background', 'light')
+ end
+ }
+ }
+ },
},
},
+ event = 'VimEnter',
config = function()
local gl = require('galaxyline')
local colors = {
@@ -31,50 +53,66 @@ return {
local condition = require('galaxyline.condition')
local gls = gl.section
local lsp = require('galaxyline.provider_lsp')
- gl.short_line_list = {'nerdtree', 'NeogitStatus', 'vim-plug', 'lspsagaoutline'}
+ gl.short_line_list = { 'nerdtree', 'NeogitStatus', 'vim-plug', 'lspsagaoutline', 'neo-tree' }
gls.left[1] = {
RainbowBlue = {
- provider = function() return '▊ ' end,
- highlight = {colors.blue, 'StatusLine'}
+ provider = function()
+ return '▊ '
+ end,
+ highlight = { colors.blue, 'StatusLine' }
},
}
gls.left[2] = {
ViMode = {
provider = function()
-- auto change color according the vim mode
- local mode_color = {n = colors.red, i = colors.green,v=colors.blue,
- ['^V'] = colors.blue,V=colors.blue,
- c = colors.magenta,no = colors.red,s = colors.orange,
- S=colors.orange,['^S'] = colors.orange,
- ic = colors.yellow,R = colors.violet,Rv = colors.violet,
- cv = colors.red,ce=colors.red, r = colors.cyan,
- rm = colors.cyan, ['r?'] = colors.cyan,
- ['!'] = colors.red,t = colors.red}
- vim.api.nvim_command('hi GalaxyViMode guifg='..mode_color[vim.fn.mode()])
+ local mode_color = {
+ n = colors.red,
+ i = colors.green,
+ v = colors.blue,
+ ['^V'] = colors.blue,
+ V = colors.blue,
+ c = colors.magenta,
+ no = colors.red,
+ s = colors.orange,
+ S = colors.orange,
+ ['^S'] = colors.orange,
+ ic = colors.yellow,
+ R = colors.violet,
+ Rv = colors.violet,
+ cv = colors.red,
+ ce = colors.red,
+ r = colors.cyan,
+ rm = colors.cyan,
+ ['r?'] = colors.cyan,
+ ['!'] = colors.red,
+ t = colors.red
+ }
+ vim.api.nvim_command('hi GalaxyViMode guifg=' .. mode_color[vim.fn.mode()])
return ' '
end,
- highlight = {colors.red, 'StatusLine', 'bold'},
- },
+ highlight = { colors.red, 'StatusLine', 'bold' },
+ },
}
gls.left[3] = {
FileSize = {
provider = 'FileSize',
condition = condition.buffer_not_empty,
- highlight = {'StatusLine', 'StatusLine'},
+ highlight = { 'StatusLine', 'StatusLine' },
}
}
- gls.left[4] ={
+ gls.left[4] = {
FileIcon = {
provider = 'FileIcon',
condition = function()
- if vim.g.GtkGuiLoaded ~= nil and condition.buffer_not_empty() then
- return true
- end
- return false
+ if vim.g.GtkGuiLoaded ~= nil and condition.buffer_not_empty() then
+ return true
+ end
+ return false
end,
- highlight = {require('galaxyline.provider_fileinfo').get_file_icon_color, 'StatusLine'},
+ highlight = { require('galaxyline.provider_fileinfo').get_file_icon_color, 'StatusLine' },
},
}
@@ -82,7 +120,7 @@ return {
FileName = {
provider = 'FileName',
condition = condition.buffer_not_empty,
- highlight = {colors.magenta, 'StatusLine', 'bold'}
+ highlight = { colors.magenta, 'StatusLine', 'bold' }
}
}
@@ -90,8 +128,8 @@ return {
LineInfo = {
provider = 'LineColumn',
separator = ' ',
- separator_highlight = {'NONE', 'StatusLine'},
- highlight = {'NONE', 'StatusLine'},
+ separator_highlight = { 'NONE', 'StatusLine' },
+ highlight = { 'NONE', 'StatusLine' },
},
}
@@ -99,8 +137,8 @@ return {
PerCent = {
provider = 'LinePercent',
separator = ' ',
- separator_highlight = {'NONE', 'StatusLine'},
- highlight = {'NONE', 'StatusLine', 'bold'},
+ separator_highlight = { 'NONE', 'StatusLine' },
+ highlight = { 'NONE', 'StatusLine', 'bold' },
}
}
@@ -108,14 +146,14 @@ return {
DiagnosticError = {
provider = 'DiagnosticError',
icon = '  ',
- highlight = {colors.red, 'StatusLine'}
+ highlight = { colors.red, 'StatusLine' }
}
}
gls.left[9] = {
DiagnosticWarn = {
provider = 'DiagnosticWarn',
icon = '  ',
- highlight = {colors.yellow, 'StatusLine'},
+ highlight = { colors.yellow, 'StatusLine' },
}
}
@@ -123,7 +161,7 @@ return {
DiagnosticHint = {
provider = 'DiagnosticHint',
icon = '  ',
- highlight = {colors.cyan, 'StatusLine'},
+ highlight = { colors.cyan, 'StatusLine' },
}
}
@@ -131,15 +169,15 @@ return {
DiagnosticInfo = {
provider = 'DiagnosticInfo',
icon = '  ',
- highlight = {colors.blue, 'StatusLine'},
+ highlight = { colors.blue, 'StatusLine' },
}
}
gls.mid[1] = {
ShowLspClient = {
provider = 'GetLspClient',
- condition = function ()
- local tbl = {['dashboard'] = true,['']=true}
+ condition = function()
+ local tbl = { ['dashboard'] = true, [''] = true }
if tbl[vim.bo.filetype] then
return false
elseif lsp.get_lsp_client() == 'No Active Lsp' then
@@ -148,7 +186,7 @@ return {
return true
end,
icon = '⚙ LSP:',
- highlight = {colors.cyan, 'StatusLine','bold'}
+ highlight = { colors.cyan, 'StatusLine', 'bold' }
}
}
@@ -157,8 +195,8 @@ return {
provider = function() return '  ' end,
condition = condition.check_git_workspace,
separator = ' ',
- separator_highlight = {'NONE', 'StatusLine'},
- highlight = {colors.violet, 'StatusLine', 'bold'},
+ separator_highlight = { 'NONE', 'StatusLine' },
+ highlight = { colors.violet, 'StatusLine', 'bold' },
}
}
@@ -166,7 +204,7 @@ return {
GitBranch = {
provider = 'GitBranch',
condition = condition.check_git_workspace,
- highlight = {colors.violet, 'StatusLine', 'bold'},
+ highlight = { colors.violet, 'StatusLine', 'bold' },
}
}
@@ -175,7 +213,7 @@ return {
provider = 'DiffAdd',
condition = condition.hide_in_width,
icon = ' +',
- highlight = {colors.green, 'StatusLine'},
+ highlight = { colors.green, 'StatusLine' },
}
}
gls.right[4] = {
@@ -183,7 +221,7 @@ return {
provider = 'DiffModified',
condition = condition.hide_in_width,
icon = ' ±',
- highlight = {colors.orange, 'StatusLine'},
+ highlight = { colors.orange, 'StatusLine' },
}
}
gls.right[5] = {
@@ -191,14 +229,14 @@ return {
provider = 'DiffRemove',
condition = condition.hide_in_width,
icon = ' -',
- highlight = {colors.red, 'StatusLine'},
+ highlight = { colors.red, 'StatusLine' },
}
}
gls.right[6] = {
RainbowBlue = {
provider = function() return ' ▊' end,
- highlight = {colors.blue, 'StatusLine'}
+ highlight = { colors.blue, 'StatusLine' }
},
}
@@ -206,23 +244,23 @@ return {
BufferType = {
provider = 'FileTypeName',
separator = ' ',
- separator_highlight = {'NONE', 'StatusLine'},
- highlight = {colors.blue, 'StatusLine', 'bold'}
+ separator_highlight = { 'NONE', 'StatusLine' },
+ highlight = { colors.blue, 'StatusLine', 'bold' }
}
}
gls.short_line_left[2] = {
SFileName = {
- provider = 'SFileName',
+ provider = 'SFileName',
condition = condition.buffer_not_empty,
- highlight = {'StatusLine', 'StatusLine', 'bold'}
+ highlight = { 'StatusLine', 'StatusLine', 'bold' }
}
}
gls.short_line_right[1] = {
BufferIcon = {
- provider= 'BufferIcon',
- highlight = {'StatusLine', 'StatusLine'},
+ provider = 'BufferIcon',
+ highlight = { 'StatusLine', 'StatusLine' },
}
}
end,