Skip to content

Instantly share code, notes, and snippets.

@imarko
imarko / my-ibuffer-auto.el
Created June 27, 2023 09:59
custom version of ibuffer-auto-hook to use simpler local post-command-hook rather than global
(defun my-ibuffer-auto-update-changed ()
(when (frame-or-buffer-changed-p 'ibuffer-auto-buffers-changed)
(ibuffer-update nil t)))
(defun my-ibuffer-auto-mode ()
(frame-or-buffer-changed-p 'ibuffer-auto-buffers-changed) ; initialize
(add-hook 'post-command-hook 'my-ibuffer-auto-update-changed nil t))
(add-hook 'ibuffer-mode-hook 'my-ibuffer-auto-mode)
@imarko
imarko / mastodon-util.el
Last active December 6, 2022 01:11
some mastodon.el utility functions
(defun my-mastodon-kill-buffers ()
"Kill all mastodon buffers."
(interactive)
(dolist (buffer (buffer-list))
(let ((mode (buffer-local-value 'major-mode buffer)))
(when (string-equal mode "mastodon-mode")
(kill-buffer buffer)))))
(defun my-mastodon-tl-scroll-up ()
"Scroll mastodon timeline up, refreshing if needed."
@imarko
imarko / my-suspend.el
Created December 1, 2022 19:04
Disable C-z suspend in GUI mode but keep it working for tty.
(defun my-suspend ()
(interactive)
(if (controlling-tty-p)
(suspend-emacs)
(suspend-tty)))
(define-derived-mode
pandoc-view-mode
org-mode
"pandoc-view-mode"
"View pandoc converted files in org-mode."
(erase-buffer)
(save-excursion
(call-process "pandoc" nil t nil "-torg" (buffer-file-name)))
(not-modified)
(read-only-mode t)
(define-derived-mode
pandoc-view-mode
org-mode
"pandoc-view-mode"
"View pandoc converted files in org-mode."
(erase-buffer)
(save-excursion
(call-process "pandoc" nil t nil "-torg" (buffer-file-name)))
(not-modified)
(read-only-mode t)
(defun diff-last-two-kills ()
"Put the last two kills to temporary buffers and diff them."
(interactive)
(with-temp-buffer
(let ((old (current-buffer)))
(insert (current-kill 0 t))
(with-temp-buffer
(insert (current-kill 1 t))
(diff old (current-buffer))))))
[Settings]
Grid=1
[Hotkeys]
Sound=Alt+S
PTT=Apostrophe,BackMouseButton
VoiceChatToggleMute=Grave
ChatCancel=Escape,Delete
ChatDefault=Slash,Backspace
MenuGame=Delete,Escape