Emacs D2 Mode

It was only a matter of time before there was Emacs mode for D2 😆 and here it is. I’m yet to try it though.

Using VSCode

I installed and used VSCode on office provided MBP yesterday. It is not like I have not used it in past. I tried vscode-vim plugin for modal editing. It allows you to embed neovim in VSCode (So all the configuration of neovim is available here.) But on my old machine, it was slow. (I also tried VSCodium, thinking it might be faster. It wasn’t) I used it exclusively for Dendron (my PKM) cause it is mainly VSCode plugin (While it has command line tools, the main strength is as VScode plugin)

Continue Reading »

Emacs Mode in Shell

I have been using Emacs for several years now. But I switched to (and stayed with) Emacs only because of evil mode. I had been vi user for decades before that. Even today, I use (Neo)vi(m) occasionally. Right now, I’m writing this in Helix editor, which is lot closer to modal editing of vi, than of Emacs. So there. I am aware that various shell support vi mode, but the default is Emacs.

Continue Reading »

D2 Layouts

D2 allows me to generate diagrams from the same source file using different layouts It comes with two built-in layout engines : Dagre is the default : Other one is ELK This needs to be specified explicitly as : D2_LAYOUT=elk d2 in.d2 out.svg and here is the output

D2 : A modern diagram scripting language

I came across D2 on Mastodon I think. (Like most things. But I can’t find the original toot 🤷‍♂) I used mermaid.js earlier. In fact, I also added mermaid support for this theme. Benefit of Mermaid is that since it is generated by mermaid.js, I don’t need to save and include the image in my blog (and worry about mismatched filename and/or path, resulting into broken image.) On the other hand, not many hugo themes support mermaid, but link to an image is supported by hugo and every other SSG.

Continue Reading »

Insert timestamp anywhere using Espanso

I wrote about Espanso long time ago. I have been using Espanso since then. Recently, I had a need to add timestamp in a note. Espanso already comes with a trigger to insert date via :date. As the name suggest, it just inserts the date. So I added the following to the match/base.yml file. - trigger: ":timestamp" replace: "{{timestamp}}" vars: - name: timestamp type: date params: format: "%b %d, %Y %I:%M%p" As might be obvious, now I get timestamp just by typing :timestamp anywhere.

Continue Reading »

→ Stashpad

I came across stashpad during this Stackoverflow podcast.

What caught my attention was when Cara mentioned

Everyone has untitled.txt open that they use every day

That is me!! 😆

It is really easy. Cmd + N to create a new empty file, and start typing. I use BBEdit for this. I’ve seen my colleagues use Sublime text I have also used Sublime text for exactly that and only that purpose for a long time, since it saves these unnamed files across reboots/application restarts. One less headache. I don’t have to think of what to name the file, where to save it, format (this is easy, I’ll just save it as .txt or .md)

Later I came across BBEdit, which does exactly same, so I switched. My workflow did not change.

Stashpad promises to make the same workflow better.

I have just installed it, and haven’t used it yet.


Ironically, I started typing my thoughts about Stashpad as a Stashpad note, with intention that I’ll copy this into a blog post “later”. But decided that why not directly write it as a blog ? 😆

Emacs: How to exclude files when searching in a project

I use SPC / a lot to find stuff inside a project. Since starting on Ruby project, a lot of my search results, specifically the first ones are inside the spec file (which is test case in Ruby) I may want those instances as well, but more often than not, I prefer the search results in the source code before test cases. The project is huge, and I have to scroll a lot before I see non-spec code, which becomes tiresome.

Continue Reading »

Helix Open File on Side

When I am working on a project, it is highly likely that I would open other files from that project. In order to do that, in Helix I would do SPC F. This opens up file picker for that workspace. I can then either navigate using arrow keys, or most likely start typing the name of the file and the file will be highlighted. As a side benefit, the file is shown on the right pane as a preview.

Continue Reading »

Vim Keybindings for Helix

Helix is a great editor. I’m trying it more and more these days (Like this post is edited in helix) While shift from action->object to object->action in itself is big change (muscle memory), there are indeed other differences as well. Luckily, it is easy to add keybindings to helix. Turns out someone took this too far, and created a lot of keybindings to make helix more like Vim Refer to this for the entire config.

Continue Reading »