I have a really large file with many paths in it. I don't want it to participate in any of the completion mechanisms. Is there a way to mark a particular buffer as "not a candidate for keyword completion" or, equivalently, to close it as soon as I leave the buffer?
Here's some motivation for doing it.
I have a file called ~/FILES
that consists of two columns like this, with the name of a file in the left column and the full path on the right. It's just a manually generated index with a very simple format.
Here's an excerpt of the file showing part of the Linux kernel source.
ABCDBCDA.c ~/ws/opt/linux/tools/lib/lockdep/tests/ABCDBCDA.c
ABCDBDDA.c ~/ws/opt/linux/tools/lib/lockdep/tests/ABCDBDDA.c
ABI.txt ~/ws/opt/linux/Documentation/devicetree/bindings/ABI.txt
ABI.txt ~/ws/opt/linux/Documentation/mn10300/ABI.txt
This file is very long and really slows down keyword completion.
I've been using this binding to delete the buffer when following paths using gf
, the most common way to exit the ~/FILES
buffer.
nnoremap <silent> gf gf:silent! bdelete ~/FILES<cr>
but it's really modifying the behavior in the wrong place.
Is there a better way of marking the buffer?
~/FILES
file is not a file I’m editing, it’s a naive way of emulating an almost-plugin. @ChristianBrabandt I will try that and report back.