Skip to content

Instantly share code, notes, and snippets.

View clemera's full-sized avatar

Clemens Radermacher clemera

View GitHub Profile
;;; Keys
(global-set-key (kbd "M-o") 'embark-act)
(define-key minibuffer-local-map (kbd "M-o") 'embark-exit-and-act)
(define-key minibuffer-local-map (kbd "C-M-o") 'embark-act)
;; occur and export are still under developement and in flux!
(define-key minibuffer-local-map (kbd "C-o") 'embark-export)
;; print immediately but only after certain commands
(setq eldoc-idle-delay 0)
(setq eldoc-print-after-edit t)
(add-hook 'eldoc-mode-hook
(defun eldoc--add-commands+ ()
;; remove any preloaded commands
(setq eldoc-message-commands
(make-vector eldoc-message-commands-table-size 0))
(eldoc-add-command 'eldoc-show-help+)))
(let ((single ()))
(mapatoms
(lambda (atom)
(when (and (boundp atom)
(not (keywordp atom))
(not (cdr (split-string (symbol-name atom) "-" t))))
(push atom single))))
(cl-remove-if-not #'special-variable-p single))
@clemera
clemera / peek-xref.el
Created August 18, 2019 16:34
Peek frame with xref
(advice-add 'xref--pop-to-location
:filter-args (lambda (args)
(list (car args) 'frame)))
(setq pop-up-frame-function
(defun peek-frame-pop-up-frame+ ()
(let* ((frame (make-frame `((parent-frame . ,(selected-frame))
(minibuffer . nil)
(name . "*Emacs Peek*")
(width . 80)
@clemera
clemera / mode-line+.el
Last active August 20, 2023 01:26
mode-line+
;;; -*- lexical-binding: t; -*-
;; doom-mode-line > mood-line > mode-line+
;; * Deps
(defvar anzu--state nil)
(defvar multiple-cursors-mode nil)
(declare-function flycheck-count-errors "ext:flycheck" (errors))
(declare-function anzu--update-mode-line "ext:anzu" ())
(declare-function mc/num-cursors "ext:multiple-cursors" ())
@clemera
clemera / emacs_feeds
Created May 12, 2019 10:06
Some Emacs blog feeds
* Blogs
** neeasade
https://notes.neeasade.net/rss.xml
** yiufung
https://yiufung.net/index.xml
** alanthird
https://github.com/alanthird/idiocy.org/commits/master.atom
** codesections
https://www.codesections.com/rss.xml
** xenodium
@clemera
clemera / dgi.el
Created February 9, 2019 13:28
Display git info in dired
;; dired git info
(with-eval-after-load 'dired
(define-key dired-mode-map ")" 'dgi-toggle-git-info))
(defvar dgi-commit-ovs nil)
(defvar dgi-commit-message-format "--pretty=%s (%cr)"
"The placeholders are (git-log PRETTY FORMATS):
· %H: commit hash
@clemera
clemera / my-isearch.el
Last active March 18, 2019 15:30
isearch hacks, objed integration
;;; -*-lexical-binding: t; -*-
(when (fboundp #'global-anzu-mode)
(global-anzu-mode 1))
(setq isearch-allow-scroll t)
(setq isearch-lazy-highlight-initial-delay 0)
(defun flash-mode-line ()
@clemera
clemera / aa.el
Created December 11, 2015 09:50
Small Emacs ASCII animation
;;(require 'drawille)
(load-file "drawille.el")
(defvar aa-pixel 1
"A one in the matrix represents a set pixel")
(defun aa-matrix-set (matrix col row elt)
"Helper to set values in the matrix"
(let ((grid-row (aref matrix row)))
(aset grid-row col elt)))