add supermaven (opt-in only)
This commit is contained in:
@@ -4,6 +4,7 @@ undodir
|
||||
lua/config/
|
||||
lua/plugins/
|
||||
lua/lisp-school.lua
|
||||
lua/supermaven-blink.lua
|
||||
|
||||
# Clojure/LSP tooling
|
||||
.clj-kondo/
|
||||
|
||||
+17
-3
@@ -171,13 +171,27 @@
|
||||
{lhs "<leader>aa" rhs "<cmd>ClaudeCodeDiffAccept<cr>" :desc "Accept diff"}
|
||||
{lhs "<leader>ad" rhs "<cmd>ClaudeCodeDiffDeny<cr>" :desc "Deny diff"}]}
|
||||
|
||||
;; Supermaven - AI code completion
|
||||
{repo "supermaven-inc/supermaven-nvim"
|
||||
:event "InsertEnter"
|
||||
:opts {:disable_inline_completion true}}
|
||||
|
||||
;; blink.cmp - Fast completion engine with LSP support
|
||||
{repo "saghen/blink.cmp"
|
||||
:version "*"
|
||||
:event ["InsertEnter" "CmdlineEnter"]
|
||||
:opts {:keymap {:preset "super-tab"}
|
||||
:completion {:documentation {:auto_show true}}
|
||||
:sources {:default ["lsp" "path" "buffer"]}}}
|
||||
:dependencies ["supermaven-inc/supermaven-nvim"]
|
||||
:opts {:keymap {:preset "super-tab"
|
||||
"<C-Space>" [(fn [cmp] (cmp.show {:providers ["supermaven"]})) :fallback]
|
||||
"<Tab>" [:select_and_accept :snippet_forward :fallback]
|
||||
"<CR>" [:select_and_accept :fallback]}
|
||||
:completion {:trigger {:show_on_keyword false
|
||||
:show_on_trigger_character false}
|
||||
:list {:selection {:preselect true :auto_insert false}}
|
||||
:documentation {:auto_show true}}
|
||||
:sources {:default ["lsp" "supermaven" "path" "buffer"]
|
||||
:providers {:supermaven {:name "Supermaven"
|
||||
:module "supermaven-blink"}}}}}
|
||||
|
||||
;; gitsigns.nvim - Git diff signs in the sign column
|
||||
{repo "lewis6991/gitsigns.nvim"
|
||||
|
||||
@@ -0,0 +1,38 @@
|
||||
(local M {})
|
||||
|
||||
(fn M.new []
|
||||
(setmetatable {} {:__index M}))
|
||||
|
||||
(fn M.get_completions [self ctx callback]
|
||||
(let [(ok preview) (pcall require :supermaven-nvim.completion_preview)]
|
||||
(if (not ok)
|
||||
(callback {:is_incomplete_backward false :is_incomplete_forward false :items []})
|
||||
(let [inst (preview:get_inlay_instance)]
|
||||
(if (or (= inst nil) (= inst.is_active false))
|
||||
(callback {:is_incomplete_backward false :is_incomplete_forward false :items []})
|
||||
(let [text inst.completion_text
|
||||
lines (vim.split text "\n" {:plain true})
|
||||
raw-label (: (. lines 1) :gsub "^%s*" "")
|
||||
label (if (> (length raw-label) 40)
|
||||
(.. (raw-label:sub 1 20) " ... " (raw-label:sub -15))
|
||||
raw-label)
|
||||
row (- (. ctx.cursor 1) 1)
|
||||
col-start (math.max (- (. ctx.cursor 2) (or inst.prior_delete 0)) 0)
|
||||
col-end (vim.fn.col "$")
|
||||
range {:start {:line row :character col-start}
|
||||
:end {:line row :character col-end}}]
|
||||
(callback {:is_incomplete_backward false
|
||||
:is_incomplete_forward false
|
||||
:items [{:label label
|
||||
:kind (. vim.lsp.protocol.CompletionItemKind :Text)
|
||||
:insertTextFormat (if (> (length lines) 1) 2 1)
|
||||
:textEdit {:newText text :insert range :replace range}
|
||||
:documentation {:kind :markdown
|
||||
:value (.. "```" vim.bo.filetype "\n" text "\n```")}}]})))))))
|
||||
|
||||
(fn M.execute [self ctx item resolve default-impl]
|
||||
(pcall (fn [] (: (require :supermaven-nvim.completion_preview) :dispose_inlay)))
|
||||
(default-impl)
|
||||
(resolve))
|
||||
|
||||
M
|
||||
@@ -12,6 +12,7 @@
|
||||
"nvim-treesitter": { "branch": "main", "commit": "f8bbc3177d929dc86e272c41cc15219f0a7aa1ac" },
|
||||
"plenary.nvim": { "branch": "master", "commit": "b9fd5226c2f76c951fc8ed5923d85e4de065e509" },
|
||||
"snacks.nvim": { "branch": "main", "commit": "ad9ede6a9cddf16cedbd31b8932d6dcdee9b716e" },
|
||||
"supermaven-nvim": { "branch": "main", "commit": "07d20fce48a5629686aefb0a7cd4b25e33947d50" },
|
||||
"telescope.nvim": { "branch": "master", "commit": "a0bbec21143c7bc5f8bb02e0005fa0b982edc026" },
|
||||
"tokyonight.nvim": { "branch": "main", "commit": "5da1b76e64daf4c5d410f06bcb6b9cb640da7dfd" },
|
||||
"vim-repeat": { "branch": "master", "commit": "65846025c15494983dafe5e3b46c8f88ab2e9635" },
|
||||
|
||||
Reference in New Issue
Block a user