-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlightline.lua
50 lines (47 loc) · 1.17 KB
/
lightline.lua
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
vim.g.lightline = {
colorscheme = 'powerlineish',
active = {
left = {
{ 'mode', 'paste' },
{ 'gitbranch', 'readonly', 'filename', 'spell' },
},
right = {
{ 'lineinfo' },
{ 'percent' },
{ 'fileformat', 'fileencoding' },
},
},
component = {
spell = '%{&spell ? "SPELL " .. &spelllang : ""}',
},
component_function = {
filename = 'LightlineFilename',
-- TODO: highlight with green color
gitbranch = 'LightlineGitBranch',
readonly = 'LightlineReadonly',
},
enable = { tabline = 0 },
}
return {
'itchyny/lightline.vim',
dependencies = {
'tpope/vim-fugitive',
},
config = function()
-- stylua: ignore start
vim.api.nvim_exec2([[
function! LightlineFilename()
let filename = expand('%:t') !=# '' ? expand('%:t') : '[No Name]'
let modified = &modified ? ' +' : ''
return filename . modified
endfunction
function! LightlineReadonly()
return &readonly && &filetype !=# 'help' ? '' : ''
endfunction
function! LightlineGitBranch()
return FugitiveHead() . ' '
endfunction
]], {})
-- stylua: ignore end
end,
}