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:
parent
a0d594e49e
commit
9f80615cb8
2 changed files with 15 additions and 1 deletions
|
@ -43,5 +43,7 @@ o.pumblend = 10
|
||||||
|
|
||||||
o.guifont = "JetBrainsMono Nerd Font Mono"
|
o.guifont = "JetBrainsMono Nerd Font Mono"
|
||||||
|
|
||||||
|
o.shortmess = o.shortmess .. "S"
|
||||||
|
|
||||||
-- Disable diagnostics
|
-- Disable diagnostics
|
||||||
vim.diagnostic.disable()
|
vim.diagnostic.disable()
|
||||||
|
|
|
@ -1,9 +1,21 @@
|
||||||
local gps = require("nvim-gps")
|
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({
|
require("lualine").setup({
|
||||||
sections = {
|
sections = {
|
||||||
lualine_a = { "filename" },
|
lualine_a = { "filename" },
|
||||||
lualine_b = {},
|
lualine_b = { { search_count, type = "lua_expr" } },
|
||||||
lualine_c = { { gps.get_location, cond = gps.is_available } },
|
lualine_c = { { gps.get_location, cond = gps.is_available } },
|
||||||
lualine_x = {},
|
lualine_x = {},
|
||||||
lualine_y = { "branch" },
|
lualine_y = { "branch" },
|
||||||
|
|
Loading…
Reference in a new issue