一般而言是terminal模式下的换行,看看截图?
关掉 writeroom-mode 就没有了。我想这是由于由于你一行的字太多了导致的,你可以试试 writeroom-increase-width
这个是"视觉换行", 实际上还是同一行字. \
符号就代表这一行和下一行是一行字, 没有拆开.
要想自动插入换行符,可以用
(turn-on-auto-fill)
对对对,但现在问题我不想要这个视觉换行,毫无意义又很annoying。这个怎么能关掉么?
(setq-default truncate-lines nil)
是不想看到\
号,还是不想看到折行?
-
是前者
(setq truncate-lines nil word-wrap t fringe-indicator-alist (cons (cons 'continuation visual-line-fringe-indicators) fringe-indicator-alist))
或开启
visual-line-mode
。 -
是后者就
M-x toggle-truncate-lines
关闭折行,这样也就看不到长行后面的内容了。
周末忙不过来,今天照这个改了下,但是不是想要的结果,"\“消失了,但”$$"出现了,而且文字会不折行,继续写在后面。我有点要崩溃了。 另外cnfonts在terminal下不可用,有啥好的替代么? 多谢
我是想做到1,但照你的方法,还是不行。不知道咋办了。
如果在终端试试这个:
⋊> emacs -Q --eval "\
(progn
(set-display-table-slot standard-display-table 'wrap ?\s)
(insert (make-string 500 ?a)))" -nw
page-break-lines
会使上述设置失效。可借鉴 purcell/page-break-lines#29 提供的方案来解决冲突:
(defun prettify-continuation-indocator (&optional dummy)
(ignore dummy)
(when buffer-display-table
(set-display-table-slot buffer-display-table 'wrap ?↩)))
(unless window-system
(set-display-table-slot standard-display-table 'wrap ?↩)
(add-hook 'window-configuration-change-hook 'prettify-continuation-indocator)
;; 如果还有问题,试着启用以下设置
;; (with-eval-after-load 'page-break-lines
;; (add-hook 'page-break-lines-mode-hook 'prettify-continuation-indocator))
)
按照这个的确""消除了
我不知道你是怎么拷贝的,是不是用了终端拷屏的方式?去掉 -nw
参数试试。
是终端,终端是我主要的使用方式
你是不是使用的拷贝 utility 有问题?
我的是 macos,终端版本 emacs 启用 xclip-mode (你要去 elpa 安装这个包)以后,跨行的长行直接复制 (M-w
) 出来以后并不会换行:
以下是我的屏幕内容:
复制出来粘贴到这里是这样子的:
jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj
可以看出来并没有换行.
我的终端显示配置是这样子的:
(set-display-table-slot standard-display-table 'truncation 32)
(set-display-table-slot standard-display-table 'wrap 32)
(defun my/display-truncation-and-wrap-indicator-as-whitespace ()
(when (not (char-table-p buffer-display-table))
(setq buffer-display-table (make-display-table)))
(set-display-table-slot buffer-display-table 'truncation 32)
(set-display-table-slot buffer-display-table 'wrap 32))
(add-hook 'prog-mode-hook #'my/display-truncation-and-wrap-indicator-as-whitespace)
(add-hook 'text-mode-hook #'my/display-truncation-and-wrap-indicator-as-whitespace)
感谢大家的热心解答,通过网上查询的一些资料,我这里做一下总结:
- 目前据我所知,超出 emacs 的显示宽度后,是会在换行的尾部(其实不是换行,只是当前显示不完了)插入提示符(可以是箭头或空白,暂未找到完全不插入提示符的设置方式)
- 通过 iterm2 等终端方式使用 emacs,实际的复制行为(右键选中复制),是终端的行为而非 emacs 的行为,所有这些尾部字符会原样保留而被复制过来
- 通过 kill-ring-save 方式复制出来的文本,则是原样的文本
被复制的原始内容
在终端模式下,我设置的系统剪切板与 emacs 剪切板不共享的