new plugin llm
This commit is contained in:
parent
8a03de58b9
commit
406f904367
5 changed files with 103 additions and 39 deletions
|
|
@ -61,6 +61,7 @@ set -g status-interval 5
|
|||
##set -g status-right '#[fg=green]#(~/src/tpom/tpom) #[fg=cyan,bold]%Y-%m-%d %H:%M:%S#[default]'
|
||||
#set -g status-justify centre # center align window list
|
||||
#set -g status-style fg=white,bg=default
|
||||
set -g status-position top
|
||||
|
||||
## default window title colors
|
||||
#set-window-option -g window-status-style fg=white,bg=default,dim
|
||||
|
|
|
|||
|
|
@ -1,3 +1,2 @@
|
|||
nmap <buffer> { <Plug>(qf_previous_file)
|
||||
nmap <buffer> } <Plug>(qf_next_file)
|
||||
nmap <buffer> dd <cmd>.Reject<cr>
|
||||
|
|
|
|||
|
|
@ -2,18 +2,16 @@ require("avante_lib").load()
|
|||
require("avante").setup({
|
||||
provider = "ollama",
|
||||
auto_suggestions_provider = "ollama",
|
||||
cursor_applying_provider = "ollama",
|
||||
behavior = {
|
||||
auto_suggestions = false,
|
||||
enable_cursor_planning_mode = true,
|
||||
},
|
||||
hints = {
|
||||
enabled = false,
|
||||
},
|
||||
vendors = {
|
||||
ollama = {
|
||||
endpoint = "http://127.0.0.1:11434/v1",
|
||||
model = "qwen2.5-coder:7b",
|
||||
__inherited_from = "openai",
|
||||
api_key_name = "",
|
||||
},
|
||||
ollama = {
|
||||
endpoint = "http://127.0.0.1:11434",
|
||||
model = "phi4:14b",
|
||||
},
|
||||
})
|
||||
|
|
|
|||
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,
|
||||
})
|
||||
|
|
|
|||
23
dot_vimrc
23
dot_vimrc
|
|
@ -110,7 +110,7 @@ Plug 'scrooloose/nerdcommenter'
|
|||
Plug 'mhinz/vim-signify'
|
||||
Plug 'nvim-lualine/lualine.nvim'
|
||||
Plug 'linrongbin16/lsp-progress.nvim'
|
||||
Plug 'airblade/vim-rooter'
|
||||
"Plug 'airblade/vim-rooter'
|
||||
Plug 'majutsushi/tagbar'
|
||||
Plug 'dcampos/nvim-snippy'
|
||||
Plug 'dcampos/cmp-snippy'
|
||||
|
|
@ -122,6 +122,7 @@ Plug 'tpope/vim-abolish'
|
|||
" Plugins for syntax
|
||||
Plug 'lunaru/vim-less'
|
||||
Plug 'hylang/vim-hy', {'for': 'hy'}
|
||||
Plug 'habamax/vim-asciidoctor'
|
||||
Plug 'jneen/ragel.vim'
|
||||
Plug 'NoahTheDuke/vim-just'
|
||||
Plug 'leafOfTree/vim-svelte-plugin'
|
||||
|
|
@ -130,7 +131,7 @@ Plug 'Shougo/context_filetype.vim'
|
|||
Plug 'fedorenchik/AnsiEsc'
|
||||
Plug 'hwayne/tla.vim'
|
||||
Plug 'zchee/vim-goasm'
|
||||
Plug 'cappyzawa/starlark.vim'
|
||||
"Plug 'cappyzawa/starlark.vim'
|
||||
|
||||
" Plugins that autocomplete
|
||||
Plug 'neovim/nvim-lspconfig'
|
||||
|
|
@ -181,9 +182,14 @@ Plug 'danymat/neogen'
|
|||
Plug 'stevearc/dressing.nvim'
|
||||
Plug 'MunifTanjim/nui.nvim'
|
||||
Plug 'zbirenbaum/copilot.lua'
|
||||
Plug 'yetone/avante.nvim', {'branch': 'main', 'do': 'make'}
|
||||
"Plug 'yetone/avante.nvim', {'branch': 'main', 'do': 'make'}
|
||||
"Plug 'David-Kunz/gen.nvim'
|
||||
Plug 'ibhagwan/fzf-lua'
|
||||
Plug 'frankroeder/parrot.nvim'
|
||||
|
||||
Plug 'edolphin-ydf/goimpl.nvim'
|
||||
Plug 'stevearc/quicker.nvim'
|
||||
Plug 'sphamba/smear-cursor.nvim'
|
||||
|
||||
call plug#end()
|
||||
|
||||
|
|
@ -292,9 +298,9 @@ let g:tagbar_autoclose = 1
|
|||
let g:tagbar_compact = 1
|
||||
|
||||
" * vim-rooter
|
||||
let g:rooter_cd_cmd="lcd"
|
||||
let g:rooter_manual_only = 1
|
||||
set autochdir
|
||||
"let g:rooter_cd_cmd="lcd"
|
||||
"let g:rooter_manual_only = 1
|
||||
"set autochdir
|
||||
|
||||
" " * FZF
|
||||
let g:rg_command = '
|
||||
|
|
@ -462,7 +468,7 @@ au FileType coq nmap <leader>a :CoqToCursor<CR>
|
|||
au FileType coq imap <leader>a <C-O>:CoqToCursor<CR>
|
||||
|
||||
" I don't know how I came up with gt for opening the tree, but it stuck.
|
||||
nmap <silent> gt :edit .<CR>
|
||||
nmap <silent> gt :edit %:h<CR>
|
||||
nmap gb :TagbarToggle<CR>
|
||||
"nnoremap gx :Kwbd<CR>
|
||||
" :Kwbd (defined below) really kills a buffer dead, and closes the window.
|
||||
|
|
@ -526,8 +532,9 @@ nnoremap <Leader>fp :lprev<CR>
|
|||
nnoremap <silent> <C-k> <cmd>lua require('telescope.builtin').git_files{}<cr>
|
||||
nnoremap <silent> <Leader>ag <cmd>lua require('telescope.builtin').live_grep{ word_match = "-w", only_sort_text = true, cwd = vim.fn.systemlist("git rev-parse --show-toplevel")[1], search = ''}<cr>
|
||||
nnoremap <silent> <Leader>aw <cmd>lua require('telescope.builtin').grep_string{ word_match = "-w", only_sort_text = true, cwd = vim.fn.systemlist("git rev-parse --show-toplevel")[1]}<cr>
|
||||
nnoremap <silent> <Leader>q <cmd>lua require('telescope.builtin').quickfix{}<cr>
|
||||
"nnoremap <silent> <Leader>q <cmd>lua require('telescope.builtin').quickfix{}<cr>
|
||||
nnoremap <silent> <Leader>ff <cmd>lua require('telescope.builtin').quickfix{}<cr>
|
||||
nnoremap <silent> <Leader>ar <cmd>lua require('telescope.builtin').resume{}<cr>
|
||||
nnoremap <silent> <Leader>o <cmd>lua require('telescope.builtin').buffers{initial_mode = "insert"}<cr>
|
||||
nnoremap <silent> <C-j> <cmd>lua require('telescope.builtin').buffers{prompt_prefix = " "}<cr>
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue