Starting my dev journal, installing PHP8 and using vim in Obsidian

September 09, 2024

Starting journal.teisenhower.dev

The concept

I'm back to wanting to put out content again (shocker). However, this time I am taking a different approach. I really enjoy this concept of keeping a "Dev Journal" and it's something I've tinkered with in the past with mild success. The idea is these less formal journal entries will be a place where I can still write dev content to share what I am learning, tips and tricks, act as a historical learning resource for me to refer back to, etc. without the extra pressure of feeling this need to have a perfectly orchestrated well thought out blog post with screenshots and code snippets to share with the world. This feels like a much lighter and honestly a more personal alternative vs always trying to put out your standard blog posts.

Implementing

Initially I wanted these entries to live in the same repo with my main blog site so they could use the same resources and styling as my main blog but it sounds like that may not be the best solution since I want to have this at the journal subdomain. Instead, it should be treated as an entirely different project. I think moving forward I am ok with this. It gives me the opportunity to build something from scratch, which is always fun, and it allows allows me to explore using a new service like Netlify to host this part of my site vs AWS Amplify where my main site lives.

Setting local environment to PHP 8.0

I found myself needing to set my environment to an older version of PHP, 8.0, in order to debug one of our projects. But whenever I would try to use php 8 with the typical brew link command, I would get some version of the following error.

dyld: Library not loaded: /usr/local/opt/icu4c/lib/libicui18n.60.dylib

The actual file name could be different but the same issue where some icu4c library could not be loaded would always be the error

I attempted to reinstall php 8 hoping that would resolve my issue but that was unsuccessful and I was presented with this error.

[email protected] has been disabled because it is a versioned formula!

After some quick looking around the reason for this error was pretty clear and made total sense. This error occurs because php8.0 is no longer a supported version and Homebrew has disabled it because of this.

Here is how I was able to actually install php8 and no longer get the library not loaded error

  1. brew tap shivammathur/php
  2. brew install shivammathur/php/[email protected]

Adding vim support to Obsidian

I enjoy using vim wherever possible. I will admit however that I do not use vim to its full potential, not even close. I am just scratching the surface of what it can do. But I find that even with this limited use, my work is much faster and efficient.

One of the custom settings I like to add to my vim setup is double tapping j in place of hitting esc to go back to Normal Mode from Insert Mode. Another tool I have been thoroughly enjoying is Obsidian for writing my markdown files. It's an awesome lightweight tool for easily writing markdown. It's what I used to construct these journal entries vs editing them in VSCode or PHPStorm which feels like overkill.

Obsidian does have have vim support which is great, but in order to have my custom jj key mapping, it requires some additional setup. Here are the steps to do that.

  1. I needed to install a community plugin called, Vimrc Support
  2. Once installed I needed to add a .obsidian.vimrc file to my vault directory
  3. Add my vim customizations to this file
  4. Point the Vimrc Support plugin to this new file
  5. Restart Obsidian

Here is what needs to be added to that .obsidian.vimrc file to add the jj keybinding

imap jj <Esc>

© 2024 Terrence Eisenhower. All rights reserved.