In Emacs org-mode, how would I instruct org-mode to make HTML code blocks folded by default? So that when I open an org file they are folded?
org-mode provides this feature out of the box. You can set it globally by customizing the variable org-hide-block-startup. To set this for a single file, add
#+STARTUP: hideblocks
To the header. Here's the relevant section of the manual
Related
While editing a markdown document in VS Code, the outline box does not show me the outline of the markdown document; it's completely blank/empty. I've disabled all extensions with no change in behavior (and I only had one markdown-related extension anyway, markdownlint). I don't know that this has ever worked, but it certainly has not for the last several months.
OS: Mac OS 12.3
VS Code: 1.65.2
Out of the box, Markdown headings should show up in the outline view as text nodes:
If the outline view is configured not to show strings, Markdown headers won't appear.
Take a look at the Outline: Show Strings setting in your preferences and make sure it's enabled.
This setting is called outline.showStrings. If you wish to enable it only for Markdown files, you should be able to disable the feature globally and then add something like this to your settings.json:
"[markdown]": {
"outline.showStrings": true
},
It's probably easiest to start by running Preferences: Configure Language Specific Settings... in the command palette and then selecting Markdown.
I installed GNU minimap (version 1.2).
When I open certain type of files , e.g. .py, .c, the minimap comes out as expected.
However, when I open .html file, the minimap is not started.
Is there a way to add additional modes where the minimap automatically shown?
I tried to add hooks to .emacs file but it just starts minimap-mode, but no displaying any minimap.
(add-hook 'html-mode-hook 'minimap-mode)
By default, minimap-mode only works for modes that derive from prog-mode (most modern modes for programming, including python-mode and c-mode). Modify minimap-major-modes if you want to activate it for others, e.g.
(setq minimap-major-modes '(prog-mode html-mode))
or
(add-to-list 'minimap-major-modes 'html-mode)
Currently in Sublime Text 2 I can do the following while editing a .html file:
hr.margin-none <TAB>
and it will expand automatically to
<hr class="margin-none"></hr>
Is there a similar function in Emacs? I found something on Flexible Expand but it doesn't seem to do what I was hoping (or maybe I'm just using it wrong.)
Thanks!
You can do the same thing in Emacs. Just install the emmet-mode and enable it. Reading the following page would help you.
https://github.com/smihica/emmet-mode
I'm using emacs to edit markdown file and I wanna display the inline formulas in the markdown mode. I thought org-preview-latex-fragment is a good idea, but there're some problems:
It's slow.
I cannot use the org-preview-latex-fragment directly, I have to launch org-mode at first and until then the org-preview-latex-fragment can be seen and used.
The effect of org-preview-latex-fragment is whole buffer. Sometimes I just want to display the formula at a single point.
And When I'm using org-preview-latex-fragment in markdown-mode, I cannot cancel the preview anyhow.
Is there a workaround or enhancement? Thank you so much!
Not sure about 1, 2 and 4. But for your third question:
If you place your cursor within a LaTeX fragment C-c C-x C-l org-mode will preview just that equation. If you move your cursor to a text area, it will preview the entire buffer.
You can read more about this is the documentation.
In the terminal when I try to use emacs the colors are not good, most of the times I can't properly see the text.
In vim I know I can change the colorscheme with :colo <colorscheme_name>
Is there something similar in emacs?
A tutorial on the proper steps to change the colors would be appreciated.
I'm not sure of tutorial, but off top of my head, what you probably will want to do is: M-x customize then navigate to the section called "Faces" - you'll get a bunch of settings related to the color scheme and other font-related settings.
But Emacs has tons of customizations related to how text is displayed. I'm using this http://www.nongnu.org/color-theme/ but you can find a lot of info here: http://emacswiki.org/emacs/ColorTheme (emacswiki is basically the resource to be consulted first when you have any Emacs-related problem).
Obviously, you can do that in your .emacs file by adding different settings, but I'd suggest to use what's generated by the changed settings first, see how it works and then add on top of that yourself (once you modify settings from the customization buffer, it will save the changes into .emacs file - you can then open it and see what exactly did it do).
M-x load-theme
then use arrows to select a theme.
Adding here for easy reference ( #deong shared this answer via comment under the accepted answer).