Does anyone know if there is a plugin that does this kind of thing? I would be able to see the source to get more details on how this would be done.
Thank you for all the advice below. -Dan -----Original Message----- From: Suresh Govindachar [mailto:[EMAIL PROTECTED] Sent: Monday, May 07, 2007 9:36 PM To: 'Dan Fabrizio'; 'Andy Wokula' Cc: 'Larson, David'; vim@vim.org Subject: RE: autocomplete on the command line from words in buffers See help on command-completion-custom, bufnr(), bufnr("$"), bufname(), <args>, <f-args> and <q-args>. Doubt if you would need to use getLineCmd(). --Suresh -----Original Message----- From: Dan Fabrizio [mailto:[EMAIL PROTECTED] Sent: Monday, May 07, 2007 5:29 PM To: 'Andy Wokula' Cc: 'Larson, David'; vim@vim.org Subject: RE: autocomplete on the command line from words in buffers Does Vim keep a Dict or list of names from all the open buffers that I can use? It sounds like there might be a way using command-completion as mentioned below and also using the getLineCmd() function? Thanks. -----Original Message----- From: Andy Wokula [mailto:[EMAIL PROTECTED] Sent: Monday, May 07, 2007 6:28 PM To: Dan Fabrizio Cc: Larson, David; vim@vim.org Subject: Re: autocomplete on the command line from words in buffers Larson, David schrieb: > Hello Dan, > > I suggest wrapping these functions into vim commands and then leverage > the command completion feature. See: > > :help :command-completion > > HTH, > David > > -----Original Message----- > From: Dan Fabrizio [mailto:[EMAIL PROTECTED] > Sent: Monday, May 07, 2007 5:27 AM > To: vim@vim.org > Subject: FW: autocomplete on the command line from words in buffers > > Hello All, > > > I want to develop a plugin just using vim scripts for the verilog > language. > In the plugin I have functions that require arguments that are words > used in > the current open buffers. > > On the command line, I want to autocomplete these words that are > arguments > to functions. > > For example: > > :call function1("last_<Tab>","first_<Tab>") > > In open buffers, the words called last_buffer_value and > first_buffer_value > are used. So when I hit <Tab> I want that word to be completed so the > result > would be > > :call function1("last_buffer_value","first_buffer_value") > > Is there a way to do this? > > Thanks in advance, > Dan Fabrizio IMHO this will become difficult. In Insert mode, Ctrl-N/Ctrl-P scans through the buffers for words, but I think there is no way to make Vim provide a similar list of completions in the command-line. You have to (kind of) scan the buffers yourself ... Please correct me if I'm wrong -- Regards, Andy EOM