1
0
Fork 0

nvim: Add search position to statusline

This commit is contained in:
Daniel Kempkens 2022-08-15 23:26:28 +02:00
parent 074107f1e0
commit 6c83430706
2 changed files with 12 additions and 1 deletions

View file

@ -271,6 +271,16 @@
i)]
(string.rep new-scrollbar 2)))
:hl {:fg colors.purple}})
;; Search count
(set mod.search-count
{:condition (fn []
(if (= vim.v.hlsearch 0) false true))
:init (fn [self]
(set self.count (vim.fn.searchcount {:timeout 5})))
:provider (fn [self]
(string.format "[%s/%s]" self.count.current
self.count.total))
:hl {:fg colors.black :bg colors.purple}})
;; Custom Mode
(fn mod.custom-mode [str fg bg]

View file

@ -16,7 +16,8 @@
ns.space
ns.scrollbar
ns.space
ns.position])
ns.position
ns.search-count])
(local telescope-statusline
{:condition (fn []
(conditions.buffer_matches {:filetype [:TelescopePrompt]}))