From b745bfda31fe0d0e16b04004f96b207753648b21 Mon Sep 17 00:00:00 2001 From: Gustaf Rydholm Date: Thu, 8 Feb 2024 12:32:56 +0100 Subject: Add noice and inc-rename --- fnl/plugins/cmp.fnl | 10 ++++++++- fnl/plugins/inc-rename.fnl | 7 ++++++ fnl/plugins/lsp/diagnostics.fnl | 7 ++---- fnl/plugins/lsp/keymaps.fnl | 1 - fnl/plugins/noice.fnl | 50 +++++++++++++++++++++++++++++++++++++++++ fnl/settings/icons.fnl | 2 ++ 6 files changed, 70 insertions(+), 7 deletions(-) create mode 100644 fnl/plugins/inc-rename.fnl create mode 100644 fnl/plugins/noice.fnl (limited to 'fnl') diff --git a/fnl/plugins/cmp.fnl b/fnl/plugins/cmp.fnl index ca09329..1662afb 100644 --- a/fnl/plugins/cmp.fnl +++ b/fnl/plugins/cmp.fnl @@ -61,6 +61,14 @@ "│"]}} :confirm_opts {:behavior cmp.ConfirmBehavior.Replace :select false} - :experimental {:ghost_text false :native_menu false}}))) + :experimental {:ghost_text false :native_menu false}}) + (cmp.setup.cmdline "/" + {:mapping (cmp.mapping.preset.cmdline) + :sources [{:name :buffer}]}) + (cmp.setup.cmdline ":" + {:mapping (cmp.mapping.preset.cmdline) + :sources [{:name :path} + {:name :cmdline + :option {:ignore_cmds [:Man "!"]}}]}))) {1 :hrsh7th/nvim-cmp : dependencies :event :InsertEnter : config} diff --git a/fnl/plugins/inc-rename.fnl b/fnl/plugins/inc-rename.fnl new file mode 100644 index 0000000..bc50481 --- /dev/null +++ b/fnl/plugins/inc-rename.fnl @@ -0,0 +1,7 @@ +(local keys [{1 :ge 2 ":IncRename " :mode :n :desc :Rename}]) + +{1 :smjonas/inc-rename.nvim + : keys + :config (fn [] + (let [inc-rename (require :inc_rename)] + (inc-rename.setup)))} diff --git a/fnl/plugins/lsp/diagnostics.fnl b/fnl/plugins/lsp/diagnostics.fnl index aa1bf4d..9fbb627 100644 --- a/fnl/plugins/lsp/diagnostics.fnl +++ b/fnl/plugins/lsp/diagnostics.fnl @@ -26,10 +26,7 @@ (fn setup [] (configure-signs) (vim.diagnostic.config config) - (set vim.lsp.handlers.textDocument/hover - (vim.lsp.with {:border :rounded :width 60})) - (set vim.lsp.handlers.textDocument/signatureHelp - (vim.lsp.with vim.lsp.handlers.signature_help - {:border :rounded :width 60}))) + (set vim.lsp.handlers.textDocument/hover false) + (set vim.lsp.handlers.textDocument/signatureHelp false)) {: setup} diff --git a/fnl/plugins/lsp/keymaps.fnl b/fnl/plugins/lsp/keymaps.fnl index 1518c78..ceb4907 100644 --- a/fnl/plugins/lsp/keymaps.fnl +++ b/fnl/plugins/lsp/keymaps.fnl @@ -15,7 +15,6 @@ "lua vim.diagnostic.open_float()" {:desc :Diagnostics}] [:n :gs "lua vim.lsp.buf.signature_help()" {:desc :Signature}] - [:n :ge "lua vim.lsp.buf.rename()" {:desc :Rename}] [:n :la "lua vim.lsp.buf.code_action()" diff --git a/fnl/plugins/noice.fnl b/fnl/plugins/noice.fnl new file mode 100644 index 0000000..9171833 --- /dev/null +++ b/fnl/plugins/noice.fnl @@ -0,0 +1,50 @@ +;; UI for messages, cmdline and the popup menu. + +(local icons (require :settings.icons)) + +(local opts + {:cmdline {:enabled true + :view :cmdline_popup + :format {:cmdline {:pattern "^:" + :icon (.. (. icons :caret) " ") + :lang :vim} + :search_down {:view :cmdline + :icon (.. (. icons :search-text) " " + (. icons :down))} + :search_up {:view :cmdline + :icon (.. (. icons :search-text) " " + (. icons :up))}}} + :messages {:enabled true} + :popupmenu {:enabled true :backend :nui} + :notify {:enabled false} + :lsp {:override {:vim.lsp.util.convert_input_to_markdown_lines true + :vim.lsp.util.stylize_markdown true + :cmp.entry.get_documentation true}} + :presets {:bottom_search true + ;; use a classic bottom cmdline for search + :command_palette false + ;; position the cmdline and popupmenu together + :long_message_to_split false + ;; long messages will be sent to a split + :inc_rename true + ;; enables an input dialog for inc-rename.nvim + :lsp_doc_border true} + :views {:cmdline_popup {:border {:style :single} + :position {:row "42%" :col "50%"} + :size {:width 60 :height :auto} + :filter_options {} + :scrollbar false + :win_options {:winhighlight {:Normal :NormalFloat + :FloatBorder :FloatBorder}}} + :popupmenu {:relative :editor + :position {:row "51%" :col "50%"} + :size {:width 60 :height 10} + :border {:style :single :padding [0 0]} + :scrollbar false + :win_options {:winhighlight {:Normal :Normal + :FloatBorder :FloatBorder}}}}}) + +{1 :folke/noice.nvim + :event :VeryLazy + :dependencies [:MunifTanjim/nui.nvim] + : opts} diff --git a/fnl/settings/icons.fnl b/fnl/settings/icons.fnl index b1115cb..080b1cb 100644 --- a/fnl/settings/icons.fnl +++ b/fnl/settings/icons.fnl @@ -16,6 +16,8 @@ :right-arrow "" :small-right-arrow "" :guillemet "»" + :up : + :down : :close "" :git-add "|" :git-delete "_" -- cgit v1.2.3-70-g09d2