Compare commits
No commits in common. "4499dee3d63a5baf96e3ae660107be7639c4e707" and "9f0d9890fd4a09e66100ae78efc60f4c83569bcf" have entirely different histories.
4499dee3d6
...
9f0d9890fd
2
init.lua
2
init.lua
@ -1,6 +1,8 @@
|
||||
vim.g.mapleader = ' '
|
||||
vim.g.maplocalleader = ' '
|
||||
|
||||
require('statusline')
|
||||
|
||||
local lazypath = vim.fn.stdpath('data') .. '/lazy/lazy.nvim'
|
||||
if not vim.loop.fs_stat(lazypath) then
|
||||
vim.fn.system({ 'git', 'clone', '--filter=blob:none',
|
||||
|
@ -109,7 +109,7 @@ end
|
||||
|
||||
-- Define active statusline, this statusline is dynamic with StatusLineLight
|
||||
-- being updated based on the current mode and only used for current buffer.
|
||||
function _G.statusline_active()
|
||||
function statusline.active()
|
||||
local mode = get_mode()
|
||||
if vim.o.buftype == 'help' then
|
||||
if mode == 'Normal' then mode = 'Help' end
|
||||
@ -138,7 +138,7 @@ function _G.statusline_active()
|
||||
return generic('StatusLineLight', mode, true)
|
||||
end
|
||||
|
||||
function _G.statusline_inactive()
|
||||
function statusline.inactive()
|
||||
local mode = modes[vim.fn.char2nr(vim.fn.mode())].name
|
||||
local line = ''
|
||||
if vim.o.buftype == 'help' then
|
||||
@ -169,7 +169,7 @@ vim.api.nvim_create_autocmd({ 'BufEnter', 'WinEnter', 'BufWinEnter' }, {
|
||||
pattern = '*',
|
||||
group = group,
|
||||
callback = function()
|
||||
vim.cmd.setlocal("statusline=%{%v:lua.statusline_active()%}")
|
||||
vim.cmd.setlocal("statusline=%{%v:lua.require('statusline').active()%}")
|
||||
end
|
||||
})
|
||||
|
||||
@ -178,7 +178,7 @@ vim.api.nvim_create_autocmd({ 'BufLeave', 'WinLeave' }, {
|
||||
pattern = '*',
|
||||
group = group,
|
||||
callback = function()
|
||||
vim.cmd.setlocal("statusline=%{%v:lua.statusline_inactive()%}")
|
||||
vim.cmd.setlocal("statusline=%{%v:lua.require('statusline').inactive()%}")
|
||||
end
|
||||
})
|
||||
|
Loading…
x
Reference in New Issue
Block a user