VIM Omni Completion: Template Not Found

I am trying to get VIM to automatically shut down, but unfortunately I am encountering problems.

Now I have only tried to start with the basics. Trying to auto-complete HTML documents first. But even that becomes a problem.

I installed the correct DOCTYPE and even pointed different ones to see if it will work on Transitional, Strict or even XHTML or HTML5, but none of them work.

The htmlcomplete.vim file is indeed located in the "autoload" directory.

My vimrc file uses the correct setting:

filetype plugin indent on 

But still this does not work, and no research helps me, because the only relevant results are problems with the automatic completion of C ++ in VIM. (which vim does not currently fully support, but it does support HTML auto-completion, as I know, because I used to work on multiple instances of different systems.)

What do you guys think I should do next? I'm not sure where I should go from here.

No matter when I use the omni completion option. AKA (Ctrl + X, Ctrl + O), he always says:

 Omni Completion (^O^N^P) Pattern not found 

Syntax highlighting works by default, without even using:

 :syntax on/:syntax enable 

it simply recognizes by file type how it should. so it works. Indentation has started working since I uncommented with the "filetype onent plugin indent". but I just can't get this to work correctly.

But maybe I missed the point here and thought about it wrong. So please correct me if I am wrong. What function am I looking for, when I type "<" it will automatically display a drop-down list with all the tags that it may be, and say that I type "<" it will refine to "div", etc. This is the functionality that I'm used to in Vim, without any configuration, by default.

When I use the command "Ctrl + N" or "Ctrl + P", I get a very small (12 tags) list of possible tags, but this manually and not automatically detects the printed "<".

Am I looking at the wrong thing? Is Omni Completion the wrong option, should I look at the setup? Or was it another plugin to provide this feature?

Whenever I look at it, it always refers to “Ctrl + X + Ctrl + O” as automatically completing the syntax, so I assumed that this is a function that I recognized. but maybe I'm wrong.

So can someone help me explain this better, call me in the right direction. Or let me know that I am on the right track (if any) and will help me fix this problem?

Thanks guys. Be careful.

According to the information requested here:

The vimrc file is here: http://pastebin.com/QfUDVvdP

My version 7.3 (aka vim73)

I use the CLI version, since I find that GVIM is actually more confusing. but I have both. and they use the same vim runtime.

I have not added any additional plugins or additional features yet, as this is a new version on Ubuntu 12.04, which is also a new installation. The only thing that has been changed or added is the syntax syntax "smali.vim" in the syntax folder, as well as opa.vim and opajs.vim. also opacomplete.vim for startup.

there are vimrc and vimrc.tiny, as well as gvimrc in the / etc / vim / folder.

and all the files for vim are in the default directory, / usr / share / vim / vim73 / and / usr / share / vim /. None of the files are moved, changed, or changed, except what is already indicated.

hope this helps.

+7
source share
2 answers

First of all, Omni Completion never worked (or works) automatically. You said that a popup should appear when you insert '<' - By default this does not work in Vim. You should press Ctrl X O. At least this does not work for me.

http://vimdoc.sourceforge.net/htmldoc/version7.html#new-omni-completion

I think you have a plugin for this or something else. It is not difficult to implement. Launch Vim without downloading plugins to verify this. Anyway, to the question.

Many people do not know that Vim 7+ has decent support for the XML / XHTML / HTML languages ( no plug-ins required !) With the ability to extend it using any XML language you want. What you can do is use DTD / RNG converters, which prepare the Vim definition, which is used to give you full completion.

For example, my Vim installation supports HTML4 and XHTML by default:

 $ rpm -ql vim vim-common | grep xml /usr/share/vim/vim73/autoload/xml /usr/share/vim/vim73/autoload/xml/html32.vim /usr/share/vim/vim73/autoload/xml/html401f.vim /usr/share/vim/vim73/autoload/xml/html401s.vim /usr/share/vim/vim73/autoload/xml/html401t.vim /usr/share/vim/vim73/autoload/xml/html40f.vim /usr/share/vim/vim73/autoload/xml/html40s.vim /usr/share/vim/vim73/autoload/xml/html40t.vim /usr/share/vim/vim73/autoload/xml/xhtml10f.vim /usr/share/vim/vim73/autoload/xml/xhtml10s.vim /usr/share/vim/vim73/autoload/xml/xhtml10t.vim /usr/share/vim/vim73/autoload/xml/xhtml11.vim /usr/share/vim/vim73/autoload/xml/xsd.vim /usr/share/vim/vim73/autoload/xml/xsl.vim /usr/share/vim/vim73/autoload/xmlcomplete.vim /usr/share/vim/vim73/compiler/xmllint.vim /usr/share/vim/vim73/compiler/xmlwf.vim /usr/share/vim/vim73/ftplugin/xml.vim /usr/share/vim/vim73/indent/xml.vim /usr/share/vim/vim73/syntax/docbkxml.vim /usr/share/vim/vim73/syntax/xml.vim 

The trick is the Vim startup feature. You must make sure that the file you open has the correct DOCTYPE definition, which is the correct one. Therefore, use HTML and XHTML files, then Vim 7+ will automatically include the omni XML / HTML add-on for you. Example for HTML4:

 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> </html> 

Now try pasting the body tag, type "bo" and press Ctrl X O. Bang. Try adding an attribute, enter "on" and click it again. Bingo.

You can use Ctrl XO and other functions:

  • after "<" fill in the tag name, depending on the context
  • full attributes inside the tag
  • when an attribute has a limited number of possible values, their
  • full entity names (defined in | xml-omni-datafile | and in the current file with "
  • when used after "

More information (and possible customization with native XML definitions) here:

http://vimdoc.sourceforge.net/htmldoc/insert.html#ft-xml-omni

+1
source

Omnicompletion is the correct function, and <Cx><Co> is the correct shortcut. You should stop calling it autocomplete, by the way, because it is far from automatic.

You don't need anything in ~/.vim/autoload , because htmlcomplete.vim already in $VIMRUNTIME .

In short, given what I know about your settings, the completion should be completed.

But this is not so. Please add the contents of your ~/.vimrc , a list of installed plugins (and how / where they are installed), as well as information about your Vim version, platform, and if you use a GUI or CLI version.

change

Omnicompletion is the right function, but you are looking for a specific plugin that uses omnicompletion under the hood on each pair of keystrokes, as there is no built-in setting to complete Auto . AutoComplPop is one such plugin (and the one I use), there are others. Choose the one that most closely matches your previous experience.

You should not touch anything in /usr/share/vim/ or /etc/vim/ . All your settings should go into ~/.vimrc , and your plugins should go into ~/.vim/ .

 ~ .vim/ autoload/ opacomplete.vim syntax/ opa.vim opajs.vim smali.vim .vimrc 

Before proceeding, you must restore the default files and directories to their original state.

Endedit

+1
source

All Articles