From ac7583b0fbaa84c04164b3746b099407d9ff255e Mon Sep 17 00:00:00 2001 From: Michaël Ball Date: Fri, 23 Aug 2024 09:36:12 +0100 Subject: Neovim changes --- neovim/.config/nvim/lua/config/colourscheme.lua | 2 +- neovim/.config/nvim/lua/config/galaxyline.lua | 201 ++++++++++++++++++++++++ neovim/.config/nvim/lua/config/lazy.lua | 4 +- 3 files changed, 204 insertions(+), 3 deletions(-) create mode 100644 neovim/.config/nvim/lua/config/galaxyline.lua (limited to 'neovim/.config/nvim/lua/config') diff --git a/neovim/.config/nvim/lua/config/colourscheme.lua b/neovim/.config/nvim/lua/config/colourscheme.lua index edba16f..56ae5b6 100644 --- a/neovim/.config/nvim/lua/config/colourscheme.lua +++ b/neovim/.config/nvim/lua/config/colourscheme.lua @@ -1,4 +1,4 @@ -local colorscheme = "xcode" +local colorscheme = "onedark" vim.o.background = "light" local ok, _ = pcall(vim.cmd, "colorscheme " .. colorscheme) if not ok then diff --git a/neovim/.config/nvim/lua/config/galaxyline.lua b/neovim/.config/nvim/lua/config/galaxyline.lua new file mode 100644 index 0000000..6204f4f --- /dev/null +++ b/neovim/.config/nvim/lua/config/galaxyline.lua @@ -0,0 +1,201 @@ +local gl = require('galaxyline') +local colors = { + yellow = vim.g.terminal_color_11, + cyan = vim.g.terminal_color_14, + darkblue = vim.g.terminal_color_4, + green = vim.g.terminal_color_10, + orange = vim.g.terminal_color_3, + violet = vim.g.terminal_color_5, + magenta = vim.g.terminal_color_13, + blue = vim.g.terminal_color_12, + red = vim.g.terminal_color_9, +} +local condition = require('galaxyline.condition') +local gls = gl.section +local lsp = require('galaxyline.provider_lsp') +gl.short_line_list = { 'nerdtree', 'NeogitStatus', 'vim-plug', 'lspsagaoutline', 'neo-tree', 'sagaoutline' } + +gls.left[1] = { + RainbowBlue = { + 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()]) + return ' ' + end, + highlight = { colors.red, 'StatusLine', 'bold' }, + }, +} + +gls.left[3] = { + FileSize = { + provider = 'FileSize', + condition = condition.buffer_not_empty, + highlight = { 'StatusLine', 'StatusLine' }, + } +} +gls.left[4] = { + FileIcon = { + provider = 'FileIcon', + highlight = { require('galaxyline.provider_fileinfo').get_file_icon_color, 'StatusLine' }, + }, +} + +gls.left[5] = { + FileName = { + provider = 'FileName', + condition = condition.buffer_not_empty, + highlight = { colors.magenta, 'StatusLine', 'bold' } + } +} + +gls.left[6] = { + LineInfo = { + provider = 'LineColumn', + separator = ' ', + separator_highlight = { 'NONE', 'StatusLine' }, + highlight = { 'NONE', 'StatusLine' }, + }, +} + +gls.left[7] = { + PerCent = { + provider = 'LinePercent', + separator = ' ', + separator_highlight = { 'NONE', 'StatusLine' }, + highlight = { 'NONE', 'StatusLine', 'bold' }, + } +} + +gls.left[8] = { + DiagnosticError = { + provider = 'DiagnosticError', + icon = '  ', + highlight = { colors.red, 'StatusLine' } + } +} +gls.left[9] = { + DiagnosticWarn = { + provider = 'DiagnosticWarn', + icon = '  ', + highlight = { colors.yellow, 'StatusLine' }, + } +} + +gls.left[10] = { + DiagnosticHint = { + provider = 'DiagnosticHint', + icon = '  ', + highlight = { colors.cyan, 'StatusLine' }, + } +} + +gls.left[11] = { + DiagnosticInfo = { + provider = 'DiagnosticInfo', + icon = '  ', + highlight = { colors.blue, 'StatusLine' }, + } +} + +gls.mid[1] = { + ShowLspClient = { + provider = 'GetLspClient', + condition = function() + local tbl = { ['dashboard'] = true, [''] = true } + if tbl[vim.bo.filetype] then + return false + elseif lsp.get_lsp_client() == 'No Active Lsp' then + return false + end + return true + end, + icon = '⚙ LSP:', + highlight = { colors.cyan, 'StatusLine', 'bold' } + } +} + +gls.right[1] = { + GitIcon = { + provider = function() return '  ' end, + condition = condition.check_git_workspace, + separator = ' ', + separator_highlight = { 'NONE', 'StatusLine' }, + highlight = { colors.violet, 'StatusLine', 'bold' }, + } +} + +gls.right[2] = { + GitBranch = { + provider = 'GitBranch', + condition = condition.check_git_workspace, + highlight = { colors.violet, 'StatusLine', 'bold' }, + } +} + +gls.right[3] = { + DiffAdd = { + provider = 'DiffAdd', + condition = condition.hide_in_width, + icon = ' +', + highlight = { colors.green, 'StatusLine' }, + } +} +gls.right[4] = { + DiffModified = { + provider = 'DiffModified', + condition = condition.hide_in_width, + icon = ' ±', + highlight = { colors.orange, 'StatusLine' }, + } +} +gls.right[5] = { + DiffRemove = { + provider = 'DiffRemove', + condition = condition.hide_in_width, + icon = ' -', + highlight = { colors.red, 'StatusLine' }, + } +} + +gls.right[6] = { + RainbowBlue = { + provider = function() return ' ▊' end, + highlight = { colors.blue, 'StatusLine' } + }, +} + +gls.short_line_left[1] = {} + +gls.short_line_left[2] = {} + +gls.short_line_right[1] = {} diff --git a/neovim/.config/nvim/lua/config/lazy.lua b/neovim/.config/nvim/lua/config/lazy.lua index a109cd0..2d9b70f 100644 --- a/neovim/.config/nvim/lua/config/lazy.lua +++ b/neovim/.config/nvim/lua/config/lazy.lua @@ -29,7 +29,7 @@ require("lazy").setup({ }, -- Configure any other settings here. See the documentation for more details. -- colorscheme that will be used when installing plugins. - install = { colorscheme = { "xcode" }, missing = true }, + install = { colorscheme = { "onedark" }, missing = true }, -- automatically check for plugin updates - checker = { enabled = false }, + checker = { enabled = true, notify = false }, }) -- cgit v1.2.3