Emacs consult-buffer filenames #
When working on my web projects I often have same the same filename in different folders, such as projectname/index.html
and anotherproject/index.html
.
When opening files in Emacs, I might have to open index.html if I'm already in projectname/
or type ../anotherproject/index.html to open from another folder. I switch folders enough that I wanted to have a more consistent way to open things. I now use a global find-file that lets me match on the complete pathname. I can open projectname/index from anywhere, without having to type something different based on which folder I'm in.
When switching buffers, either with the built-in function or with consult-buffer
from consult.el, I can type index.html if I only have one index.html file open. If I have more than one open, Emacs will rename them index.html<projectname>
, index.html<anotherproject>
, etc., and then I would type index projectname. But if I have only one open, then typing index projectname will fail. I wanted to make it more consistent so that I could always type index projectname whether there's only one index.html buffer open or multiple. I implemented this by putting the full filename instead of the buffer name into consult's buffer list:
Labels: emacs
Observational studies #
People who wear red shirts on the original Star Trek have a high mortality rate.
- can we conclude that red shirts caused the high mortality rate?
- can we solve the problem by having them yellow shirts instead?
Labels: health