Giter VIP home page Giter VIP logo

Comments (4)

zloom31 avatar zloom31 commented on July 17, 2024 1

Thanks a lot! This works perfectly.
The reason I do not have a scratch buffer on launch is because I launch my emacs with key bound to this command:
emacsclient -c -n -e '(switch-to-buffer nil)'

It opens the Messages buffer immediately on the first startup but it's very handy since it reopens the last buffer I had open when I close my emacs frame.

from general.el.

noctuid avatar noctuid commented on July 17, 2024

Try this:

(general-with 'evil
  ;; (evil-set-initial-state 'messages-buffer-mode 'normal)
  ;; this won't work (runs too soon it seems)
  ;; (general-add-hook 'messages-buffer-mode-hook #'evil-normalize-keymaps)
  ;; this doesn't work
  ;; (general-add-advice 'after-find-file
  ;;                     :after (lambda (&rest _)
  ;;                              (when (eq major-mode 'messages-buffer-mode)
  ;;                                (evil-normalize-keymaps)
  ;;                                t))
  ;;                     nil
  ;;                     #'identity)
  ;; this is what fixes things
  (general-add-hook 'post-command-hook
                    (lambda (&rest _)
                      (when (eq major-mode 'messages-buffer-mode)
                        (evil-normalize-keymaps)
                        t))
                    nil
                    nil
                    #'identity))

from general.el.

zloom31 avatar zloom31 commented on July 17, 2024

Thanks for the reply. This seems to work but only if another buffer is visited before messages. Otherwise I need to press SPC (reads it as evil-forward-char) once before it will start using the leader properly.

from general.el.

noctuid avatar noctuid commented on July 17, 2024

Do you not have a scratch buffer and visit Messages immediately? Maybe try this:

(general-add-hook 'after-init-hook
                    (lambda (&rest _)
                      (when-let ((messages-buffer (get-buffer "*Messages*")))
                        (with-current-buffer messages-buffer
                          (evil-normalize-keymaps))))
                    nil
                    nil
                    t)

from general.el.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.