8

If I set a custom make program, is there any way to provide a list of tab completion options that would get activated when I type :make+Space+Tab?

With custom commands I can do f.i.:

command! -nargs=* -complete=customlist,MakeComplete -bar MakeGitbook call MakeGitbook(<q-args>) 

Is there any similar mechanism for builtin commands, and in particular for :make? Or should I just define a custom command wrapper that calls the built in one but also adds tab completion?

3
  • Writing a custom command is probably your best bet. Commented Jun 16, 2015 at 9:53
  • -complete=customlist,MakeComplete alreeady does what you want? I don't quite understand where you're stuck or what does't work like you want. Commented Jun 16, 2015 at 11:08
  • That only works for a custom command, I'm after something for the built in make command Commented Jun 16, 2015 at 11:14

1 Answer 1

1

There is no mechanism in vim to change built-in commands. This is actually a good thing, because you can be sure that default behavior is not changed by plugins. Also plugins itself can rely on the default behavior, so such a feature (to change builtin commands) would potentially create a lot of headache.

Is there any similar mechanism for builtin commands, and in particular for :make?

No. If you check vim docs (here and here), you'll find that :command only works with custom commands, which should start with capital letter (except Next which is also reserved).

Or should I just define a custom command wrapper that calls the built in one but also adds tab completion?

Yes, this is the way to go.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.