4l3xBB

Disable CMP Plugin ~ NVChad

Oct 9th, 2024
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.25 KB | Cybersecurity | 0 0
  1. -- ~/.local/share/nvim/lazy/NvChad/lua/nvchad/plugins/init.lua
  2. -- load luasnips + cmp related in insert mode only
  3. {
  4.   "hrsh7th/nvim-cmp",
  5.   event = "InsertEnter",
  6.   dependencies = {
  7.     {
  8.       -- snippet plugin
  9.       "L3MON4D3/LuaSnip",
  10.       dependencies = "rafamadriz/friendly-snippets",
  11.       opts = { history = true, updateevents = "TextChanged,TextChangedI" },
  12.       config = function(_, opts)
  13.         require("luasnip").config.set_config(opts)
  14.         require "nvchad.configs.luasnip"
  15.       end,
  16.     },
  17.  
  18.     -- autopairing of (){}[] etc
  19.     {
  20.       "windwp/nvim-autopairs",
  21.       opts = {
  22.         fast_wrap = {},
  23.         disable_filetype = { "TelescopePrompt", "vim" },
  24.       },
  25.       config = function(_, opts)
  26.         require("nvim-autopairs").setup(opts)
  27.  
  28.         -- setup cmp for autopairs
  29.         local cmp_autopairs = require "nvim-autopairs.completion.cmp"
  30.         require("cmp").event:on("confirm_done", cmp_autopairs.on_confirm_done())
  31.       end,
  32.     },
  33.  
  34.     -- cmp sources plugins
  35.     {
  36.       "saadparwaiz1/cmp_luasnip",
  37.       "hrsh7th/cmp-nvim-lua",
  38.       "hrsh7th/cmp-nvim-lsp",
  39.       "hrsh7th/cmp-buffer",
  40.       "hrsh7th/cmp-path",
  41.     },
  42.   },
  43.   opts = function()
  44.     return require "nvchad.configs.cmp"
  45.   end,
  46. },
Advertisement
Add Comment
Please, Sign In to add comment