Compare commits

..

7 Commits

Author SHA1 Message Date
Jeremy Dormitzer
2a6cddabdf Fix Inbox mu4e bookmark so it shows unread/read counter 2021-03-03 09:28:32 -05:00
Jeremy Dormitzer
03d760a16a Move evil-numbers config so it can use :general 2021-03-03 09:28:20 -05:00
Jeremy Dormitzer
c540378cc4 Add binding to refresh Helpful buffers 2021-03-03 09:28:08 -05:00
Jeremy Dormitzer
cf9db5078e Fix run-command-term-minor-mode "g" keybinding 2021-03-03 09:27:54 -05:00
Jeremy Dormitzer
1dcc953d33 Add homebrew.el 2021-03-03 09:27:44 -05:00
Jeremy Dormitzer
32588d9d39 Load custom file last 2021-03-03 09:27:34 -05:00
Jeremy Dormitzer
4ddf25b19c Vterm ediff integration and ability to send ESC sequences 2021-03-03 09:26:58 -05:00
10 changed files with 58 additions and 24 deletions

View File

@ -35,7 +35,20 @@
:defer t :defer t
:straight (:type built-in) :straight (:type built-in)
:config :config
(setq ediff-window-setup-function #'ediff-setup-windows-plain)) (setq ediff-window-setup-function #'ediff-setup-windows-plain)
(evil-collection-ediff-setup)
;; Restore window configuration after an ediff session
(defvar ediff-last-windows nil)
(defun store-pre-ediff-winconfig ()
(setq ediff-last-windows (current-window-configuration)))
(defun restore-pre-ediff-winconfig ()
(set-window-configuration ediff-last-windows))
(add-hook 'ediff-before-setup-hook #'store-pre-ediff-winconfig)
(add-hook 'ediff-quit-hook #'restore-pre-ediff-winconfig))
(use-package replace (use-package replace
:defer t :defer t

View File

@ -96,4 +96,13 @@
(use-package ws-butler (use-package ws-butler
:hook (prog-mode . ws-butler-mode)) :hook (prog-mode . ws-butler-mode))
;; Inc/dec numbers
(use-package evil-numbers
:straight (:host github :repo "juliapath/evil-numbers")
:general
(normal "g+" #'evil-numbers/inc-at-pt)
(normal "g-" #'evil-numbers/dec-at-pt)
(normal "g M-+" #'evil-numbers/inc-at-pt-incremental)
(normal "g M--" #'evil-numbers/dec-at-pt-incremental))
(provide 'init-editing) (provide 'init-editing)

View File

@ -26,8 +26,7 @@
("View in browser" . mu4e-action-view-in-browser)) ("View in browser" . mu4e-action-view-in-browser))
;; Bookmarked searches ;; Bookmarked searches
mu4e-bookmarks '((:name "Inbox" mu4e-bookmarks '((:name "Inbox"
:query (concat "maildir:/jeremy-dormitzer-gmail-com/Inbox" :query "maildir:/jeremy-dormitzer-gmail-com/Inbox OR maildir:/jeremydormitzer-lola-com/Inbox"
" OR maildir:/jeremydormitzer-lola-com/Inbox")
:key ?i) :key ?i)
(:name "Unread messages" (:name "Unread messages"
:query "flag:unread AND NOT flag:trashed" :query "flag:unread AND NOT flag:trashed"

View File

@ -13,12 +13,4 @@
(use-package evil-collection (use-package evil-collection
:after evil) :after evil)
(use-package evil-numbers
:straight (:host github :repo "juliapath/evil-numbers")
:general
(normal "g+" #'evil-numbers/inc-at-pt)
(normal "g-" #'evil-numbers/dec-at-pt)
(normal "g M-+" #'evil-numbers/inc-at-pt-incremental)
(normal "g M--" #'evil-numbers/dec-at-pt-incremental))
(provide 'init-evil) (provide 'init-evil)

View File

@ -12,6 +12,7 @@
([remap describe-function] #'helpful-callable) ([remap describe-function] #'helpful-callable)
([remap describe-variable] #'helpful-variable) ([remap describe-variable] #'helpful-variable)
([remap describe-key] #'helpful-key) ([remap describe-key] #'helpful-key)
(normal helpful-mode-map "TAB" #'forward-button)) (normal helpful-mode-map "TAB" #'forward-button
"gr" #'helpful-update))
(provide 'init-help) (provide 'init-help)

View File

@ -0,0 +1,9 @@
;; -*- lexical-binding: t; -*-
;; An Emacs interface to the Homebrew package manager
(use-package homebrew
:straight (:host github :repo "jdormit/homebrew.el")
:if (executable-find "brew")
:defer t)
(provide 'init-homebrew)

View File

@ -10,9 +10,10 @@
(defvar-local run-command-project-local-commands nil) (defvar-local run-command-project-local-commands nil)
(put 'run-command-project-local-commands 'safe-local-variable (lambda (_) t)) (put 'run-command-project-local-commands 'safe-local-variable (lambda (_) t))
:config :config
(general-def run-command-term-minor-mode-map [remap recompile] #'run-command-term-recompile) (general-def run-command-term-minor-mode-map
[remap recompile] #'run-command-term-recompile
"g" nil)
(general-def 'normal run-command-term-minor-mode-map "gr" #'run-command-term-recompile) (general-def 'normal run-command-term-minor-mode-map "gr" #'run-command-term-recompile)
(general-def 'insert run-command-term-minor-mode-map "g" #'self-insert-command)
(defun run-command-recipe-terraform () (defun run-command-recipe-terraform ()
(when (directory-files default-directory (when (directory-files default-directory

View File

@ -8,13 +8,14 @@
(call-interactively #'vterm))) (call-interactively #'vterm)))
:config :config
(evil-collection-vterm-setup) (evil-collection-vterm-setup)
(general-def 'insert vterm-mode-map "C-<escape>" #'vterm-send-escape)
;; Add a hook when vterm changes the directory ;; Add a hook when vterm changes the directory
(defvar vterm-directory-change-hook nil (defvar vterm-directory-change-hook nil
"Hooks to be run after vterm changes the directory") "Hooks to be run after vterm changes the directory")
(defun vterm--set-directory (path) (defun vterm--set-directory (path)
"Set `default-directory' to PATH." "Set `default-directory' to PATH."
(let ((dir (vterm--get-directory path))) (let ((dir (vterm--get-directory path)))
(when dir (when (and dir (eq major-mode 'vterm-mode))
(setq default-directory dir) (setq default-directory dir)
(run-hooks 'vterm-directory-change-hook)))) (run-hooks 'vterm-directory-change-hook))))
(add-hook 'vterm-mode-hook #'hack-dir-local-variables-non-file-buffer) (add-hook 'vterm-mode-hook #'hack-dir-local-variables-non-file-buffer)
@ -23,6 +24,11 @@
(leader-map "v" #'project-vterm) (leader-map "v" #'project-vterm)
:custom :custom
(vterm-environment '("TYPEWRITTEN_CURSOR=terminal")) (vterm-environment '("TYPEWRITTEN_CURSOR=terminal"))
(vterm-ignore-blink-cursor t)) (vterm-ignore-blink-cursor t)
(vterm-eval-cmds '(("find-file" find-file)
("message" message)
("vterm-clear-scrollback" vterm-clear-scrollback)
("man" man)
("ediff" ediff))))
(provide 'init-vterm) (provide 'init-vterm)

View File

@ -49,8 +49,6 @@
;; Don't use this file as the custom-file ;; Don't use this file as the custom-file
(setq custom-file (expand-file-name "custom.el" user-emacs-directory)) (setq custom-file (expand-file-name "custom.el" user-emacs-directory))
(when (file-exists-p custom-file)
(load custom-file 'noerror 'nomessage))
;; Load config modules ;; Load config modules
(add-to-list 'load-path (expand-file-name "config" user-emacs-directory)) (add-to-list 'load-path (expand-file-name "config" user-emacs-directory))
@ -90,3 +88,7 @@
(require 'init-email) (require 'init-email)
(require 'init-kubernetes) (require 'init-kubernetes)
(require 'init-epub) (require 'init-epub)
(require 'init-homebrew)
(when (file-exists-p custom-file)
(load custom-file 'noerror 'nomessage))

View File

@ -122,12 +122,6 @@ function vterm_printf(){
fi fi
} }
# Completely clear the buffer. With this, everything that is not on screen
# is erased.
if [[ "$INSIDE_EMACS" = 'vterm' ]]; then
alias clear='vterm_printf "51;Evterm-clear-scrollback";tput clear'
fi
# With vterm_cmd you can execute Emacs commands directly from the shell. # With vterm_cmd you can execute Emacs commands directly from the shell.
# For example, vterm_cmd message "HI" will print "HI". # For example, vterm_cmd message "HI" will print "HI".
# To enable new commands, you have to customize Emacs's variable # To enable new commands, you have to customize Emacs's variable
@ -142,6 +136,14 @@ vterm_cmd() {
vterm_printf "51;E$vterm_elisp" vterm_printf "51;E$vterm_elisp"
} }
if [[ "$INSIDE_EMACS" = 'vterm' ]]; then
# Completely clear the buffer. With this, everything that is not on screen
# is erased.
alias clear='vterm_printf "51;Evterm-clear-scrollback";tput clear'
alias man='vterm_cmd man'
alias ediff='vterm_cmd ediff'
fi
# This is to change the title of the buffer based on information provided by the # This is to change the title of the buffer based on information provided by the
# shell. See, http://tldp.org/HOWTO/Xterm-Title-4.html, for the meaning of the # shell. See, http://tldp.org/HOWTO/Xterm-Title-4.html, for the meaning of the
# various symbols. # various symbols.