1
0
Fork 0
mirror of https://codeberg.org/Mo8it/dotfiles.git synced 2024-10-17 20:52:40 +00:00

Use custom search match count

This commit is contained in:
Mo 2022-06-30 04:27:06 +02:00
parent a0d594e49e
commit 9f80615cb8
2 changed files with 15 additions and 1 deletions

View file

@ -43,5 +43,7 @@ o.pumblend = 10
o.guifont = "JetBrainsMono Nerd Font Mono"
o.shortmess = o.shortmess .. "S"
-- Disable diagnostics
vim.diagnostic.disable()

View file

@ -1,9 +1,21 @@
local gps = require("nvim-gps")
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
require("lualine").setup({
sections = {
lualine_a = { "filename" },
lualine_b = {},
lualine_b = { { search_count, type = "lua_expr" } },
lualine_c = { { gps.get_location, cond = gps.is_available } },
lualine_x = {},
lualine_y = { "branch" },