cmp and autopairs
This commit is contained in:
+58
-58
@@ -27,82 +27,82 @@ local function pick(light, dark)
|
||||
end
|
||||
|
||||
local c = {
|
||||
bg = "#161219",
|
||||
bg_alt = "#1E1A21",
|
||||
bg_float = "#221E25",
|
||||
bg_popup = "#2D2830",
|
||||
bg_cursorline = pick("#2D2830", "#38333B"),
|
||||
bg_fold = "#1E1A21",
|
||||
bg_visual = "#543D68",
|
||||
bg_search = pick("#B2417A", "#543D68"),
|
||||
bg_incsearch = "#894FBF",
|
||||
bg_selection = "#894FBF",
|
||||
bg_statusline = pick("#2D2830", "#221E25"),
|
||||
bg_statusline_nc = "#1E1A21",
|
||||
bg_tabline = "#1E1A21",
|
||||
bg_tabsel = "#2D2830",
|
||||
bg = "#15130F",
|
||||
bg_alt = "#1D1B17",
|
||||
bg_float = "#221F1A",
|
||||
bg_popup = "#2C2A25",
|
||||
bg_cursorline = pick("#2C2A25", "#37342F"),
|
||||
bg_fold = "#1D1B17",
|
||||
bg_visual = "#51482F",
|
||||
bg_search = pick("#35491F", "#51482F"),
|
||||
bg_incsearch = "#514209",
|
||||
bg_selection = "#514209",
|
||||
bg_statusline = pick("#2C2A25", "#221F1A"),
|
||||
bg_statusline_nc = "#1D1B17",
|
||||
bg_tabline = "#1D1B17",
|
||||
bg_tabsel = "#2C2A25",
|
||||
|
||||
fg = "#E9E0EA",
|
||||
fg_muted = "#CEC3D3",
|
||||
fg_subtle = "#978D9D",
|
||||
fg_comment = pick("#978D9D", "#4C4451"),
|
||||
fg = "#E8E2DA",
|
||||
fg_muted = "#CEC6B5",
|
||||
fg_subtle = "#979081",
|
||||
fg_comment = pick("#979081", "#4B463A"),
|
||||
fg_strong = pick("#1A1B1F", "#F2F2F7"),
|
||||
fg_on_soft = pick("#17181C", "#F4F4F8"),
|
||||
|
||||
border = "#4C4451",
|
||||
accent = "#DEB7FF",
|
||||
accent_container = "#894FBF",
|
||||
accent_fg = "#F7E7FF",
|
||||
accent_solid_fg = "#4A007F",
|
||||
border = "#4B463A",
|
||||
accent = "#DCC580",
|
||||
accent_container = "#514209",
|
||||
accent_fg = "#C5AF6D",
|
||||
accent_solid_fg = "#3C2F00",
|
||||
|
||||
secondary = "#D8BCEF",
|
||||
secondary_container = "#543D68",
|
||||
secondary_fg = "#C6AADD",
|
||||
secondary_solid_fg = "#3C2750",
|
||||
secondary = "#D2C6A5",
|
||||
secondary_container = "#51482F",
|
||||
secondary_fg = "#C4B897",
|
||||
secondary_solid_fg = "#373019",
|
||||
|
||||
tertiary = "#FFB0D0",
|
||||
tertiary_container = "#B2417A",
|
||||
tertiary_fg = "#FFE7EE",
|
||||
tertiary_solid_fg = "#63003C",
|
||||
tertiary = "#B6CF98",
|
||||
tertiary_container = "#35491F",
|
||||
tertiary_fg = "#A0B883",
|
||||
tertiary_solid_fg = "#23360E",
|
||||
|
||||
error = "#FFB4AB",
|
||||
error_container = "#93000A",
|
||||
error_fg = "#FFDAD6",
|
||||
error_solid_fg = "#690005",
|
||||
|
||||
ok = "#FFBAC2",
|
||||
warn = "#FFDCF2",
|
||||
info = "#A9A5D8",
|
||||
hint = "#9DCEFF",
|
||||
add = "#FFBAC2",
|
||||
change = "#A9A5D8",
|
||||
delete = "#DE4FFD",
|
||||
ok = "#E8CB46",
|
||||
warn = "#FFE39D",
|
||||
info = "#AAAF6E",
|
||||
hint = "#D6CC72",
|
||||
add = "#E8CB46",
|
||||
change = "#AAAF6E",
|
||||
delete = "#BE8700",
|
||||
|
||||
cursor_fg = "#4A007F",
|
||||
cursor_bg = "#DEB7FF",
|
||||
match_bg = "#B2417A",
|
||||
match_fg = "#FFE7EE",
|
||||
todo_bg = "#B2417A",
|
||||
todo_fg = "#FFE7EE",
|
||||
cursor_fg = "#3C2F00",
|
||||
cursor_bg = "#DCC580",
|
||||
match_bg = "#35491F",
|
||||
match_fg = "#A0B883",
|
||||
todo_bg = "#35491F",
|
||||
todo_fg = "#A0B883",
|
||||
|
||||
-- Syntax accents must stay dynamic. These come from your generated palette
|
||||
-- instead of fixed hex values, so foregrounds change with the wallpaper too.
|
||||
code_keyword = "#CA98DE",
|
||||
code_func = "#9DCEFF",
|
||||
code_string = "#FFBAC2",
|
||||
code_number = "#FFDCF2",
|
||||
code_const = "#DE4FFD",
|
||||
code_type = "#DEB7FF",
|
||||
code_special = "#FFB0D0",
|
||||
code_preproc = "#D8BCEF",
|
||||
code_builtin = "#DEB7FF",
|
||||
code_param = "#FFDCF2",
|
||||
code_field = "#D8BCEF",
|
||||
code_namespace = "#FFB0D0",
|
||||
code_operator = pick("#DEB7FF", "#D8BCEF"),
|
||||
code_keyword = "#DB9F46",
|
||||
code_func = "#D6CC72",
|
||||
code_string = "#E8CB46",
|
||||
code_number = "#FFE39D",
|
||||
code_const = "#BE8700",
|
||||
code_type = "#DCC580",
|
||||
code_special = "#B6CF98",
|
||||
code_preproc = "#D2C6A5",
|
||||
code_builtin = "#DCC580",
|
||||
code_param = "#FFE39D",
|
||||
code_field = "#D2C6A5",
|
||||
code_namespace = "#B6CF98",
|
||||
code_operator = pick("#DCC580", "#D2C6A5"),
|
||||
|
||||
line_current = pick("#232428", "#E7E7EC"),
|
||||
ref_bg = pick("#38333B", "#2D2830"),
|
||||
ref_bg = pick("#37342F", "#2C2A25"),
|
||||
}
|
||||
|
||||
-- Core UI -------------------------------------------------------------------
|
||||
|
||||
@@ -1,3 +1,26 @@
|
||||
local npairs = require('nvim-autopairs')
|
||||
local M = {}
|
||||
|
||||
npairs.setup({})
|
||||
M = {
|
||||
disable_filetype = {
|
||||
"TelescopePrompt",
|
||||
"spectre_panel",
|
||||
"snacks_picker_input",
|
||||
},
|
||||
disable_in_macro = true,
|
||||
disable_in_visualblock = false,
|
||||
disable_in_replace_mode = true,
|
||||
ignored_next_char = [=[[%w%%%'%[%"%.%`%$]]=],
|
||||
enable_moveright = true,
|
||||
enable_afterquote = true,
|
||||
enable_check_bracket_line = true,
|
||||
enable_bracket_in_quote = true,
|
||||
enable_abbr = false,
|
||||
break_undo = true,
|
||||
check_ts = false,
|
||||
map_cr = true,
|
||||
map_bs = true,
|
||||
map_c_h = false,
|
||||
map_c_w = false,
|
||||
}
|
||||
|
||||
return M
|
||||
|
||||
@@ -1,40 +0,0 @@
|
||||
local cmp_kinds = {
|
||||
Text = ' ',
|
||||
Method = ' ',
|
||||
Function = ' ',
|
||||
Constructor = ' ',
|
||||
Field = ' ',
|
||||
Variable = ' ',
|
||||
Class = ' ',
|
||||
Interface = ' ',
|
||||
Module = ' ',
|
||||
Property = ' ',
|
||||
Unit = ' ',
|
||||
Value = ' ',
|
||||
Enum = ' ',
|
||||
Keyword = ' ',
|
||||
Snippet = ' ',
|
||||
Color = ' ',
|
||||
File = ' ',
|
||||
Reference = ' ',
|
||||
Folder = ' ',
|
||||
EnumMember = ' ',
|
||||
Constant = ' ',
|
||||
Struct = ' ',
|
||||
Event = ' ',
|
||||
Operator = ' ',
|
||||
TypeParameter = ' ',
|
||||
}
|
||||
|
||||
local cmp = require('cmp')
|
||||
|
||||
cmp.setup({
|
||||
preselect = 'None',
|
||||
formatting = {
|
||||
fields = { 'kind', 'abbr' },
|
||||
format = function(_, vim_item)
|
||||
vim_item.kind = cmp_kinds[vim_item.kind] or ''
|
||||
return vim_item
|
||||
end,
|
||||
}
|
||||
})
|
||||
@@ -1,6 +1,7 @@
|
||||
local cmp = require "cmp"
|
||||
local cmp_lsp = require "cmp_nvim_lsp"
|
||||
local cmp_kinds = require("assets.icons").icons.kinds
|
||||
local cmp_autopairs = require "nvim-autopairs.completion.cmp"
|
||||
|
||||
local function flatten_to_array(t)
|
||||
local res = {}
|
||||
@@ -133,9 +134,22 @@ cmp.setup {
|
||||
["<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,
|
||||
["<CR>"] = cmp.mapping {
|
||||
i = function(fallback)
|
||||
if cmp.visible() and cmp.get_active_entry() then
|
||||
cmp.confirm {
|
||||
behavior = cmp.ConfirmBehavior.Replace,
|
||||
select = false,
|
||||
}
|
||||
else
|
||||
fallback()
|
||||
end
|
||||
end,
|
||||
s = cmp.mapping.confirm { select = true },
|
||||
c = cmp.mapping.confirm {
|
||||
behavior = cmp.ConfirmBehavior.Replace,
|
||||
select = true,
|
||||
},
|
||||
},
|
||||
["<Tab>"] = cmp.mapping(function(fallback)
|
||||
if cmp.visible() then
|
||||
@@ -165,6 +179,7 @@ cmp.setup {
|
||||
{ name = "nvim_lua" },
|
||||
},
|
||||
}
|
||||
cmp.event:on("confirm_done", cmp_autopairs.on_confirm_done())
|
||||
|
||||
vim.diagnostic.config {
|
||||
virtual_text = false,
|
||||
|
||||
@@ -6,19 +6,19 @@ local function pick(light, dark)
|
||||
end
|
||||
|
||||
local c = {
|
||||
bg = "#161219",
|
||||
bg_alt = "#1E1A21",
|
||||
bg_mid = pick("#2D2830", "#221E25"),
|
||||
fg = "#E9E0EA",
|
||||
fg_muted = "#CEC3D3",
|
||||
bg = "#15130F",
|
||||
bg_alt = "#1D1B17",
|
||||
bg_mid = pick("#2C2A25", "#221F1A"),
|
||||
fg = "#E8E2DA",
|
||||
fg_muted = "#CEC6B5",
|
||||
fg_strong = pick("#15161A", "#F4F4F8"),
|
||||
|
||||
normal = "#894FBF",
|
||||
insert = "#543D68",
|
||||
visual = "#B2417A",
|
||||
normal = "#514209",
|
||||
insert = "#51482F",
|
||||
visual = "#35491F",
|
||||
replace = "#93000A",
|
||||
command = pick("#FFDCF2", "#A9A5D8"),
|
||||
inactive = "#1E1A21",
|
||||
command = pick("#FFE39D", "#AAAF6E"),
|
||||
inactive = "#1D1B17",
|
||||
|
||||
normal_fg = pick("#15161A", "#F4F4F8"),
|
||||
insert_fg = pick("#15161A", "#F4F4F8"),
|
||||
|
||||
+4
-4
@@ -19,10 +19,10 @@ vim.keymap.set("n", "<A-S-Left>", require("smart-splits").resize_left)
|
||||
vim.keymap.set("n", "<A-S-Down>", require("smart-splits").resize_down)
|
||||
vim.keymap.set("n", "<A-S-Up>", require("smart-splits").resize_up)
|
||||
vim.keymap.set("n", "<A-S-Right>", require("smart-splits").resize_right)
|
||||
vim.keymap.set("n", "<A-Left>", require("smart-splits").move_cursor_left)
|
||||
vim.keymap.set("n", "<A-Down>", require("smart-splits").move_cursor_down)
|
||||
vim.keymap.set("n", "<A-Up>", require("smart-splits").move_cursor_up)
|
||||
vim.keymap.set("n", "<A-Right>", require("smart-splits").move_cursor_right)
|
||||
-- vim.keymap.set("n", "<A-Left>", require("smart-splits").move_cursor_left)
|
||||
-- vim.keymap.set("n", "<A-Down>", require("smart-splits").move_cursor_down)
|
||||
-- vim.keymap.set("n", "<A-Up>", require("smart-splits").move_cursor_up)
|
||||
-- vim.keymap.set("n", "<A-Right>", require("smart-splits").move_cursor_right)
|
||||
|
||||
-- Explorer and Undotree
|
||||
map("n", "<leader>e", function()
|
||||
|
||||
@@ -70,13 +70,6 @@ return {
|
||||
"hiphish/rainbow-delimiters.nvim",
|
||||
enabled = false,
|
||||
},
|
||||
{
|
||||
"windwp/nvim-autopairs",
|
||||
event = "InsertEnter",
|
||||
config = function()
|
||||
require "config.autopairs"
|
||||
end,
|
||||
},
|
||||
{
|
||||
"tpope/vim-fugitive",
|
||||
},
|
||||
@@ -116,6 +109,13 @@ return {
|
||||
require "config.lazydev"
|
||||
end,
|
||||
},
|
||||
{
|
||||
"windwp/nvim-autopairs",
|
||||
enabled = true,
|
||||
event = "InsertEnter",
|
||||
config = true,
|
||||
opts = require "config.autopairs",
|
||||
},
|
||||
{
|
||||
"neovim/nvim-lspconfig",
|
||||
enabled = true,
|
||||
@@ -131,6 +131,7 @@ return {
|
||||
"saadparwaiz1/cmp_luasnip",
|
||||
"j-hui/fidget.nvim",
|
||||
"b0o/schemastore.nvim",
|
||||
"windwp/nvim-autopairs",
|
||||
},
|
||||
config = function()
|
||||
require "config.lspconfig"
|
||||
@@ -288,7 +289,6 @@ return {
|
||||
},
|
||||
{
|
||||
"Zacharias-Brohn/zterm-navigator.nvim",
|
||||
enabled = false,
|
||||
config = function()
|
||||
require "config.zterm-navigator"
|
||||
end,
|
||||
|
||||
Reference in New Issue
Block a user