2
2
3
3
## Notice
4
4
5
- This plugin doesn't support windows. \
6
- This plugin requires [ neovim nightly] ( https://github.com/neovim/neovim/wiki/Installing-Neovim ) . \
7
- You can switch to commit ` afc86a9 ` if you use neovim 0.4.x. \
8
- Note that the old version has less features and is much slower than the new one.
5
+ This plugin doesn't support windows yet. \
6
+ This plugin requires [ neovim nightly] ( https://github.com/neovim/neovim/wiki/Installing-Neovim ) .
9
7
10
8
## Install
11
9
12
10
Install with [ vim-plug] ( https://github.com/junegunn/vim-plug ) :
13
11
14
12
``` vim
15
- " master (neovim git)
13
+ " requires
16
14
Plug 'kyazdani42/nvim-web-devicons' " for file icons
17
15
Plug 'kyazdani42/nvim-tree.lua'
18
-
19
- " old version that runs on neovim 0.4.x
20
- Plug 'kyazdani42/nvim-tree.lua', { 'commit': 'afc86a9' }
21
- " for icons in old version
22
- Plug 'ryanoasis/vim-devicons'
23
16
```
24
17
25
18
## Setup
26
19
27
20
``` vim
28
- let g:lua_tree_side = 'right' | 'left' "left by default
29
- let g:lua_tree_width = 40 "30 by default
30
- let g:lua_tree_ignore = [ '.git', 'node_modules', '.cache' ] "empty by default
31
- let g:lua_tree_auto_open = 1 "0 by default, opens the tree when typing `vim $DIR` or `vim`
32
- let g:lua_tree_auto_close = 1 "0 by default, closes the tree when it's the last window
33
- let g:lua_tree_quit_on_open = 1 "0 by default, closes the tree when you open a file
34
- let g:lua_tree_follow = 1 "0 by default, this option allows the cursor to be updated when entering a buffer
35
- let g:lua_tree_indent_markers = 1 "0 by default, this option shows indent markers when folders are open
36
- let g:lua_tree_hide_dotfiles = 1 "0 by default, this option hides files and folders starting with a dot `.`
37
- let g:lua_tree_git_hl = 1 "0 by default, will enable file highlight for git attributes (can be used without the icons).
38
- let g:lua_tree_root_folder_modifier = ':~' "This is the default. See :help filename-modifiers for more options
39
- let g:lua_tree_tab_open = 1 "0 by default, will open the tree when entering a new tab and the tree was previously open
40
- let g:lua_tree_width_allow_resize = 1 "0 by default, will not resize the tree when opening a file
41
- let g:lua_tree_show_icons = {
21
+ let g:nvim_tree_side = 'right' | 'left' "left by default
22
+ let g:nvim_tree_width = 40 "30 by default
23
+ let g:nvim_tree_ignore = [ '.git', 'node_modules', '.cache' ] "empty by default
24
+ let g:nvim_tree_auto_open = 1 "0 by default, opens the tree when typing `vim $DIR` or `vim`
25
+ let g:nvim_tree_auto_close = 1 "0 by default, closes the tree when it's the last window
26
+ let g:nvim_tree_quit_on_open = 1 "0 by default, closes the tree when you open a file
27
+ let g:nvim_tree_follow = 1 "0 by default, this option allows the cursor to be updated when entering a buffer
28
+ let g:nvim_tree_indent_markers = 1 "0 by default, this option shows indent markers when folders are open
29
+ let g:nvim_tree_hide_dotfiles = 1 "0 by default, this option hides files and folders starting with a dot `.`
30
+ let g:nvim_tree_git_hl = 1 "0 by default, will enable file highlight for git attributes (can be used without the icons).
31
+ let g:nvim_tree_root_folder_modifier = ':~' "This is the default. See :help filename-modifiers for more options
32
+ let g:nvim_tree_tab_open = 1 "0 by default, will open the tree when entering a new tab and the tree was previously open
33
+ let g:nvim_tree_width_allow_resize = 1 "0 by default, will not resize the tree when opening a file
34
+ let g:nvim_tree_show_icons = {
42
35
\ 'git': 1,
43
36
\ 'folders': 0,
44
37
\ 'files': 0,
@@ -50,7 +43,7 @@ let g:lua_tree_show_icons = {
50
43
" You can edit keybindings be defining this variable
51
44
" You don't have to define all keys.
52
45
" NOTE: the 'edit' key will wrap/unwrap a folder and open a file
53
- let g:lua_tree_bindings = {
46
+ let g:nvim_tree_bindings = {
54
47
\ 'edit': ['<CR>', 'o'],
55
48
\ 'edit_vsplit': '<C-v>',
56
49
\ 'edit_split': '<C-x>',
@@ -73,11 +66,11 @@ let g:lua_tree_bindings = {
73
66
74
67
" Disable default mappings by plugin
75
68
" Bindings are enable by default, disabled on any non-zero value
76
- " let lua_tree_disable_keybindings =1
69
+ " let nvim_tree_disable_keybindings =1
77
70
78
71
" default will show icon by default if no icon is provided
79
72
" default shows no icon by default
80
- let g:lua_tree_icons = {
73
+ let g:nvim_tree_icons = {
81
74
\ 'default': '',
82
75
\ 'symlink': '',
83
76
\ 'git': {
@@ -94,15 +87,15 @@ let g:lua_tree_icons = {
94
87
\ }
95
88
\ }
96
89
97
- nnoremap <C-n> :LuaTreeToggle <CR>
98
- nnoremap <leader>r :LuaTreeRefresh <CR>
99
- nnoremap <leader>n :LuaTreeFindFile <CR>
100
- " LuaTreeOpen and LuaTreeClose are also available if you need them
90
+ nnoremap <C-n> :NvimTreeToggle <CR>
91
+ nnoremap <leader>r :NvimTreeRefresh <CR>
92
+ nnoremap <leader>n :NvimTreeFindFile <CR>
93
+ " NvimTreeOpen and NvimTreeClose are also available if you need them
101
94
102
95
set termguicolors " this variable must be enabled for colors to be applied properly
103
96
104
- " a list of groups can be found at `:help lua_tree_highlight `
105
- highlight LuaTreeFolderIcon guibg=blue
97
+ " a list of groups can be found at `:help nvim_tree_highlight `
98
+ highlight NvimTreeFolderIcon guibg=blue
106
99
```
107
100
108
101
## KeyBindings
@@ -126,7 +119,7 @@ highlight LuaTreeFolderIcon guibg=blue
126
119
- ` <C-x> ` will open the file in a horizontal split
127
120
- ` <C-t> ` will open the file in a new tab
128
121
- ` <Tab> ` will open the file as a preview (keeps the cursor in the tree)
129
- - ` I ` will toggle visibility of folders hidden via |g: lua_tree_ignore |
122
+ - ` I ` will toggle visibility of folders hidden via |g: nvim_tree_ignore |
130
123
- ` H ` will toggle visibility of dotfiles (files/folders starting with a ` . ` )
131
124
- ` R ` will refresh the tree
132
125
- ` gx ` opens the file with the ` open ` command on MACOS and ` xdg-open ` in linux
0 commit comments