aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2025-04-24 03:01:17 +0900
committernsfisis <nsfisis@gmail.com>2025-04-24 03:01:17 +0900
commit94f4fd60e81082d0fe7fd15503d71af28d3412af (patch)
treebe83a1475e4563bc3db4504ff2874f1b12f7d8a4
parent6c195cf68da12f17d96d9f10aa833ff66ee93de9 (diff)
downloaddotfiles-94f4fd60e81082d0fe7fd15503d71af28d3412af.tar.gz
dotfiles-94f4fd60e81082d0fe7fd15503d71af28d3412af.tar.zst
dotfiles-94f4fd60e81082d0fe7fd15503d71af28d3412af.zip
nvim/statusline: make inactive statusline simple
-rw-r--r--.config/nvim/lua/init/05-appearance.lua16
1 files changed, 7 insertions, 9 deletions
diff --git a/.config/nvim/lua/init/05-appearance.lua b/.config/nvim/lua/init/05-appearance.lua
index 9a5f97b..1c9c396 100644
--- a/.config/nvim/lua/init/05-appearance.lua
+++ b/.config/nvim/lua/init/05-appearance.lua
@@ -15,15 +15,12 @@ function vimrc.statusline.build()
local winid = G.statusline_winid
local bufnr = F.winbufnr(winid)
local is_active = winid == F.win_getid()
- local left
- if is_active then
- local mode, mode_hl = vimrc.statusline.mode()
- left = string.format('%%#statusLineMode%s# %s %%#statusLine#', mode_hl, mode)
- else
- left = ''
+ local fname = vimrc.statusline.filename(bufnr)
+ if not is_active then
+ return ' ' .. fname
end
+ local mode, mode_hl = vimrc.statusline.mode()
local ro = vimrc.statusline.readonly(bufnr)
- local fname = vimrc.statusline.filename(bufnr)
local mod = vimrc.statusline.modified(bufnr)
local extra_info = vimrc.statusline.extra_info(bufnr, winid)
local linenum = vimrc.statusline.linenum(winid)
@@ -32,8 +29,9 @@ function vimrc.statusline.build()
local ff = vimrc.statusline.ff(bufnr)
local ft = vimrc.statusline.filetype(bufnr)
return string.format(
- '%s %s%s%s %%= %s%s %s%s%s %s ',
- left,
+ '%%#statusLineMode%s# %s %%#statusLine# %s%s%s %%= %s%s %s%s%s %s ',
+ mode_hl,
+ mode,
ro and ro .. ' ' or '',
fname,
mod and ' ' .. mod or '',