Convert Figma logo to code with AI

ms-jpq logochadtree

File manager for Neovim. Better than NERDTree.

1,673
64
1,673
93

Top Related Projects

A file explorer tree for neovim written in lua

19,922

A tree explorer plugin for vim.

🌿 General purpose asynchronous tree viewer written in Pure Vim script

The undo history visualizer for VIM

Quick Overview

CHADTree is a file manager plugin for Neovim, designed to provide a fast and feature-rich tree-like file explorer. It aims to enhance the file navigation experience within Neovim by offering a modern, performant alternative to traditional file explorers.

Pros

  • Fast and responsive, even with large directory structures
  • Highly customizable with extensive configuration options
  • Seamless integration with Neovim's native features
  • Supports Git integration for visual file status indicators

Cons

  • Requires Neovim 0.5.0 or higher, which may not be available on all systems
  • Learning curve for users accustomed to traditional file explorers
  • May conflict with other file explorer plugins or keybindings

Getting Started

To install CHADTree using vim-plug, add the following to your Neovim configuration file:

Plug 'ms-jpq/chadtree', {'branch': 'chad', 'do': 'python3 -m chadtree deps'}

After installation, you can open CHADTree with the following command:

:CHADopen

To customize CHADTree, create a chadtree.yml file in your Neovim configuration directory. Here's a basic example:

view:
  width: 30
  side: left
  sessions: true
keymap:
  tertiary: ["t"]
  v_split: ["v"]
  h_split: ["s"]

For more detailed configuration options and usage instructions, refer to the official CHADTree documentation.

Competitor Comparisons

A file explorer tree for neovim written in lua

Pros of nvim-tree.lua

  • More active development and larger community support
  • Better integration with Neovim's native features
  • Extensive customization options through Lua configuration

Cons of nvim-tree.lua

  • Slightly slower performance for large directories
  • Less robust handling of git status and modifications
  • Fewer built-in filtering options compared to Chadtree

Code Comparison

nvim-tree.lua configuration:

require('nvim-tree').setup({
  sort_by = "case_sensitive",
  view = { width = 30 },
  renderer = { group_empty = true },
  filters = { dotfiles = true },
})

Chadtree configuration:

let g:chadtree_settings = {
    \ 'view.width': 30,
    \ 'theme.text_colour_set': 'nord',
    \ 'keymap.primary': ['<enter>', 'o'],
    \ }

Both plugins offer file tree functionality for Neovim, but they differ in implementation and features. nvim-tree.lua is written in Lua and integrates more seamlessly with Neovim's ecosystem, while Chadtree is implemented in Python and offers some unique features like faster performance for large directories. The choice between the two depends on personal preferences, workflow requirements, and the desired level of customization.

19,922

A tree explorer plugin for vim.

Pros of NERDTree

  • Well-established and widely adopted in the Vim community
  • Extensive documentation and user support
  • Simpler setup and configuration for basic use cases

Cons of NERDTree

  • Less performant with large directory structures
  • Limited customization options compared to modern alternatives
  • Lacks some advanced features like async operations and git integration

Code Comparison

NERDTree:

let g:NERDTreeShowHidden = 1
let g:NERDTreeMinimalUI = 1
let g:NERDTreeIgnore = []
let g:NERDTreeStatusline = ''

CHADTree:

let g:chadtree_settings = {
    \ 'view.width': 30,
    \ 'theme.icon_glyph_set': 'ascii',
    \ 'keymap.primary': ['<enter>', 'o'],
    \ 'keymap.secondary': ['<c-v>', '<c-x>', '<c-t>'],
}

Summary

While NERDTree is a classic and reliable file explorer for Vim, CHADTree offers improved performance and modern features. NERDTree excels in simplicity and community support, making it ideal for users who prefer a straightforward setup. CHADTree, on the other hand, provides better performance with large directories and more advanced customization options, catering to users who need a more powerful and flexible file explorer.

🌿 General purpose asynchronous tree viewer written in Pure Vim script

Pros of vim-fern

  • Pure Vim script implementation, making it more compatible across different Vim setups
  • Extensible architecture with a plugin system for customization
  • Lightweight and fast, with minimal dependencies

Cons of vim-fern

  • Less feature-rich out of the box compared to chadtree
  • May require more manual configuration to achieve advanced functionality
  • Limited built-in Git integration

Code comparison

vim-fern:

call fern#default#mappings#init()
nnoremap <silent> <Leader>f :Fern . -drawer -toggle<CR>

chadtree:

nnoremap <leader>v <cmd>CHADopen<cr>
let g:chadtree_settings = {
    \ 'view.width': 30,
    \ 'theme.text_colour_set': 'nord'
    \ }

