in org-mode how to auto create new numbering? - org-mode

I write this in org-mode
SomeTopic
Anything I can click here to automatically create the below 1.
Anything I can click here to automatically create the below 1. automatically indented below?
1.
For example, I have this line (non header, text):
1. some item
I want to click something so it will open 2. so after I click that something I will have:
1. some item
2.

Try M-RET which is bound to org-meta-return which in list context calls
org-insert-item. E.g.
* foo
Let's have a list:
1. itemX
where X marks the position of the cursor.
Now press M-RET:
* foo
Let's have a list:
1. item
2.
The Plain lists section of the manual explains this and many other things that you can do with lists.

Related

Is there in vscode an option to: Select an entire section

Is there in vscode a shortcut available which selects a whole section at once? I'd like a shortcut that would select one line of code if it's a single line, or if a section includes any closures it should collect everything including the preceding code before the opening and end at the the relevant closure.
Also see: Is there in vscode an option to: Select everything between matching brackets
Edit:
Basically I want a shortcut to highlight this whole phrase at once:
if 1 == 1 {
** do stuff
}
that I can also use to highlight single lines of code:
** second do stuff

How to create sub-headers in org-mode (emacs)?

Hello I was wondering how to create sub-headers in an org document. I have tried this:
* header
* sub-header
Some text
The * works for the header part but will create bullets instead of sub-headers.
for these kind of questions the org-manual is the best place to check: https://orgmode.org/org.html#Headlines
Headlines define the structure of an outline tree. The headlines in Org start with one or more stars, on the left margin3. For example:
* Top level headline
** Second level
*** Third level
some text
*** Third level
more text
* Another top level headline
Hope, this helps!
As a supplement to the answer by #sanenr9, you can also enable a "clean view" that hides all but the last star in a heading if you prefer (see A Cleaner Outline View): the asterisks are still there in the buffer but they are hidden using an overlay.
Another useful hint is to examine the "Org" entry in the menu: there are many useful commands there (generally with a keyboard shortcut as well). E.g. you can add a new heading at the same level as the previous heading by clicking on the "New Heading" entry in the "Org" menu and you can then make it into a subheading by clicking on
"Org/Edit Structure/Demote heading" menu item (or you can use the indicated keyboard shortcut M-<right> which is done by holding down the Meta key and pressing the right arrow key.)

Emacs org-mode: how to hide the enumerated list items descriptions by default

Suppose we have this org file:
1. first item
description of the first item
2. second item
description of the second item
3. third item
description of the third item
If I move the cursor to all the top items, and click <tab>, it will hide the descrption. And the file will look like this:
1. first item...
2. second item...
3. third item...
But when I open the file all items are open, which is uncomfortable for me. How can I hide them by default, leaving just dots?
That's strange, for me this is the default behavior to hide everything except the top level.
You can either modify it globally via the customize menu : Group org startup -> option org-startup-folded
or for each file like this http://orgmode.org/manual/Initial-visibility.html#Initial-visibility

Collapsing the current outline in Emacs org-mode

Say I am in org-mode in a document with the following structure:
* First headline
* Second headline
** Section A
Here is one line
Here is another line
blah, blah
** Section B
Say the cursor is on the line that reads Here is another line. I would like to collapse ** Section A from this location with a keyboard shortcut.
If I press <TAB> it does not collapse ** Section A, as I would need the cursor to be on the stars for this to work.
If I press <Shift-TAB> it collapses all outlines, and not the current one.
Is there any way to cycle through the collapsing of the outline in scope (i.e. the "current outline")?
You can customize the behaviour of the org-cycle command (which is bound to <TAB>) by changing the value of org-cycle-emulate-tab.
To get it to collapse ** Section A when your cursor is on Here is another line add the following line to your .emacs file:
(setq org-cycle-emulate-tab 'white)
The white will allow you to still use <TAB> to indent in empty lines. From org-mode Github:
org-cycle-emulate-tab's value is t
Documentation:
Where should `org-cycle' emulate TAB.
nil Never
white Only in completely white lines
whitestart Only at the beginning of lines, before the first non-white char
t Everywhere except in headlines
exc-hl-bol Everywhere except at the start of a headline
If you don't mind doing this in two steps:
C-c C-p: move the cursor to the previous heading (** Section A in your example)
TAB: fold the section
This method doesn't require any configuration, as long as you get used to it.

Can I make a macro in n++ that does a search/replace?

I'm new to n++, but I have been most impressed with this tool so far. I've been trying to record a macro that do a search/replace, but the 'search' part seems to have the initial search text from the recording 'hard-coded' in the macro.
What I want is:
Manually locate the cursor at the beginning of the first line of a fixed format code segment, then Macro actions:
move cursor two lines down
move cursor right x characters
mark charters from pos x to x+n
search and replace all occurrences of the selected text with "{p_'selected text'}"
In an more advanced version, I'd like to add some logic to step 4: only execute the replace part if the # of occurrences are > 1 (e.g. by first adding a count statement, but I'm not sure how to obtain the returned count # from the dialog box)
Is this possible?
While I'm a big fan of Notepad++, this sounds like something I would accomplish with AutoHotKey. You would select the text and copy it to the clipboard. AutoHotKey would read the clipboard, replace the text as you desire, and either replace the clipboard contents, or send it back to your document. Let me know if you would like to go that route.