My vim is throwing nasty errors 50% of the time when I use ctrl-n for completion
E854: path too long for completion
I really want to remap this, and call it with the :silent option to suppress the error, but I have no idea what function provides completion, so I can’t remap it.
So my question is where can I find exactly what C-N calls when it is invoked in insert mode
Solution:
As mentioned in the comment on my accepted answer I found a way round this. Based off the instructions on building your own vim here : brilliantcorners.org/2011/02/building-vim-on-osx-snow-leopard
I grepped the source directory for E854 and it only comes up in 1 file. If you open that file you see it is only referenced twice. I just removed those error calls and built vim
This doesn’t solve whatever the actual problem is, but it’s the same effect as doing ignore. It works great now and doesn’t throw any errors, I hope anyone else with this problem is helped by this.
My copy of the vim source code (obtained at some point using Mercurial and
hg clone https://vim.googlecode.com/hg/) finds that error being thrown only in one spot, in the internal functionvim_findfile_init():So it looks like it’s doing arbitrary-depth wildcard expansion. If I had to take a wild stab I’d say you have a path somewhere in the filesystem that has a circular symbolic link (say c -> a), so you end up doing path completion and getting /foo/bar/a/b/c/a/b/c/a/b/c/a/b/c/….. and the limit gets hit.
Edit
Scratch that last theory; based on actually reading the code, it looks like it’s trying to find a tag file and blowing up. Can you post what you get when you do
:set tags?Edit 2
Sigh, it’s late… Here’s the answer you originally wanted that I just found: do
:help completefuncand:help completion-functions.completefuncis the one you want, if I (finally) understand your question.