From cf0e79d1e94202f76a1e7eb46765acf400fb67eb Mon Sep 17 00:00:00 2001 From: Josiah Ledbetter Date: Wed, 22 Mar 2023 09:44:32 -0500 Subject: [PATCH 1/3] Misc updates. --- .config/hammerspoon/init.lua | 2 +- .emacs.d/init.el | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.config/hammerspoon/init.lua b/.config/hammerspoon/init.lua index 8ccfe41..4ff68fe 100644 --- a/.config/hammerspoon/init.lua +++ b/.config/hammerspoon/init.lua @@ -82,7 +82,7 @@ end) -- stolen from @mrled appCuts = { - c = 'Microsoft Edge', + c = 'Brave Browser', e = 'Emacs', d = 'Dash', f = 'Firefox', diff --git a/.emacs.d/init.el b/.emacs.d/init.el index 7efee56..dbc4821 100644 --- a/.emacs.d/init.el +++ b/.emacs.d/init.el @@ -36,3 +36,4 @@ (when (eq system-type 'gnu/linux) (keychain-refresh-environment) ) +(put 'upcase-region 'disabled nil) From 87b129511cc1f9a007f201ba61863aaed1116460 Mon Sep 17 00:00:00 2001 From: Josiah Ledbetter Date: Wed, 22 Mar 2023 09:44:59 -0500 Subject: [PATCH 2/3] Add black, isort to python setup. For now I still have to manually run the formatter, but eventually I will figure out a better way to do that on save. There's at least vague support for on save hook, but it doesn't seem to handle the way I'd expect or want. --- .emacs.d/jlj-python.el | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/.emacs.d/jlj-python.el b/.emacs.d/jlj-python.el index 24126ed..77db685 100644 --- a/.emacs.d/jlj-python.el +++ b/.emacs.d/jlj-python.el @@ -21,6 +21,16 @@ (use-package flycheck :ensure t) +(use-package python-black + :demand t + :after python + :hook (python-mode . python-black-on-save-mode-enable-dwim)) + +(use-package py-isort + :ensure t + :after python + ) + ; helps with LSP, generally. (yas-global-mode 1) @@ -31,7 +41,13 @@ (setq company-idle-delay 0) (setq company-minimum-prefix-length 1)) -(use-package project :ensure t) +;; this is hardcoded like this to force a load of the CORRECT project.el function. +;; reference this url: https://github.com/joaotavora/eglot/issues/549 + +(load-file "~/.emacs.d/elpa/project-0.8.1/project.el") + +(use-package project + :ensure t) (use-package eglot :ensure t @@ -47,4 +63,15 @@ (venv-initialize-eshell) ;; if you want eshell support (setq venv-location "~/.local/share/virtualenvs/")) +(defun jlj/python_format () + "Format python buffer with isort and black." + (interactive) + (py-isort-buffer) + (python-black-buffer) + (save-buffer)) + +(add-hook 'python-mode-hook + (lambda () (local-set-key (kbd "C-c r") 'jlj/python_format))) + ;;; jlj-python.el ends here + From 140e21dd566c86910d418804868ae1b79bd1bdda Mon Sep 17 00:00:00 2001 From: Josiah Ledbetter Date: Thu, 20 Jul 2023 11:53:43 -0500 Subject: [PATCH 3/3] Add vs:code shortcut. --- .config/hammerspoon/init.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.config/hammerspoon/init.lua b/.config/hammerspoon/init.lua index 4ff68fe..614c0ae 100644 --- a/.config/hammerspoon/init.lua +++ b/.config/hammerspoon/init.lua @@ -92,7 +92,8 @@ appCuts = { o = 'Calendar.app', p = 'Bitwarden', t = 'iTerm.app', - z = 'Zoom.us' + z = 'Zoom.us', + v = 'Visual Studio Code' } modalHotKey = dofile(os.getenv("HOME") .. "/.config/hammerspoon/modalHotKey.lua")