I am using emacs 24.5.1 and do not understand how to shift outlines up/down in org-mode
Let's say I have the following list:
* Title 1
** section a
** section b
** section c
I would like to swap sections b and c. According to the manual this is achieved by using the keys M-up/down for items or M-S-up/down for subtree items. If I try M-down on "section b" for instance, I expect the following:
* Title 1
** section a
** section c
** section b
But instead I get:
* Title 1
** section a
** section c
The command deletes the current line ! It seems to work only with tickbox lists...
I checked my key-bindings with C-h k and they are calling the right commands. They are also displayed properly in the org-mode menu. I also tried to execute the commands
(org-shiftmetadown)
(org-move-subtree-down)
(org-move-item-down)
directly in the minibuffer but always get the same behaviour (line is deleted). I thought about a conflict with cua-mode but disabling it does not help.
I am missing something ? How to move outline items up/dow in org-mode ?
It shows M-up is bounded to command org-metaup in my case. And it moves subtree or table row up depending the context. Could you please try the command org-metaup and see if it works?
Related
In VSCode on Mac, I can use the keyboard shortcut Cmd + D to select the next occurrence of my currently highlighted text.
For example, if I highlight the variable order on line 1 in the below code, hitting Cmd + D causes order_form on line 2 to be partially highlighted, and hitting Cmd + D again causes order to be highlighted on line 3.
1. order = "Some string"
2. order_form = create_form()
3. return "Here is your order: " + order
However, I just want to select the actual variable order on lines 1 and 3 (i.e. excluding the text that is part of the variable order_form)
What keyboard shortcut can I use to just highlight the actual variables named order on lines 1 and 3?
The Ctrl+D functionality uses the current Find widget settings "behind the scenes" - whether that Find widget is visible or not.
So you would get the behaviour you want if the Whole Word option was enabled in that Find widget first before you began Ctrl+D'ing.
Alternatively, as the demo below shows when you place your cursor on the word you want order you can then hit Alt+W which will toggle the Whole Word option on and off. Note the little box that opens in the top right of the editor that shows only the Find options.
Then all your find next occurrences with Ctrl+D will find only what you want with that Whole Word option still enabled.
If you want to skip any of those occurrences, you can use the command
Add Selection To Previous Find Match
editor.action.addSelectionToPreviousFindMatch
(which you would have to make your own keybinding for). Just trigger that command to skip the next possible match - so follow this order:
Ctrl+D on the first order
Alt+W to enable whole word matching
trigger the command Add Selection To Previous Find Match
Ctrl+D to select the next order
It sounds like a bit of a hassle but they are common commands to know - to skip the next match and to toggle Whole Word matching.
[That little box that opens with the Find options is a little glitchey in that it seems to sometimes also enable the case sensitivity option as well - which isn't a problem in your example.]
Edit: Fresh install of emacs (emacs version from M-x emacs-version: GNU Emacs 25.2.2 (x86_64-pc-linux-gnu, GTK+ Version 3.22.21) of 2017-09-22, modified by Debian)
I had originall had emacs version 47.0 (that was from dpkg -l emacs which showed that as a metapackage)
Server was new and never had it before.
I am not an emacs guru. I don't fiddle too much and I can just get around in it.
I set
tab-width 4
indent-tabs-mode nil
I tried it before setting tab-stop-list and then setting it to nil and to "4 8 12" and to "0 4 8" but it didn't change the behaviour I describe below. In fact none of the settings I changed seemed to affect anything for this.
I then tried searching for the problem, and I tried everything mentioned (c-basic-offset, standard-indent, etc) nothing seemed to help.
I am simply trying to edit conf files.
This is an example
settings.conf:
setting name {
param1=1
param2={
s1="test"
s2=5
}
}
however when I hit the tab key the behaviour is all over the place.
[a1]
setting name {
[a2]
param1=1
param2={
[a3]
s1="test"
s2=5
}
}
in [a1] - tab is 4 spaces - I can hit all day and its fine - perfect
in [a2] hitting tab from the start of the line:
first tab key inserts a tab (size of 4 spaces but backspace deletes it as a whole) and then 3 spaces
second tab key inserts 3 tabs (each the size of 4 spaces)
third tab key inserts 2 tabs (4 spaces size) and then 3 spaces
in [a3] hitting from the start of the line:
first tab key inserts a tab (size 4 spaces)
second tab key inserts a tab (4 spaces) and then 3 individual spaces
third tab key seems to move forward 1 space and converts the 3 individual spaces from before and its newly added 1 space to a tab character as backspace deletes a size of 4 spaces in 1 go
I have no idea what is going on and except for those settings mentioned above that I change through M-x customize I haven't touched anything else at all.
Only other thing I can say is I am running emacs on Ubuntu 18.04 (edit from 20.04 - my mistake, sorry) on a server I ssh too.
By C-h k I get the following:
TAB runs the command indent-for-tab-command (found in global-map),
which is an interactive compiled Lisp function in ‘indent.el’.
It is bound to TAB.
(indent-for-tab-command &optional ARG)
Indent the current line or region, or insert a tab, as appropriate.
This function either inserts a tab, or indents the current line,
or performs symbol completion, depending on ‘tab-always-indent’.
The function called to actually indent the line or insert a tab
is given by the variable ‘indent-line-function’.
If a prefix argument is given, after this function indents the
current line or inserts a tab, it also rigidly indents the entire
It works in 'text-mode" but I don't want to switch to 'text-mode' (in which it works) as I like the highlighting it does.
*Edit (from comment):
I need to edit files that are listed as .conf and .cnf. There are hundreds of them in total. Some are for internal applications. The .cnf file are for nagios, and the .conf files are for icinga
Any help is appreciated.
Thanks.
My emacs version is GNU Emacs 24.3.1 (i386-mingw-nt6.1.7601) of 2013-03-18 on MARVIN.
If I start emacs with '-q' option, I'll use the built-in org-mode 7.9.3f, and for following text
* Level 1
** Level 2
Some text for level2.
if I press M-RET at the end of the last line, I'll get a new heading in a new line.
* Level 1
** Level 2
Some text for level2.
**
However, in org mode 8.0.3(from ELPA), it makes the last line a new heading instead of inserting a new one.
* Level 1
** Level 2
** Some text for level2.
It's very intrusive and I'm wondering whether it's a bug or something. Could you tell me how to get M-RET behave like version 7.9.3f?
This is known new behavior which was introduced just recently and a possible bug, see
http://thread.gmane.org/gmane.emacs.orgmode/72172
http://thread.gmane.org/gmane.emacs.orgmode/72399
Any way to have org-mode continue a numbered list rather than restarting?
Here is the situation. You make a list like:
Sometimes you can restart the display by doing something like this:
Hit Ctrl-Alt-F1 to open up a terminal.
Enter the following two commands:
#+BEGIN_SRC bash
export DISPLAY=:0.0
cinnamon --replace
#+END_SRC
\3. Then hit Ctrl-Alt-F8 to go back to the window manager.
Both the markdown editor and org-mode want the #3 to be #1, restarting the list after the code block.
SOLUTION below. Now it looks perfect. Here's a tip for recovering when Cinnamon locks up in Ubuntu 12.04 or Mint 13.
You can tell org-mode what the label of each item should be, so you can make the next list start with the number following the last one from the previous list. The org-mode manual for version 8.2.5h says (with boldness added by me):
Ordered list items start with a numeral followed by either a period or a right parenthesis, such as ‘1.’ or ‘1)’. If you want a list to start with a different value (e.g., 20), start the text of the item with [#20]. Those constructs can be used in any item of the list in order to enforce a particular numbering.
Using this, you can indent the text between the two lists any way you like, but there is no automatic updating of the numbering when the previous list changes.
Example:
Here comes a multi-part list.
1. Item the first.
2. Item the second.
Here is some intermediate text.
3. [#3] Item the third.
4. Item the fourth.
Try indenting the #+BEGIN_SRC block, so it "looks" like it's a child of item number 2 instead of a top-level item. Does doing that fix your problem?
Like this:
1. Hit Ctrl-Alt-F1 to open up a terminal.
2. Enter the following two commands:
#+BEGIN_SRC bash
export DISPLAY=:0.0
cinnamon --replace
#+END_SRC
3. Then hit Ctrl-Alt-F8 to go back to the window manager
The org-mode manual describes precisely what terminates lists. Quoting from it :
A list ends whenever every item has ended, which means before any line less or equally indented than items at top level. It also ends before two blank lines¹.
¹ See also org-empty-line-terminates-plain-lists.
As Daniel mentions, indenting all in between 2. and 3. should solve your problem.
As stated accidently ran the org-column command and I manage to remove it from the todo item somehow. Not sure how but it got rid of it but it's still at the top of the buffer it shows the column labels. How do I remove this and remove org-column view from a todo item in the future if this happens again?
Figured out you have to run the command:
org-columns-quit
Also, hitting q anywhere on a column is equivalent to M-x org-columns-quit RET.