Skip to content

Commit

Permalink
feat(nvim): refactor luasnip
Browse files Browse the repository at this point in the history
AhmedAbdulrahman committed Dec 4, 2023
1 parent 262c887 commit b3d00b9
Showing 1 changed file with 46 additions and 31 deletions.
77 changes: 46 additions & 31 deletions nvim/lua/plugins/lualine.lua
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
local status_ok, lualine = pcall(require, 'lualine')
if not status_ok then
return
end

require('multicursors').setup({
hint_config = false,
})

local lualine = require('lualine')
local icons = NvimConfig.icons

-- Color table for highlights
local colors = {
@@ -19,6 +24,29 @@ local colors = {
red = '#f45c7f',
}

local mode_color = {
n = colors.red,
i = colors.green,
v = colors.blue,
[''] = colors.blue,
V = colors.blue,
c = colors.magenta,
no = colors.red,
s = colors.orange,
S = colors.orange,
[''] = colors.orange,
R = colors.violet,
Rv = colors.violet,
ic = colors.yellow,
cv = colors.red,
ce = colors.red,
r = colors.cyan,
rm = colors.cyan,
['r?'] = colors.cyan,
['!'] = colors.red,
t = colors.red,
}

local conditions = {
buffer_not_empty = function()
return vim.fn.empty(vim.fn.expand('%:t')) ~= 1
@@ -153,28 +181,6 @@ ins_left({
-- mode component
fmt = function(str)
-- auto change color according to neovims mode
local mode_color = {
n = colors.red,
i = colors.green,
v = colors.blue,
[''] = colors.blue,
V = colors.blue,
c = colors.magenta,
no = colors.red,
s = colors.orange,
S = colors.orange,
[''] = 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! LualineMode guifg='
.. mode_color[vim.fn.mode()]
@@ -190,6 +196,7 @@ ins_left({
ins_left({
-- filesize component
'filesize',
color = { fg = colors.fg, gui = 'bold' },
condition = conditions.buffer_not_empty,
})

@@ -210,11 +217,19 @@ ins_left({ 'progress', color = { fg = colors.fg, gui = 'bold' } })

ins_left({
'diagnostics',
sources = { 'nvim_diagnostic' },
symbols = { error = '', warn = '', info = '' },
color_error = colors.red,
color_warn = colors.yellow,
color_info = colors.cyan,
sources = { 'nvim_lsp', 'nvim_diagnostic', 'nvim_workspace_diagnostic' },
symbols = {
error = icons.diagnostics.Error,
warn = icons.diagnostics.Warning,
info = icons.diagnostics.Information,
hint = icons.diagnostics.Hint,
},
diagnostics_color = {
color_error = { fg = colors.red },
color_warn = { fg = colors.yellow },
color_info = { fg = colors.cyan },
color_hint = { fg = colors.yellow },
},
})

ins_left({
@@ -248,7 +263,7 @@ ins_left({
end
return msg
end,
icon = 'LSP:',
icon = icons.ui.Gear .. 'LSP:',
color = { fg = '#ffffff', gui = 'bold' },
})

@@ -268,13 +283,13 @@ ins_right({
mac = '', -- e711
},
upper = true,
icons_enabled = false, -- I think icons are cool but Eviline doesn't have them. sigh
icons_enabled = true, -- I think icons are cool but Eviline doesn't have them. sigh
color = { fg = colors.green, gui = 'bold' },
})

ins_right({
'branch',
icon = '',
icon = icons.git.Branch,
condition = conditions.check_git_workspace,
color = { fg = colors.violet, gui = 'bold' },
})

0 comments on commit b3d00b9

Please sign in to comment.