2022-06-30 02:27:06 +00:00
|
|
|
local function search_count()
|
|
|
|
if vim.api.nvim_get_vvar("hlsearch") == 1 then
|
|
|
|
local res = vim.fn.searchcount({ maxcount = 999, timeout = 500 })
|
|
|
|
|
|
|
|
if res.total > 0 then
|
|
|
|
return string.format("%d/%d", res.current, res.total)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
return ""
|
|
|
|
end
|
|
|
|
|
2022-08-15 18:12:36 +00:00
|
|
|
local navic = require("nvim-navic")
|
|
|
|
|
2022-03-20 04:22:56 +00:00
|
|
|
require("lualine").setup({
|
|
|
|
sections = {
|
|
|
|
lualine_a = { "filename" },
|
2022-06-30 02:27:06 +00:00
|
|
|
lualine_b = { { search_count, type = "lua_expr" } },
|
2022-08-15 18:12:36 +00:00
|
|
|
lualine_c = { { navic.get_location, cond = navic.is_available } },
|
2022-05-04 20:47:51 +00:00
|
|
|
lualine_x = {},
|
2022-05-15 20:16:43 +00:00
|
|
|
lualine_y = { "branch" },
|
2022-05-04 20:47:51 +00:00
|
|
|
lualine_z = { "filetype" },
|
2022-03-20 04:22:56 +00:00
|
|
|
},
|
|
|
|
})
|