cmp-rg icon indicating copy to clipboard operation
cmp-rg copied to clipboard

Option to only run rg completion if in a git directory

Open joshzcold opened this issue 3 years ago • 3 comments

There is a chance with cmp-rg to accidentally run a large completion job (even with max-depth set to something reasonable) if you are in a directory that has lots of sub-directories.

If wanted this option would limit completion to only occur if you are currently in a git directory. Which would lower the risk of freezing if a user opened neovim in their ~/git_projects folder, which at least for me with a max-depth of 4 accounts for 8259 directories

joshzcold avatar Dec 09 '21 20:12 joshzcold

Thank you for the PR, but I think it would be nicer to do something like this instead https://github.com/hrsh7th/nvim-cmp/issues/632 Let's see what hrsh7th thinks.

lukas-reineke avatar Dec 10 '21 02:12 lukas-reineke

Yeah good idea. Would be great to be built in. In fact I have another cmp plugin that relies on an auto command to load it in for a certain file type.

joshzcold avatar Dec 10 '21 03:12 joshzcold

Sorry, I noticed afterward this opened PR. I proposed another solution here: https://github.com/lukas-reineke/cmp-rg/pull/47

gjeusel avatar Nov 11 '22 21:11 gjeusel