Skip to content

Automatically change the column layout in yazi based on available window width

License

luccahuguet/auto-layout.yazi

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 

Repository files navigation

auto-layout.yazi

This plugin for the yazi file explorer will automatically change the number of columns to show in yazi based on the available width. This is especially useful if you use a terminal layout that might have yazi run in a sidebar (where 1 column is all that's required) but then sometimes zoom into it and you want it to update to use the full 3 column layout.

Why a fork?

  • The original repo plugin is broken as of July 30th, and has been for some months now
  • So to help the great yazi community, I announced my fork on yazi's repo, since my fork works

Compatibility

  • Tested with yazi v0.5.31
  • Works with recent versions of yazi

Installation

$ ya pack -a luccahuguet/auto-layout

Usage

-- In your yazi config's init.lua
require("auto-layout")

If you want to customize the breakpoints where the column shifts happen:

require("auto-layout").setup({
   breakpoint_large = 110,  -- new large window threshold, defaults to 100
   breakpoint_medium = 60,  -- new medium window threshold, defaults to 50
 })

About

Automatically change the column layout in yazi based on available window width

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Lua 100.0%