Mercurial > vim
changeset 10:b95a8e2525cc
Better vim-ai support for local model on edit
| author | Luka Sitas <lsitas@avatarasoftware.com> |
|---|---|
| date | Fri, 28 Nov 2025 08:44:05 -0500 |
| parents | 17c557de03e0 |
| children | 08bdff1abb15 027a85d0e60e |
| files | .vimrc plugins/vim-ai.vim plugins/vim-ai/roles.ini test.vim |
| diffstat | 3 files changed, 47 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/.vimrc Tue Nov 18 11:37:01 2025 -0500 +++ b/.vimrc Fri Nov 28 08:44:05 2025 -0500 @@ -8,6 +8,7 @@ colorscheme desert " Support for tags closing and classes +source $HOME/.vim/plugins/vim-ai.vim source $HOME/.vim/plugins/taghelp source $HOME/.vim/plugins/dbtables/dbtables.vim source $HOME/.vim/plugins/hghelp/hghelp.vim @@ -104,10 +105,12 @@ " AI-ify Plug 'madox2/vim-ai' + + " LLama.vim " put before llama.vim loads -" let g:llama_config = { 'show_info': 0, 'endpoint': 'http://0.0.0.0:8080/infill' } -" Plug 'ggml-org/llama.vim' +let g:llama_config = { 'show_info': 0, 'endpoint': 'http://127.0.0.1:8012/infill' } +Plug 'ggml-org/llama.vim' call plug#end()
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/plugins/vim-ai.vim Fri Nov 28 08:44:05 2025 -0500 @@ -0,0 +1,5 @@ +let g:vim_ai_roles_config_file = expand("$HOME/.vim/plugins/vim-ai/roles.ini") + +" debug settings +let g:vim_ai_debug = 1 +let g:vim_ai_debug_log_file = "/tmp/vim_ai_debug.log"
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/plugins/vim-ai/roles.ini Fri Nov 28 08:44:05 2025 -0500 @@ -0,0 +1,37 @@ +# .ini file structure: https://docs.python.org/3/library/configparser.html#supported-ini-file-structure + + +# common options for all commands (complete, edit, chat) +[default] +options.model = gpt-5.1 + +[default.chat] +options.initial_prompt = + >>> system + You are a general assistant. + You are providing assistance through vim-ai chat. + If you attach code, please include ``` to enable syntax highlighting. + +[editor] +options.initial_prompt = + >>> system + You are a general assistant providing editin help through the vim-ai plugin. + Answer shortly, consisely and only what you are asked. + Do not provide any explanantion or comments if not requested. + If you answer in a code, do not wrap it in markdown code block. Do not include any markdown codeblocks. + +options.endpoint_url = http://127.0.0.1:8012/v1/chat/completions +options.auth_type = none + +[default.edit] +options.initial_prompt = + >>> system + You are a general assistant providing editin help through the vim-ai plugin. + Answer shortly, consisely and only what you are asked. + Do not provide any explanantion or comments if not requested. + If you answer in a code, do not wrap it in markdown code block. Do not include any markdown codeblocks. + Reasoning: low + +options.endpoint_url = http://127.0.0.1:8080/v1/chat/completions +options.reasoning_effort = none +options.auth_type = none
