I have sublime text 3 and emmet and am trying to use Emmet but a few things are broken/ I am using completion.
ul+< tab >
gives
<ul>
</ul>
Also
input:text
outputs
inupt:<table></table>
Is sublime hijacking the the completion.
If I remember correctly, Sublime Text hides the completion popup by default when working in the text scope. The scope for HTML is text.html, so that behaviour is inherited. Add the text (or text.html) scope to auto_complete_selector in your user settings. Now, when you type code, you should see a completion popup, that allows you to select different types of completion. Personally, I have Emmet and the HTML5 package installed, so when typing ul I'm seeing two completion entries to choose from. I suspect that you're triggering the wrong completion.
The HTML5 package completes ul to <ul>|</ul>, while Emmet completes to <ul><li>|</li></ul> (over multiple lines.)
So, theree might indeed be another package interfering with Emmet. The completion popup should make it easier to see if that's the case. Otherwise, you will have to disable all your packages to narrow down the problem.
Related
I have the Emmet package installed for Sublime Text 3 via Package Control. I do a lot of Markdown editing in Sublime, and I've noticed that as Markdown files get larger, inserting a tab by pressing my keyboard's Tab button gets slower and slower. However, when I disable Emmet, inserting tabs is snappy and quick again. This leads me to believe that Emmet trying to parse what I'm writing and searching for ways to expand it is slowing tabbing down significantly.
Things I have tried:
"ignored_packages": ["Emmet"] in my syntax-specific user settings.
"tab_completion": false in my global Sublime settings.
"disable_tab_abbreviations_for_scopes": "text.html.markdown" in my Emmet settings.
To be clear: I still want Emmet to run for other syntax/filetypes. I just want Emmet, or at least whatever part of Emmet's behaviour is slowing down my tabbing, to be disabled when I'm writing in Markdown (*.md) files, or whichever files have the markdown syntax selected.
Thanks!
You can try new Emmet 2 extension (still in development): https://github.com/emmetio/sublime-text-plugin
It should work much faster and better
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.
I want to be able to select some content in sublime text, then press cmd+ctrl+l and then the selected content to be wrapped with an advanced version of markdown link. for example
[ $selection ](linkGoesHere "titleGoesHere")
You can likely get this working by writing a snippet or plugin to suit your needs.
You will be able to bind a plugin to your preferred keystroke, but snippets are triggered as you type in your file. Therefore a plugin is more likely to be your solution (since this requires some text to be written, selected, then the command executed), but if that ends up as a dead end, you might be able to use a snippet to accomplish the same task.
I'm making a Vim Script. I want to make a popup that offers alternatives. It should work the same as the Omni-popup, but not replace the string or go through the omni functions. Like this:
I've haxxed in the functionality I need by using the completefunc and the auto command event CompleteDone, just to get the popup. But it's really ugly and messy, since I'm not using it for auto completion.
Is there a way to use this popup but with full control, not going through the omni-complete functionality? Like populating it with values and receive the value selected?
I know you can just place the alternatives in an other buffer and just grab the input from there. But it disturbs the work flow, I want a popup.
The insert mode popup menu is only meant for completions, as you've correctly found out. There is not other precedence for popup menus as a general selector in Vim, so such functionality is not there and is difficult to emulate. (In GVIM, one can populate a right mouse button popup menu, but this would need to be triggered by a mouse key press.)
The "Vim way" would be to :echo the list of menu items and query (via getchar() or input()), or just use confirm() or inputlist(). Examples built into Vim are the query in :tselect.
Plugins often use a split scratch buffer to build a more elaborate menu; this can even be combined with 'completefunc', as any text entry into the scratch buffer is discarded, anyway.
The FuzzyFinder - buffer/file/command/tag/etc explorer plugin uses this, and even provides an API for custom uses, cp. :help fuf-callbackitem-mode. That's certainly worth a look, though the menu would still be located at the top, not inside the current buffer.
Do either of these do what you want?
:help inputdialog()
:help inputlist()
I am trying to use sublimetext3 for editing html.
If I do
ul tab, then it generates <ul></ul>
if I do
ul.temp tab, then it generates <ul class="temp"></ul>
however, when I am trying
ul>li.temp tab, it is generating ul><li class="temp"></li>
What I am expecting to see is <ul><li class="temp"></li></ul>
I have package control. What am I missing in getting this functionality?
Note: Moved to an answer at the request of the original poster.
Perhaps the behavior you are looking for comes from the Emmet plugin
What you are describing it the expected behavior for Sublime Text.
The functionality that you are looking for comes from Emmet as skuroda said. Just install it using Package Control and you should be good to go.