/chadtree

File manager for Neovim. Better than NERDTree.

Primary LanguagePython

CHADTree

File Manager for Neovim, Better than NERDTree.

Features Illustrated

See full list of screen captures here

I like speed

  • Incremental file system scan

  • None blocking

  • Literally every FS call is async.

I like power

  • Visual mode selections

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

  • Quickfix integration

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

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

filtering.gif

I like version control

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

  • Full support for git ignore, toggle show / hide

  • Full support for globbing ignored files

git.gif

I like colours

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

  • Github coloured icons (over 600 colours!)

  • Full icon support from importing vim-devicon

ls_colours.png

github_colours.png

Install

Requires pyvim (as all python plugins do)

pip3 install pynvim

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

Plug 'ms-jpq/chadtree', {'branch': 'chad', 'do': ':UpdateRemotePlugins'}

Minimum version: python: 3.7, nvim: 0.4.3

Documentation

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

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

Check out config.json before you proceed for an overview of options.

Set a dictionary with same keys to g:chadtree_settings to overwrite any options. You dont need to provide every key, just the ones you want to overwrite.

Keybindings

important: if you get a missing function error, it means I added a feature and you need to run :UpdateRemotePlugins to see the new function.

functions only work under the CHADTree buffer

functions usage default key
quit close chad window q
refresh trigger refresh <c-r>
change_focus re-center root at folder c
change_focus_up re-center root at root's parent C
refocus refocus root at vim cwd ~
jump_to_current set cursor row to currently active file J
primary open / close folders & open file <enter>
secondary open / close folders & preview file <tab>, <doubleclick>
tertiary open / close folders & open file in new tab <m-enter>, <middlemouse>
v_split open / close folders & open file in vertical split w
h_split open / close folders & open file in horizontal split W
open_sys open file using open / xdg-open o
toggle_hidden toggle showing hidden items (you need to set your own ignore list) .
collapse collapse all sub folders <s-tab>
copy_name copy file path of items under cursor / visual selection / selection y
filter set glob filter for visible items f
clear_filter clear filtering F
select select item under cursor / visual selection s
clear_select clear selection S
new create new folder / file at location under cursor (name ending with os specific / will be folders) a
rename rename file under cursor r
delete delete item under cursor / visual selection / selection d
trash trash item under cursor / visual selection / selection t
copy copy selected items to location under cursor p
cut move selected items to location under cursor x
stat print ls -l stat to status line K
toggle_follow toggle follow mode on / off
toggle_version_control toggle version control on / off
bigger increase chad size +, =
smaller decrease chad size -, _

View & Ignore

Likewise set dictionaries to g:chadtree_view and g:chadtree_ignores to overwrite view.json and ignore.json accordingly.

option usage
name globs of name to ignore
path glob of full path to ignore

Note: if you want to ignore dotfiles, you will need to set it up like so

lua vim.api.nvim_set_var("chadtree_ignores", { name = {".*", ".git"} })

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.

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

Special Thanks

All the icons are imported from the vim-devicon project