diff --git a/home/config/nvim/init.fnl b/home/config/nvim/init.fnl index b317eb6..c21aac8 100644 --- a/home/config/nvim/init.fnl +++ b/home/config/nvim/init.fnl @@ -67,6 +67,7 @@ (set g.mapleader " ") ; Some plugins need this, so set it before the keymap is loaded (set o.timeoutlen 400) (set g.loaded_python_provider 0) ; Disable built-in providers + (set g.loaded_python3_provider 0) (set g.loaded_ruby_provider 0) (set g.loaded_node_provider 0) (set g.loaded_perl_provider 0) diff --git a/home/config/nvim/nifoc/keymap.fnl b/home/config/nvim/nifoc/keymap.fnl index 6f1b51e..7705b11 100644 --- a/home/config/nvim/nifoc/keymap.fnl +++ b/home/config/nvim/nifoc/keymap.fnl @@ -9,6 +9,14 @@ gitsigns (require :gitsigns) repl (require :nifoc.repl) formatting (require :nifoc.formatting)] + (set _G.mini_cr_action + (fn [] + (if (not= (vim.fn.pumvisible) 0) + (if (not= (. (vim.fn.complete_info) :selected) -1) + (vim.api.nvim_replace_termcodes : true true true) + (vim.api.nvim_replace_termcodes : true true true)) + ((. (require :mini.pairs) :cr))))) + (fn mod.setup [] (keymap.set :n : : {:noremap true}) ;; Leader Mappings @@ -48,7 +56,8 @@ (keymap.set :n :dtp :TSPlaygroundToggle {:desc "Toggle Treetsitter Playground"}) ;; Other Mappings - (keymap.set :n :F #(formatting.maybe-format-buffer 0) {:desc "Format Buffer"}) + (keymap.set :n :F #(formatting.maybe-format-buffer 0) + {:desc "Format Buffer"}) (keymap.set :n : :b) (keymap.set :n : :w) (keymap.set :n : "^") @@ -66,7 +75,13 @@ (keymap.set :x :gp "(YankyGPutAfter)") (keymap.set :x :gP "(YankyGPutBefore)") (keymap.set :n :y "(YankyYank)") - (keymap.set :x :y "(YankyYank)")) + (keymap.set :x :y "(YankyYank)") + ;; Completion + (keymap.set :i : "pumvisible() ? \"\\\" : \"\\\"" + {:expr true}) + (keymap.set :i : "pumvisible() ? \"\\\" : \"\\\"" + {:expr true}) + (keymap.set :i : "v:lua._G.mini_cr_action()" {:expr true})) (fn mod.lsp-attach [client bufnr] (keymap.set :n :t diff --git a/home/config/nvim/plugins/lsp.fnl b/home/config/nvim/plugins/lsp.fnl index d71745f..1e01bc7 100644 --- a/home/config/nvim/plugins/lsp.fnl +++ b/home/config/nvim/plugins/lsp.fnl @@ -1,6 +1,5 @@ (let [lsp (require :lspconfig) lsp-configs (require :lspconfig.configs) - coq (require :coq) navic (require :nvim-navic) diagnostic (require :nifoc.diagnostic) augroup (vim.api.nvim_create_augroup :NifocLsp {:clear true}) @@ -22,13 +21,16 @@ (when (client.supports_method :textDocument/inlayHint) (vim.lsp.inlay_hint bufnr true) (setup-inlay-hint-toggle bufnr)) + (when (client.supports_method :textDocument/completion) + (set vim.opt_local.omnifunc + "v:lua.MiniCompletion.completefunc_lsp")) (diagnostic.maybe-enable-lsp client bufnr))) :group augroup :desc "Automatic LSP setup"}) ;; Servers (vim.lsp.set_log_level :OFF) (let [flags {:allow_incremental_sync true :debounce_text_changes 700} - default-config (coq.lsp_ensure_capabilities {: flags}) + default-config {: flags} default-servers [:bashls :cssls :dockerls diff --git a/home/config/nvim/plugins/mini.fnl b/home/config/nvim/plugins/mini.fnl index 9306ce4..ce0ce6c 100644 --- a/home/config/nvim/plugins/mini.fnl +++ b/home/config/nvim/plugins/mini.fnl @@ -11,6 +11,15 @@ :clues [(miniclue.gen_clues.builtin_completion)]}) ;; https://github.com/echasnovski/mini.nvim/blob/main/readmes/mini-comment.md ((. (require :mini.comment) :setup) {}) + ;; https://github.com/echasnovski/mini.nvim/blob/main/readmes/mini-completion.md + ((. (require :mini.completion) :setup) {:window {:info {:height 25 + :width 80 + :border :rounded} + :signature {:height 25 + :width 80 + :border :rounded}} + :lsp_completion {:source_func :omnifunc + :auto_setup false}}) ;; https://github.com/echasnovski/mini.nvim/blob/main/readmes/mini-hipatterns.md (hipatterns.setup {:highlighters {:fixme {:pattern "%f[%w]()FIXME()%f[%W]" :group :MiniHipatternsFixme} diff --git a/home/programs/nvim/default.nix b/home/programs/nvim/default.nix index 352998d..301dd8f 100644 --- a/home/programs/nvim/default.nix +++ b/home/programs/nvim/default.nix @@ -184,15 +184,6 @@ in telescope-ui-select-nvim telescope-undo-nvim - # Completion - { - plugin = pkgs.vimPlugins.coq_nvim; - config = builtins.readFile ../../config/nvim/plugins/coq.fnl; - type = "fennel"; - } - - pkgs.vimPlugins.coq-artifacts - # LSP { plugin = nvim-lspconfig;