Loading ...
Sorry, an error occurred while loading the content.

Re: How to get completion candidates in files in 'dictionary' option?

Expand Messages
  • WU Yue
    ... Thanks glts, it s a way, but if the file is large, the speed of reading a file and extracting it would be very slow, that s why I m searching a way to get
    Message 1 of 3 , Nov 14, 2012
    • 0 Attachment
      On Thu, 15 Nov 2012 03:20:53 +0800, glts wrote:

      > Hi
      >
      >> For example, I have a string "foo", I want to get its completion
      >> candidates like doing i_ctrl-x_ctrl-k after word "foo", but I don't want
      >> to do this by hand, I want to get the candidate list and use it in
      >> vimscript.
      >
      > There is no Vim script function to extract the lines from the popup
      > menu.
      >
      > However, as you realize, Ctrl-X Ctrl-K in insert mode gets its data from
      > the files specified with the 'dictionary' option. You could extract your
      > data directly from those files, couldn't you?
      >
      > Or, if the 'dictionary' option is empty, then the completion data comes
      > from the spell files for the current spelling language. Again you could
      > try to get your data directly from the spell files.
      >
      > That's all I've got. Maybe somebody else has a better idea ...
      >

      Thanks glts, it's a way, but if the file is large, the speed of reading a
      file and extracting it would be very slow, that's why I'm searching a way
      to get the result from vim dictionary feature.


      --
      Regards,
      WU Yue

      State Key laboratory of Natural Products and Functions
      Key Laboratory of Modern Chinese Medicines
      Department of Traditional Chinese Medicine
      China Pharmaceutical University
      No.24, Tongjia Xiang Street, Nanjing 210009, China

      --
      You received this message from the "vim_use" maillist.
      Do not top-post! Type your reply below the text you are replying to.
      For more information, visit http://www.vim.org/maillist.php
    Your message has been successfully submitted and would be delivered to recipients shortly.