Skip to content

Instantly share code, notes, and snippets.

@mookid
mookid / gist:ec9e416a020687713915fd5c0c861a77
Last active December 15, 2019 12:11
a basic prompt for cmd
PROMPT=$E[33;1m$P$E[m$E[1m$_$$$S
@mookid
mookid / narrow.el
Last active November 7, 2017 08:35
Noarrowing in other indirect clone buffer
;; Narrow to the current buffer is somethimes weird because you loose
;; the ability to see other parts of the buffer. One way is to first
;; create a clone of the current buffer. However, when this is
;; repeated, clones accumulate.
;; This hack just allows to kill clones when ending the narrowing,
;; allowing transparent workflow without manual buffer bookkeeping.
@mookid
mookid / github.user.js
Last active October 22, 2018 23:15
Tweak github fonts
// ==UserScript==
// @name Github font changer
// @namespace local.greasemonkey.githubfontchanger
// @include https://*github.com/*
// @include http://lists.gnu.org/*
// @version 1
// @grant none
// ==/UserScript==
var fontdef =
@mookid
mookid / untabify.el
Last active March 30, 2017 09:18
Untabify
;; I don't want to introduce tabs in my code; but I don't want to break Makefiles,
;; or to introduce diffs in third party code.
;; Here is my solution:
(defun my-untabify-buffer ()
"Untabify the current buffer, unless `my-untabify-this-buffer' is nil."
(and my-untabify-this-buffer (untabify (point-min) (point-max))))
(define-minor-mode my-untabify-mode
"Untabify buffer on save." nil " untab" nil
@mookid
mookid / repeatable-zap-to-char.el
Last active November 5, 2018 06:45
emacs: repeatable interactive commands
;; I happen to use a lot the command `zap-to-char', which prompts for
;; a character, and deletes from the point to the character,
;; included. However, it is not repetition friendly: when you call the
;; `repeat' command, you are prompted again for the character.
;; So, if you would like to zap to the character # four times, you
;; have to press
;; M-z # M-z # M-z # M-z # ; call repeatedly `zap-to-char'.
;; or