Browse Source

Add text zoom via hydra

main
parent
commit
941399c023
  1. 66
      README.org
  2. 28
      init.el

66
README.org

@ -9,7 +9,7 @@ Immutable GNU Emacs dotfiles, inspired by Doom, built for Liberty.
* Configuration * Configuration
:PROPERTIES: :PROPERTIES:
:header-args: :tangle init.el
:header-args: :tangle init.el :results silent
:END: :END:
Define a function to build literate programming projects. Define a function to build literate programming projects.
@ -149,6 +149,13 @@ https://github.com/noctuid/general.el
:prefix dotfiles/leader-key)) :prefix dotfiles/leader-key))
#+end_src #+end_src
https://github.com/abo-abo/hydra
+ Transient keybindings sharing a common prefix
#+begin_src emacs-lisp
(use-package hydra)
#+end_src
*** Evil *** Evil
After a few hour with =vim= I knew it was game over, I cannot even think of another way I would feel comfortable editing text. Luckily, there exist packages to emulate this within Emacs. After a few hour with =vim= I knew it was game over, I cannot even think of another way I would feel comfortable editing text. Luckily, there exist packages to emulate this within Emacs.
@ -181,6 +188,26 @@ https://github.com/redguardtoo/evil-nerd-commenter
:bind ("M-;" . evilnc-comment-or-uncomment-lines)) :bind ("M-;" . evilnc-comment-or-uncomment-lines))
#+end_src #+end_src
*** Zoom
Increase the font size in buffers with =SPC f=.
+ Increase =j=
+ Decrease =k=
+ Finish =f=
#+begin_src emacs-lisp
(defhydra hydra-text-scale (:timeout 4)
"Scale"
("j" text-scale-increase "Increase")
("k" text-scale-decrease "Decrease")
("f" nil "Finished" :exit t))
#+end_src
#+begin_src emacs-lisp
(dotfiles/leader
"f" '(hydra-text-scale/body :which-key "Font"))
#+end_src
*** Shortcuts *** Shortcuts
Again cherry picked from =Doom=, I want to continue utilizing the muscle memory I have developed from a year of mainlining the framework. Again cherry picked from =Doom=, I want to continue utilizing the muscle memory I have developed from a year of mainlining the framework.
@ -327,6 +354,13 @@ https://github.com/hlissner/emacs-doom-themes
:init (load-theme 'doom-moonlight t)) :init (load-theme 'doom-moonlight t))
#+end_src #+end_src
Load a theme with =SPC t=.
#+begin_src emacs-lisp
(dotfiles/leader
"t" '(load-theme t nil :which-key "Theme"))
#+end_src
https://github.com/seagle0128/doom-modeline https://github.com/seagle0128/doom-modeline
+ Elegant status bar / modeline + Elegant status bar / modeline
@ -384,7 +418,7 @@ https://github.com/integral-dw/org-superstar-mode
* Development * Development
:PROPERTIES: :PROPERTIES:
:header-args: :tangle init.el
:header-args: :tangle init.el :results silent
:END: :END:
An IDE like experience (or better) can be achieved in Emacs using two *Microsoft* open source initiatives. An IDE like experience (or better) can be achieved in Emacs using two *Microsoft* open source initiatives.
@ -396,8 +430,7 @@ https://emacs-lsp.github.io/lsp-mode/
#+begin_src emacs-lisp #+begin_src emacs-lisp
(use-package lsp-mode (use-package lsp-mode
:commands (lsp lsp-deferred)
:hook (lsp-mode . lsp-deferred))
:commands lsp)
#+end_src #+end_src
https://emacs-lsp.github.io/lsp-ui/ https://emacs-lsp.github.io/lsp-ui/
@ -405,7 +438,8 @@ https://emacs-lsp.github.io/lsp-ui/
#+begin_src emacs-lisp #+begin_src emacs-lisp
(use-package lsp-ui (use-package lsp-ui
:hook (lsp-mode . lsp-ui-mode))
:commands lsp-ui-mode
:custom (lsp-ui-doc-position 'bottom))
#+end_src #+end_src
https://emacs-lsp.github.io/dap-mode/ https://emacs-lsp.github.io/dap-mode/
@ -415,6 +449,16 @@ https://emacs-lsp.github.io/dap-mode/
(use-package dap-mode) (use-package dap-mode)
#+end_src #+end_src
Text completion framework via =company= aka *Complete Anything*.
http://company-mode.github.io/
+ Integrate with =lsp-mode=
#+begin_src emacs-lisp
(use-package company-lsp
:commands company-lsp)
#+end_src
** Python ** Python
Full *IDE* experience for Python within Emacs. Full *IDE* experience for Python within Emacs.
@ -428,19 +472,13 @@ pip install --user "python-language-server[all]"
#+end_src #+end_src
https://www.emacswiki.org/emacs/PythonProgrammingInEmacs https://www.emacswiki.org/emacs/PythonProgrammingInEmacs
+ Built in mode
#+begin_src emacs-lisp #+begin_src emacs-lisp
(use-package python-mode (use-package python-mode
:hook (python-mode . lsp-deferred)
:hook (python-mode . lsp)
:config (require 'dap-python) :config (require 'dap-python)
:custom (python-shell-interpreter "python3") ;; Required if "python" is not python 3. :custom (python-shell-interpreter "python3") ;; Required if "python" is not python 3.
(dap-python-executable "python3") ;; Same as above. (dap-python-executable "python3") ;; Same as above.
(dap-python-debugger 'debugpy)) (dap-python-debugger 'debugpy))
#+end_src #+end_src
Use the =pyvenv= package to use the =virtualenv= environment in Emacs. This allows =pyvenv-activate= to cause =lsp-mode= and =dap-mode= to be configured for the virtual environment.
#+begin_src emacs-lisp
(use-package pyvenv
:config (pyvenv-mode 1))
#+end_src

28
init.el

@ -63,6 +63,8 @@
:keymaps 'override :keymaps 'override
:prefix dotfiles/leader-key)) :prefix dotfiles/leader-key))
(use-package hydra)
(use-package evil (use-package evil
:init (setq evil-want-integration t :init (setq evil-want-integration t
evil-want-keybinding nil) evil-want-keybinding nil)
@ -75,6 +77,15 @@
(use-package evil-nerd-commenter (use-package evil-nerd-commenter
:bind ("M-;" . evilnc-comment-or-uncomment-lines)) :bind ("M-;" . evilnc-comment-or-uncomment-lines))
(defhydra hydra-text-scale (:timeout 4)
"Scale"
("j" text-scale-increase "Increase")
("k" text-scale-decrease "Decrease")
("f" nil "Finished" :exit t))
(dotfiles/leader
"f" '(hydra-text-scale/body :which-key "Font"))
(dotfiles/leader (dotfiles/leader
"," '(switch-to-buffer :which-key "Buffer") "," '(switch-to-buffer :which-key "Buffer")
"." '(find-file :which-key "File")) "." '(find-file :which-key "File"))
@ -125,6 +136,9 @@
(use-package doom-themes (use-package doom-themes
:init (load-theme 'doom-moonlight t)) :init (load-theme 'doom-moonlight t))
(dotfiles/leader
"t" '(load-theme t nil :which-key "Theme"))
(use-package doom-modeline (use-package doom-modeline
:init (doom-modeline-mode 1) :init (doom-modeline-mode 1)
:custom ((doom-modeline-height 16))) :custom ((doom-modeline-height 16)))
@ -159,20 +173,20 @@
:hook (org-mode . org-superstar-mode)) :hook (org-mode . org-superstar-mode))
(use-package lsp-mode (use-package lsp-mode
:commands (lsp lsp-deferred)
:hook (lsp-mode . lsp-deferred))
:commands lsp)
(use-package lsp-ui (use-package lsp-ui
:hook (lsp-mode . lsp-ui-mode))
:commands lsp-ui-mode
:custom (lsp-ui-doc-position 'bottom))
(use-package dap-mode) (use-package dap-mode)
(use-package company-lsp
:commands company-lsp)
(use-package python-mode (use-package python-mode
:hook (python-mode . lsp-deferred)
:hook (python-mode . lsp)
:config (require 'dap-python) :config (require 'dap-python)
:custom (python-shell-interpreter "python3") ;; Required if "python" is not python 3. :custom (python-shell-interpreter "python3") ;; Required if "python" is not python 3.
(dap-python-executable "python3") ;; Same as above. (dap-python-executable "python3") ;; Same as above.
(dap-python-debugger 'debugpy)) (dap-python-debugger 'debugpy))
(use-package pyvenv
:config (pyvenv-mode 1))
Loading…
Cancel
Save