emacs org-indent-mode: how to go back a tab - emacs

When I enable org-indent-mode in emacs and have a document outline like the following:
* headline
** secondary headline
text
(after pressing enter key on previous line cursor is set here)
(i want my cursor to be here)
I want to have my cursor go back to the 'headline' part, and not automatically to the 'secondary headline' part. How can I make this happen?

Use M-Enter (probably Alt-Enter) instead of just enter.

This is not possible. It's not an org-indent limitation. It's an org-mode, and a general outliner limitation.
You cannot add content to a headline after creating a sub-headline.

Related

Is there a way to disable the default behaviour of ctrl+enter in find and replace in vscode?

VScode has an annoying feature where it adds a new line into the text box during find and replace when I press ctrl+enter. I would like to use the keyboard shortcut ctrl+enter to replace all, but when I configure it that way in keyboard shortcuts, it is still inserting a newline before replacing, adding an extra newline to every match that is replaced. Example:
Find: "foo"
Replace: "bar"
Before:
foofoofoo
foo
Expected result:
barbarbar
bar
Actual result:
bar
bar
bar
bar
This is highly infuriating since I've already become accustomed to this keyboard shortcut and it is disrupting my normal workflow. Does anyone know how to fix this?
Use CTRL+K+S , you will get list of all defaults.
Change whatever you want from the first option in the line of edit.
This issue is now fixed in at least 1.67, probably a version before that.

Any way to manually trigger highlighting of semantic symbol occurrence in Visual Studio Code?

In VSCode, when you place cursor inside a symbol (variables, functions, etc), all occurrence of the same symbol will be highlighted.
This feature is somewhat useful but annoying as well. Even I can make it less obtrusive by customizing the color theme in settings.json, it will suppress the selection highlighting when you select a variable by double clicking it with mouse cursor.
I've learned that I can completely disable this feature by adding "editor.occurrencesHighlight":false in settings.json, but this feature is still useful because it can label occurrences of a symbol with different color, to represent read/write status of each occurrence.
So my question is: is there any way to disable the automatic semantic matching feature, and only enable it manually with keyboard shortcuts or commands ?
If you only need textual matches, you can select some text use the Select all occurrences of find match command. This will select every occurrence of the selected text in the current document (and also create a cursor at it)
For symbol based information, try using the Find all references or Peek references commands. The flow is different but it gives the same information.
Alternatively, use an extension like this one to create a keyboard shortcut that toggles editor.occurrencesHighlight

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.)

How to disable autoindent on enter

I see multiple settings for Code in terms of how to indent (spaces vs tabs), but nothing about how to disable indents. So for example, I enter a <p> tag, hit enter, and Code auto indents the next line. I'd like to disable that but cannot find the setting to do so.
No, there is no option to disable auto indent on enter. But if you need to insure that inline elements remain without extra spaces because it affects the layout you can use the new option, introduced in v1.0: html.format.unformatted - comma separated list of tags that shouldn't be reformatted. Default value null means that all inline elements should remain as you formatted them.
In addition, instead of typing <p> + Enter you can type just p and press tab which will give you a nice <p><\p> and will place the cursor in the middle.
Hope this helps.
You can now set the configuration property editor.autoIndent in your settings.json file (which for me was in C:\Users\$USER\AppData\Roaming\Code\User\settings.json). the value you want to set it to is the string "none".
see this thread for more details https://github.com/microsoft/vscode/issues/5446#issuecomment-559145939

Configure Eclipse word-boundaries so 'Next-Word-Key' skips whole identifier

If I have a piece of Code
MyIdentifierIsNice(OtherThingAlsoNice isBetterThen);
I'd like to change the behavior of Ctrl-Left in Eclipse from stopping here:
My|Identifier|Is|Nice|(|Other|Thing|Also|Nice is|Better|Then|);|
to here:
MyIdentifierIsNice(|OtherThingAlsoNice |isBetterThen);|
...or at least just not so often. Other variants would be also fine, like:
MyIdentifierIsNice|(|OtherThingAlsoNice| isBetterThen|);|
Mainly it should stop considering a CamelCaseIdentifier to consist of several words for navigation via Next-Word, and such like.
I use SpringSourceSuite Version 2.5.1, which is Eclipse 3.6, I guess.
Try and unselect the option:
Preferences / Java / Editor / Smart caret positioning in Java names
And see if that enhances the user experience in term of cursor positioning.
If this is not Java, you have a similar option in:
Preferences / General / Editors / Text Editors / Smart caret positioning at line start and end
It is usually selected, meaning if the cursor still stops at every word, that may suggests another setting for a specific language is overriding it.
Coming to Eclipse from XCode, I found the default navigation annoying. In Eclipse, Alt+Left and Alt+Right move to the next camelcase segment, and Ctrl+Left/Right does nothing. In XCode, Alt+Left/Right moves between words and Ctrl+Left/Right moves between camelcase segments. This allows you to control how fine-grained your navigation is.
How I fixed this for myself was by going into Preferences > General > Keys, searching for "Word", and changing the "Next Word" and "Previous Word" bindings from Alt+Left/Right to Ctrl+Left/Right. Then the Alt-navigation is by word and the Ctrl-navigation is by camelcase segment, as in XCode.
I thought this might be useful to some.
Edit:
As I continue to use these new settings, I've found another point:
Although navigation works as advertised, selection has some funky behavior. Namely, Shift+Ctrl+Left/Right can sometimes select large blocks of text instead of just the next camelcase component.
To fix this, again go to Preferences > General > Keys, search for "Select".
Set "Select Next/Previous Word" to Shift+Ctrl+Right/Left.
Unbind "Select Next/Previous Element" (there are three "Whens" to pick from, I unbound all 3).
Voila.
If you want a very simple way to select a entire word without the need to disable smart caret positioning.
You can use at the beginning of word or inside the word:
Shift+Alt+Right
At the end or in the middle of word:
Shift+Alt+Left