I'd like to be able to use <tab> to unfold folded text when using vimish-fold, how could I do that without override the default binding of <tab>?
Related
Is there a way to move an item together with underlying text in a structural way?
* Header
** Subheader
some text
I want to move Subheader together with some text in a structural way. So I tried M-UP/DOWN when I'm on Subheader but it only moves the Subheader not the "some text" as well.
Note: I prefer not to cut paste yank text as it's not structural.
There is org-cut-special (bound to C-c C-x C-w), org-copy-special (bound to C9c C-x M-w) and org-paste-special (bound to C-c C-x C-y):
they are analogous to Cut/Copy/Paste but they operate on subtrees.
Also, you might try looking at the Org menu when you are editing an org-mode file. The above commands and quite a few more are under the Edit structure menu.
Is there a short way to wrap an s-expression using slime?
Suppose i have finished some piece of code and I realize I need a variable (e.g. for efficiency reasons) and therefore want to wrap it with let or want to make it tail recursive and need to wrap it with labels, what is the fastest way to do this? Is there a shortcut?
IntelliJ (a Java IDE) allows things like:
x > 3.if + TAB
yielding
if (x > 3) {
}
So are there any "sexp-wrapping" shortcuts (postfix or prefix) in slime/emacs?
The bar represents the cursor.
With paredit
There is a wrap-round command, bound to M-(. But when adding context to an expression, I generally do as follows:
|code
Open the parenthesis (the closing one is added automatically):
(|)code
... type ...
(let |)code
Call paredit-forward-slurp-sexp (C-right)
(let | code)
See also the The Animated Guide to Paredit.
Without paredit
|code
Call mark-sexp (C-M-Space), then kill the region; type and yank (paste) the text where you need it.
See also Expressions with Balanced Parentheses (e.g. forward-sexp), available in Emacs.
Is there something I can press on the keyboard to get Pycharm to auto-complete without my first having to type a letter?
The purpose of this is so I can see all the possibilities as opposed to only the ones that start with the letter that I typed, or if I don't know what any of the possibilities are to begin with.
Example:
You can trigger different types of completion from the menu Code → Completion or using the corresponding keyboard shortcuts (depend on keymap):
Default completion shortcuts:
Basic: Ctrl+Space
SmartType: Ctrl+Shift+Space
Class Name: Ctrl+Alt+Space
Is there an Emacs minor-mode (or piece of elisp code) that lets you selectively hide/show environments while in LaTeX mode? For instance, I would like to move to the beginning of a long \begin{figure} block, hit a keystroke, and have the contents of that figure environment hidden from view. Similarly with \begin{proof} and so on, and ideally even with \subsections.
Is this possible? I just tried hs-minor-mode, allout-mode, and outline-minor-mode, but most of them don't recognize LaTeX's environments, e.g. hs-minor-mode fails with "scan error: unbalanced parentheses". I would prefer not to have to enter explicit folding marks like {{{ as in folding-mode.
[Ideally it would be great if the folding were persistent, but I see that that question doesn't have an accepted answer yet.]
AUCTeX does folding: http://www.gnu.org/software/auctex/manual/auctex.html#Folding
A popular complaint about markup languages like TeX and LaTeX is that there is too much clutter in the source text and that one cannot focus well on the content. There are macros where you are only interested in the content they are enclosing, like font specifiers where the content might already be fontified in a special way by font locking. Or macros the content of which you only want to see when actually editing it, like footnotes or citations. Similarly you might find certain environments or comments distracting when trying to concentrate on the body of your document.
With AUCTeX’s folding functionality you can collapse those items and replace them by a fixed string, the content of one of their arguments, or a mixture of both. If you want to make the original text visible again in order to view or edit it, move point sideways onto the placeholder (also called display string) or left-click with the mouse pointer on it. (The latter is currently only supported on Emacs.) The macro or environment will unfold automatically, stay open as long as point is inside of it and collapse again once you move point out of it. (Note that folding of environments currently does not work in every AUCTeX mode.)
In order to use this feature, you have to activate TeX-fold-mode which will activate the auto-reveal feature and the necessary commands to hide and show macros and environments. You can activate the mode in a certain buffer by typing the command M-x TeX-fold-mode RET or using the keyboard shortcut C-c C-o C-f. If you want to use it every time you edit a LaTeX document, add it to a hook:
(add-hook 'LaTeX-mode-hook (lambda ()
(TeX-fold-mode 1)))
If it should be activated in all AUCTeX modes, use TeX-mode-hook instead of LaTeX-mode-hook.
Once the mode is active there are several commands available to hide and show macros, environments and comments...
I've recently started using screen in remote sessions. One problem is that emacs doesn't recognize its C-a and I don't want to bind emacs C-a to something else, as I'm very used to it.
Google shows ways to change every keybinding individually using ~/.screenrc but not how to change a keybinding globally. I want all C-a to change to something else. Is that possible? What are my options?
Thanks for your answers
You can change the escape combination via escape in .screenrc:
# Makes Control+b become the escape combination
escape ^Bb
You can also just use Ctrl + a a to pass a Ctrl + a to the child process. You get used to it after a while.