NvChad / NvChad

Blazing fast Neovim config providing solid defaults and a beautiful UI, enhancing your neovim experience.
https://nvchad.com/
GNU General Public License v3.0
24.66k stars 2.11k forks source link

Disable autocompletion feature and snippets #1198

Closed mcctuxic closed 2 years ago

mcctuxic commented 2 years ago

Describe the bug Autocompletion and snippets are always on - independet of the current type of file. When I write mails (for example) I am confronted with a license agreement text which suddenly gets inserted into my mail or other nonesense like wordlists, containing words, which needs lesser characters to type than it needs TAB hits to get to that word finally.

To Reproduce Write a non technical, not programming text.

Expected behavior Autocompletion and snippet feature should be restricted to technical related types of files.

Screenshots ...sorry. My mails are private data. Therefore no screenshot.

Desktop (please complete the following information):

Additional context Solution would be sufficient, if it is know, how to disable related plugins in dependence to certain types of files.

siduck commented 2 years ago

https://github.com/hrsh7th/nvim-cmp/issues/666

siduck commented 2 years ago

or you could write an autocmd for it, idk much about autocmds but I could come up with this

local autocmd = vim.api.nvim_create_autocmd

autocmd("FileType", {
   pattern = "lua",
   callback = function()
      require("cmp").setup.buffer { enabled = false }
   end,
}
rdaneelu commented 1 year ago

If I want it for .py files It will be

pattern = "python"

for .md files

pattern = "markdown"

But what about plain text files without a filetype?

siduck commented 1 year ago

If I want it for .py files It will be

pattern = "python"

for .md files

pattern = "markdown"

But what about plain text files without a filetype?

maybe "*" :thinking: