Git Product home page Git Product logo

zellij's Introduction

Yazelix v3: Helix with a File Tree!

Overview

Yazelix is a glorified config that integrates yazi, zellij and helix, hence the name, get it?

  • Zellij orchestrates everything, with yazi as a sidebar and helix as the editor
  • You can open and close the sidebar by switching zellij layouts (press alt ] and alt [)
  • Every keybinding from zellij that conflicts with helix is remapped (see them at the bottom)
  • Helix is called when you hit enter on a file in the "sidebar", opening as a new pane in zellij
    • If helix is called like that, that pane will be closed as well when you quit helix
    • Note: I recommend running zellij from your shell (nu -c "zellij -l welcome" for nushell). This way you can load your enviroment variables like EDITOR and HELIX_RUNTIME
  • This project holds my config files for zellij and yazi, almost like a plugin or something, but it's just a glorified config!

Base Layout

The initial layout includes one usable pane (actually 4, counting the tab-bar, status-bar and sidebar): image

  • Tab-bar at the top
  • Status-bar at the bottom
  • Yazi pane (20% width) acting as a sidebar on the left
  • Empty pane on the right

Swap Layouts Behavior

  • Open and close the sidebar by switching layouts (you need at least two panes open to do that).
  • New panes will be appearing to the left, stacked, but this won't change the layout.
  • You can add more swap layouts as needed, using the KDL files in layouts.

Two or more panes open with the sidebar open: Sidebar Open

Two or more panes open with the sidebar closed: Sidebar Closed


Improvements Over v2

  • Before, the yazi config files were in a separate repo, now its all integrated here!
    • Thanks to Zykino from Zellij's discord for that tip!
  • Yazi's maintainer (what an honor!) added a init.lua file that makes the status-bar in yazi look really good in the small width it has
  • The project's got a name! Yazelix. It simply had no name before and that was a mistake.
  • This one is great: I've remapped 6 keybindings from zellij to avoid conflicts with helix
    • use alt m for new panes and the rest is in zellij's status-bar
    • this is configured in the layouts/yazelix.kdl file, if you want to change something

Instructions to set it up

  1. Make sure yazi, zellij and helix are installed and in your path
  2. Remove (or rename) your old ~/.config/zellij folder, and just clone this repo in your ~/.config dir
  3. You can open this layout either from zellij -l welcome or directly zellij -l ~/.config/zellij/layouts/yazelix
  • I just set my terminal config to open zellij on startup, so I never leave zellij (my alacritty files here)

That's it, and feel free to open issues and PRs ๐Ÿ˜‰


Why use this project?

  • I think one of the main things is just how dead simple to configure this project is. No shell scripting magic
  • Easy to configure and make it yours
  • I daily drive this, and will change it according to my needs, keeping it updated and improving it
  • Even if you don't care about the sidebar, the keybindings may be helpful

