MacVim/YADR Autocomplete Issue - vim

I have installed MacVim, and https://github.com/skwp/dotfiles (including all the dependencies such as zsh, etc). and I am having trouble getting auto complete to work.
When I'm typing
<tit a pink box shows up with <title>Index</title> and according to the https://github.com/skwp/dotfiles documentation pressing tab will make it autocomplete. Which sometimes works, sometimes it just adds two spaces, however that's not really my question.
When it does auto complete it turns it into
<<title>Index</title>> notice the two < and >
How can I fix this?

Wow… 79 plugins? Really?
At a low level, your problem is that you give someone else too much power over your configuration, your toolset and your workflow.
At a higher level, you are probably misusing your config's auto-completion feature. I think that you have a conflict between the neocomplcache, delimitmate and snipmate plugins: the 1st deals with auto-completion, the 2nd automatically closes pairs of characters (<>,"",()…) while the 3rd does "tab-expansion" on the tit keyword.
Basically, I believe that you are supposed to type tit<Tab> instead of <tit<Tab> to avoid triggering delimitmate.

Related

A way to display a general invalid status of a buffer using Vim CoC

Is there any way to have something like a status bar in Vim with CoC (or just language server in general) that tells you when current buffer is static analysis-wise invalid, eg. has compilation or linting errors?
I am using Vim w/ CoC in an Angular project, and while CoC shows me errors just fine when I have the problematic line in my current view, I don't see those outside of the current scroll position.
Compare
to
I am just one line higher on the second picture and already have no indication of errors. I can jump preemptively to next issue with coc-diagnostic or just rely on compiler output but that's clearly not ideal.
So is there perhaps plugin to be used for this (preferably one which plays nicely with CoC), or is there any better way (workflow-wise) to quickly find out that current buffer is invalid?
Turns out I was unaware of the concept of configuring statusline in vim. Searching for it yielded nice integration options between lightline (which I am using) among others and Coc https://github.com/neoclide/coc.nvim/wiki/Statusline-integration.

How to expand an UltiSnips snippet using <c-y> in the YouCompleteMe pop-up menu?

This problem really hit a nerve with me. I have both YouCompleteMe and UltiSnips installed on my vim 8.0 editor. It seems that both of these plugins use the tab key for doing the auto-completion and that has created an incompatibility that has been also addressed by this question. My question is more specific, though. When I write a piece of code like <html, there is a pop-up menu that shows me all related snippets for that code.
I use the tab key to navigate through that menu but when I hit ctrl+y to accept and therefore expand one of these snippets, nothing happens! I think this structure suggests that it's possible to somehow choose one of those snippets from the menu without trying to define a shortcut for UltiSnip. What am I doing wrong? How should I navigate and choose those snippets?
I also would not want to stuff my vim with any new plugins (like supertab, etc.).
The solution was actually a lot simpler than I expected. In the beginning, I felt stupid for not knowing it but when I find a similar question like this one, I thought that probably many were fallen into the same trap.
I don't know whether to name it a bug or not but it's how Ultisnips and YouCompleteMe work together. In order to expand a snippet, you have to write the initializer exactly as it's defined. Of course, this seems obvious, but when you see a pop-up menu of different snippets, you might think they can be chosen but it only works if you already wrote the snippet initializer exactly as it's defined.
So when a snippet is called "html5"---as it's shown in my question---writing an extra opening bracket (<) will cause it to stop working. It cannot be expanded.
Also, don't forget to check out Siegfried Gevatter configuration. It's not possible to use tab key both for navigating into the pop-up menu and expanding the snippets.
P.S. It was nice if navigating through the pop-up menu could change the whole word (including the angle bracket), not just what succeeds it. This feature works this way in most of the other editors I see and that's probably why I wasn't able to spot the problem in the beginning.

Sublime 3 autocomplete recommends vague internal functions in Julia

So I'm using Sublime Text 3 w/ Julia, and I have mixed feelings about the autocomplete. A lot of the time it recommends these vague internal functions that aren't even close to the word I'm typing in. For example:
http://puu.sh/iWyrB/7293a9928f.png
Even if I've used dict_t as a variable before, I have to type in most of the word before it recommends dict_t; it seems to happen once it runs out of internal functions to recommend.
So it seems like this is coming from the IJulia package. I like using that package, but moments like the picture above are frustrating. Any advice?
Edit:
To disable "insert completion on tab" add this to you User Preferences:
// By default, auto complete will commit the current completion on enter.
// This setting can be used to make it complete on tab instead.
// Completing on tab is generally a superior option, as it removes
// ambiguity between committing the completion and inserting a newline.
"auto_complete_commit_on_tab": false,
To disable the auto-complete popup (but still be able to insert completion on tab):
// Enable auto complete to be triggered automatically when typing.
"auto_complete": true,
I'm afraid you cannot remove only the completions coming from Sublime-IJulia and keeping all default completions without changing any code in the Sublime-IJulia package.
If what you need is genera Julia support for sublime (syntax highlighting, auto-indent etc), I recommend switching from Sublime-IJulia to Julia-sublime. Sublime-IJulia had it's last commit in January 2015 while Julia-sublime is actively maintained. Most notably in this case, Julia-sublime does not give autocomplete for all standard functions.
Note that Julia-sublime, like other syntax packages in sublime, does not not strive to be an IDE substitute. These features should be separated, not all users wants both.
For running Julia code from within Sublime with IDE-like functionality there is currently no good alternative, the packages I've found are outdated and have quite a few issues.
When it comes to developing and testing code, I like keep a REPL open in the terminal and just re-include() my code in there. I find this to be flexible and efficient. More on this in the Julia FAQ: http://docs.julialang.org/en/release-0.4/manual/faq/#how-can-i-modify-the-declaration-of-a-type-immutable-in-my-session).
Disclosure: I am the maintainer of Julia-sublime. If you encounter issues or feel that something can be improved, I encourage you open an issue.

VIM Omni Completion: Pattern Not Found

Ive been trying to get the VIM auto completion working, but am running into issues unfortunately.
Right now I tried just starting with the basics. trying to get the auto completion to work on HTML documents first. But even this is becoming an issue.
I set the correct DOCTYPE, and have even specified different ones to see if it will work on Transitional, or Strict, or even XHTML or HTML5, but none are seeming to work.
The htmlcomplete.vim file is indeed in the "autoload" directory.
In my vimrc file, the correct setting is applied:
filetype plugin indent on
But still this isn't working, and no amount of research is helping me, because the only relevant results are issues with C++ auto completion, in VIM. (which vim does not fully support at this time, but it DOES support HTML auto completion, as I know because I have had it work on multiple instances of different systems before.)
What do you guys think I should do next? Im not sure where I should go from here..
No matter what, when I use the "omni completion" option. AKA (Ctrl+X, Ctrl+O), it always says:
Omni Completion (^O^N^P) Pattern not found
The syntax highlighting works by default without even using:
:syntax on/:syntax enable
it just recognizes by the filetype as it should. so that works.
The indentation has started working ever since I uncommented the "filetype plugin indent on". but I just cant get this to work correctly.
But maybe, I am missing the point here, and thinking about this the wrong way. So please correct me if I am wrong.
What function I am looking for, is when I type "<" it will automatically bring up a drop down list with all the tags it could be, and say I type "<" it will further refine to "div", etc. This is the functionality I am used to in Vim, without any configuring, just by default.
When I use the command "Ctrl+N" or "Ctrl+P" I get a very small (12 tags) list of possible tags, but that is manual, and not automatically detecting the typed "<".
Am I looking at the wrong thing? Is Omni Completion not the right option I should be looking at configuring? Or was this a different plugin to provide this functionality?
Whenever I look into it, it always refers to "Ctrl+X + Ctrl+O" as the syntax auto completion, so I assumed this is the feature I have come to know. but maybe I am wrong.
So can someone help to explain this better to me, point me in the right direction. Or let me know I am on the right path (if I am) and help me fix this issue?
Thank you guys.
Take care.
As requested here is the information:
The vimrc file is here: http://pastebin.com/QfUDVvdP
My version is 7.3 (aka vim73)
I am using the CLI version, as I find GVIM actually more confusing. but I have both. and they use the same vim runtime.
I have not added any more plugins or extra feautres, as this is a fresh install on Ubuntu 12.04, which is also a fresh install. The only thing that has been altered or added is "smali.vim" syntax highlighting to syntax folder, as well as opa.vim, and opajs.vim. also opacomplete.vim to autoload.
there is vimrc, and vimrc.tiny, as well as gvimrc in /etc/vim/ folder.
and all the files for vim are located in the default directory, /usr/share/vim/vim73/ and /usr/share/vim/. None of the files are moved, changed, or altered besides what was already specified.
hope that helps.
First of all, Omni Completion never worked (or works) automatically. You said popup should appear when you insert '<' - this is not working in Vim by default. You have to press Ctrl X O combination. At least it is not working for me.
http://vimdoc.sourceforge.net/htmldoc/version7.html#new-omni-completion
I guess you have a plugin for that or something. It's not hard to implement it. Start Vim without loading any plugins to check it out. Anyway, to the question.
Many folks do not know, that Vim 7+ has decent support for XML/XHTML/HTML languages (no plugins needed!) with possibilities to extend it with any XML-based language you want. What you can do is to use DTD/RNG converters that prepares Vim definition which is used to give you omni completion.
For example, my Vim installation contains support for HTML4 and XHTML languages 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 Vim's autoloading feature. You need to make sure the file you are opening has the proper DOCTYPE definition which is correct. So use that for HTML and XHTML files, then Vim 7+ will automatically enable XML/HTML omni completion 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 to insert body tag, type "bo" and hit Ctrl X O. Bang. Try to add an attribute, type "on" and hit it again. Bingo.
You can use Ctrl X O and other features:
after "<" complete the tag name, depending on context
inside of a tag complete proper attributes
when an attribute has a limited number of possible values help to complete
them
complete names of entities (defined in |xml-omni-datafile| and in the
current file with "
when used after "
More info (and possible user customization with own XML definitioins) here:
http://vimdoc.sourceforge.net/htmldoc/insert.html#ft-xml-omni
Omnicompletion is the right feature and <C-x><C-o> is the right shortcut. You should stop calling it autocompletion, by the way, because it's far from being automatic.
You don't need anything in ~/.vim/autoload because htmlcomplete.vim is already in $VIMRUNTIME.
In brief, given what I know of your settings, completion should work.
But it isn't. Please append the content of your ~/.vimrc, a list of installed plugins (and how/where they are installed) and details on your Vim version, platform and if you use the GUI or the CLI version.
edit
Omnicompletion is the right feature but you are looking for a specific plugin that uses omnicompletion under the hood on each couple of keystroke as there's no built-in setting to enable Auto completion. AutoComplPop is one such plugin (and the one I use), there are others. Pick the one that most closely matches with your previous experience.
You shouldn't 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
You must revert the default files and directories to their original state before going further.
endedit

Vim: How to set up an efficient autocomplete configuration?

I've been using Vim for a while now and love it, but one thing I've noticed when I use other editors is that I've never really got autocomplete working with much efficiency. I have supertab & snipmate working, I have tags for whatever language I'm using set up, but somehow it seems a little too cumbersome to use all that much, and apart from long method names I typically just avoid autocomplete.
Does anyone have fast, comprehensive autocomplete funcitonality set up in vim? Specifically:
At the moment, I hit "tab" to autocomplete class/method/variable names & generate snippets, but Ctrl+X+O for inbuilt langauge commands. I'd rather press tab for everything.
The ordering doesn't seem to be too intelligent. Very common stuff is often hidden in the middle of a bunch of rarely-used commands.
I've set up autocomplpop to show potential autocompletes as I'm typing, but I have to hit tab twice to accept the first entry. One much rather single-tab it.
So, any tips on setting up an efficient, comprehensive autocomplete configuration in vim? I know this question is a little vague - but if anyone has an overview of how they autocomplete well, and/or a link to a guide, it would be much appreciated.
Just thought I'd come back and mention that I finally found something I like: A customised version of NeoComplCache. Nice auto popup, everything integrated pleasantly into 'tab', and with a bit of customisation plays nice with snippets.
http://www.vim.org/scripts/script.php?script_id=2620
This is very dependant on your working domain. Vim is a text editor with the ability to interface with intelligent text-aware mechanisms.
If you are using java there is eclim, which is the eclipse backend together with a vim plugin for the frontend.
For C or C++ there is the plugin OmniCppComplete
It works by scanning the headers in the paths you have set up in vim (see :h path), and works very well imo.
If you have to press Ctrl-X_Ctrl-O for omnicompleteion, then your supertab config seems a bit broken. It should try omni or filename completion first, and then fall back to word completion.
YouCompleteMe plugin by Valloric is a very decent plugins for autocomplete and suggestion.
It contains support for all the major languages and you can extend the feature with setting up different engine .
it also comes with syntax checker so u don't have to use Syntastic separately
For setup details visit this link
https://github.com/Valloric/YouCompleteMe

Resources