Browse Source

Cleanup bindings and nameing conventions

main
parent
commit
6861775b59
  1. 75
      README.org
  2. 56
      init.el

75
README.org

@ -486,11 +486,9 @@ 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 #+begin_src emacs-lisp
(dotfiles/leader (dotfiles/leader
"t" '(load-theme t nil :which-key "Theme"))
"t" '(load-theme t nil :which-key "Themes"))
#+end_src #+end_src
https://github.com/seagle0128/doom-modeline https://github.com/seagle0128/doom-modeline
@ -509,10 +507,17 @@ https://github.com/seagle0128/doom-modeline
I use Emacs as a Desktop Environment with the [[https://github.com/ch11ng/exwm][exwm]] package. It allows Emacs to function as a complete tiling window manager for =X11=. I use Emacs as a Desktop Environment with the [[https://github.com/ch11ng/exwm][exwm]] package. It allows Emacs to function as a complete tiling window manager for =X11=.
#+begin_src emacs-lisp
(defun dotfiles/run (command)
"Run an external process."
(interactive (list (read-shell-command "λ ")))
(start-process-shell-command command nil command))
#+end_src
Some methods must be called and applied to the current call process in order to function correctly with Emacs hooks. Some methods must be called and applied to the current call process in order to function correctly with Emacs hooks.
#+begin_src emacs-lisp #+begin_src emacs-lisp
(defun dotfiles/run (command)
(defun dotfiles/run-in-background (command)
(let ((command-parts (split-string command "[ ]+"))) (let ((command-parts (split-string command "[ ]+")))
(apply #'call-process `(,(car command-parts) nil 0 nil ,@(cdr command-parts))))) (apply #'call-process `(,(car command-parts) nil 0 nil ,@(cdr command-parts)))))
#+end_src #+end_src
@ -520,11 +525,16 @@ Some methods must be called and applied to the current call process in order to
Setting the wallpaper is one example; this must occur every time the screen change hook is called. Setting the wallpaper is one example; this must occur every time the screen change hook is called.
#+begin_src emacs-lisp #+begin_src emacs-lisp
(defun dotfiles/set-wallpaper (path)
(interactive)
(when (file-exists-p path)
(let ((command (concat "feh --bg-scale " path)))
(start-process-shell-command "feh" nil command))))
;; (defun dotfiles/set-wallpaper (path)
;; (interactive)
;; (when (file-exists-p path)
;; (let ((command (concat "feh --bg-scale " path)))
;; (start-process-shell-command "feh" nil command))))
#+end_src
#+begin_src emacs-lisp
(dotfiles/leader
"r" '(dotfiles/run :which-key "Run"))
#+end_src #+end_src
When the window manager first launches the ~init-hook~ will be called, this allows us to define some custom logic when it's initialized. When the window manager first launches the ~init-hook~ will be called, this allows us to define some custom logic when it's initialized.
@ -546,9 +556,8 @@ Using =autorandr= with pre configured profiles, switching screens (AKA hot plugg
#+begin_src emacs-lisp #+begin_src emacs-lisp
(defun dotfiles/update-display () (defun dotfiles/update-display ()
(dotfiles/run "autorandr --change --force")
;; (dotfiles/set-wallpaper "TODO")
)
(dotfiles/run-in-background "autorandr --change --force"))
;; (dotfiles/set-wallpaper "TODO"))
#+end_src #+end_src
Finally we configure the window manager. Finally we configure the window manager.
@ -581,9 +590,7 @@ Connect our custom hooks and configure the input keys, a custom layer for defini
?\C-\ ) ?\C-\ )
exwm-input-global-keys exwm-input-global-keys
`(([?\s-r] . exwm-reset) `(([?\s-r] . exwm-reset)
([?\s-&] . (lambda (command)
(interactive (list (read-shell-command "λ ")))
(start-process-shell-command command nil command)))
([?\s-&] . dotfiles/run)
,@(mapcar (lambda (i) ,@(mapcar (lambda (i)
`(,(kbd (format "s-%d" i)) . `(,(kbd (format "s-%d" i)) .
(lambda () (lambda ()
@ -593,8 +600,6 @@ Connect our custom hooks and configure the input keys, a custom layer for defini
(exwm-enable)) (exwm-enable))
#+end_src #+end_src
**
* Writing * Writing
:PROPERTIES: :PROPERTIES:
:header-args: :tangle ~/.local/source/dotfiles/init.el :results silent :header-args: :tangle ~/.local/source/dotfiles/init.el :results silent
@ -612,11 +617,12 @@ I am using [[https://orgmode.org][Org-mode]] extensively for writing projects fo
** Mail ** Mail
#+begin_src emacs-lisp #+begin_src emacs-lisp
(add-to-list 'load-path "/usr/share/emacs/site-lisp/mu4e")
;; (add-to-list 'load-path "/usr/share/emacs/site-lisp/mu4e")
#+end_src #+end_src
#+begin_src emacs-lisp #+begin_src emacs-lisp
(use-package mu4e (use-package mu4e
:load-path "/usr/share/emacs/site-lisp/mu4e"
:config :config
(setq mu4e-change-filenames-when-moving t (setq mu4e-change-filenames-when-moving t
mu4e-update-interval (* 5 60) ;; Every 5 minutes. mu4e-update-interval (* 5 60) ;; Every 5 minutes.
@ -676,7 +682,7 @@ I am using [[https://orgmode.org][Org-mode]] extensively for writing projects fo
:hook (org-roam-mode . org-roam-server-mode)) :hook (org-roam-mode . org-roam-server-mode))
#+end_src #+end_src
Configure keybindings behind =SPC r=.
Configure keybindings behind =SPC b=.
+ Find with =f= + Find with =f=
+ Buffer with =b= + Buffer with =b=
+ Capture with =c= + Capture with =c=
@ -684,15 +690,15 @@ Configure keybindings behind =SPC r=.
#+begin_src emacs-lisp #+begin_src emacs-lisp
(dotfiles/leader (dotfiles/leader
"r" '(:ignore t :which-key "Roam")
"rf" '(org-roam-find-file :which-key "Find")
"rb" '(org-roam-buffer-toggle-display :which-key "Buffer")
"rc" '(org-roam-capture :which-key "Capture")
"rd" '(:ignore t :which-key "Dailies")
"rdd" '(org-roam-dailies-find-date :which-key "Date")
"rdt" '(org-roam-dailies-find-today :which-key "Today")
"rdm" '(org-roam-dailies-find-tomorrow :which-key "Tomorrow")
"rdy" '(org-roam-dailies-find-yesterday :which-key "Yesterday"))
"b" '(:ignore t :which-key "Roam")
"bf" '(org-roam-find-file :which-key "Find")
"bb" '(org-roam-buffer-toggle-display :which-key "Buffer")
"bc" '(org-roam-capture :which-key "Capture")
"bd" '(:ignore t :which-key "Dailies")
"bdd" '(org-roam-dailies-find-date :which-key "Date")
"bdt" '(org-roam-dailies-find-today :which-key "Today")
"bdm" '(org-roam-dailies-find-tomorrow :which-key "Tomorrow")
"bdy" '(org-roam-dailies-find-yesterday :which-key "Yesterday"))
#+end_src #+end_src
Configure the default capture template for new topics. Configure the default capture template for new topics.
@ -917,6 +923,19 @@ Pass makes managing passwords extremely easy, encrypring them in a file structur
:custom (password-store-dir "~/.local/source/passwords")) :custom (password-store-dir "~/.local/source/passwords"))
#+end_src #+end_src
Configure keybindings behind =SPC p=.
+ Copy with =p=
+ Rename with =r=
+ Generate with =g=
#+begin_src emacs-lisp
(dotfiles/leader
"p" '(:ignore t :which-key "Passwords")
"pp" '(password-store-copy :which-key "Copy")
"pr" '(password-store-rename :which-key "Rename")
"pg" '(password-store-generate :which-key "Generate"))
#+end_src
** Debugging ** Debugging
Handled through the [[https://microsoft.github.io/debug-adapter-protocol/][Debug Adapter Protocol]], an open source initiative from *Microsoft* for the *VSCode* editor. Handled through the [[https://microsoft.github.io/debug-adapter-protocol/][Debug Adapter Protocol]], an open source initiative from *Microsoft* for the *VSCode* editor.

56
init.el

@ -190,21 +190,29 @@
:init (load-theme 'doom-moonlight t)) :init (load-theme 'doom-moonlight t))
(dotfiles/leader (dotfiles/leader
"t" '(load-theme t nil :which-key "Theme"))
"t" '(load-theme t nil :which-key "Themes"))
(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)))
(defun dotfiles/run (command) (defun dotfiles/run (command)
"Run an external process."
(interactive (list (read-shell-command "λ ")))
(start-process-shell-command command nil command))
(defun dotfiles/run-in-background (command)
(let ((command-parts (split-string command "[ ]+"))) (let ((command-parts (split-string command "[ ]+")))
(apply #'call-process `(,(car command-parts) nil 0 nil ,@(cdr command-parts))))) (apply #'call-process `(,(car command-parts) nil 0 nil ,@(cdr command-parts)))))
(defun dotfiles/set-wallpaper (path)
(interactive)
(when (file-exists-p path)
(let ((command (concat "feh --bg-scale " path)))
(start-process-shell-command "feh" nil command))))
;; (defun dotfiles/set-wallpaper (path)
;; (interactive)
;; (when (file-exists-p path)
;; (let ((command (concat "feh --bg-scale " path)))
;; (start-process-shell-command "feh" nil command))))
(dotfiles/leader
"r" '(dotfiles/run :which-key "Run"))
(defun dotfiles/init-hook () (defun dotfiles/init-hook ()
(exwm-workspace-switch-create 1) (exwm-workspace-switch-create 1)
@ -213,9 +221,8 @@
(display-time-mode 1)) (display-time-mode 1))
(defun dotfiles/update-display () (defun dotfiles/update-display ()
(dotfiles/run "autorandr --change --force")
;; (dotfiles/set-wallpaper "TODO")
)
(dotfiles/run-in-background "autorandr --change --force"))
;; (dotfiles/set-wallpaper "TODO"))
(use-package exwm (use-package exwm
:config :config
@ -230,9 +237,7 @@
?\C-\ ) ?\C-\ )
exwm-input-global-keys exwm-input-global-keys
`(([?\s-r] . exwm-reset) `(([?\s-r] . exwm-reset)
([?\s-&] . (lambda (command)
(interactive (list (read-shell-command "λ ")))
(start-process-shell-command command nil command)))
([?\s-&] . dotfiles/run)
,@(mapcar (lambda (i) ,@(mapcar (lambda (i)
`(,(kbd (format "s-%d" i)) . `(,(kbd (format "s-%d" i)) .
(lambda () (lambda ()
@ -244,9 +249,10 @@
(use-package org-superstar (use-package org-superstar
:hook (org-mode . org-superstar-mode)) :hook (org-mode . org-superstar-mode))
(add-to-list 'load-path "/usr/share/emacs/site-lisp/mu4e")
;; (add-to-list 'load-path "/usr/share/emacs/site-lisp/mu4e")
(use-package mu4e (use-package mu4e
:load-path "/usr/share/emacs/site-lisp/mu4e"
:config :config
(setq mu4e-change-filenames-when-moving t (setq mu4e-change-filenames-when-moving t
mu4e-update-interval (* 5 60) ;; Every 5 minutes. mu4e-update-interval (* 5 60) ;; Every 5 minutes.
@ -294,15 +300,15 @@
:hook (org-roam-mode . org-roam-server-mode)) :hook (org-roam-mode . org-roam-server-mode))
(dotfiles/leader (dotfiles/leader
"r" '(:ignore t :which-key "Roam")
"rf" '(org-roam-find-file :which-key "Find")
"rb" '(org-roam-buffer-toggle-display :which-key "Buffer")
"rc" '(org-roam-capture :which-key "Capture")
"rd" '(:ignore t :which-key "Dailies")
"rdd" '(org-roam-dailies-find-date :which-key "Date")
"rdt" '(org-roam-dailies-find-today :which-key "Today")
"rdm" '(org-roam-dailies-find-tomorrow :which-key "Tomorrow")
"rdy" '(org-roam-dailies-find-yesterday :which-key "Yesterday"))
"b" '(:ignore t :which-key "Roam")
"bf" '(org-roam-find-file :which-key "Find")
"bb" '(org-roam-buffer-toggle-display :which-key "Buffer")
"bc" '(org-roam-capture :which-key "Capture")
"bd" '(:ignore t :which-key "Dailies")
"bdd" '(org-roam-dailies-find-date :which-key "Date")
"bdt" '(org-roam-dailies-find-today :which-key "Today")
"bdm" '(org-roam-dailies-find-tomorrow :which-key "Tomorrow")
"bdy" '(org-roam-dailies-find-yesterday :which-key "Yesterday"))
(setq org-roam-capture-templates (setq org-roam-capture-templates
'(("d" "Default" plain (function org-roam-capture--get-point) '(("d" "Default" plain (function org-roam-capture--get-point)
@ -422,6 +428,12 @@
(use-package password-store (use-package password-store
:custom (password-store-dir "~/.local/source/passwords")) :custom (password-store-dir "~/.local/source/passwords"))
(dotfiles/leader
"p" '(:ignore t :which-key "Passwords")
"pp" '(password-store-copy :which-key "Copy")
"pr" '(password-store-rename :which-key "Rename")
"pg" '(password-store-generate :which-key "Generate"))
(use-package dap-mode) (use-package dap-mode)
(use-package company) (use-package company)

Loading…
Cancel
Save