search

Anzu mode for incremental find-and-replace

Shared on the Emacs Tip & Tricks thread 1. Anzu is great for previewing your query-replace as you go; just remember not to attempt it on HUGE files as the preview (or at least, result counting) gets problematic. Also remember that if you are doing a regexp replace that has side-effects (e.g. incrementing a counter), the preview itself will also do all those side effects before you run the actual replace.

Easy incrementing find and replace in emacs

I start with a list with a bunch of entries like this: newsletter W02 newsletter W02 newsletter W02 newsletter W02 EDIT: New Solutions It turns out that emacs automatically initializes a variable that tracks how many interations your replacement function has made, and in lisp mode you can get to it with \#. This way, the single line necessary to number all my newsletters becomes this: W\(02\) → W\,(format "%02d" (+ 4 \#))) and, of course, you can adjust that 4 to whatever you need it to be for your starting digit.

Firefox: Keyword Shortcuts 2019

For years I’ve had shortcuts in Firefox. In this example, I’ve long been able to type i thing in my URL-bar and it would immediately take me to a google image search for “thing”. In the past this was added by right-clicking “search” on some page and selecting “add a shortcut for this search”. At some point, though, that went away. The functionality is now hidden a little, and you solve it with bookmarks (which I also haven’t used in any form for years).