Need help with tree.nvim?
Click the “chat” button below for chat support from the developer who created it, or find similar developers for support.

About the developer

zgpio
159 Stars 4 Forks BSD 3-Clause "New" or "Revised" License 265 Commits 2 Opened issues

Description

Neovim file-explorer powered by C++

Services available

!
?

Need anything else?

Contributors list

# 378,551
Vim
Neovim
denite
C++
117 commits
# 279,758
pointcl...
C
PHP
explore...
70 commits

Tree.nvim - File explorer powered by C++.

Build Status Build Status Build status

🎉:

QT
dependencies removed (2020-03-21)

Requirements

Features

  • Support Linux/MacOS/Windows
  • NeoVim line-based highlight (
    conceal
    free)
  • High performance
  • Defx's UI/API (minor revision)
  • For more information refer to doc

Usage

Demo Demo

Config

Step 1

mkdir tree.nvim && cd tree.nvim
# via wget or curl
sh -c "$(wget -O- https://raw.githubusercontent.com/zgpio/tree.nvim/master/install.sh)"
sh -c "$(curl -fsSL https://raw.githubusercontent.com/zgpio/tree.nvim/master/install.sh)"

Step 2

" Add tree.nvim to runtime path
set rtp+=/path/to/tree.nvim/
" Start user configuration
" ...

User configuration ref to config.lua.

lua
vim.o.termguicolors = true
vim.api.nvim_set_keymap('n', 'z',
    ":Tree -columns=mark:indent:git:icon:filename:size:time"..
    " -split=vertical -direction=topleft -winwidth=40 -listed `expand('%:p:h')`",
    {noremap=true, silent=true})
local custom = require 'tree/custom'
custom.option('_', {root_marker='[in]:'})
custom.column('filename', {
  root_marker_highlight='Ignore',
  max_width=60,
})
custom.column('time', {
  format="%d-%M-%Y",
})
custom.column('mark', {
  readonly_icon="X",
  selected_icon="*",
})
local tree = require('tree')
-- keymap(keys, action1, action2, ...)  action can be `vim action` or `tree action`
tree.keymap('cp', 'copy')
tree.keymap('m', 'move')
tree.keymap('p', 'paste')
tree.keymap('a', 'view')
tree.keymap('o', 'open_or_close_tree')
tree.keymap('R', 'open_tree_recursive')
tree.keymap('r', 'rename')
tree.keymap('x', 'execute_system')
tree.keymap('', 'drop')
tree.keymap('', 'redraw')
tree.keymap('', 'print')
tree.keymap('>', 'toggle_ignored_files')
tree.keymap('*', 'toggle_select_all')
tree.keymap('s', {'drop', 'split'}, 'quit')
tree.keymap('N', 'new_file')
tree.keymap('cd', {'cd', '.'})
tree.keymap('~', 'cd')
tree.keymap('', 'toggle_select', 'j')  -- tree action and vim action
tree.keymap('\\', {'cd', vim.fn.getcwd})
tree.keymap('cD', {'call', function(context) print(vim.inspect(context)) end})
tree.keymap('l', 'open')
tree.keymap('yy', 'yank_path')
tree.keymap('D', 'debug')
tree.keymap('d', 'remove')
tree.keymap('E', {'open', 'vsplit'})
tree.keymap('h', {'cd', '..'})
tree.keymap('gk', {'goto', 'parent'})

Build

macos

brew install boost
git clone https://github.com/zgpio/tree.nvim

cmake -DCMAKE_INSTALL_PREFIX=./INSTALL -DBoost_USE_STATIC_LIBS=ON -DCMAKE_BUILD_TYPE=Release -S tree.nvim/ -B tree.nvim/build make -C tree.nvim/build/ install

ubuntu1804

# cmake 3.10  boost 1.65
sudo apt install cmake libboost-filesystem-dev
git clone https://github.com/zgpio/tree.nvim.git
cd tree.nvim
mkdir build && cd build
cmake -DCMAKE_INSTALL_PREFIX=./INSTALL -DBoost_USE_STATIC_LIBS=ON -DCMAKE_BUILD_TYPE=Release  ..
make install

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.