|
89 | 89 | :results [""] |
90 | 90 | :preview ["" "" "" "" "" "" "" ""]} |
91 | 91 | :shorten_path true |
92 | | - :layout_config {:height height |
93 | | - :preview_width 0.65 |
94 | | - }})) |
95 | | - ;:preview_title ""})) |
| 92 | + :layout_config {: height :preview_width 0.7}})) |
| 93 | + |
| 94 | +;:preview_title ""})) |
96 | 95 |
|
97 | 96 | (local ivy_config (gen_ivy_config 0.7)) |
98 | | -(local small_ivy_config (gen_ivy_config 0.4)) |
99 | 97 |
|
100 | 98 | (local fzf_opts_theme (merge-table ivy_config fuzzy_search_opts)) |
101 | 99 |
|
|
145 | 143 | (map [:n] :fr (bindf builtin.resume {:initial_mode :normal}) |
146 | 144 | {:desc "Resume last search"}) |
147 | 145 |
|
148 | | -(map [:n] :ff themed_count_find_files {:desc "Find files"}) |
149 | 146 | (map [:n] :fa (bindf themed_count_find_files {:hidden true}) |
150 | 147 | {:desc "Find all files [hidden]"}) |
151 | 148 |
|
|
328 | 325 | (var mode (if (= (. opts :mode) :grep) :grep :find)) |
329 | 326 | (var cwd (. opts :cwd)) |
330 | 327 | (var relcwd (cwd:gsub (os.getenv :HOME) :$HOME)) |
331 | | - (tset opts :prompt_title (.. mode " [d:" (. opts :fcmd_depth) "] " relcwd))) |
| 328 | + (var hidden? (if (. opts :hidden) :on :off)) |
| 329 | + (tset opts :prompt_title |
| 330 | + (.. mode |
| 331 | + " [d:" |
| 332 | + (. opts :fcmd_depth) |
| 333 | + "] [h:" |
| 334 | + hidden? |
| 335 | + "] " |
| 336 | + relcwd))) |
332 | 337 |
|
333 | 338 | (fn refresh [picker opts popts] |
334 | 339 | "Refresh the picker with new options" |
|
446 | 451 | true)})) |
447 | 452 | (p.find p))) |
448 | 453 |
|
| 454 | +(fn themed_magic_height [height] |
| 455 | + (bindf magic (gen_ivy_config height))) |
449 | 456 | (local themed_magic (bindf magic ivy_config)) |
450 | | -(local small_themed_magic (bindf magic small_ivy_config)) |
| 457 | + |
| 458 | +(fn count_themed_magic [] |
| 459 | + (let [n (. vim.v :count) |
| 460 | + n (if (> n 0) n 4) |
| 461 | + n (math.max 1 (math.min n 9)) |
| 462 | + height (/ n 10)] |
| 463 | + ((themed_magic_height height)))) |
451 | 464 |
|
452 | 465 | (fn magic-grep-cword [] |
453 | 466 | (magic (merge-table ivy_config |
|
459 | 472 | (vim.fn.setreg :v []) |
460 | 473 | (magic (merge-table ivy_config {:mode :grep :default_text text}))) |
461 | 474 |
|
462 | | -(map [:n] :F small_themed_magic {:desc "Find and move around"}) |
| 475 | +(map [:n] :F count_themed_magic {:desc "Find and move around [count height]"}) |
463 | 476 | (map [:n] :<C-f> themed_magic {:desc "Find and move around"}) |
464 | 477 | (map [:n] :fs magic-grep-cword {:desc "Find string [magic grep]"}) |
465 | 478 | (map [:v] :fs magic-grep-visual {:desc "Find selection [magic grep]"}) |
0 commit comments