I have a file, which contains lines of function name, now I want to use them for code auto completion, and only for file names end with .XXX.How should I do it, is it possible to work with ctags or Omni plugin? 
Set auto completion for a new filetype
vim;autocomplete;programming
You can use dictionary completion, i.e.:setlocal dictionary+=/path/to/your/fileand then trigger the insert-mode completion with <C-x><C-k>; see :help i_CTRL-X_CTRL-K.If you want this only for filetype xxx, put the :setlocal in ~/.vim/after/ftplugin/xxx.vim.In contrast, Omni completion gives you more power, but you have to write the completion function yourself. (You could write a function that reads in your file, but why do all the effort when Vim has this built-in?!)