Code Monkey home page Code Monkey logo

yanil's Introduction

Yanil

Yet Another Nerdtree In Lua

This not an out-of-box nerdtree alternative (and won't be), but a lib to build your own nerdtree.

Prerequisites

  • neovim-0.5.0 or higher.

Installation

Plug 'Xuyuanp/yanil'

Setup

It's not very easy to make it work (It's just a lib). A sample config can be found in my personal dotfile.

Note

This plugin is in very early stages and has no backward compatibility guarantees.

Known issues

  • Not support for windows
  • Not support for multi tabs
  • ...

Credits

  • nerdtree: It's one of the greatest vim plugin.
  • nvim-tree.lua: I learned a lot from it in prototype stage.

yanil's People

Contributors

mhartington avatar xuyuanp 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

Watchers

 avatar  avatar  avatar

yanil's Issues

1a820c4 breaks things

I recently updated and noticed that the style changes break things in neovim.

Screen Shot 2021-10-19 at 8 00 58 PM

After reverting and trying to debug, it seems the change of yanil/<package> to yanil.<package>, is the problem.

diff --git a/lua/yanil.lua b/lua/yanil.lua
index c2dc81d..8808131 100644
--- a/lua/yanil.lua
+++ b/lua/yanil.lua
@@ -1,9 +1,9 @@
-local git      = require("yanil/git")
-local devicons = require("yanil/devicons")
+local git      = require("yanil.git")
+local devicons = require("yanil.devicons")

 local config = {
-    colors   = require("yanil/colors"),
-    commands = require("yanil/commands"),
+    colors   = require("yanil.colors"),
+    commands = require("yanil.commands"),
 }

 local M = {}

Integrate with plenary?

Hey @Xuyuanp !

Cool plugin! I was wondering if you would be interested in collabin with github.com/nvim-lua/plenary.nvim since I think we'd both benefit from sharing some of the abstractions over vim.loop (and potentially upstream some of them to core someday).

If you're not interested in doing so, totally fine :)

Have a good day!

How to change Normal highlight of window ?

I want to change the background of yanil window but I don't know how, I try winhighlight=Normal:... but it didn't worked.

Moreover, there are less options than nvim-tree so I must change source code to make it works such as show window in right, change root node name, ellipsis.

There are still some things I can't implement such as directory with only one subdirectory and no file may corrupt to directory/subdirectrory > instead of directory > subdirectory > (Java often has this kind of directories).

yanil

`node.toggle()` not working to open/close directories

Hi,

Im trying to create a mapping (o) that behaves in the following way. When used on a directory it collapses or opens it depending on whether it is opened or closed. If used on a file, then it will close the directory that contains that file. I tried the following code but its not doing anything. Can you please help understand why its not working?

    ["o"] = function(tree, node)
      node = node:is_dir() and node or node.parent
      node:toggle()
      tree:force_refresh_node()
    end

Thanks!

change highlight of a given node

Hi,

Im reviewing the code for node and tree but can figure out how to change a node highlight. I want to add a global mapping that search for the node in the tree (โœ…), goes to the node (โœ…), and adds a special highlight. I cant figure out this last part, could you please show me an example?

Thanks

Can this be used as a general purpose tree?

Hey, I first learned about this plugin during @mhartington 's presentation for vimconf2021 and your idea for file tree being just a library intrigued me. I skimmed through the docs and a though struck me:

Can this be used as a general purpose tree widget?

In other words, is there any kind of interface that could be used (or exposed easily) for user to supply a content provider? Maybe a list of lists or whatever. The main idea being that yanil already provides most of the functionality for implementing a functional tree widget with traversal, hooks and keymaps, while user would just supply the data and missing mappings for whatever.
An example would be a call stack widget.

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.