From f74f7b0fd4e3d87f9371d0020e236d6af0238895 Mon Sep 17 00:00:00 2001 From: LordMZTE Date: Sat, 27 May 2023 01:26:34 +0200 Subject: [PATCH] nvim UI improvements --- mzte-nv/conf/ftplugin/java.fnl | 8 ++++++++ mzte-nv/conf/lua/pluginconf/p-harpoon.fnl | 1 + mzte-nv/conf/lua/pluginconf/p-noice.fnl | 4 ++++ 3 files changed, 13 insertions(+) diff --git a/mzte-nv/conf/ftplugin/java.fnl b/mzte-nv/conf/ftplugin/java.fnl index 63fda35..c4758da 100644 --- a/mzte-nv/conf/ftplugin/java.fnl +++ b/mzte-nv/conf/ftplugin/java.fnl @@ -17,6 +17,14 @@ (jdtls-setup.add_commands) (jdtls.setup_dap {:hotcodereplace :auto})) +;; Deshittify pick UI +(tset (require :jdtls.ui) :pick_one + (fn [items prompt label-fn] + (let [co (coroutine.running)] + ((. (require :jdtls.ui) :pick_one_async) items prompt label-fn + #(coroutine.resume co $1)) + (coroutine.yield)))) + (let [opts {:cmd [:jdtls :-configuration dirs.config :-data dirs.workspace] :capabilities caps :root_dir (jdtls-setup.find_root [:.git diff --git a/mzte-nv/conf/lua/pluginconf/p-harpoon.fnl b/mzte-nv/conf/lua/pluginconf/p-harpoon.fnl index be30799..fa6e14f 100644 --- a/mzte-nv/conf/lua/pluginconf/p-harpoon.fnl +++ b/mzte-nv/conf/lua/pluginconf/p-harpoon.fnl @@ -5,5 +5,6 @@ (local mopt (. (require :mzte_nv) :utils :map_opt)) (vim.keymap.set :n :ma mark.toggle_file mopt) +(vim.keymap.set :n :mc mark.clear_all mopt) (vim.keymap.set :n :mn ui.nav_next mopt) (vim.keymap.set :n :mp ui.nav_prev mopt) diff --git a/mzte-nv/conf/lua/pluginconf/p-noice.fnl b/mzte-nv/conf/lua/pluginconf/p-noice.fnl index eeb8594..22b2115 100644 --- a/mzte-nv/conf/lua/pluginconf/p-noice.fnl +++ b/mzte-nv/conf/lua/pluginconf/p-noice.fnl @@ -6,6 +6,10 @@ (noice.setup {:messages {:view :mini} :lsp {:override (collect [_ o (ipairs overrides)] (values o true))} + :routes [;; Redirect DAP messages to mini view + {:filter {:event :notify + :cond #(and $1.opts (= $.opts.title :DAP))} + :view :mini}] :presets {:lsp_doc_border true}}) ;; Shift-Enter to redirect cmdline