去掉source code与results之间的空行

source code与results之间, 默认有空行

#+BEGIN_SRC shell 
ls  ~ | head 
#+END_SRC

#+RESULTS:
| $tty            |
| 8022            |
| anaconda3       |
| Desktop         |
| Documents       |
| Downloads       |
| exclude-me.txt  |
| geckodriver.log |
| index.html      |
| Jupyter         

怎样从设置中将空行去掉?

1 个赞

加个空行更清楚,挤在一起多难看。

至于你的问题,没有也不太可能会有这样的设置,但你可以自行折腾,可以试试 org-babel-after-execute-hook,找到 #+RESULT: 后删除空行,举个例子:

(defun your-org-babel-after-execute ()
  "Remove the empty line between SRC and RESULT."
  (when-let ((beg (org-babel-where-is-src-block-result nil nil)))
    (save-excursion
      (goto-char beg)
      (forward-line -1)
      (delete-blank-lines))))

(add-hook 'org-babel-after-execute-hook #'your-org-babel-after-execute)
2 个赞

距离 产生美

O(∩_∩)O哈哈~…