Possible Improvements

  • Be able to close the sidebar with only one pane besides the sidebar open (see the problem here
  • Full Yazi pane: Integrate a full Yazi pane in another swap layout showing parents and preview, not just the current dir
    • this is already implemented, but has a few kinks to iron out.
    • To test, uncomment the yazi_full swap layout and panes, and increase the panes constraints by one
    • Problem 1: some panes swap with others when they shouldn't, like the sidebar and a normal pane
    • Problem 2: you have to "walk" through the closed pane, which isn't great
    • Big thanks to zellij's maintainer and other people for helping with this
  • Higher Helix Integration: Currently, selected files in Yazi open as a new pane in Zellij, running Helix. It would be nice to open them as a split or a buffer inside Helix (though this might be complex to code).
  • Rename the repo to yazelix: I did try that but using a custom path to the layout folder just didn't work with ~ or $HOME (see some issues here and here
  • Adjusting things for helix plugin system: Namely making yazi just a full pane, and killing the sidebar, since there is a helix file tree plugin

Keybinding remaps

New Zellij Keybinding Previous Keybinding Helix Action that uses that previous key Zellij Action remaped
Ctrl e Ctrl o jump_backward SwitchToMode "Session"
Ctrl y Ctrl s save_selection SwitchToMode "Scroll"
Alt w Alt i shrink_selection MoveTab "Left"
Alt q Alt o expand_selection MoveTab "Right"
Alt m Alt n select_next_sibling NewPane
Alt 2 Ctrl b move_page_up SwitchToMode "Tmux"

If you find a conflict, please open an issue. Keep in mind, though, that compatibility with tmux mode is not a goal of this project.


Notes

  • I recommend using alacritty as your terminal
    • because it's a "dumb" terminal, it has no panes, no tabs. This means less keybindings conflicts to worry about, less feature overlap
    • very performant
    • but I do want to explore more modern options, so long as they have a "plain mode", like this
    • you can check out my alacritty files here (they include all alacritty themes)
  • Use nushell, it's a great shell, it's fast and beautiful and a proper programming language. Why wouldn't you?
  • If you test this with nvim and it works, let me know (see the issue here)
  • Special thanks to yazi's and zellij's maintainer (and discord members) for their help with some stuff. Also shoutout to helix's contributors!

Similar projects

  • Shelix: Shelix does intent to maximize the hidden power of Tmux as an IDE, enhance capabilities of the incredibly efficient Helix editor, around an interactive menu that performs IDE related actions
  • Helix-Wezterm:Turning Helix into an IDE with the help of WezTerm and CLI tools
  • File tree picker in Helix with Zellij: Yazi can be used as a file picker to browse and open file(s) in your current Helix instance (running in a Zellij session)

zellij's People

Contributors

luccahuguet avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

zellij's Issues

rename repo to yazelix

it will hurt out-of-the-boxness because you wont be able to just clone the repo but something feels off about this repo being called zellij

incorporate zj-status somehow

it's bad having to install and configure it, but if I manage to do this automatically, like including a binary in the repo...

i feel it could work

Would be nice to talk to the maintainer, perhaps they have an idea of how to go about this

Unwanted Pane Swapping when I close helix from a pane to the right

This is currently mitigated by setting min-panes in the "closed_sidebar" layout to 5, but it would be nice to be able to close the sidebar when you only have the sidebar and a pane.

So, this happens when I swap layouts (to close the sidebar) if there is more than a pane besides the sidebar open, or when I close this second pane (more details below)

I might open an issue in the zellij repo or something

v4 bug

wont open a file in a buffer properly if there is a space in the name

opening "my files.md" will result in it opening an empty buffer call "my"

hardcoded username in layouts/yazelix.kdl

firstly thank you for creating such a wonderful work.
your username is hardcoded in layouts/yazelix.kdl (link), making not able to install successfully just by following instructions.

nvim compatibility

neovim compatibility is not a goal of this project, but would be nice to have.

If you tried this with nvim and it worked, please let me know here

Opening new files

When opening new files from the yazi sidebar does it open the file in a new helix instance or open the buffer within the same helix instance?

Thanks

Discussion: focus on full panes

instead of making the first two panes split vertically, make the second pane be created already stacked with the first pane

so no more vertical splitting by default

ok but what if I need to split vertically?
just type ctrl p + r for a split to the right

This would focus on a single pane using all the width avaiable.
Would make sense to launch this along the helix scheme file tree, when the plugin system is ready

Refactor: avoid duplication in yazelix.kdl

Clearly, there is code duplication. But I have yet to find a way to fix it, basically because I could not use a tab_template inside default_tab_template

layout {
    tab_template name="ui" {
        pane size=1 borderless=true {
           plugin location="zellij:tab-bar"
        }
        children
        pane size=1 borderless=true {
           plugin location="zellij:status-bar"
        }
    }

    default_tab_template {
        pane size=1 borderless=true {
           plugin location="zellij:tab-bar"
        }
        pane split_direction="vertical" {
            pane name="sidebar" {
                command "env"
                args "YAZI_CONFIG_HOME=~/.config/zellij/yazi/sidebar" "yazi"
            	size "20%"
            }
            pane {
                focus true
            }
        }
        pane size=1 borderless=true {
           plugin location="zellij:status-bar"
        }
    }
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.