-
-
Notifications
You must be signed in to change notification settings - Fork 19
Expand file tree
/
Copy pathairline_luffy.lua
More file actions
151 lines (140 loc) · 4.29 KB
/
airline_luffy.lua
File metadata and controls
151 lines (140 loc) · 4.29 KB
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
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
local windline = require('windline')
local helper = require('windline.helpers')
local sep = helper.separators
local b_components = require('windline.components.basic')
local state = _G.WindLine.state
local vim_components = require('windline.components.vim')
local animation = require('wlanimation')
local efffects = require('wlanimation.effects')
local lsp_comps = require('windline.components.lsp')
local git_comps = require('windline.components.git')
local hl_list = {
Black = { 'white', 'black' },
White = { 'black', 'white' },
Normal = {'NormalFg', 'NormalBg'},
Inactive = { 'InactiveFg', 'InactiveBg' },
Active = { 'ActiveFg', 'ActiveBg' },
}
local basic = {}
local luffy_text = ""
basic.divider = { b_components.divider, hl_list.Normal }
local colors_mode_light = {
Normal = { 'magenta', 'black_light' },
Insert = { 'green', 'black_light' },
Visual = { 'yellow', 'black_light' },
Replace = { 'blue_light', 'black_light' },
Command = { 'red', 'black_light' },
}
local colors_mode_rev = {
Normal = { 'black', 'magenta' },
Insert = { 'black', 'green' },
Visual = { 'black', 'yellow' },
Replace = { 'black', 'blue_light' },
Command = { 'black', 'red' },
}
local hide_in_width = function()
return vim.fn.winwidth(0) > 90
end
basic.vi_mode = {
name = 'vi_mode',
hl_colors = colors_mode_rev,
text = function()
return { { luffy_text ..' ' .. state.mode[1] .. ' ', state.mode[2] } }
end,
}
basic.vi_mode_sep_left = {
name = 'vi_mode',
hl_colors = colors_mode_light,
text = function()
return { { sep.right_filled, state.mode[2] } }
end,
}
basic.lsp_diagnos = {
name = 'diagnostic',
hl_colors = {
red = { 'red', 'NormalBg' },
yellow = { 'yellow', 'NormalBg' },
blue = { 'blue', 'NormalBg' },
},
text = function()
if hide_in_width() and lsp_comps.check_lsp() then
return {
{ ' ', 'red' },
{ lsp_comps.lsp_error({ format = ' %s', show_zero = false }), 'red' },
{ lsp_comps.lsp_warning({ format = ' %s', show_zero = false }), 'yellow' },
{ lsp_comps.lsp_hint({ format = ' %s', show_zero = false }), 'blue' },
}
end
return { ' ', 'red' }
end,
}
basic.right = {
hl_colors = colors_mode_rev,
text = function()
return {
{ '', state.mode[2] },
{ b_components.progress, '' },
{ ' ', '' },
{ b_components.line_col, '' },
}
end,
}
basic.right_sep = {
hl_colors = colors_mode_light,
text = function()
return {
{ sep.left_filled, state.mode[2] },
}
end,
}
local default = {
filetypes = { 'default' },
active = {
basic.vi_mode,
basic.vi_mode_sep_left,
{ git_comps.git_branch({}), { 'white_light', 'black_light' } },
{ ' ' .. sep.right .. ' ', '' },
{ b_components.file_name(), '' },
{ sep.right_filled, { 'black_light', 'NormalBg' } },
basic.lsp_diagnos,
{vim_components.search_count(),{"cyan", "NormalBg"}},
basic.divider,
{ sep.left_filled, { 'black_light', 'NormalBg' } },
{ ' ', { 'white_light', 'black_light' } },
{ b_components.file_type({ icon = true }), '' },
{ ' ', '' },
{ b_components.file_encoding(), '' },
{ ' ', '' },
{ b_components.file_format({ icon = true }), { 'white_light', 'black_light' } },
{ ' ', '' },
basic.right_sep,
basic.right,
},
inactive = {
{ b_components.full_file_name, hl_list.Inactive },
basic.divider,
basic.divider,
{ b_components.line_col, hl_list.Inactive },
{ b_components.progress, hl_list.Inactive },
},
}
--
windline.setup({
statuslines = {
default,
},
})
-- need to use font family: Fira Code iCursive S12
-- https://github.com/windwp/windline.nvim/wiki/fonts/FiraCodeiCursiveS12-Regular.ttf
local luffy = { '', '', '', '', '', '' }
animation.stop_all()
animation.basic_animation({
timeout = nil,
delay = 200,
interval = 200,
effect = efffects.list_text(luffy),
on_tick = function(value)
luffy_text = value
vim.cmd.redrawstatus()
end
})