Emacs: Disable line truncation in minibuffer only

天涯浪子 提交于 2020-01-01 06:27:06

问题


I am using ido mode for file & buffer switching in Emacs 23.

The following options allow the minibuffer to be resized if there is more than one line worth of files in the directory:

(setq resize-mini-windows t) ; grow and shrink as necessary
(setq max-mini-window-height 3) ; grow up to max of 3 lines

However, this only works if line truncation is not enabled by default (globally):

(setq-default truncate-lines t) ; Truncate, do not wrap lines

I like this option for my main editing window, but this also overrides the above function to show more than one line in the minibuffer. The line in the minibuffer is truncated, not wrapped, also.

Is there a way to enable line truncation for the main editing window and only disable it in the minibuffer?


回答1:


You just need to set the truncate-lines variable to nil for the minibuffer. The easiest way to do that is with the following:

(add-hook 'minibuffer-setup-hook
      (lambda () (setq truncate-lines nil)))


来源:https://stackoverflow.com/questions/1775898/emacs-disable-line-truncation-in-minibuffer-only

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!