Is there a way to use Emmet to number div element in increments greater than 1? - auto-increment

I've been looking for a way to create div elements numbered in increments of 9 but everything I have tried has failed, usually by stopping Emmet from expanding.
So I want something like .container$*3 to which gives:
<div class="container1"></div>
<div class="container2"></div>
<div class="container3"></div>
but so that the classes are container1, container10, container19, etc.
I have looked at this Emmet documentation but cannot find any reference to incrementation greater than 1. I have tried various operators but nothing that worked outside of the documentation.
Note: what I am trying to use Emmet to expand is more complicated but the 'greater than one' incrementation is the bit I am missing, e.g. .col*16>.row.row$.rowCol$#10[style=background-image:url$#19]*9.
I can't just produce many more lines by incrementing by 1 and delete the unwanted ones as all lines should contain classes incremented by 1 and by 9.

Related

Django if statement with beginning tag in conditional breaking next div

I have the following code in a file in my template folder
{% if permission <= 4 %}
<div class='row'>
The < in my conditional is breaking my next div.
If I use > then it works but that's not how I have my permissions and I don't want to switch it around.
vim detects a break in this conditional by changing the color and the template never loads the div even though the conditional is true.
Session output:
('permission', 0)])
I feel like I'm missing something simple but I can't quite get my search strings to give me what I am looking for.
Someone helped me here: https://forum.djangoproject.com/t/conditional-conflict-in-template-with-following-div/14476
I got distracted by the VIM error and went in the wrong direction.
I changed 'permission' to 'request.session.permission' and it works now.

Sublime Text 3 Search and Replace Project Using Regex

I'm using Sublime Text 3 on Ubuntu 18.04. I need to do a Search and Replace across 100+ pages in a project directory. I'd like to do this with a regex, if possible, but I cannot figure out how to do it.
I want to find tabindex="nbr" where nbr is an actual number. I.e: tabindex="2". I want to replace every instance with tabindex="0".
I've tried this:
Find: tabindex="\d"
Where: /home/me/path/to/project/
Replace: tabindex="0"
But this does not work. I get a 0 matches found pop up. I've tried other regex's with the same 0 matches found message.
This has to be easier than I am making it.
Thanks for any advice.

Creating a 4-5 character column along the left margin in vim

As a bit of context, I am considering making a plugin for vim that would inline specific debugging and/or profiling information on along the left margin (ideally left of the numbers column) which would need to be 4-5 characters wide. However, I cannot find any means to accomplish this. I've searched around, and the closest thing I can find is vimscript code for inserting signs in the sign column, but the sign column is fixed at 2 characters wide.
I've considered the possibility of making my own makeshift column (to the right of the numbers column, in the normally editable text area) and somehow marking it as readonly, but that doesn't seem possible either- from what I've read, the entire buffer must be readonly or not; you can't have just a portion as readonly.
For completeness here's an example. I would like to programmatically insert a 4-5 character column before some text (with numbers set)
1 Text buffer
2 with some
3 text
to make
My 1 Text buffer
own 2 with some
text 3 text
Is there any way to accomplish this task?
The built-in feature for this is the sign column, but yes it is limited to two characters.
Depending on your use cases, it might be okay to enhance the signs with a tooltip popup (:help balloon-eval explicitly mentions This feature allows a debugger, or other external tool, to display dynamic information based on where the mouse is pointing.), or maybe place the additional information in the quickfix or location list.
Modification of the actual buffer has many downsides (as it effectively prevents editing, and Vim's main purpose is just that). What some plugins do is showing a scratch (that is: unpersisted, unmodifiable) buffer in a vertical split, and setting the 'scrollbind' option so that its contents follow the original buffer. For an example, have a look at the VCSCommand plugin, which uses this for annotating a buffer with commit information.

Sublime text multiple cursors?

Sublime Text is so damn advanced and this seems like such a stupid question, but...
I started writing a for loop in PHP (using SFTP), loved that it gave me a choice to auto-generate the loop. However, it enters this weird multi-cursor mode, which
1)I am not really sure how to use/exit without using the mouse;
2) it seems useless, seeing as all 3 type the same thing, even though I need to change, for example, the $i > x or $i = x.
Although Sublime does indeed support the idea of multiple cursors (which is an incredible time saver and useful as all get out, as we're about to see), what you're actually asking about here is a snippet which in this case happens to also include multiple cursors.
The general idea is that for code that you're likely to type many times (e.g. a for loop), you can create a snippet that will generate the bulk of the text for you in one shot, and then allow you to easily customize it as needed. In this case, the snippet in question is part of the default functionality of Sublime and is provided by the shipped PHP package.
To answer point #2 in your question first, this is far from useless. As seen here, I enter the text for and then press Tab to expand the snippet out. The first thing to notice here is that the status line says Field 1 of 4 to tell me that I'm in a snippet and that it contains four fields.
The first field is the name of the control variable for the loop, and all of them are selected so that as I change the name, all of them change at the same time because when there are multiple cursors, the text you type appears at all of them at the same time.
Once I'm done changing the name of the variable, I press Tab again to go to the next field, which allows me to easily change the point at which the loop starts. Another press of Tab takes me to the third field, where I can specify where the loop ends.
One last press of Tab exits the snippet and selects the text in the loop, so I can start writing my code (caveat: I am not a PHP developer).
At this point you can see Sublime offering another snippet for echo, which would expand out to an echo statement complete with quotes, then allow me to edit the text in the echo and skip to the end.
Circling back around to the first point in your question, you can use Esc at any point to jump out of a snippet and go back to regular editing. You can also use Tab or Shift+Tab to move through the fields in the snippet, and pressing Tab at the last field in the snippet exits it as well.
In this particular case, the first field in the snippet sets up multiple cursors, and so exiting the snippet while this field is active leaves multiple cursors in effect. You can jump back to a single cursor by pressing Esc one more time (this is true regardless of how you ended up with multiple cursors).

What are "Code Styles" in Intelli J IDEs?

I took a look at this, and I thought it was a color scheme or something. I followed my stems to find out that it's not.
What are "Code Styles" and what changes can they, for example, do?
Code styles dictate what happens when you auto-format your code, which includes:
The placing of braces, forcing or omitting their inclusion with a single statement
The amount of spaces indentation does
Whether or not you chop down or wrap long statements or parameters
How annotations appear in fields (on top of/next to)
Whether or not you use import * statements in Java, and what/when the cutoff is
How you close ML tags (XML, HTML, etc - either with the </full-name> or <full-name />)
...and many other pieces.
Code style varies from person to person, and shop to shop, so having IntelliJ as a way to configure this once and shared with others is ideal.

Resources