cmp works? ghost text works?

This commit is contained in:
inorishio
2026-03-05 00:36:39 +01:00
parent d9157328ef
commit 75a5dd8f9c
17 changed files with 262 additions and 316 deletions
+13
View File
@@ -0,0 +1,13 @@
function! neoformat#formatters#qml#enabled() abort
return ['qmlformat']
endfunction
function! neoformat#formatters#qml#qmlformat() abort
return {
\ 'exe': '/usr/lib/qt6/bin/qmlformat',
\ 'args': ['-t', '-n', '--objects-spacing', '--functions-spacing', '-i'],
\ 'replace': 1,
\ 'stderr': 1,
\ 'stdin': 0
\ }
endfunction
+4 -4
View File
@@ -1,12 +1,12 @@
local gen_hook = MiniSplitjoin.gen_hook
local curly = { brackets = { '%b{}' }, separator = ';' }
local curly_semi = { brackets = { '%b{}' }, separator = ';' }
local curly = { brackets = { "%b{}" }, separator = ";" }
local curly_semi = { brackets = { "%b{}" }, separator = ";" }
local add_semicolon_curly = gen_hook.add_trailing_separator(curly)
local remove_semicolon_curly = gen_hook.del_trailing_separator(curly)
local pad_curly = gen_hook.pad_brackets(curly_semi)
vim.b.minisplitjoin_config = {
split = { hooks_post = { remove_semicolon_curly }},
join = { hooks_pre = { add_semicolon_curly }, hooks_post = { pad_curly }},
split = { hooks_post = { remove_semicolon_curly } },
join = { hooks_pre = { add_semicolon_curly }, hooks_post = { pad_curly } },
}
+68 -68
View File
@@ -1,74 +1,74 @@
local M = {}
M.icons = {
misc = {
dots = "󰇘",
},
ft = {
octo = "",
gh = "",
["markdown.gh"] = "",
},
dap = {
Stopped = { "󰁕 ", "DiagnosticWarn", "DapStoppedLine" },
Breakpoint = "",
BreakpointCondition = "",
BreakpointRejected = { "", "DiagnosticError" },
LogPoint = ".>",
},
diagnostics = {
Error = "",
Warn = "",
Hint = "",
Info = "",
},
git = {
added = "",
modified = "",
removed = "",
},
kinds = {
Array = "",
Boolean = "󰨙 ",
Class = "",
Codeium = "󰘦 ",
Color = "",
Control = "",
Collapsed = "",
Constant = "󰏿 ",
Constructor = "",
Copilot = "",
Enum = "",
EnumMember = "",
Event = "",
Field = "",
File = "",
Folder = "",
Function = "󰊕 ",
Interface = "",
Key = "",
Keyword = "",
Method = "󰊕 ",
Module = "",
Namespace = "󰦮 ",
Null = "",
Number = "󰎠 ",
Object = "",
Operator = "",
Package = "",
Property = "",
Reference = "",
Snippet = "󱄽 ",
String = "",
Struct = "󰆼 ",
Supermaven = "",
TabNine = "󰏚 ",
Text = "",
TypeParameter = "",
Unit = "",
Value = "",
Variable = "󰀫 ",
},
misc = {
dots = "󰇘",
},
ft = {
octo = "",
gh = "",
["markdown.gh"] = "",
},
dap = {
Stopped = { "󰁕 ", "DiagnosticWarn", "DapStoppedLine" },
Breakpoint = "",
BreakpointCondition = "",
BreakpointRejected = { "", "DiagnosticError" },
LogPoint = ".>",
},
diagnostics = {
Error = "",
Warn = "",
Hint = "",
Info = "",
},
git = {
added = "",
modified = "",
removed = "",
},
kinds = {
Array = "",
Boolean = "󰨙 ",
Class = "",
Codeium = "󰘦 ",
Color = "",
Control = "",
Collapsed = "",
Constant = "󰏿 ",
Constructor = "",
Copilot = "",
Enum = "",
EnumMember = "",
Event = "",
Field = "",
File = "",
Folder = "",
Function = "󰊕 ",
Interface = "",
Key = "",
Keyword = "",
Method = "󰊕 ",
Module = "",
Namespace = "󰦮 ",
Null = "",
Number = "󰎠 ",
Object = "",
Operator = "",
Package = "",
Property = "",
Reference = "",
Snippet = "󱄽 ",
String = "",
Struct = "󰆼 ",
Supermaven = "",
TabNine = "󰏚 ",
Text = "",
TypeParameter = "",
Unit = "",
Value = "",
Variable = "󰀫 ",
},
}
return M
-177
View File
@@ -1,177 +0,0 @@
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
-38
View File
@@ -1,38 +0,0 @@
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>",
},
})
+1 -1
View File
@@ -17,7 +17,7 @@ require("copilot").setup({
suggestion = {
enabled = true,
auto_trigger = true,
hide_during_completion = true,
hide_during_completion = false,
debounce = 75,
keymap = {
accept = "<A-a>",
+4
View File
@@ -0,0 +1,4 @@
require("copilot_cmp").setup {
event = { "InsertEnter", "LspAttach" },
fix_pairs = true,
}
+16 -16
View File
@@ -1,29 +1,29 @@
local highlight = {
"RainbowRed",
"RainbowYellow",
"RainbowBlue",
"RainbowOrange",
"RainbowGreen",
"RainbowViolet",
"RainbowCyan",
"RainbowRed",
"RainbowYellow",
"RainbowBlue",
"RainbowOrange",
"RainbowGreen",
"RainbowViolet",
"RainbowCyan",
}
local hooks = require "ibl.hooks"
-- create the highlight groups in the highlight setup hook, so they are reset
-- every time the colorscheme changes
hooks.register(hooks.type.HIGHLIGHT_SETUP, function()
vim.api.nvim_set_hl(0, "RainbowRed", { fg = "#E06C75" })
vim.api.nvim_set_hl(0, "RainbowYellow", { fg = "#E5C07B" })
vim.api.nvim_set_hl(0, "RainbowBlue", { fg = "#61AFEF" })
vim.api.nvim_set_hl(0, "RainbowOrange", { fg = "#D19A66" })
vim.api.nvim_set_hl(0, "RainbowGreen", { fg = "#98C379" })
vim.api.nvim_set_hl(0, "RainbowViolet", { fg = "#C678DD" })
vim.api.nvim_set_hl(0, "RainbowCyan", { fg = "#56B6C2" })
vim.api.nvim_set_hl(0, "RainbowRed", { fg = "#E06C75" })
vim.api.nvim_set_hl(0, "RainbowYellow", { fg = "#E5C07B" })
vim.api.nvim_set_hl(0, "RainbowBlue", { fg = "#61AFEF" })
vim.api.nvim_set_hl(0, "RainbowOrange", { fg = "#D19A66" })
vim.api.nvim_set_hl(0, "RainbowGreen", { fg = "#98C379" })
vim.api.nvim_set_hl(0, "RainbowViolet", { fg = "#C678DD" })
vim.api.nvim_set_hl(0, "RainbowCyan", { fg = "#56B6C2" })
end)
vim.g.rainbow_delimiters = { highlight = highlight }
require("ibl").setup {
indent = { char = "" },
scope = { highlight = highlight }
indent = { char = "" },
scope = { highlight = highlight },
}
hooks.register(hooks.type.SCOPE_HIGHLIGHT, hooks.builtin.scope_highlight_from_extmark)
+74 -1
View File
@@ -1,3 +1,7 @@
local cmp = require "cmp"
local cmp_lsp = require "cmp_nvim_lsp"
local cmp_kinds = require("assets.icons").icons.kinds
local function flatten_to_array(t)
local res = {}
local function _flatten(tbl)
@@ -17,7 +21,7 @@ local capabilities = vim.tbl_deep_extend(
"force",
{},
vim.lsp.protocol.make_client_capabilities(),
require("blink.cmp").get_lsp_capabilities()
cmp_lsp.default_capabilities()
)
require("fidget").setup {}
@@ -95,6 +99,75 @@ require("mason-lspconfig").setup {
},
}
cmp.setup {
preselect = "None",
formatting = {
fields = { "kind", "abbr" },
format = function(entry, vim_item)
vim_item.kind = cmp_kinds[vim_item.kind] or ""
if entry.completion_item.detail then
vim_item.menu = entry.completion_item.detail
end
return vim_item
end,
},
completion = { completeopt = "menu,menuone" },
snippet = {
expand = function(args)
require("luasnip").lsp_expand(args.body)
end,
},
window = {
completion = cmp.config.window.bordered(),
documentation = cmp.config.window.bordered(),
},
view = {
entries = "custom",
},
mapping = {
["<C-p>"] = cmp.mapping.select_prev_item(),
["<C-n>"] = cmp.mapping.select_next_item(),
["<C-d>"] = cmp.mapping.scroll_docs(-4),
["<C-f>"] = cmp.mapping.scroll_docs(4),
["<C-Space>"] = cmp.mapping.complete(),
["<C-e>"] = cmp.mapping.close(),
["<CR>"] = cmp.mapping.confirm {
behavior = cmp.ConfirmBehavior.Insert,
select = true,
},
["<Tab>"] = cmp.mapping(function(fallback)
if cmp.visible() then
cmp.select_next_item()
elseif require("luasnip").expand_or_jumpable() then
require("luasnip").expand_or_jump()
else
fallback()
end
end, { "i", "s" }),
["<S-Tab>"] = cmp.mapping(function(fallback)
if cmp.visible() then
cmp.select_prev_item()
elseif require("luasnip").jumpable(-1) then
require("luasnip").jump(-1)
else
fallback()
end
end, { "i", "s" }),
},
sources = cmp.config.sources {
{ name = "path" },
{ name = "nvim_lsp" },
{ name = "luasnip" },
{ name = "buffer" },
{ name = "nvim_lua" },
{ name = "copilot" },
},
}
vim.diagnostic.config {
virtual_text = false,
virtual_lines = false,
+55
View File
@@ -0,0 +1,55 @@
local opts = {}
opts = {
file_types = { "markdown" },
completions = {
lsp = {
enabled = true,
},
},
render_modes = true,
anti_conceal = {
enabled = true,
above = 1,
below = 1,
},
code = {
enabled = true,
render_modes = false,
sign = true,
conceal_delimiters = true,
language = true,
position = "left",
language_icon = true,
language_name = true,
language_info = true,
language_pad = 0,
width = "full",
left_margin = 0,
left_pad = 2,
right_pad = 0,
min_width = 40,
border = "thick",
language_border = "",
language_left = "",
language_right = "",
above = "",
below = "",
inline = true,
inline_left = "",
inline_right = "",
inline_pad = 0,
priority = 140,
highlight = "RenderMarkdownCode",
highlight_info = "RenderMarkdownCodeInfo",
highlight_language = nil,
highlight_border = "RenderMarkdownCodeBorder",
highlight_fallback = "RenderMarkdownCodeFallback",
highlight_inline = "RenderMarkdownCodeInline",
style = "full",
},
}
return opts
+1 -1
View File
@@ -3,7 +3,7 @@ local M = {}
M.plugin = {
"sbdchd/neoformat",
config = function()
vim.g.neoformat_enabled_lua = { "stylua" }
vim.g.neoformat_enabled_lua = { "luaformatter" }
vim.g.neoformat_enabled_python = { "black" }
vim.g.neoformat_enabled_javascript = { "prettier" }
vim.g.neoformat_enabled_typescript = { "prettier" }
+1 -1
View File
@@ -62,7 +62,7 @@ return {
scope = { enabled = true },
scroll = { enabled = true },
statuscolumn = { enabled = true },
words = { enabled = true },
words = { enabled = false },
terminal = {
enabled = true,
win = { style = "terminal" },
+4 -5
View File
@@ -6,8 +6,7 @@ vim.g.coq_settings = { keymap = { recommended = false } }
vim.g.zig_fmt_parse_errors = 0
vim.g.zig_fmt_autosave = 0
vim.api.nvim_set_hl(0, 'GitGutterAdd', { fg = '#009900', ctermfg = 2 })
vim.api.nvim_set_hl(0, 'GitGutterChange', { fg = '#bbbb00', ctermfg = 3 })
vim.api.nvim_set_hl(0, 'GitGutterDelete', { fg = '#ff2222', ctermfg = 1 })
-- vim.g.gruvbox_material_background = "medium"
-- vim.g.gruvbox_material_foreground = "original"
vim.api.nvim_set_hl(0, "GitGutterAdd", { fg = "#009900", ctermfg = 2 })
vim.api.nvim_set_hl(0, "GitGutterChange", { fg = "#bbbb00", ctermfg = 3 })
vim.api.nvim_set_hl(0, "GitGutterDelete", { fg = "#ff2222", ctermfg = 1 })
vim.api.nvim_set_hl(1, "CmpItemKindCopilot", { fg = "#6CC644" })
+1 -1
View File
@@ -36,7 +36,7 @@ end)
-- Greatest remap
map("n", "<leader>Y", [["+Y]])
map("n", "<C-q>", function() Snacks.terminal.toggle() end, { desc = "Toggle Terminal" })
map("n", "<A-q>", function() Snacks.terminal.toggle() end, { desc = "Toggle Terminal" })
map("n", "<leader>gb", function() Snacks.gitbrowse.open() end )
map("n", "K", require("pretty_hover").hover)
-1
View File
@@ -5,7 +5,6 @@ vim.opt.softtabstop = 4
vim.opt.shiftwidth = 4
vim.opt.expandtab = true
vim.opt.smartindent = false
vim.opts.rocks.enabled = false
vim.o.list = true
vim.opt.listchars = { tab = "··", trail = "·", nbsp = "_" }
+12
View File
@@ -0,0 +1,12 @@
return {
{
"MeanderingProgrammer/render-markdown.nvim",
dependencies = {
"nvim-treesitter/nvim-treesitter",
"nvim-mini/mini.nvim",
},
---@module 'render-markdown'
---@type render.md.UserConfig
opts = require "config.format.markdown",
},
}
+8 -2
View File
@@ -55,7 +55,7 @@ return {
"mawkler/modicator.nvim",
config = function()
require("config.modicator")
end
end,
},
{
"shinchu/lightline-gruvbox.vim",
@@ -86,7 +86,7 @@ return {
require "config.notify"
end,
},
{
{
"zbirenbaum/copilot.lua",
cmd = "Copilot",
event = "InsertEnter",
@@ -94,6 +94,12 @@ return {
require "config.ai.copilot"
end,
},
{
"zbirenbaum/copilot-cmp",
config = function ()
require "config.ai.copilot_cmp"
end,
},
{
"CopilotC-Nvim/CopilotChat.nvim",
dependencies = {