2023-10-08 21:28:27 +00:00
|
|
|
(let [miniclue (require :mini.clue)
|
2023-10-23 12:30:10 +00:00
|
|
|
hipatterns (require :mini.hipatterns)
|
|
|
|
b vim.b
|
|
|
|
api vim.api
|
|
|
|
ctrl_n (api.nvim_replace_termcodes :<C-g><C-g><C-n> true false true)
|
|
|
|
augroup (vim.api.nvim_create_augroup :NifocMini {:clear true})
|
|
|
|
aucmd vim.api.nvim_create_autocmd]
|
2023-10-09 16:07:32 +00:00
|
|
|
;; https://github.com/echasnovski/mini.nvim/blob/main/readmes/mini-ai.md
|
|
|
|
((. (require :mini.ai) :setup) {})
|
2023-10-08 18:57:17 +00:00
|
|
|
;; https://github.com/echasnovski/mini.nvim/blob/main/readmes/mini-clue.md
|
|
|
|
(miniclue.setup {:triggers [; Leader
|
|
|
|
{:mode :n :keys :<leader>}
|
|
|
|
{:mode :x :keys :<leader>}
|
|
|
|
; Built-in
|
|
|
|
{:mode :i :keys :<C-x>}]
|
|
|
|
:clues [(miniclue.gen_clues.builtin_completion)]})
|
|
|
|
;; https://github.com/echasnovski/mini.nvim/blob/main/readmes/mini-comment.md
|
|
|
|
((. (require :mini.comment) :setup) {})
|
2023-10-18 21:18:10 +00:00
|
|
|
;; https://github.com/echasnovski/mini.nvim/blob/main/readmes/mini-completion.md
|
2023-10-23 12:30:10 +00:00
|
|
|
(set b.nifoc_completion_fallback_count 0)
|
|
|
|
|
|
|
|
(fn completion-fallback []
|
|
|
|
(let [count b.nifoc_completion_fallback_count]
|
|
|
|
(when (< count 3)
|
|
|
|
(api.nvim_feedkeys ctrl_n :n false)
|
|
|
|
(set b.nifoc_completion_fallback_count (+ count 1)))))
|
|
|
|
|
2023-10-18 21:18:10 +00:00
|
|
|
((. (require :mini.completion) :setup) {:window {:info {:height 25
|
|
|
|
:width 80
|
|
|
|
:border :rounded}
|
|
|
|
:signature {:height 25
|
|
|
|
:width 80
|
|
|
|
:border :rounded}}
|
|
|
|
:lsp_completion {:source_func :omnifunc
|
2023-10-23 12:30:10 +00:00
|
|
|
:auto_setup false}
|
|
|
|
:fallback_action completion-fallback})
|
|
|
|
(aucmd [:InsertLeave :CursorHoldI]
|
|
|
|
{:callback #(set b.nifoc_completion_fallback_count 0)
|
|
|
|
:group augroup
|
|
|
|
:desc "Re-enable completion fallback on cursor-hold"})
|
2023-10-08 21:28:27 +00:00
|
|
|
;; https://github.com/echasnovski/mini.nvim/blob/main/readmes/mini-hipatterns.md
|
|
|
|
(hipatterns.setup {:highlighters {:fixme {:pattern "%f[%w]()FIXME()%f[%W]"
|
|
|
|
:group :MiniHipatternsFixme}
|
|
|
|
:hack {:pattern "%f[%w]()HACK()%f[%W]"
|
|
|
|
:group :MiniHipatternsHack}
|
|
|
|
:todo {:pattern "%f[%w]()TODO()%f[%W]"
|
|
|
|
:group :MiniHipatternsTodo}
|
|
|
|
:note {:pattern "%f[%w]()NOTE()%f[%W]"
|
|
|
|
:group :MiniHipatternsNote}
|
|
|
|
:hex_color (hipatterns.gen_highlighter.hex_color)}})
|
2023-10-08 18:57:17 +00:00
|
|
|
;; https://github.com/echasnovski/mini.nvim/blob/main/readmes/mini-jump2d.md
|
|
|
|
((. (require :mini.jump2d) :setup) {:hooks {:before_start (fn []
|
|
|
|
(vim.cmd :nohlsearch))}})
|
2023-10-08 21:28:27 +00:00
|
|
|
;; https://github.com/echasnovski/mini.nvim/blob/main/readmes/mini-move.md
|
2023-10-09 19:59:19 +00:00
|
|
|
((. (require :mini.move) :setup) {:mappings {:down :<A-Down>
|
|
|
|
:up :<A-Up>
|
|
|
|
:line_down :<A-Down>
|
|
|
|
:line_up :<A-Up>}})
|
2023-10-08 18:57:17 +00:00
|
|
|
;; https://github.com/echasnovski/mini.nvim/blob/main/readmes/mini-surround.md
|
|
|
|
((. (require :mini.surround) :setup) {})
|
|
|
|
;; https://github.com/echasnovski/mini.nvim/blob/main/readmes/mini-pairs.md
|
|
|
|
((. (require :mini.pairs) :setup) {}))
|