This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; this should better be handled via (advice-add) | |
(defun avy-handler-default (char) | |
"The default handler for a bad CHAR." | |
(let (dispatch) | |
(cond ((setq dispatch (assoc char avy-dispatch-alist)) | |
(unless (eq avy-style 'words) | |
(setq avy-action (cdr dispatch))) | |
(throw 'done 'restart)) | |
((memq char avy-escape-chars) | |
(setq avy-cancelled-via-escape t) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(use-package org-superstar | |
:custom | |
(org-superstar-remove-leading-stars t) | |
(org-superstar-headline-bullets-list '("◉" "○" "●" "○" "●" "○" "●")) | |
:config | |
(add-hook 'org-mode-hook | |
(lambda () | |
(org-superstar-mode 1)))) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defun is-in-web-modes () | |
(or (string= major-mode "web-mode") | |
(string= major-mode "sgml-mode") | |
(string= major-mode "mhtml-mode") | |
(string= major-mode "css-mode"))) | |
(defun emmet-enter-insert-mode (arg) | |
(interactive "P") | |
(xah-fly-insert-mode-activate)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defun get-symbol-for-buffer-file () | |
(intern (concat "jump-list-" (buffer-file-name)))) | |
;; (message "%s" (intern "abcd")) | |
;; (message "%s" (boundp (intern "tab-width"))) | |
(set (get-symbol-for-buffer-file) 369) | |
(message "%s" (symbol-value (get-symbol-for-buffer-file))) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; to never dim the which-key frame and the deadgrep window | |
(defun mpn-never-dim-hidden (buf) | |
(or (string-match-p (regexp-quote "*deadgrep ") (buffer-name buf)) | |
(eq ?\s (aref (buffer-name buf) 0))) | |
(add-hook 'auto-dim-other-buffers-never-dim-buffer-functions #'mpn-never-dim-hidden) | |
(add-hook 'after-init-hook (lambda () | |
(when (fboundp 'auto-dim-other-buffers-mode) | |
(auto-dim-other-buffers-mode t)))) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defun setup-lispy () | |
(add-hook 'emacs-lisp-mode-hook (lambda () (lispy-mode 1))) | |
(add-hook 'scheme-mode-hook (lambda () (lispy-mode 1))) | |
;; apparently setting tuhdo-special key-theme does not work | |
(eval-after-load "lispy" | |
`(progn | |
;; h is already mapped correctly to lispy-left | |
;; overwrites lispy-clone, was k |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- using real hyper with shift breaks some hotkeys for whatever reason | |
hyper = {"cmd", "alt", "ctrl"} | |
-- workaround from https://github.com/Hammerspoon/hammerspoon/issues/2099#issuecomment-490503167 | |
function execAppleScript(scpt) | |
local scpt = 'run script ((POSIX file "' .. scpt .. '") as alias)' | |
hs.osascript.applescript(scpt) | |
end | |
hs.hotkey.bind(hyper, "n", function() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- using real hyper with shift breaks some hotkeys for whatever reason | |
hyper = {"cmd", "alt", "ctrl"} | |
-- Take a screenshot of the current window | |
hs.hotkey.bind(hyper, "d", function() | |
file_name = "screenshot-" .. os.time() .. ".png" | |
hs.window.focusedWindow():snapshot():saveToFile(os.getenv("HOME") .. "/Desktop/" .. file_name) | |
title = hs.window.focusedWindow():title() | |
hs.alert.show(title .. "\n\n Saved screenshot as " .. file_name) | |
hs.execute('open ~/Desktop/') |