-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstatusline.lua
26 lines (24 loc) · 1.04 KB
/
statusline.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
-- statusline
-- %< trim from here
-- %{fugitive#head()} name of the current branch (needs fugitive.vim)
-- %f path+filename
-- %m check modifi{ed,able}
-- %r check readonly
-- %w check preview window
-- %= left/right separator
-- %l/%L,%c rownumber/total,colnumber
-- %{&fileencoding?&fileencoding:&encoding} file encoding
vim.opt.statusline =
' %< %{FugitiveHead()} %f %m %r %w %= Ln %l, Col %c %{&fileencoding?&fileencoding:&encoding} '
-- minimal statusline on start
_G.laststatus = 0
vim.opt.laststatus = _G.laststatus
-- toggle statusline
vim.keymap.set('n', '<space>z', function()
if _G.laststatus == 0 then
_G.laststatus = 2
else
_G.laststatus = 0
end
vim.opt.laststatus = _G.laststatus
end)