aboutsummaryrefslogtreecommitdiff
path: root/.config/nvim/lua/cmp-config.lua
diff options
context:
space:
mode:
authorNathan Reiner <nathan@nathanreiner.xyz>2024-08-15 20:28:13 +0200
committerNathan Reiner <nathan@nathanreiner.xyz>2024-08-15 20:28:13 +0200
commit17e319a4455f3135ed3cc759dee8ba5034fde75b (patch)
tree6d07c1875ae2736a5f3eb026a243328ab5c73fca /.config/nvim/lua/cmp-config.lua
parent346854ff3ea83202de7437f01f1c1c336f4c3edf (diff)
update vim configHEADmaster
Diffstat (limited to '.config/nvim/lua/cmp-config.lua')
-rw-r--r--.config/nvim/lua/cmp-config.lua90
1 files changed, 0 insertions, 90 deletions
diff --git a/.config/nvim/lua/cmp-config.lua b/.config/nvim/lua/cmp-config.lua
deleted file mode 100644
index 2bb6047..0000000
--- a/.config/nvim/lua/cmp-config.lua
+++ /dev/null
@@ -1,90 +0,0 @@
-local cmp = require "cmp"
-require("luasnip.loaders.from_vscode").lazy_load()
-
-local function border(hl_name)
- return {
- { "╭", hl_name },
- { "─", hl_name },
- { "╮", hl_name },
- { "│", hl_name },
- { "╯", hl_name },
- { "─", hl_name },
- { "╰", hl_name },
- { "│", hl_name },
- }
-end
-
---if cmp_style ~= "atom" and cmp_style ~= "atom_colored" then
--- options.window.completion.border = border "CmpBorder"
--- end
-
-cmp.setup {
- completion = {
- completeopt = "menu,menuone",
- },
-
- window = {
- completion = {
- border = border "CmpBorder",
- side_padding = 1,
- winhighlight = "Normal:CmpPmenu,CursorLine:CmpSel,Search:None",
- scrollbar = true,
- },
- documentation = {
- border = border "CmpDocBorder",
- winhighlight = "Normal:CmpDoc",
- },
- },
- snippet = {
- expand = function(args)
- require("luasnip").lsp_expand(args.body)
- end,
- },
-
- 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
- vim.fn.feedkeys(vim.api.nvim_replace_termcodes("<Plug>luasnip-expand-or-jump", true, true, true), "")
- 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
- vim.fn.feedkeys(vim.api.nvim_replace_termcodes("<Plug>luasnip-jump-prev", true, true, true), "")
- else
- fallback()
- end
- end, { "i", "s" }),
- },
- sources = {
- { name = "nvim_lsp" },
- { name = "luasnip" },
- { name = "buffer" },
- { name = "nvim_lua" },
- { name = "path" },
- },
-}
-
-local signs = { Error = "󰀨 ", Warn = " ", Hint = " ", Info = " " }
-for type, icon in pairs(signs) do
- local hl = "DiagnosticSign" .. type
- vim.fn.sign_define(hl, { text = icon, texthl= hl, numhl = hl })
-end