Introducing Dirt - Keep your git repositories clean

Dirt is a lightweight command-line tool built in Go that helps developers maintain clean Git repositories across their workspaces. It scans specified directories (and subdirectories up to 2 levels deep) for Git repos, checking each for uncommitted changes or unpushed commits.

Check out the project source code on Github

The Problem It Solves

In large codebases or multi-project setups, it’s easy to forget about local changes or commits that haven’t been pushed. Dirt automates the discovery of “dirty” repositories, saving time and preventing lost work or merge conflicts.

[Read more]

Building a JSX Transpiler with Vite

Vite Setup

Bootstrap a new vite project using vanilla template.

npm create vite@latest jsx-renderer-vite -- --template vanilla

Enter the project and install the dependencies

cd jsx-renderer-vite && npm install

Then, adjust the project files so that the final structure is like this

.
├── src/
│   └── main.jsx
├── .gitignore
├── index.html
├── package-lock.json
├── package.json
└── vite.config.js

The following files are important for this setup process

// vite.config.js

import * as v from "vite";

export default v.defineConfig({
    esbuild: {
        // use h as the JSX Factory function instead of React.createElement
        jsxFactory: "h",
        // use Fragment for JSX fragments (<>)
        jsxFragment: "Fragment",
    },
});
// package.json

{
  "name": "jsx-renderer-vite",
  "private": true,
  "version": "0.0.0",
  "type": "module",
  "scripts": {
    "dev": "vite",
    "build": "vite build",
    "preview": "vite preview"
  },
  "devDependencies": {
    "vite": "^7.1.7"
  }
}
<!-- index.html -->

<!doctype html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>jsx-renderer-vite</title>
  </head>
  <body>
    <div id="app"></div>
    <!-- change the value of "src" here to main.jsx -->
    <script type="module" src="src/main.jsx"></script>
  </body>
</html>

Creating the h Function

Now let’s implement the h() function that esbuild will call for each JSX element.

[Read more]

Neovim Plugin Testing with Mocks: Customizing Child Neovim Instances in lazydocker.nvim

Testing Neovim plugins is tricky: side effects like spawning jobs (lazydocker), creating windows, notifications, etc.

In lazydocker.nvim tests, we use a mock system to:

  • Simulate missing executables (docker, podman, lazydocker)
  • Capture jobstart params (cmd, env)
  • Stub window APIs (nvim_win_is_valid, nvim_open_win)
  • Intercept vim.notify for error verification

Powered by mini.test child Neovim instances.

Child Neovim: Isolated Sandboxes

Bootstrap:

local child = helpers.new_child_neovim()  -- MiniTest child
child.setup()  -- Minimal init: readonly=false, small viewport (15x40)
child.load_lzd(config)  -- require('lazydocker').setup(config)
child.unload_lzd()  -- Cleanup: package.loaded, globals, augroups

Lifecycle management:

[Read more]

Enhancing Neovim Plugin Documentation and Readability with Lua Type Annotations: lazydocker.nvim Case Study

Introduction

In the world of Neovim plugin development. One of superpowers enabled by the Lua language in Neovim is type annotations using EmmyLua-style comments (—@). These annotations supercharge documentation, IDE integration, and code readability.

In lazydocker.nvim, a plugin that embeds LazyDocker into a Neovim floating window, I extensively used these annotations.

Lua Type Annotations

Lua is dynamically typed, but Neovim’s LSP (via nvim-lspconfig and emmy-lua) supports EmmyLua annotations:

---@class MyClass
---@field field string A description.

---@param param string Input param.
---@return boolean Success?
function myFunc(param) end

These generate:

[Read more]

Docker mangement in Neovim

lazydocker.nvim is my personal Neovim plugin project that brings the power of lazydocker directly into your editor workflow

Check out the project source code on Github on GitHub

lazydocker.nvim is a Lua-based Neovim plugin that allows you to open lazydocker in a floating window without ever leaving your editor. This means you can quickly check on your containers, view logs, or manage services, and then get right back to your code with a single keystroke.

[Read more]