[nvim] Add AI completion and status bar
This commit is contained in:
@@ -1,4 +1,37 @@
|
|||||||
return {
|
return {
|
||||||
|
{
|
||||||
|
'milanglacier/minuet-ai.nvim',
|
||||||
|
dependencies = {
|
||||||
|
'nvim-lua/plenary.nvim',
|
||||||
|
'Saghen/blink.cmp'
|
||||||
|
},
|
||||||
|
config = function()
|
||||||
|
require('minuet').setup {
|
||||||
|
provider = 'openai_fim_compatible',
|
||||||
|
n_completions = 1, -- recommend for local model for resource saving
|
||||||
|
-- I recommend beginning with a small context window size and incrementally
|
||||||
|
-- expanding it, depending on your local computing power. A context window
|
||||||
|
-- of 512, serves as an good starting point to estimate your computing
|
||||||
|
-- power. Once you have a reliable estimate of your local computing power,
|
||||||
|
-- you should adjust the context window to a larger value.
|
||||||
|
context_window = 512,
|
||||||
|
provider_options = {
|
||||||
|
openai_fim_compatible = {
|
||||||
|
-- For Windows users, TERM may not be present in environment variables.
|
||||||
|
-- Consider using APPDATA instead.
|
||||||
|
api_key = 'TERM',
|
||||||
|
name = 'Ollama',
|
||||||
|
end_point = 'http://localhost:11434/v1/completions',
|
||||||
|
model = 'qwen2.5-coder:7b',
|
||||||
|
optional = {
|
||||||
|
max_tokens = 56,
|
||||||
|
top_p = 0.9,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
end,
|
||||||
|
},
|
||||||
{
|
{
|
||||||
'saghen/blink.cmp',
|
'saghen/blink.cmp',
|
||||||
-- optional: provides snippets for the snippet source
|
-- optional: provides snippets for the snippet source
|
||||||
@@ -34,15 +67,13 @@ return {
|
|||||||
nerd_font_variant = 'mono'
|
nerd_font_variant = 'mono'
|
||||||
},
|
},
|
||||||
|
|
||||||
-- (Default) Only show the documentation popup when manually triggered
|
completion = { trigger = { prefetch_on_insert = false }, documentation = { auto_show = false } },
|
||||||
completion = { documentation = { auto_show = false } },
|
|
||||||
|
|
||||||
-- Default list of enabled providers defined so that you can extend it
|
-- Default list of enabled providers defined so that you can extend it
|
||||||
-- elsewhere in your config, without redefining it, due to `opts_extend`
|
-- elsewhere in your config, without redefining it, due to `opts_extend`
|
||||||
sources = {
|
sources = {
|
||||||
default = { 'lsp', 'path', 'snippets', 'buffer' },
|
default = { 'lsp', 'path', 'snippets', 'buffer', 'minuet' },
|
||||||
},
|
},
|
||||||
|
|
||||||
-- (Default) Rust fuzzy matcher for typo resistance and significantly better performance
|
-- (Default) Rust fuzzy matcher for typo resistance and significantly better performance
|
||||||
-- You may use a lua implementation instead by using `implementation = "lua"` or fallback to the lua implementation,
|
-- You may use a lua implementation instead by using `implementation = "lua"` or fallback to the lua implementation,
|
||||||
-- when the Rust fuzzy matcher is not available, by using `implementation = "prefer_rust"`
|
-- when the Rust fuzzy matcher is not available, by using `implementation = "prefer_rust"`
|
||||||
@@ -50,6 +81,24 @@ return {
|
|||||||
-- See the fuzzy documentation for more information
|
-- See the fuzzy documentation for more information
|
||||||
fuzzy = { implementation = "prefer_rust_with_warning" }
|
fuzzy = { implementation = "prefer_rust_with_warning" }
|
||||||
},
|
},
|
||||||
opts_extend = { "sources.default" }
|
opts_extend = { "sources.default" },
|
||||||
|
config = function()
|
||||||
|
require('blink-cmp').setup {
|
||||||
|
sources = {
|
||||||
|
default = { 'lsp', 'path', 'buffer', 'snippets', 'minuet' },
|
||||||
|
providers = {
|
||||||
|
minuet = {
|
||||||
|
name = 'minuet',
|
||||||
|
module = 'minuet.blink',
|
||||||
|
async = true,
|
||||||
|
-- Should match minuet.config.request_timeout * 1000,
|
||||||
|
-- since minuet.config.request_timeout is in seconds
|
||||||
|
timeout_ms = 3000,
|
||||||
|
score_offset = 50, -- Gives minuet higher priority among suggestions
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
end
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
60
.config/nvim/lua/plugins/statusbar.lua
Normal file
60
.config/nvim/lua/plugins/statusbar.lua
Normal file
@@ -0,0 +1,60 @@
|
|||||||
|
return {
|
||||||
|
'nvim-lualine/lualine.nvim',
|
||||||
|
dependencies = { 'nvim-tree/nvim-web-devicons' },
|
||||||
|
config = function()
|
||||||
|
require('lualine').setup {
|
||||||
|
options = {
|
||||||
|
icons_enabled = true,
|
||||||
|
theme = 'auto',
|
||||||
|
component_separators = { left = '', right = ''},
|
||||||
|
section_separators = { left = '', right = ''},
|
||||||
|
disabled_filetypes = {
|
||||||
|
statusline = {},
|
||||||
|
winbar = {},
|
||||||
|
},
|
||||||
|
ignore_focus = {},
|
||||||
|
always_divide_middle = true,
|
||||||
|
always_show_tabline = true,
|
||||||
|
globalstatus = false,
|
||||||
|
refresh = {
|
||||||
|
statusline = 1000,
|
||||||
|
tabline = 1000,
|
||||||
|
winbar = 1000,
|
||||||
|
refresh_time = 16, -- ~60fps
|
||||||
|
events = {
|
||||||
|
'WinEnter',
|
||||||
|
'BufEnter',
|
||||||
|
'BufWritePost',
|
||||||
|
'SessionLoadPost',
|
||||||
|
'FileChangedShellPost',
|
||||||
|
'VimResized',
|
||||||
|
'Filetype',
|
||||||
|
'CursorMoved',
|
||||||
|
'CursorMovedI',
|
||||||
|
'ModeChanged',
|
||||||
|
},
|
||||||
|
}
|
||||||
|
},
|
||||||
|
sections = {
|
||||||
|
lualine_a = {'mode'},
|
||||||
|
lualine_b = {'branch', 'diff', 'diagnostics'},
|
||||||
|
lualine_c = {'filename'},
|
||||||
|
lualine_x = {'encoding', 'fileformat', 'filetype'},
|
||||||
|
lualine_y = {'progress'},
|
||||||
|
lualine_z = {'location'}
|
||||||
|
},
|
||||||
|
inactive_sections = {
|
||||||
|
lualine_a = {},
|
||||||
|
lualine_b = {},
|
||||||
|
lualine_c = {'filename'},
|
||||||
|
lualine_x = {'location'},
|
||||||
|
lualine_y = {},
|
||||||
|
lualine_z = {}
|
||||||
|
},
|
||||||
|
tabline = {},
|
||||||
|
winbar = {},
|
||||||
|
inactive_winbar = {},
|
||||||
|
extensions = {}
|
||||||
|
}
|
||||||
|
end
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user