Add llama.vim, LlamaStart/Stop commands, and fix completion preset
- Add llama.vim plugin with optimized FIM context settings - Add LlamaStart/LlamaStop commands for managing llama-server - Auto-stop llama-server on Neovim exit - Switch blink.cmp back to default preset (Ctrl+y) for Tab compatibility Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
5fd790130b
commit
bc020fba1a
32
init.lua
32
init.lua
|
|
@ -223,6 +223,36 @@ vim.keymap.set('n', '<C-k>', '<C-w><C-k>', { desc = 'Move focus to the upper win
|
|||
vim.keymap.set('n', '<leader>sv', '<cmd>vsp<CR>', { desc = '[S]plit [V]ertical' })
|
||||
vim.keymap.set('n', '<leader>sh', '<cmd>sp<CR>', { desc = '[S]plit [H]orizontal' })
|
||||
|
||||
local llama_job_id = nil
|
||||
|
||||
vim.api.nvim_create_user_command('LlamaStart', function()
|
||||
if llama_job_id then
|
||||
vim.notify('llama-server is already running', vim.log.levels.WARN)
|
||||
return
|
||||
end
|
||||
llama_job_id = vim.fn.jobstart('llama-server --fim-qwen-3b-default -c 16384', { detach = true })
|
||||
vim.notify('llama-server started', vim.log.levels.INFO)
|
||||
end, { desc = 'Start llama-server' })
|
||||
|
||||
vim.api.nvim_create_user_command('LlamaStop', function()
|
||||
if not llama_job_id then
|
||||
vim.notify('llama-server is not running', vim.log.levels.WARN)
|
||||
return
|
||||
end
|
||||
vim.fn.jobstop(llama_job_id)
|
||||
llama_job_id = nil
|
||||
vim.notify('llama-server stopped', vim.log.levels.INFO)
|
||||
end, { desc = 'Stop llama-server' })
|
||||
|
||||
vim.api.nvim_create_autocmd('VimLeavePre', {
|
||||
callback = function()
|
||||
if llama_job_id then
|
||||
vim.fn.jobstop(llama_job_id)
|
||||
llama_job_id = nil
|
||||
end
|
||||
end,
|
||||
})
|
||||
|
||||
|
||||
-- NOTE: Some terminals have colliding keymaps or are not able to send distinct keycodes
|
||||
-- vim.keymap.set("n", "<C-S-h>", "<C-w>H", { desc = "Move window to the left" })
|
||||
|
|
@ -779,7 +809,7 @@ require('lazy').setup({
|
|||
-- <c-k>: Toggle signature help
|
||||
--
|
||||
-- See :h blink-cmp-config-keymap for defining your own keymap
|
||||
preset = 'super-tab',
|
||||
preset = 'default',
|
||||
|
||||
-- For more advanced Luasnip keymaps (e.g. selecting choice nodes, expansion) see:
|
||||
-- https://github.com/L3MON4D3/LuaSnip?tab=readme-ov-file#keymaps
|
||||
|
|
|
|||
|
|
@ -13,6 +13,17 @@ return {
|
|||
},
|
||||
},
|
||||
{ 'editorconfig/editorconfig-vim' },
|
||||
{
|
||||
'ggml-org/llama.vim',
|
||||
init = function()
|
||||
vim.g.llama_config = {
|
||||
n_predict = 256, -- longer suggestions
|
||||
ring_n_chunks = 64, -- more project context chunks
|
||||
ring_chunk_size = 64, -- smaller chunks for speed
|
||||
ring_scope = 2048, -- wider scope around cursor
|
||||
}
|
||||
end,
|
||||
},
|
||||
{
|
||||
'folke/flash.nvim',
|
||||
event = 'VeryLazy',
|
||||
|
|
|
|||
Loading…
Reference in New Issue