Let’s develop squint
a little package for controlling the font
height, so you won’t need to squint your eyes when you are on smaller
screens.
It will look like this:
It will give us the chance to touch on:
consult--read
.We all know how to use git commit --amend
to fix up the very last commit.
How beautiful would it be to have a command like:
git commit --amend=3
to extend this power to fix up the 3rd to last — or any other past — commit?
Enter git fixup.
So you want to code in F# with Emacs?
I can relate, I also love both. Oh dear, if I love them!
So, presto! Let’s make Emacs your next F# IDE!
In our exploration of the ways to navigate back to previous buffer
positions, Registers can be seen as mark ring items with an assigned
name, so that they can be conveniently accessed by that name in an arbitrary order.
But in fact they are much, much more:
Playing Hansel and Gretel is just the excuse to happily slip into
yet another rabbit hole.
Let’s go!
Bookmarks are like Registers, with a few special traits:
Consider them as specialized, super convenient Registers.
A cool trick not everybody knows with Visual Studio and JetBrains’
IDEs is that it is possible to navigate back to previous positions
with Ctrl -
.
A similar trick also works with Bash:
cd -
and with Git:
git checkout -
Neat, right?
Of course, there are way more powerful tools built around this idea
(such as z, autojump and zoxide). And
— did you doubt? — similar powerful features are in Emacs
too. Let’s explore them.
Rings — fixed sized variables acting as circular buffers — are a beautiful idea: one day I will eventually write something about how undoing changes is handled in Emacs with the undo-ring. I find outrageous that other editors have not followed the same idea.
In the previous installment we learnt how to
surround a region with hard-coded <<<
and >>>
. Let’s learn now how
to interactively ask arguments to the user and to go beyond hard-coded
delimiters.
Therefore, just use:
(add-hook '<major-mode>-hook #'<function-you-wish-to-trigger>)
For example, to have line numbers in your Python files, use:
(add-hook 'python-mode-hook #'display-line-numbers-mode)