summaryrefslogtreecommitdiff
path: root/fnl
diff options
context:
space:
mode:
authorGustaf Rydholm <gustaf.rydholm@gmail.com>2024-02-08 12:32:56 +0100
committerGustaf Rydholm <gustaf.rydholm@gmail.com>2024-02-08 12:32:56 +0100
commitb745bfda31fe0d0e16b04004f96b207753648b21 (patch)
tree660d38626c8827ba303e9c313b74f2abd87b4512 /fnl
parentd4babc575017a85bfd0e5191771a2f74104c59d6 (diff)
Add noice and inc-rename
Diffstat (limited to 'fnl')
-rw-r--r--fnl/plugins/cmp.fnl10
-rw-r--r--fnl/plugins/inc-rename.fnl7
-rw-r--r--fnl/plugins/lsp/diagnostics.fnl7
-rw-r--r--fnl/plugins/lsp/keymaps.fnl1
-rw-r--r--fnl/plugins/noice.fnl50
-rw-r--r--fnl/settings/icons.fnl2
6 files changed, 70 insertions, 7 deletions
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 @@
"<cmd>lua vim.diagnostic.open_float()<CR>"
{:desc :Diagnostics}]
[:n :gs "<cmd>lua vim.lsp.buf.signature_help()<CR>" {:desc :Signature}]
- [:n :ge "<cmd>lua vim.lsp.buf.rename()<cr>" {:desc :Rename}]
[:n
:<leader>la
"<cmd>lua vim.lsp.buf.code_action()<cr>"
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 "_"