-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy path.vimrc_plugins_lualine
133 lines (114 loc) · 3.45 KB
/
.vimrc_plugins_lualine
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
lua << END
-- stylua: ignore
-- TODO: Try to import base16 theme and just override what is needed instead of copy/paste
-- Source: https://raw.githubusercontent.com/nvim-lualine/lualine.nvim/master/lua/lualine/themes/base16.lua
local modules = require('lualine_require').lazy_require { notices = 'lualine.utils.notices' }
local function add_notice(notice)
modules.notices.add_notice('theme(base16): ' .. notice)
end
local function setup(colors)
local theme = {
normal = {
a = { fg = colors.bg, bg = colors.normal },
b = { fg = colors.light_fg, bg = colors.alt_bg },
c = { fg = colors.fg, bg = colors.bg },
},
replace = {
a = { fg = colors.bg, bg = colors.replace },
b = { fg = colors.light_fg, bg = colors.alt_bg },
},
insert = {
a = { fg = colors.bg, bg = colors.insert },
b = { fg = colors.light_fg, bg = colors.alt_bg },
},
visual = {
a = { fg = colors.bg, bg = colors.visual },
b = { fg = colors.light_fg, bg = colors.alt_bg },
},
inactive = {
a = { fg = colors.dark_fg, bg = colors.bg },
b = { fg = colors.dark_fg, bg = colors.bg },
c = { fg = colors.dark_fg, bg = colors.bg },
},
}
theme.command = theme.normal
theme.terminal = theme.insert
return theme
end
local function setup_default()
return setup {
bg = '#282a2e',
alt_bg = '#373b41',
dark_fg = '#969896',
fg = '#b4b7b4',
light_fg = '#c5c8c6',
normal = '#81a2be',
insert = '#b5bd68',
visual = '#b294bb',
replace = '#de935f',
}
end
local function setup_base16()
local loaded, base16 = pcall(require, 'base16-colorscheme')
if not loaded then
add_notice(
'nvim-base16 is not currently present in your runtimepath, make sure it is properly installed,'
.. ' fallback to default colors.'
)
return nil
end
if not base16.colors and not vim.env.BASE16_THEME then
add_notice(
'nvim-base16 is not loaded yet, you should update your configuration to load it before lualine'
.. ' so that the colors from your colorscheme can be used, fallback to "tomorrow-night" theme.'
)
elseif not base16.colors and not base16.colorschemes[vim.env.BASE16_THEME] then
add_notice(
'The colorscheme "%s" defined by the environment variable "BASE16_THEME" is not handled by'
.. ' nvim-base16, fallback to "tomorrow-night" theme.'
)
end
local colors = base16.colors or base16.colorschemes[vim.env.BASE16_THEME or 'tomorrow-night']
return setup {
bg = colors.base00,
alt_bg = colors.base01,
dark_fg = colors.base03,
fg = colors.base04,
light_fg = colors.base05,
normal = colors.base03,
insert = colors.base0A,
visual = colors.base09,
replace = colors.base08,
}
end
my_theme = setup_base16() or setup_default()
require('lualine').setup {
options = {
theme = my_theme,
component_separators = '',
section_separators = { left = ' ', right = ' ' },
},
sections = {
lualine_a = {
{ 'mode', separator = { left = ' ' }, color = { gui = 'bold'} },
},
lualine_b = { 'filename' },
lualine_c = {},
lualine_x = {},
lualine_y = { 'progress' },
lualine_z = {
{ 'location', separator = { right = ' ' }, left_padding = 2 },
},
},
inactive_sections = {
lualine_a = { 'filename' },
lualine_b = {},
lualine_c = {},
lualine_x = {},
lualine_y = {},
lualine_z = { 'location' },
},
tabline = {},
extensions = {},
}
END