The complete windows feel
This commit is contained in:
@@ -0,0 +1,177 @@
|
||||
local M = {}
|
||||
|
||||
local icons = require("assets.icons").icons.kinds
|
||||
|
||||
local devicons = {
|
||||
default_icon = { icon = "", name = "Default" },
|
||||
js = { icon = "", name = "js" },
|
||||
ts = { icon = "", name = "ts" },
|
||||
lock = { icon = "", name = "lock" },
|
||||
["robots.txt"] = { icon = "", name = "robots" },
|
||||
}
|
||||
|
||||
M.components = {
|
||||
kind_icon = {
|
||||
text = function(ctx)
|
||||
local icon = (icons[ctx.kind] or "")
|
||||
|
||||
return icon .. " "
|
||||
end,
|
||||
},
|
||||
|
||||
kind = {
|
||||
highlight = function(ctx)
|
||||
return ctx.kind
|
||||
end,
|
||||
},
|
||||
}
|
||||
|
||||
local opts = {
|
||||
"saghen/blink.cmp",
|
||||
dependencies = {
|
||||
"rafamadriz/friendly-snippets",
|
||||
{
|
||||
"fang2hou/blink-copilot",
|
||||
config = function()
|
||||
require "config.blink-copilot"
|
||||
end,
|
||||
},
|
||||
},
|
||||
|
||||
version = "1.*",
|
||||
|
||||
opts = {
|
||||
keymap = {
|
||||
["<Tab>"] = {
|
||||
function(cmp)
|
||||
if cmp.is_visible() then
|
||||
return cmp.select_next()
|
||||
end
|
||||
|
||||
if cmp.snippet_active() then
|
||||
return cmp.snippet_forward()
|
||||
end
|
||||
end,
|
||||
"fallback",
|
||||
},
|
||||
["<S-Tab>"] = {
|
||||
function(cmp)
|
||||
if cmp.is_visible() then
|
||||
return cmp.select_prev()
|
||||
end
|
||||
|
||||
if cmp.snippet_active() then
|
||||
return cmp.snippet_backward()
|
||||
end
|
||||
end,
|
||||
"fallback",
|
||||
},
|
||||
["<CR>"] = { "accept", "fallback" },
|
||||
["Up"] = {},
|
||||
["Down"] = {},
|
||||
},
|
||||
|
||||
appearance = {
|
||||
nerd_font_variant = "mono",
|
||||
},
|
||||
|
||||
cmdline = {
|
||||
completion = {
|
||||
menu = { auto_show = true },
|
||||
list = { selection = { preselect = false } },
|
||||
},
|
||||
|
||||
keymap = {
|
||||
["<Tab>"] = {
|
||||
function(cmp)
|
||||
if cmp.is_visible() then
|
||||
return cmp.select_next()
|
||||
end
|
||||
end,
|
||||
"fallback",
|
||||
},
|
||||
["<S-Tab>"] = {
|
||||
function(cmp)
|
||||
if cmp.is_visible() then
|
||||
return cmp.select_prev()
|
||||
end
|
||||
end,
|
||||
"fallback",
|
||||
},
|
||||
["<CR>"] = { "accept", "fallback" },
|
||||
["Up"] = {},
|
||||
["Down"] = {},
|
||||
},
|
||||
},
|
||||
|
||||
completion = {
|
||||
documentation = { auto_show = true, auto_show_delay_ms = 50 },
|
||||
keyword = { range = "full" },
|
||||
accept = { auto_brackets = { enabled = true } },
|
||||
ghost_text = { enabled = true },
|
||||
list = {
|
||||
selection = {
|
||||
-- preselect = false,
|
||||
auto_insert = false,
|
||||
},
|
||||
},
|
||||
|
||||
menu = {
|
||||
scrollbar = false,
|
||||
border = "single",
|
||||
draw = {
|
||||
padding = 1,
|
||||
columns = {
|
||||
{ "kind_icon" },
|
||||
{ "label", "label_description", gap = 1 },
|
||||
{ "kind" },
|
||||
},
|
||||
components = M.components,
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
signature = { enabled = true },
|
||||
|
||||
sources = {
|
||||
default = { "lsp", "path", "snippets", "buffer", "copilot" },
|
||||
providers = {
|
||||
lsp = {
|
||||
score_offset = 50,
|
||||
},
|
||||
|
||||
path = {
|
||||
opts = {
|
||||
get_cwd = function()
|
||||
return vim.fn.getcwd()
|
||||
end,
|
||||
},
|
||||
},
|
||||
|
||||
buffer = {
|
||||
score_offset = -10,
|
||||
},
|
||||
|
||||
snippets = {
|
||||
score_offset = 0,
|
||||
},
|
||||
|
||||
copilot = {
|
||||
name = "copilot",
|
||||
module = "blink-copilot",
|
||||
score_offset = 100,
|
||||
async = true,
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
snippets = {
|
||||
preset = "default",
|
||||
},
|
||||
|
||||
fuzzy = { implementation = "prefer_rust_with_warning" },
|
||||
},
|
||||
opts_extend = { "sources.default" },
|
||||
}
|
||||
|
||||
return opts
|
||||
@@ -0,0 +1,38 @@
|
||||
require("chatgpt").setup({
|
||||
api_host_cmd = "echo http://localhost:5000",
|
||||
api_key_cmd = "echo ''",
|
||||
openai_params = {
|
||||
model = "Selene-1-Mini-Llama-3.1-8B-EXL3",
|
||||
frequency_penalty = 0,
|
||||
presence_penalty = 0,
|
||||
max_tokens = 1024,
|
||||
temperature = 0.1,
|
||||
top_p = 1,
|
||||
n = 1,
|
||||
},
|
||||
keymaps = {
|
||||
close = "<C-c>",
|
||||
close_n = "<Esc>",
|
||||
yank_last = "<C-y>",
|
||||
yank_last_code = "<C-k>",
|
||||
scroll_up = "<C-u>",
|
||||
scroll_down = "<C-d>",
|
||||
new_session = "<C-l>",
|
||||
cycle_windows = "<Tab>",
|
||||
cycle_modes = "<C-f>",
|
||||
next_message = "<C-j>",
|
||||
prev_message = "<C-k>",
|
||||
select_session = "<Space>",
|
||||
rename_session = "r",
|
||||
delete_session = "d",
|
||||
draft_message = "<C-r>",
|
||||
edit_message = "e",
|
||||
delete_message = "d",
|
||||
toggle_settings = "<C-o>",
|
||||
toggle_sessions = "<C-p>",
|
||||
toggle_help = "<C-h>",
|
||||
toggle_message_role = "<C-r>",
|
||||
toggle_system_role_open = "<C-s>",
|
||||
stop_generating = "<C-x>",
|
||||
},
|
||||
})
|
||||
@@ -0,0 +1,59 @@
|
||||
require("copilot").setup({
|
||||
panel = {
|
||||
enabled = true,
|
||||
auto_refresh = true,
|
||||
keymap = {
|
||||
jump_prev = "[[",
|
||||
jump_next = "]]",
|
||||
accept = "<CR>",
|
||||
refresh = "gr",
|
||||
open = "<M-CR>"
|
||||
},
|
||||
layout = {
|
||||
position = "bottom", -- | top | left | right | horizontal | vertical
|
||||
ratio = 0.4
|
||||
},
|
||||
},
|
||||
suggestion = {
|
||||
enabled = true,
|
||||
auto_trigger = true,
|
||||
hide_during_completion = true,
|
||||
debounce = 75,
|
||||
keymap = {
|
||||
accept = "<A-a>",
|
||||
accept_word = false,
|
||||
accept_line = false,
|
||||
next = "<M-]>",
|
||||
prev = "<M-[>",
|
||||
dismiss = "<C-]>",
|
||||
},
|
||||
},
|
||||
filetypes = {
|
||||
-- yaml = false,
|
||||
-- markdown = false,
|
||||
-- help = false,
|
||||
-- gitcommit = false,
|
||||
-- gitrebase = false,
|
||||
-- hgcommit = false,
|
||||
-- svn = false,
|
||||
-- cvs = false,
|
||||
-- python = false,
|
||||
-- html = false,
|
||||
-- css = false,
|
||||
-- sh = false,
|
||||
-- tex = false,
|
||||
-- typescript = false,
|
||||
-- java = false,
|
||||
-- swift = false,
|
||||
-- cpp = false,
|
||||
-- hypr = false,
|
||||
-- ["."] = false,
|
||||
},
|
||||
copilot_node_command = 'node',
|
||||
server_opts_overrides = {},
|
||||
vim.api.nvim_create_autocmd({ "VimLeavePre" }, {
|
||||
callback = function()
|
||||
vim.cmd( "CopilotChatSave AutoSave" )
|
||||
end,
|
||||
}),
|
||||
})
|
||||
@@ -0,0 +1,42 @@
|
||||
require("CopilotChat").setup {
|
||||
-- system_prompt = "You are an assistant helping the user with whatever they need, but you are also a bit of an asshole.",
|
||||
prompts = {
|
||||
},
|
||||
|
||||
headers = {
|
||||
user = ' You: ',
|
||||
assistant = ' Copilot: ',
|
||||
tool = ' Tool: ',
|
||||
},
|
||||
|
||||
temperature = 0.2,
|
||||
|
||||
providers = {
|
||||
tabby = {
|
||||
prepare_input = require('CopilotChat.config.providers').copilot.prepare_input,
|
||||
prepare_output = require('CopilotChat.config.providers').copilot.prepare_output,
|
||||
|
||||
get_models = function(headers)
|
||||
local response, err = require('CopilotChat.utils').curl_get('http://localhost:5000/v1/models', {
|
||||
headers = headers,
|
||||
json_response = true
|
||||
})
|
||||
|
||||
if err then
|
||||
error(err)
|
||||
end
|
||||
|
||||
return vim.tbl_map(function(model)
|
||||
return {
|
||||
id = model.id,
|
||||
name = model.id,
|
||||
}
|
||||
end, response.body.data)
|
||||
end,
|
||||
|
||||
get_url = function()
|
||||
return 'http://localhost:5000/v1/chat/completions'
|
||||
end,
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user