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)] i)]
(string.rep new-scrollbar 2))) (string.rep new-scrollbar 2)))
:hl {:fg colors.purple}}) :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 ;; Custom Mode
(fn mod.custom-mode [str fg bg] (fn mod.custom-mode [str fg bg]

View file

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