new plugin llm
This commit is contained in:
parent
8a03de58b9
commit
406f904367
5 changed files with 103 additions and 39 deletions
105
dot_vim/nvim.lua
105
dot_vim/nvim.lua
|
|
@ -62,16 +62,14 @@ nvim_lsp.rust_analyzer.setup({
|
|||
})
|
||||
nvim_lsp.gopls.setup({
|
||||
on_attach = function(client, bufnr)
|
||||
client.server_capabilities.semanticTokensProvider = {
|
||||
full = true,
|
||||
legend = {
|
||||
--tokenTypes = { 'namespace', 'type', 'class', 'enum', 'interface', 'struct', 'typeParameter', 'parameter', 'variable', 'property', 'enumMember', 'event', 'function', 'method', 'macro', 'keyword', 'modifier', 'comment', 'string', 'number', 'regexp', 'operator', 'decorator', },
|
||||
tokenTypes = { 'namespace' },
|
||||
tokenModifiers = { 'declaration', 'definition', 'readonly', 'static', 'deprecated', 'abstract', 'async',
|
||||
'modification', 'documentation', 'defaultLibrary',
|
||||
},
|
||||
}
|
||||
}
|
||||
--client.server_capabilities.semanticTokensProvider = {
|
||||
--full = true,
|
||||
--legend = {
|
||||
----tokenTypes = { 'namespace', 'type', 'class', 'enum', 'interface', 'struct', 'typeParameter', 'parameter', 'variable', 'property', 'enumMember', 'event', 'function', 'method', 'macro', 'keyword', 'modifier', 'comment', 'string', 'number', 'regexp', 'operator', 'decorator', },
|
||||
--tokenTypes = { 'namespace' },
|
||||
--tokenModifiers = { 'declaration', 'definition', 'readonly', 'static', 'deprecated', 'abstract', 'async', 'modification', 'documentation', 'defaultLibrary' },
|
||||
--}
|
||||
--}
|
||||
end,
|
||||
capabilities = default_capabilities,
|
||||
settings = {
|
||||
|
|
@ -342,17 +340,17 @@ require('trouble').setup {
|
|||
jump = { "o", "<tab>" }, -- jump to the diagnostic or open / close folds
|
||||
--open_split = { "<c-x>" }, -- open buffer in new split
|
||||
--open_vsplit = { "<c-v>" }, -- open buffer in new vsplit
|
||||
open_tab = {}, -- open buffer in new tab
|
||||
jump_close = { "<cr>" }, -- jump to the diagnostic and close the list
|
||||
toggle_mode = "m", -- toggle between "workspace" and "document" diagnostics mode
|
||||
toggle_preview = "P", -- toggle auto_preview
|
||||
hover = "K", -- opens a small popup with the full multiline message
|
||||
preview = "p", -- preview the diagnostic location
|
||||
open_tab = {}, -- open buffer in new tab
|
||||
jump_close = { "<cr>" }, -- jump to the diagnostic and close the list
|
||||
toggle_mode = "m", -- toggle between "workspace" and "document" diagnostics mode
|
||||
toggle_preview = "P", -- toggle auto_preview
|
||||
hover = "K", -- opens a small popup with the full multiline message
|
||||
preview = "p", -- preview the diagnostic location
|
||||
close_folds = { "zM", "zm" }, -- close all folds
|
||||
open_folds = { "zR", "zr" }, -- open all folds
|
||||
open_folds = { "zR", "zr" }, -- open all folds
|
||||
toggle_fold = { "zA", "za" }, -- toggle fold of current file
|
||||
previous = "k", -- previous item
|
||||
next = "j" -- next item
|
||||
previous = "k", -- previous item
|
||||
next = "j" -- next item
|
||||
},
|
||||
}
|
||||
|
||||
|
|
@ -445,15 +443,19 @@ require('telescope').setup {
|
|||
-- Treesitter
|
||||
--
|
||||
|
||||
require 'nvim-treesitter.configs'.setup {
|
||||
require 'nvim-treesitter.configs'.setup({
|
||||
-- One of "all", "maintained" (parsers with maintainers), or a list of languages
|
||||
ensure_installed = {
|
||||
"c",
|
||||
"cpp",
|
||||
"css",
|
||||
"cue",
|
||||
"dockerfile",
|
||||
"fish",
|
||||
"go",
|
||||
"gomod",
|
||||
"gosum",
|
||||
"gotmpl",
|
||||
"haskell",
|
||||
"html",
|
||||
"javascript",
|
||||
|
|
@ -465,6 +467,7 @@ require 'nvim-treesitter.configs'.setup {
|
|||
"python",
|
||||
"query",
|
||||
"rust",
|
||||
"starlark",
|
||||
"terraform",
|
||||
"toml",
|
||||
"tsx",
|
||||
|
|
@ -504,7 +507,7 @@ require 'nvim-treesitter.configs'.setup {
|
|||
playground = {
|
||||
enable = true,
|
||||
disable = {},
|
||||
updatetime = 25, -- Debounced time for highlighting nodes in the playground from source code
|
||||
updatetime = 25, -- Debounced time for highlighting nodes in the playground from source code
|
||||
persist_queries = false, -- Whether the query persists across vim sessions
|
||||
keybindings = {
|
||||
toggle_query_editor = 'o',
|
||||
|
|
@ -519,7 +522,7 @@ require 'nvim-treesitter.configs'.setup {
|
|||
show_help = '?',
|
||||
},
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
require "neogen".setup {}
|
||||
|
||||
|
|
@ -623,9 +626,65 @@ end
|
|||
|
||||
require("hoversplit").setup({})
|
||||
|
||||
require("quicker").setup()
|
||||
|
||||
vim.keymap.set("n", "<leader>q", function()
|
||||
require("quicker").toggle()
|
||||
end, {
|
||||
desc = "Toggle quickfix",
|
||||
})
|
||||
|
||||
--require("murdock")
|
||||
--require("ollama_setup")
|
||||
--require("gen_setup")
|
||||
require("lir_setup")
|
||||
require("lualine_setup")
|
||||
require("avante_setup")
|
||||
--require("avante_setup")
|
||||
--require("gen").setup({
|
||||
--model = "gemma3:12b-it-qat",
|
||||
--init = nil,
|
||||
--})
|
||||
require("smear_cursor").setup({
|
||||
--stiffness = 0.8,
|
||||
--trailing_stiffness = 0.5,
|
||||
--distance_stop_animating= 0.5,
|
||||
})
|
||||
|
||||
require("parrot").setup({
|
||||
providers = {
|
||||
ollama = {}
|
||||
},
|
||||
chat_user_prefix = "Chat: ",
|
||||
llm_prefix = "LLM: ",
|
||||
hooks = {
|
||||
CompleteFullContext = function(prt, params)
|
||||
local template = [[
|
||||
I have the following code from {{filename}}:
|
||||
|
||||
```{{filetype}}
|
||||
{{filecontent}}
|
||||
```
|
||||
|
||||
Please look at the following section specifically:
|
||||
```{{filetype}}
|
||||
{{selection}}
|
||||
```
|
||||
|
||||
Goal: {{command}}
|
||||
|
||||
Respond just with the snippet of code that should be inserted.
|
||||
|
||||
|
||||
]]
|
||||
local model_obj = prt.get_model("command")
|
||||
prt.Prompt(params, prt.ui.Target.append, model_obj, nil, template)
|
||||
end,
|
||||
},
|
||||
})
|
||||
|
||||
vim.diagnostic.config({
|
||||
virtual_text = false,
|
||||
signs = true,
|
||||
update_in_insert = false,
|
||||
underline = true,
|
||||
})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue