Skip to content

MrDwarf7/lazyjui.nvim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 

Repository files navigation

LazyJui.nvim

A Neovim plugin that provides a beautiful floating window interface for jj, leveraging the jjui TUI for functionality.

Features

  • Floating Window Interface - Clean, distraction-free jjui experience
  • Fast Integration - Seamless integration with your Neovim workflow
  • Customizable - Configurable window size, borders, and behavior
  • Smart Window Management - Auto-resize, focus handling, and proper cleanup
  • Health Checks - Built-in dependency validation

Prerequisites

  • Neovim 0.7.0
  • plenary.nvim - Required dependency
  • jj - The VCS used with the plugin
  • jjui - The TUI/tool that's spawned inside the floating window

Installation & Configuration

Using lazy.nvim

{
  "mrdwarf7/lazyjui.nvim",
  dependencies = {
    "nvim-lua/plenary.nvim"
  },
  keys = {
    {
      -- Default is <Leader>jj
      -- An example of a custom mapping to open the interface
      "<Leader>gj",
      function()
        require("lazyjui").open()
      end,
    },
  }
  opts =  {
    -- Optionally: 
    winblend = 69, -- If you want some level of transparency
    -- support for custom command pass-through
    -- In this example, we use the revset `all()` command 
    --
    -- Will default to just `jjui`
    cmd = { "jjui", "-r", "all()" }, 
  }
}

Usage

Commands

  • :LazyJui - Open the LazyJui floating window

API

local lazyjui = require("lazyjui")

-- Open the interface
lazyjui.open()

-- Close the interface
lazyjui.close()

Health Check

Verify your installation and dependencies:

:checkhealth lazyjui

Keymaps

The plugin sets a default keymap to open the interface. You can customize it in your Neovim configuration:

vim.api.nvim_set_keymap('n', '<Leader>gj', ':lua require("lazyjui").open()<CR>', { noremap = true, silent = true })

Or the recommended way is to use the keys table in the plugin spec/configuration:

{
  "mrdwarf7/lazyjui.nvim",
  keys = {
    {
      "<Leader>gj",
      function()
        require("lazyjui").open()
      end,
    },
  }
}

How It Works

LazyJui creates a floating window and spawns the jjui command inside it as a terminal job. The window:

  • Automatically resizes when you resize Neovim
  • Closes when you lose focus
  • Properly cleans up resources to prevent memory leaks
  • Integrates with plenary.nvim for enhanced window positioning when available

Troubleshooting

"jjui executable not found" error

Make sure you have the jjui command available & installed. It must be available on your PATH:

# Check if jjui is installed
which jjui

# Oh no!
# Follow the instructions on the official jjui repository 

# If using Arch for instance: 
paru -S jjui-bin # or yay

Window positioning issues

If you're experiencing window positioning problems, make sure you have plenary.nvim installed. LazyJui uses plenary's advanced window positioning when available. If you're still having problems with it, please open an issue with details about your Neovim version, OS, and any relevant configuration.

Health check fails

Run :checkhealth lazyjui to diagnose issues. Common problems:

  • Missing plenary.nvim dependency
  • jjui not in PATH
  • Neovim version too old

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

MIT License - see LICENSE for details.

Related Projects

  • plenary.nvim - Window management and other utilities
  • jj - The new-fangled VCS system that's all the rage with the cool kids
  • jjui - A TUI tool for jj that makes it a lil bit easier to understand what is going on

About

Small plugin to pull up jj/jujutsu using the jjtui Go project.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages