jerrypnz / major-mode-hydra.el

Spacemacs-esque major mode leader key powered by Hydra
297 stars 9 forks source link

pretty-hydra: columns cannot left-justified, how to solve it? #41

Closed dnxbjyj closed 4 years ago

dnxbjyj commented 4 years ago

I have this config:

(require 'pretty-hydra)

(pretty-hydra-define jp-toggles
  (:color amaranth :quit-key "q" :title "My Toggle")
  ("Basic"
   (("n" linum-mode "line number" :toggle t)
    ("w" whitespace-mode "whitespace" :toggle t)
    ("W" whitespace-cleanup-mode "whitespace cleanup" :toggle t)
    ("r" rainbow-mode "rainbow" :toggle t)
    ("L" page-break-lines-mode "page break lines" :toggle t))
   "Highlight"
   (("s" symbol-overlay-mode "symbol" :toggle t)
    ("l" hl-line-mode "line" :toggle t)
    ("x" highlight-sexp-mode "sexp" :toggle t)
    ("t" hl-todo-mode "todo" :toggle t))
   "UI"
   (("d" jp-themes-toggle-light-dark "dark theme" :toggle jp-current-theme-dark-p))
   "Coding"
   (("p" smartparens-mode "smartparens" :toggle t)
    ("P" smartparens-strict-mode "smartparens strict" :toggle t)
    ("S" show-smartparens-mode "show smartparens" :toggle t)
    ("f" flycheck-mode "flycheck" :toggle t))
   "Emacs"
   (("D" toggle-debug-on-error "debug on error" :toggle (default-value 'debug-on-error))
    ("X" toggle-debug-on-quit "debug on quit" :toggle (default-value 'debug-on-quit)))))

And when I execute: M-x jp-toggles/body, I find that columns cannot left-justified:

截屏2020-05-01上午1 06 47

Can you help me? How to solve this problem? thank u :)

jerrypnz commented 4 years ago

Looks like you're not using a monospaced font? Try changing your font to one of the programming fonts like Monaco, Fira Code, Consolas etc.

dnxbjyj commented 4 years ago

Looks like you're not using a monospaced font? Try changing your font to one of the programming fonts like Monaco, Fira Code, Consolas etc.

It works when I changed my font to Monaco, thanks a lot :)

spacekitteh commented 4 years ago

Which font should be changed to a monospaced font?

jerrypnz commented 4 years ago

@spacekitteh In my config I set both default and fixed-pitch font to the same

(defvar jp-default-font "Cascadia Code-10")
(set-face-font 'default jp-default-font)
(set-face-font 'fixed-pitch jp-default-font)
spacekitteh commented 4 years ago

Hmm, when I figure out how to do elisp properly, I'll create a face for pretty-hydra to use, unless you want to do it? :P

jerrypnz commented 4 years ago

Do you want the extra faces for further customization or just for fonts? If it's just fonts, it should use your default font unless you want a different font for hydras. I did think about introducing a couple of faces for different elements (title, headers and rows) but I don't really need it personally so haven't done it yet.

spacekitteh commented 4 years ago

Both, actually, now that I think of it. I have a variable-pitched font as my default font; perhaps that is not a good idea in general?