-
Hi there, sorry for the noob question, but could someone clarify how i can toggle I'd like to disable it by default (configured as below), and be able to toggle this setting with a keybind. Configured in "ggml-org/llama.vim",
-- Disable auto FIM completion
init = function()
vim.g.llama_config = {
auto_fim = false,
}
end, I tried this keybind, but it's not working: -- Toggle auto FIM completion setting
vim.keymap.set('n', '<leader>ta', function()
vim.g.llama_config.auto_fim = not vim.g.llama_config.auto_fim
print('Auto FIM: ' .. tostring(vim.g.llama_config.auto_fim))
end, { desc = 'Toggle Auto FIM' })
Please advise, thank you! |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
I am a beginner in VimScript so I didn't know how to implement such functionality. There are already a couple of issues that have been raised: #40, #34, so hopefully somebody will figure out how to implement this. |
Beta Was this translation helpful? Give feedback.
-
I do this function ToggleLlamaAutoFIM()
let g:llama_config.auto_fim = !g:llama_config.auto_fim
call llama#init()
endfunction
inoremap <silent><C-\> <ESC>:call ToggleLlamaAutoFIM()<CR>i |
Beta Was this translation helpful? Give feedback.
@notDavid In case you still need it and for future visitors, the equivalent config in lua is something like the following:
TIL setting table field directly like
vim.g.llama_config.auto_fim = not ...
would not work, see https://stackoverflow.com/questions/75300318/changing-global-variable-value-neovim