cmp works? ghost text works?
This commit is contained in:
@@ -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
|
||||||
+2
-2
@@ -1,7 +1,7 @@
|
|||||||
local gen_hook = MiniSplitjoin.gen_hook
|
local gen_hook = MiniSplitjoin.gen_hook
|
||||||
|
|
||||||
local curly = { brackets = { '%b{}' }, separator = ';' }
|
local curly = { brackets = { "%b{}" }, separator = ";" }
|
||||||
local curly_semi = { brackets = { '%b{}' }, separator = ';' }
|
local curly_semi = { brackets = { "%b{}" }, separator = ";" }
|
||||||
local add_semicolon_curly = gen_hook.add_trailing_separator(curly)
|
local add_semicolon_curly = gen_hook.add_trailing_separator(curly)
|
||||||
local remove_semicolon_curly = gen_hook.del_trailing_separator(curly)
|
local remove_semicolon_curly = gen_hook.del_trailing_separator(curly)
|
||||||
local pad_curly = gen_hook.pad_brackets(curly_semi)
|
local pad_curly = gen_hook.pad_brackets(curly_semi)
|
||||||
|
|||||||
@@ -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
|
|
||||||
@@ -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>",
|
|
||||||
},
|
|
||||||
})
|
|
||||||
@@ -17,7 +17,7 @@ require("copilot").setup({
|
|||||||
suggestion = {
|
suggestion = {
|
||||||
enabled = true,
|
enabled = true,
|
||||||
auto_trigger = true,
|
auto_trigger = true,
|
||||||
hide_during_completion = true,
|
hide_during_completion = false,
|
||||||
debounce = 75,
|
debounce = 75,
|
||||||
keymap = {
|
keymap = {
|
||||||
accept = "<A-a>",
|
accept = "<A-a>",
|
||||||
|
|||||||
@@ -0,0 +1,4 @@
|
|||||||
|
require("copilot_cmp").setup {
|
||||||
|
event = { "InsertEnter", "LspAttach" },
|
||||||
|
fix_pairs = true,
|
||||||
|
}
|
||||||
@@ -23,7 +23,7 @@ end)
|
|||||||
vim.g.rainbow_delimiters = { highlight = highlight }
|
vim.g.rainbow_delimiters = { highlight = highlight }
|
||||||
require("ibl").setup {
|
require("ibl").setup {
|
||||||
indent = { char = "▏" },
|
indent = { char = "▏" },
|
||||||
scope = { highlight = highlight }
|
scope = { highlight = highlight },
|
||||||
}
|
}
|
||||||
|
|
||||||
hooks.register(hooks.type.SCOPE_HIGHLIGHT, hooks.builtin.scope_highlight_from_extmark)
|
hooks.register(hooks.type.SCOPE_HIGHLIGHT, hooks.builtin.scope_highlight_from_extmark)
|
||||||
|
|||||||
@@ -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 function flatten_to_array(t)
|
||||||
local res = {}
|
local res = {}
|
||||||
local function _flatten(tbl)
|
local function _flatten(tbl)
|
||||||
@@ -17,7 +21,7 @@ local capabilities = vim.tbl_deep_extend(
|
|||||||
"force",
|
"force",
|
||||||
{},
|
{},
|
||||||
vim.lsp.protocol.make_client_capabilities(),
|
vim.lsp.protocol.make_client_capabilities(),
|
||||||
require("blink.cmp").get_lsp_capabilities()
|
cmp_lsp.default_capabilities()
|
||||||
)
|
)
|
||||||
|
|
||||||
require("fidget").setup {}
|
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 {
|
vim.diagnostic.config {
|
||||||
virtual_text = false,
|
virtual_text = false,
|
||||||
virtual_lines = false,
|
virtual_lines = false,
|
||||||
|
|||||||
@@ -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
|
||||||
@@ -3,7 +3,7 @@ local M = {}
|
|||||||
M.plugin = {
|
M.plugin = {
|
||||||
"sbdchd/neoformat",
|
"sbdchd/neoformat",
|
||||||
config = function()
|
config = function()
|
||||||
vim.g.neoformat_enabled_lua = { "stylua" }
|
vim.g.neoformat_enabled_lua = { "luaformatter" }
|
||||||
vim.g.neoformat_enabled_python = { "black" }
|
vim.g.neoformat_enabled_python = { "black" }
|
||||||
vim.g.neoformat_enabled_javascript = { "prettier" }
|
vim.g.neoformat_enabled_javascript = { "prettier" }
|
||||||
vim.g.neoformat_enabled_typescript = { "prettier" }
|
vim.g.neoformat_enabled_typescript = { "prettier" }
|
||||||
|
|||||||
@@ -62,7 +62,7 @@ return {
|
|||||||
scope = { enabled = true },
|
scope = { enabled = true },
|
||||||
scroll = { enabled = true },
|
scroll = { enabled = true },
|
||||||
statuscolumn = { enabled = true },
|
statuscolumn = { enabled = true },
|
||||||
words = { enabled = true },
|
words = { enabled = false },
|
||||||
terminal = {
|
terminal = {
|
||||||
enabled = true,
|
enabled = true,
|
||||||
win = { style = "terminal" },
|
win = { style = "terminal" },
|
||||||
|
|||||||
+4
-5
@@ -6,8 +6,7 @@ vim.g.coq_settings = { keymap = { recommended = false } }
|
|||||||
vim.g.zig_fmt_parse_errors = 0
|
vim.g.zig_fmt_parse_errors = 0
|
||||||
vim.g.zig_fmt_autosave = 0
|
vim.g.zig_fmt_autosave = 0
|
||||||
|
|
||||||
vim.api.nvim_set_hl(0, 'GitGutterAdd', { fg = '#009900', ctermfg = 2 })
|
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, "GitGutterChange", { fg = "#bbbb00", ctermfg = 3 })
|
||||||
vim.api.nvim_set_hl(0, 'GitGutterDelete', { fg = '#ff2222', ctermfg = 1 })
|
vim.api.nvim_set_hl(0, "GitGutterDelete", { fg = "#ff2222", ctermfg = 1 })
|
||||||
-- vim.g.gruvbox_material_background = "medium"
|
vim.api.nvim_set_hl(1, "CmpItemKindCopilot", { fg = "#6CC644" })
|
||||||
-- vim.g.gruvbox_material_foreground = "original"
|
|
||||||
|
|||||||
+1
-1
@@ -36,7 +36,7 @@ end)
|
|||||||
|
|
||||||
-- Greatest remap
|
-- Greatest remap
|
||||||
map("n", "<leader>Y", [["+Y]])
|
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", "<leader>gb", function() Snacks.gitbrowse.open() end )
|
||||||
map("n", "K", require("pretty_hover").hover)
|
map("n", "K", require("pretty_hover").hover)
|
||||||
|
|
||||||
|
|||||||
@@ -5,7 +5,6 @@ vim.opt.softtabstop = 4
|
|||||||
vim.opt.shiftwidth = 4
|
vim.opt.shiftwidth = 4
|
||||||
vim.opt.expandtab = true
|
vim.opt.expandtab = true
|
||||||
vim.opt.smartindent = false
|
vim.opt.smartindent = false
|
||||||
vim.opts.rocks.enabled = false
|
|
||||||
|
|
||||||
vim.o.list = true
|
vim.o.list = true
|
||||||
vim.opt.listchars = { tab = "··", trail = "·", nbsp = "_" }
|
vim.opt.listchars = { tab = "··", trail = "·", nbsp = "_" }
|
||||||
|
|||||||
@@ -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",
|
||||||
|
},
|
||||||
|
}
|
||||||
@@ -55,7 +55,7 @@ return {
|
|||||||
"mawkler/modicator.nvim",
|
"mawkler/modicator.nvim",
|
||||||
config = function()
|
config = function()
|
||||||
require("config.modicator")
|
require("config.modicator")
|
||||||
end
|
end,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"shinchu/lightline-gruvbox.vim",
|
"shinchu/lightline-gruvbox.vim",
|
||||||
@@ -94,6 +94,12 @@ return {
|
|||||||
require "config.ai.copilot"
|
require "config.ai.copilot"
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"zbirenbaum/copilot-cmp",
|
||||||
|
config = function ()
|
||||||
|
require "config.ai.copilot_cmp"
|
||||||
|
end,
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"CopilotC-Nvim/CopilotChat.nvim",
|
"CopilotC-Nvim/CopilotChat.nvim",
|
||||||
dependencies = {
|
dependencies = {
|
||||||
|
|||||||
Reference in New Issue
Block a user