help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Can I turn off ivy-mode in comint buffers?


From: Jonathan Kyle Mitchell
Subject: Re: Can I turn off ivy-mode in comint buffers?
Date: Sat, 30 Jun 2018 17:22:08 -0500

On Sat, Jun 30, 2018 at 3:36 PM <bbenedetto@goodyear.com> wrote:
>
> Good day.
>
> I have loaded ivy-mode and really like it... everywhere except in
> comint buffers (for filename completion).  Is there some way to either
> disable it in comint buffers or to just turn it on everywhere else?
>
> Sorry if this is a pretty basic question.  I couldn't find an answer
> either online or looking through the source.
>
> Thanks!
>
> --
> - Bill
> +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
> Bill Benedetto     <bbenedetto@goodyear.com>    The Goodyear Tire & Rubber Co.
> I don't speak for Goodyear and they don't speak for me.  We're both happy.

One way to do it is to customize post-command-hook to dynamically turn
ivy on and off depending on the current buffer's major mode.

(ivy-mode 1) ; globally enabled

(defun disable-ivy-in-comint-only ()
  "Leave `ivy-mode' enabled everywhere except in buffers that derive
from `comint-mode'."
  (if (derived-mode-p 'comint-mode)
      (ivy-mode -1)
    (ivy-mode 1)))

(add-hook 'post-command-hook 'disable-ivy-in-comint-only)

--
Jonathan Kyle Mitchell



reply via email to

[Prev in Thread] Current Thread [Next in Thread]