Commit Graph

91 Commits

Author SHA1 Message Date
kiyan
f74dd24c58 refacto: move some code into actions
(non breaking, old assignments link to new assignments)
- move lib.collapse-all into actions/collapse-all
- move lib.dir-up into actions/dir-up
- move lib.change-dir into actions/change-dir
- use setup option for change-dir global (and use the old option for
  setup)
2022-02-05 17:42:40 +01:00
kiyan
96650c801f BREAKING: rename populate -> explorer
- rename populate.lua to explorer.lua
- rename refresh_entries to refresh in explorer.lua
- rename populate to explore in explorer.lua
2022-02-05 16:56:42 +01:00
kiyan
14461373e0 refacto: move all keybind logic to actions/init 2022-01-21 12:21:23 +01:00
kiyan
2b2bf0721d refacto: move keypress to actions/init 2022-01-21 12:07:54 +01:00
kiyan
4d22f9487d refacto: move open-file to actions
move all logic to open file from lib to actions/open-file
2022-01-21 12:01:17 +01:00
kiyan
dc5eae6512 refacto: remove fs folder and move code to actions
- remove file moved to actions.remove-file.lua
- rename file moved to actions.rename-file.lua
2022-01-21 11:54:35 +01:00
kiyan
45671e94be refacto: extract create_file into actions module 2022-01-21 11:45:52 +01:00
Wen Jun
2e25ba5958 feat(preview): enhanced preview to toggle folder (#907)
Co-authored-by: MusiCool <wenjun.super@bytedance.com>
2022-01-21 11:29:17 +01:00
kiyan
1248bcec86 refacto: create actions folder and move some code to it
- move trash.lua into actions
- move system-open from root file to actions
- move copypasta code from fs to actions
- add file_exists in utils
- add rename_loaded_buffers in utils (might need to move that in the
  future).
2022-01-21 11:25:49 +01:00
Carlos Coves Prieto
fa8bb09de4 custom node keymaps (#855) 2022-01-21 11:03:49 +01:00
Michael
9e2f6b6f25 feat: add exclude filter list (#878) 2022-01-21 10:48:58 +01:00
kiyan
0a2f6b0b6b fix(dirchange): do not change dir when switching windows
- Avoid changing dir when switching windows, except when
changing tabpage.
- Load nvim-tree with passed directory when opening with `nvim DIR`

Fixes #858 #720
2021-12-24 14:50:20 +01:00
Reviakin Evgeny
239f2d6fea show diagnostics on parent dirs if nodes with diagnostics are not visible (#862) 2021-12-24 12:47:23 +01:00
shikun
65b8b19c8b fix: idx passed to api.nvim_win_set_cursor may be -1 (#821)
This causes out of range error on CursorMoved event is fired if hijack_cursor option is set to true.
Although I don't know why it fixes the issue, but it has been working fine for me.

Potentially fix #783, #803
2021-12-05 22:27:20 +01:00
Raafat Turki
e842f08884 feat: add trashing (#749) 2021-11-28 15:26:24 +01:00
Kiyan
6662b60a2b feat/chore: rewrite git with job and some other fixes (#743)
* feat/chore: rewrite git with job and some other fixes

* fix: fs clear window, rename echo_warning -> warn

also fix renaming and add an event blocker to avoid running many events
at the same time
2021-11-27 16:02:54 +01:00
kiyan
b853e1083c Revert "fix: remove buffer when its empty when hijacking"
This reverts commit 0babcb4f2c.
2021-11-27 14:08:46 +01:00
kiyan
0babcb4f2c fix: remove buffer when its empty when hijacking 2021-11-27 13:54:17 +01:00
kiyan
a6c1d45dd6 chore: refacto populate filtering
move `nvim_tree_ignore` and `nvim_tree_hide_dotfiles` to setup
2021-10-30 12:25:09 +02:00
kiyan
f92b7e7627 fix: hijack current dir when doing :edit .
fixes #756
2021-10-30 11:35:44 +02:00
M.A
fd3969ec98 feat: add hide_root_folder (#728) 2021-10-24 16:48:57 +02:00
figsoda
514619897f feat: add NvimTreeFindFileToggle (#735) 2021-10-23 15:35:28 +02:00
kiyan
fda5b82bdf fix: lsp diagnostics user autocmd setup 2021-10-10 17:02:34 +02:00
kiyan
94b8604e86 chore: complete the diagnostic setup migration
Colors groups and icons are now in diagnostics.lua. They are defined on
setup which allows an easier configuration and better documentation.
`lsp_diagnostics` boolean value has been moved into a table `diagnostics`
with `enable` and `icons` as properties.
2021-10-10 11:42:22 +02:00
kiyan
7ca37f824b fix: run find_file on DirChanged if update_focused_file is enabled
fixes #690
2021-10-05 17:51:48 +02:00
kiyan
fb32f35d7f chore: allow configuring height
also fixes window management for top and bottom tree side
2021-10-03 14:13:10 +02:00
kiyan
6416ea3562 chore: add old option detection in plugin/nvim-tree.lua 2021-10-02 14:05:50 +02:00
kiyan
137628acb6 chore: update_to_buf_dir allow auto_open configuration
also improve the documentation with doc references
2021-10-02 13:53:51 +02:00
kiyan
1fe211eda0 fix: update to buf directory implementation 2021-10-01 14:04:07 +02:00
kiyan
9282944078 fix: add option update_to_buf_dir in setup
avoid hijacking the tree for use case of users using vim-dirvish
2021-09-30 12:43:20 +02:00
kiyan
e2e7720caa fix: properly hijack netrw, don't always open on dir
- fix hijack netrw logic
- do not open on directory if open_on_setup is false, but do if the
  window is open.
2021-09-30 12:26:55 +02:00
Sávio Carlos Martins Costa
12e61dd057 fix 'system_open' keypress callback (#655) 2021-09-29 21:16:10 +02:00
kiyan
3633e728e0 chore: refacto view setup and simplify the code 2021-09-26 14:55:49 +02:00
kiyan
591f5d436d fix: remove buffer when replacing window 2021-09-26 12:42:13 +02:00
kiyan
db547dcd41 fix: defer the options check
the new setup refactoring might have some issues when users require the
tree before setting up global options, which might result in a startup
check not detecting those out of date options.
2021-09-26 12:14:20 +02:00
kiyan
1edebb7894 chore: lsp diagnostics setup 2021-09-26 11:56:44 +02:00
kiyan
0ca87178b6 fix: open view on NvimTreeFindFile 2021-09-26 11:36:57 +02:00
WayJam So
d4172928e2 fix: lsp_diagnostics switch reversed. (#635) 2021-09-26 11:31:26 +02:00
Kiyan
a864b80baf chore: refacto setup part 1 (#603)
* chore: refacto setup part 1

refacto setup for code entrypoint
following options switched boolean values as options to the setup function:
- `nvim_tree_disable_netrw` -> `disable_netrw`
- `nvim_tree_hijack_netrw` -> `hijack_netrw`
- `nvim_tree_auto_open` -> `open_on_setup`
- `nvim_tree_auto_close` -> `auto_close`
- `nvim_tree_tab_open` -> `tab_open`
- `nvim-tree-update-cwd` -> `update_cwd`
- `nvim_tree_hijack_cursor` -> `hijack_cursor`
- `nvim_tree_system_open_command` -> `system_open.cmd`
- `nvim_tree_system_open_command_args` -> `system_open.args`
- `nvim_tree_follow` -> `update_focused_file.enable`
- `nvim_tree_follow_update_path` -> `update_focused_file.update_cwd`
Also added new option `update_focused_file.ignore_list` which will
ignore filepath or filetypes that matches one entry of the list when
updating the path if update_cwd is true.

* add deprecation warning

* update readme

* schedule on enter to avoid running before vim first buffer has loaded

* update docs

* correct typo

* rename tab open -> open on tab
2021-09-25 16:43:39 +02:00
kiyan
b1c447946b fix: luacheck, buffer override erroring with mark not set 2021-08-31 21:22:30 +02:00
kiyan
d41ca62320 fix: hide the base dir update on bufenter behind an option 2021-08-30 19:03:43 +02:00
kiyan
66f46b204f fix: change base dir in find file when fname does not start with the path of the root 2021-08-28 15:07:45 +02:00
kiyan
3445d3fefa fix: only hijack current window if tree should open at start 2021-08-28 13:59:05 +02:00
Kiyan
3bac5633e1 feat: open tree on directory (#288) 2021-08-28 11:39:10 +02:00
kiyan
dc630d199a fix: do not auto open if bufname is and buf has content 2021-08-28 11:33:15 +02:00
xeluxee
d74af818c0 system_open: use asynchronous vim.loop to spawn process + let user customize the command to be used to open a file/folder with default system application (#551) 2021-08-14 15:13:56 +02:00
颜贵彬
7014b6aff4 Feat: add focus on tree functionality (#563) 2021-08-14 11:06:56 +02:00
kiyan
6175d63eae fix for luacheck ci 2021-08-08 14:32:56 +02:00
kiyan
e5a534f51b fix: do not block search with hijack cursor 2021-08-08 01:40:07 +02:00
Matthieu ARENE
8bb58daddb Feature: add the possibility to not focus tree on TabEnter when (#545) 2021-08-07 10:02:03 +02:00