Both plugins offer file tree functionality for Vim/Neovim, but they differ in implementation and feature set. vim-fern focuses on simplicity and extensibility, while chadtree provides a more feature-rich experience out of the box. The code examples show basic setup for each plugin, with vim-fern requiring less initial configuration. chadtree offers more built-in customization options and advanced features like Git integration, but may have a steeper learning curve. Ultimately, the choice between the two depends on the user's preferences for simplicity versus advanced features.

The undo history visualizer for VIM

Pros of undotree

  • Lightweight and focused solely on undo history visualization
  • Simple setup and integration with Vim/Neovim
  • Intuitive visual representation of undo branches

Cons of undotree

  • Limited to undo history functionality
  • Less actively maintained compared to chadtree
  • Lacks advanced features like file system operations

Code Comparison

undotree:

if !exists('g:undotree_WindowLayout')
    let g:undotree_WindowLayout = 1
endif

chadtree:

from pynvim import Nvim
from .nvim.quickfix import quickfix
from .settings.types import Settings
from .state.types import State

Summary

undotree is a specialized plugin for visualizing undo history in Vim/Neovim, offering a simple and intuitive interface. It's lightweight and easy to set up but focuses solely on undo functionality.

chadtree, on the other hand, is a more comprehensive file explorer with advanced features like async operations and customizable icons. It offers broader functionality but may have a steeper learning curve.

The choice between the two depends on whether you need a dedicated undo history tool (undotree) or a full-featured file explorer with additional capabilities (chadtree).

Convert Figma logo designs to code with AI

Visual Copilot

Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.

Try Visual Copilot

README

CHADTree

File Manager for Neovim, Better than NERDTree.

Features Illustrated

See full list of screen captures here

I like speed

  • Parallel Filesystem Scan

  • React Like Reconciling Difference Minimizing Rendering engine

  • Never blocks

You can read more about my performance optimization here.

I like power

  • Visual mode selections

  • Create, Copy, Paste, Delete, Rename, gotta do them all

  • Quickfix integration

  • Bookmarks

visual_select.gif

I like 21st century

  • Filtering by glob

  • Follow mode

  • Session support (save open folders to disk, pick up where you left off)

  • Trash support (requires trash or trash-cli)

  • ls -l statistics

  • Correct! handling of symlinks

filtering.gif

I like version control

  • Asynchronous parse git status (untracked, modified, staged)

  • Full support for git submodules

git.gif

I like colours

  • Full $LS_COLOR support! (shows same colours as unix ls & tree commands)

  • Github coloured icons (over 600 colours!)

  • Three different sets of icons out of the box

  • Four built-in themes - nord, solarized, trapdoor, vim-syntax

ls_colours.png

github_colours.png

I like refinement

  • Maintain cursor position on relevant files even when during movements.

  • Maintain selection when copying, moving files

  • Mimetype warning (so you don't accidentally open an image)

  • Validating config parser (notice, I added an extra "dog" param)

mime warn.png

schema error.png

I like documentation

  • Built-in help command in a floating window!

  • Over 1000 lines of meticulous docs covering every option / function!

Use :CHADhelp to view documentation

Use :CHADhelp --web to open documentation in your browser! (If you have one installed)

Install

Minimum version: python: 3.8.2, nvim: 0.4.3, make sure to have virtualenv installed (e.g.: sudo apt install --yes -- python3-venv)

Install the usual way, ie. VimPlug, Vundle, etc

Plug 'ms-jpq/chadtree', {'branch': 'chad', 'do': 'python3 -m chadtree deps'}

You will have to run :CHADdeps when installing / updating. This will install CHADTree's dependencies locally inside chadtree/.vars/runtime.

doing rm -rf chadtree/ will cleanly remove everything CHADTree uses on your computer.

Usage

To toggle CHADTree run command :CHADopen. Set it to a hotkey for convenience.

nnoremap <leader>v <cmd>CHADopen<cr>

To see a list of hot keys:

Either use :CHADhelp keybind or open in browser using :CHADhelp keybind --web

FAQ

Q: Sometimes Windows will get stuck with CHADTree decorations when I do not want them to be, how do I resolve this?

A: Run :CHADrestore

Recommendations

Add a hotkey to clear quickfix list:

nnoremap <leader>l <cmd>call setqflist([])<cr>

If you like this...

Also check out

  • sad, its a modern sed that does previews with syntax highlighting, and lets you pick and choose which chunks to edit.

  • coq.nvim, it's a FAST AS FUCK completion client with shit tons of features.

  • isomorphic-copy, it's a cross platform clipboard that is daemonless, and does not require third party support.

Special Thanks

CHADTree does not define it's own colours beyond some minimal defaults, all themes are imported from other open source projects.

The base icons are imported from the vim-devicon

All emoji icons are imported from the vim-emoji-icon-theme

Some themes are imported from dircolors-solarized

Some themes are imported from nord-dircolors

Some themes are imported from LS_COLORS

Some themes are imported from vim-nerdtree-syntax-highlight