使用emacs记录笔记,会将命令的输出,保存在
#+BEGIN_SRC
#+END_SRC
命令输出很长,怎么设置下次打开这个org文件, BEGIN_SRC 里面的内容是折叠的?
使用emacs记录笔记,会将命令的输出,保存在
#+BEGIN_SRC
#+END_SRC
命令输出很长,怎么设置下次打开这个org文件, BEGIN_SRC 里面的内容是折叠的?
=> search bar: emacs org babel code fold by default
=> emacs org babel code fold by default - Google Search
=> Collapse src blocks in org-mode by default - Emacs Stack Exchange
=> (add-hook 'org-mode-hook 'org-hide-block-all)
谢谢 能不能指定类型? #+BEGIN_SRC的默认隐藏, 隐藏这个的内容 因为这个是命令的输出,
一般是不看的 但是像其他的比如说 源码或者引文 都是要一直显示的
=> searech bar: org-hide-block partially OR selectively
=> https://www.google.com/search?ei=1SlQXJHTBIeh_wSbrJyQBw&q=org-hide-block+partially+OR+selectively&oq=org-hide-block+partially+OR+selectively&gs_l=psy-ab.3..33i160l2.63130.67406..67679...0.0..0.328.4228.2-7j7......0....1..gws-wiz.......0i71j33i299.9CcYc51SOqo
=> org babel - Choose individual startup visibility of org-mode's source blocks - Emacs Stack Exchange
Indeed, some code blocks are too long and take up too much space. By default, you want to display all the code blocks, only hidden when you set a block of code to hide. Suppose there is a block of code in an org file that needs to be hidden, like:
#+BEGIN_SRC emacs-lisp :hidden
(defun individual-visibility-source-blocks ()
"Fold some blocks in the current buffer."
(interactive)
(org-show-block-all)
(org-block-map
(lambda ()
(let ((case-fold-search t))
(when (and
(save-excursion
(beginning-of-line 1)
(looking-at org-block-regexp))
(cl-assoc
':hidden
(cl-third
(org-babel-get-src-block-info))))
(org-hide-block-toggle))))))
(add-hook
'org-mode-hook
(function individual-visibility-source-blocks))
#+END_SRC
When the command “individual-visibility-source-blocks” is used, all code blocks are displayed except for the code block.
谢谢 我消化下
简而言之,添加此函数并将上面的钩子添加到您的配置中。 然后在希望在默认情况下折叠的代码块前面添加:hidden
在您的情况下,只需使用yasnippet或内置org snippet,如
#+ BEGIN_SRC $ 0(语言):hidden \ n#+ END_SRC
(边注: 我发现在这情节,下,google> yandex >> bing = baidu = duckduckgo, 最后三个(bing.com,baidu,duckduckgo)找不到任何有用的信息)
(setq org-hide-block-startup t )