From b2c085452b6dcc98e3b1554d3192e330ecc5cbc2 Mon Sep 17 00:00:00 2001 From: Jannik Buhr Date: Wed, 13 Mar 2024 12:54:39 +0100 Subject: [PATCH] fix: set math.randomseed to ensure a different animal in the status line every start --- lua/config/global.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lua/config/global.lua b/lua/config/global.lua index 2bfb9e1..5736998 100644 --- a/lua/config/global.lua +++ b/lua/config/global.lua @@ -64,7 +64,9 @@ let g:currentmode={ \} ]] -vim.opt.statusline = '%{%g:currentmode[mode()]%} %{%reg_recording()%} %* %t | %y | %* %= c:%c l:%l/%L %p%% ' .. animals[math.random(#animals)] .. ' %*' +math.randomseed(os.time()) +local i = math.random(#animals) +vim.opt.statusline = '%{%g:currentmode[mode()]%} %{%reg_recording()%} %* %t | %y | %* %= c:%c l:%l/%L %p%% ' .. animals[i] .. ' %*' -- hide cmdline when not used vim.opt.cmdheight = 1