Commit Graph

423 Commits

Author SHA1 Message Date
Azad
c1568568b3
feat(#2498): delete, trash prompts default N, added ui.confirm.default_yes option to override this behaviour (#2500)
Co-authored-by: Alexander Courtis <alex@courtis.org>
2023-10-30 12:28:29 +11:00
Azad
78a9ca5ed6
feat: mapping and options to sort entries in help window (#2482)
* feat: add option to sort entries in help window

* stylua

* Add keymap to toggle sorting methods

* Bug fix

---------

Co-authored-by: Alexander Courtis <alex@courtis.org>
2023-10-23 08:57:49 +11:00
Alexander Courtis
db8145c27d
fix(#2459): disable cygwin git support by default, see :help nvim-tree.git.cygwin_support to enable (#2486) 2023-10-21 16:34:34 +11:00
Alexander Courtis
40b9b887d0
fix(#2473): remove problematic <S-Tab> default mapping (#2475) 2023-10-17 10:00:56 +11:00
umlx5h
aaee4cd896
feat: api.node.open.preview_no_picker with default mapping <S-Tab> (#2464)
* feat: add preview with no window picker action

* feat: preview_no_window_picker -> preview_no_picker

---------

Co-authored-by: Alexander Courtis <alex@courtis.org>
2023-10-15 14:04:04 +11:00
Benoit Charles
0882354517
feat(#2148): api.fs.rename_full (#2461)
* feat(#2148): add rename_full in API

* feat(#2148): add default mapping 'u' for rename_full

---------

Co-authored-by: Alexander Courtis <alex@courtis.org>
2023-10-15 13:40:40 +11:00
Bram Reyniers
e153d9f599
fix(#2440): view.width.padding may be a number or function returning a number (#2442)
* fix validation view.width.padding

* fix docs for view.width.padding

* fix docs for view.width.padding

---------

Co-authored-by: Alexander Courtis <alex@courtis.org>
2023-10-07 12:21:13 +11:00
Alexander Courtis
7dcda5d3b6
doc(#2440): view.width.padding may only be a string (#2441) 2023-10-02 14:38:11 +11:00
Alexander Courtis
07eb5b4059
docs: notify deprecated hide_root_folder (#2431) 2023-09-24 15:15:19 +10:00
Alexander Courtis
d49a284236
feat(#2411): add renderer.highlight_bookmarks, renderer.icons.bookmarks_placement (#2412)
* feat(#1079): add highlight NvimTreeCopiedText and NvimTreeCutText

* feat(#1079): add highlight NvimTreeCopiedText and NvimTreeCutText

* feat(#1079): node may not be present in copy and cut

* feat(#2411): bookmark highlight and icon placement

* feat(#1079): add renderer.highlight_clipboard

* feat(#1079): add renderer.highlight_clipboard

* feat(#2411): bookmark highlight and icon placement

* feat(#2411): bookmark highlight and icon placement

* style

* feat(#2411): bookmark highlight and icon placement

* feat(#2411): bookmark highlight and icon placement

* feat(#2411): bookmark highlight and icon placement

* feat(#2411): bookmark highlight and icon placement
2023-09-24 15:07:02 +10:00
Azad
914a6868cb
docs: add missing quotes (#2424) 2023-09-23 12:06:48 +10:00
Alexander Courtis
a3aa3b47ea
feat(#1079): add renderer.highlight_clipboard default name, defaults to undercurls (#2410)
* feat(#1079): add highlight NvimTreeCopiedText and NvimTreeCutText

* feat(#1079): add highlight NvimTreeCopiedText and NvimTreeCutText

* feat(#1079): node may not be present in copy and cut

* feat(#1079): add renderer.highlight_clipboard

* feat(#1079): renderer.highlight_clipboard takes options, style cut/copy HL

* feat(#1079): renderer.highlight_clipboard takes options, style cut/copy HL

* feat(#1079): use an enum for highlight position

* feat(#1079): diagnostics uses _append_highlight
2023-09-17 16:08:04 +10:00
pr4th4m
7f7665a17b
feat: api.marks.bulk.trash (#2391)
* Feature: Bulk trash api

* Update docs

* Follow documentation syntax

* Remove unnecessary refresh

* doc spacing

---------

Co-authored-by: Alexander Courtis <alex@courtis.org>
2023-09-16 15:10:36 +10:00
Alexander Courtis
b7f6600bc2
feat(#2197): git and diagnostics folder highlight groups (#2409)
* feat(#2197): add git folder highlight groups

* feat(#2197): add diagnostics folder highlight groups
2023-09-09 15:13:14 +10:00
Alexander Courtis
8f48426c88
feat(#2316): add NvimTreeFolderArrowClosed NvimTreeFolderArrowOpen (#2408) 2023-09-09 14:21:25 +10:00
Alexander Courtis
33c3bc562b
feat(#2398): add NvimTreeOpenedFileIcon (#2407) 2023-09-09 13:31:40 +10:00
Alexander Courtis
277632fbd9
docs: enhance quickstart, document git timeouts (#2400)
* doc: clarify git and remove bookmarks

* doc: break up quickstart
2023-09-03 16:36:37 +10:00
Alexander Courtis
a2b6e5ad2a
docs: help sections and tidy (#2399)
* doc: add nvim-tree-options, sort root level options

* doc: reorder default options, add sections

* doc: collapse opts spacing and tidy

* doc: tidy highlight groups
2023-09-03 15:52:33 +10:00
Alexander Courtis
323f65cb9c
feat(#1917): add diagnostic highlighting and icon placement (#2396)
* feat(#1917): add renderer.highlight_diagnostics

* feat(#1917): add renderer.highlight_diagnostics

* feat(#1917): add enderer.icons.diagnostics_placement

* feat(#1917): add renderer.icons.show.diagnostics

* feat(#1917): document highlight overrides
2023-09-03 12:29:33 +10:00
Antonio Sarosi
b144b33390
feat(#2369): add full renderer.icons.web_devicons options for file and folder (#2375)
* Add `webdev_colors_folder` option

* Check if `M.devicons` exists

* Refactor `get_folder_icon`

* Add configuration options for both files and folders

* web_devicons.*.enabled -> enable

* silent migration: renderer.icons.webdev_colors -> renderer.icons.web_devicons.file.color

* silent migration: renderer.icons.webdev_colors -> renderer.icons.web_devicons.file.color

---------

Co-authored-by: Alexander Courtis <alex@courtis.org>
2023-08-26 14:42:44 +10:00
Azad
d11d701857
feat(#2364): add option to sort files first (#2366)
* feat(#2364): add option to show files first

* Refactor `folders_or_files_first` function

* Improve readability

* Remove `fallback` from `folders_or_files_first` function

---------

Co-authored-by: Alexander Courtis <alex@courtis.org>
2023-08-26 14:15:56 +10:00
Devansh Sharma
dea82ae207
docs: fix typo in API Node section (#2381) 2023-08-18 23:54:16 +02:00
Alexander Courtis
18c7a31198
chore: remove legacy view.mappings.list (#2371) 2023-08-14 17:41:55 +10:00
Alexander Courtis
116b88564f
chore: use stdpath "log" rather than "cache" (#2372) 2023-08-14 11:03:38 +10:00
Alexander Courtis
0a54dcb76b
fix: trash.cmd defaults to 'trash' on macos and windows, document option (#2336)
* fix: trash.cmd defaults to 'trash' on macos

* fix: macOS and windows default trash commands, allow trash on all OS

* fix: windows default trash command doc

* fix: trash.cmd message
2023-08-13 12:18:06 +10:00
Alexander Courtis
6c3ddcbc10
doc: sort.sort_folders_first -> sort.folders_first (#2355) 2023-08-06 10:50:51 +10:00
Danila Usachev
4bd30f0137
feat: add actions.open_file.eject (#2341)
* feat: added prevent_buffer_override option to allow in-place opens by :e

* Moved option check inside the callback

* Renamed option to eject
2023-07-29 17:45:03 +10:00
linrongbin16
75c05742bc
feat(trash): add synchronized trash support for windows (#2335)
* feat(trash): support 'trash' on Windows

* feat(trash): need sync wait on Windows to avoid switch to other app from nvim process

* doc: remove 'Only available for UNIX'

* doc(trash): highlight 'Trash' on Windows is syncrhonized

* doc(trash): highlight 'trash' on Windows is synchronized

* doc(trash): remove dot

* fix(trash): check for unix and windows

* fix(trash): comment

---------

Co-authored-by: Alexander Courtis <alex@courtis.org>
2023-07-29 17:34:47 +10:00
Stefano Stoduto
3b62c6bf2c
feat(event): add TreeRendered (#2324)
* add TreeRendered event

* pass bufnr and winnr to TreeRendered event

---------

Co-authored-by: Alexander Courtis <alex@courtis.org>
2023-07-16 17:22:45 +10:00
Alexander Courtis
697bfaccac
feat: add filters.git_ignored (prev git.ignore), apply "Toggle Filter:" prefix to mapping descriptions (#2325) 2023-07-16 13:26:03 +10:00
Alexander Courtis
ef305a888b
feat(#2313): sort_by -> sort.sorter, add sort.folders_first default true (#2314)
* feat(#2313): add sort_folders_first, default true

* feat(#2313): add sort.sorter, sort.folders_firs
2023-07-15 15:20:22 +10:00
Cyber Oliveira
a708bd2413
feat: add sort_by "suffix" (#2307)
* feat: adds new type of sorting based on the filename's suffix

* chore(syntax): using string colon methods

* fix(regex): use alphanumeric match for extensions

* feat: adds new type of sorting based on the filename's suffix

---------

Co-authored-by: Alexander Courtis <alex@courtis.org>
2023-07-09 13:49:41 +10:00
Cyber Oliveira
3d2fd90b28
feat: add sort_by "filetype" (#2302)
* feat: adds new type of sorting based on vim's filetype detection

* fix(ft/sorter): fallbacks to C.name when both ft's are nil or equal

* feat: adds new type of sorting based on vim's filetype detection

---------

Co-authored-by: Alexander Courtis <alex@courtis.org>
2023-07-09 12:31:06 +10:00
Asror
3cc698b35b
feat(#2270): add notify.absolute_path - show file or absolute path (default) names with notifications (#2286)
Co-authored-by: Alexander Courtis <alex@courtis.org>
2023-06-25 13:06:21 +10:00
Svetlozar Iliev
c3c6544ee0
feat(event): add WillCreateFile, WillRemoveFile (#2273)
node. These are mostly going to be useful for implementing lsp file
operation actions.

Co-authored-by: Alexander Courtis <alex@courtis.org>
2023-06-19 10:00:55 +10:00
Alexander Courtis
bdceaf5096
feat(#1804): add api.marks.bulk.delete with default bd mapping (#2276) 2023-06-18 14:09:11 +10:00
Felix Kästner
e0c7eb5044
docs: fix typo in netrw section (#2264) 2023-06-11 16:54:31 +02:00
Alexander Courtis
63061404f4
feat(#1837): add git.disable_for_dirs (#2239)
* feat(##1837): add git.disabled_dirs

* feat(#1837): add git.disable_for_dirs

* feat(#1837): note disable_for_dirs evaluation
2023-06-04 14:29:04 +10:00
Alexander Courtis
73ab6651db
docs: add on_attach to quickstart (#2256) 2023-06-04 14:09:49 +10:00
Alexander Courtis
58d1014324
docs: add on_attach to quickstart (#2236) 2023-06-04 14:02:32 +10:00
Alexander Courtis
e2a4c9d09d
docs: clarify git icon positions (#2235) 2023-05-27 16:23:33 +10:00
Alexander Courtis
164eb10cbd
fix(#2104): remove experimental.git.async, always used (#2234) 2023-05-27 15:11:29 +10:00
Alexander Courtis
9ef6c3cd88
docs: add nvim-tree-netrw (#2222)
* docs: add nvim-tree-netrw

* docs: add nvim-tree-netrw
2023-05-24 12:09:23 +10:00
Alexander Courtis
b1e074d2b5
feat: add winid parameter for api.tree.open, toggle, find_file (#2213)
* feat: add winid parameter for api.tree.open, toggle, find_file

* feat: add winid parameter for api.tree.open, toggle, find_file
2023-05-21 17:37:22 +10:00
DoctorKnowsBetter
736c7ff590
feat: add NvimTreeSymlinkIcon (#2198)
* #2193 Add the ability to change the icon color for "symlink_formatted"

* Remove defaults and update doc #2198

---------

Co-authored-by: DoctorKnowsBetter <you@example.com>
Co-authored-by: Alexander Courtis <alex@courtis.org>
2023-05-15 10:54:36 +10:00
James Tan
98b76ff0a2
feat: add NvimTreeNormalFloat (#2167)
* feat: add `NormalFloat` hl for floating windows

* fix: follow default floatwin bg color

---------

Co-authored-by: Alexander Courtis <alex@courtis.org>
2023-05-06 15:33:17 +10:00
gegoune
0df384b6c0
feat(api): add node.open.drop() (#2164)
Co-authored-by: Alexander Courtis <alex@courtis.org>
2023-04-30 09:35:25 +02:00
Alexander Courtis
74996b8626
docs: clarify on_attach example, quick start (#2165)
* doc: more on_attach examples

* doc: human readable mappings help

* doc: human readable mappings help

* doc: more on_attach examples

* doc: enhance quick start

* doc: enhance quick start

* doc: enhance quick start

* doc: enhance quick start

* doc: enhance quick start

* doc: enhance quick start
2023-04-29 17:00:40 +10:00
Alexander Courtis
13c714681f
fix(#2157): use stdpath cache for nvim-tree-on-attach.lua (#2159)
* fix(#2157): use stdpath cache for my_on_attach.lua

* fix(#2157): my_on_attach.lua -> nvim-tree-on-attach.lua
2023-04-23 13:09:49 +10:00
hinell
d68b00a63e
feat(api): Add new node selection action based on tab :drop command (#2161)
Co-authored-by: gegoune <dev@clog.rocks>
2023-04-23 02:41:21 +03:00
Alexander Courtis
f8bb6b4c76
feat(#1974): enable experimental.git.async by default, see https://github.com/nvim-tree/nvim-tree.lua/issues/2104 (#2158) 2023-04-22 13:22:30 +10:00
Alexander Courtis
a774fa186c
feat(api): add tree.is_visible, tree.is_tree_buf (#2150)
* feat(api): add api.tree.is_visible

* feat(api): add api.tree.is_tree_buf
2023-04-18 16:51:57 +10:00
Alexander Courtis
e99616bebe doc: tidy quick start, enhance on_attach 2023-04-18 14:38:57 +10:00
Anshuman Medhi
8f392fa763
fix(#2126): custom window pickers may create windows (#2140)
call nvim_list_wins again after the picker is run
2023-04-16 15:58:10 +10:00
Alexander Courtis
6ad5c26f4d
feat(#2079): sort_by may return predefined sort (#2123)
* feat(#2079): prefactor

* feat(#2079): sort_by may return a predefined string
2023-04-15 15:53:40 +10:00
Eden Lentz
f3dbddf8b3
feat(renderer): add NvimTreeSymlinkFolderName (#2000)
* Added FolderSymlink color that is applied in builder.lua

* changed highlight names and links, changed folder build function

* remove NvimTreeSymlinkFolderName

---------

Co-authored-by: Alexander Courtis <alex@courtis.org>
2023-04-15 15:24:50 +10:00
Alexander Courtis
e16083cb01
deprecated(#1808): hide_root_folder (#2124) 2023-04-12 16:02:48 +10:00
Alexander Courtis
48d53a5934
feat(#1669): remove deprecated open_on_setup mechanisms (#2122) 2023-04-11 14:53:27 +10:00
Alexander Courtis
086bf310bd
docs: complete API (#2115)
* doc: correct api.tree.expand_all

* doc: add Event.WillRenameNode

* doc: api git, events, live_filter, marks

* doc: api fs

* doc: api tidy

* doc: api index

* doc: api tidy

* doc: api index
2023-04-09 14:11:03 +10:00
Alexander Courtis
d1410cb089
docs: :help for api.node (#2106) 2023-04-04 16:32:32 +10:00
Alexander Courtis
0ef3d4613f
feat(#1974): experimental.git.async see https://github.com/nvim-tree/nvim-tree.lua/issues/2104 (#2094)
* async git watcher reload; callback hell for now

* async git watcher reload; revert unnecessary extractions

* async git watcher reload; callback and non-callback functions are required for sync codepaths that loop

* async git watcher reload

* async git watcher reload

* feat(#1974): experimental.git.async

* feat(#1974): experimental.git.async
2023-04-03 16:20:52 +10:00
Alexander Courtis
0c9bfe7225
feat(#2092): add api.node.navigate.open.next, prev (#2093)
* feat(#2092): add api.node.navigate.open.next, prev

* feat(#2092): add api.node.navigate.listed.next, prev

* feat(#2092): add api.node.navigate.opened.next, prev

* feat(#2092): add api.node.navigate.opened.next, prev
2023-04-03 14:23:03 +10:00
Alexander Courtis
45400cd7e0
feat(api): add api.commands.get (#2083)
* feat(commands): add descriptions

* Update lua/nvim-tree.lua

Co-authored-by: gegoune <69750637+gegoune@users.noreply.github.com>

* feat(commands): add descriptions, extract to commands.lua

* feat(commands): add descriptions, add api.get_commands

* feat(commands): add descriptions, api.get_commands -> api.commands.get

---------

Co-authored-by: gegoune <69750637+gegoune@users.noreply.github.com>
2023-03-28 10:52:48 +11:00
Zhizhen He
aa9971768a
doc: spelling (#2070) 2023-03-21 16:39:45 +11:00
Gaétan Lepage
a50723e35f
fix(doc): duplicate help tag in README (#2066) 2023-03-20 13:52:53 +02:00
Alexander Courtis
4f036342f1
feat(api): add api.config.mappings.get_keymap and get_keymap_default (#2056)
* feat(api): add api.config.mappings.get_keymap and get_keymap_default

* feat(api): add api.config.mappings.get_keymap and get_keymap_default
2023-03-20 11:23:45 +11:00
Alexander Courtis
fe980baa94
feat(api): api.tree.find_file feature parity with open/toggle, convert all commands to API, document commands (#2039)
* fix(#1212): API find file feature parity

* fix(#2011): API find file feature parity

* fix(#2011): API find file feature parity

* fix(#2011): API find file feature parity

* fix(#2011): API find file feature parity

* fix(#2011): API find file feature parity

* fix(#2011): API find file feature parity

* fix(#2011): API find file feature parity
2023-03-13 16:53:20 +11:00
Alexander Courtis
6e4b3b1868 doc: clarify setup() expense and purpose 2023-03-13 12:15:36 +11:00
Alexander Courtis
bbb6d48910
feat(api): add api.config.mappings.default_on_attach (#2037) 2023-03-06 10:45:58 +11:00
Alexander Courtis
1b453441f4 doc: case sensitive rename is not possible on macOS with case insensitive file systems 2023-03-04 15:02:01 +11:00
Alexander Courtis
74959750f7
feat: automated migration from view.mappings.list to on_attach, see https://github.com/nvim-tree/nvim-tree.lua/wiki/Migrating-To-on_attach (#1579)
* chore(mappings): migrate legacy mappings under the hood

* chore(mappings): POC for help and :help on_attach keymaps

* chore(mappings): POC for help and :help on_attach keymaps

* chore(mappings): add desc to all mappings, show in help, reformat help

* chore(mappings): add desc to all mappings

* chore(mappings): add desc to all mappings

* chore(mappings): escape help keys

* chore(mappings): migrate legacy mappings under the hood: map keymap to legacy mappings

* chore(mappings): migrate legacy mappings under the hood: remove dispatch

* Revert "chore(mappings): migrate legacy mappings under the hood: remove dispatch"

This reverts commit f6f439ba59.

* chore(mappings): migrate legacy mappings under the hood: pass node to action_cb

* chore(mappings): migrate legacy mappings under the hood: remove dispatch

* chore(mappings): migrate legacy mappings under the hood: replace mappigns with keymaps in help

* chore(mappings): generate on_attach from user's legacy mappings

* chore(mappings): generate on_attach from user's legacy mappings

* chore(mappings): merge cleanup

* chore(mappings): use default mappings when on_attach not present, log legacy migration

* on_attach is default or user only, legacy and generation includes defaults (#1777)

* chore(mappings): remove mappings via vim.keymap.del instead of filtering mappings, to allow for multiple ways of specifying a key

* doc: specify that the terminal emulator must be configured to use the patched font

* feat(renderer): add NvimTreeOpenedFolderIcon NvimTreeClosedFolderIcon (#1768)

* feat: Add highlight group for opened folder

closes #1674

* docs: Add NvimTreeOpenedFolderIcon default

* feat: Add NvimTreeClosedFolderIcon highlight group

Defaults to NvimTreeFolderIcon

* feat: add diagnostics.show_on_open_dirs git.show_on_open_dirs (#1778)

* feat(diagnostics): only show diagnostic on closed folder

* feat(git): only show git icon on closed folder

* docs: Update feature_request.md (#1788)

* Update feature_request.md

Closes #1654

* Update feature_request.md

Co-authored-by: Alexander Courtis <alex@courtis.org>

* 1786 git next prev land on dirs (#1787)

* Filtered dir with git status that are open when show_on_open_dir is false

* refactored for single source of truth of existence of git status on a node

Putting `has_git_status()` in `explorer.common` because that's where node.status is constructed
Or at least I think that's where it's constructed

* 1786 semantic nit

Co-authored-by: Alexander Courtis <alex@courtis.org>

* fix(git): git rename not showing up for the renamed file (#1783)

* fixed git rename not showing up for the renamed file

* considered " -> " being a part of the filename

Fixed -> pattern to escape -
Fixed "\"" and "\\" in filename

* using string.find(, , true) to match plain ->

* Using -z and removed unnecessary logic

* feat(view): always enable cursorline, users may change this behaviour via Event.TreeOpen (#1814)

* Update view.lua

* set cursorline to true

* feat(event): dispatch Event.NodeRenamed on cut-paste (#1817)

* feat(view): add filters.git_clean, filters.no_buffer (#1784)

* feat(view): add filters.git_clean

* feat(view): add filters.git_clean

* feat(view): add filters.no_buffer

* feat(view): filters.no_buffer misses unloaded, handles buffer in/out

* feat(view): filters.no_buffer matches directories specifically

* feat(view): filters.no_buffer clarify targets

* feat: add placeholder filters.diagnostics_ok, refactor filters

* feat(view): remove placeholder filters.diagnostics_ok

* doc: consolidate and clarify :help examples

* doc: format help

* feat: paste and create always target closed folder, remove create_in_closed_folder (#1802)

* Fix default for file creation in closed directories

* Make paste in closed directories consistent with create

* doc: clarify create_in_closed_folder

* Remove create_in_closed_folder option

* doc: clarify create_in_closed_folder removal message (whoops)

Co-authored-by: Alexander Courtis <alex@courtis.org>

* on_attach is user's or default, nothing else; legacy generated on_attach includes defaults

Co-authored-by: baahrens <bahrens@compeon.de>
Co-authored-by: Richard Li <38484873+chomosuke@users.noreply.github.com>
Co-authored-by: gegoune <69750637+gegoune@users.noreply.github.com>
Co-authored-by: rishabhjain9191 <rishabh.jain9191@gmail.com>
Co-authored-by: Anton <14187674+antosha417@users.noreply.github.com>
Co-authored-by: Eric Haynes <ehaynes99@gmail.com>

* on_attach_default hardcoded

* format default_on_attach

* source default on_attach directly

* remove human mappings help

* simplified on_attach generation

* simplified on_attach generation

* generate default on_attach

* generate default on_attach

* split out keymap_legacy

* add recently introduced mappings

* legacy api.config.mappings.active and default

* legacy api.config.mappings.active and default

* on_attach help and readme

* legacy generate handles action = ""

* legacy generate handles action =

* legacy generate gives defaults when no user mappings

* legacy generate handles action = ""

* legacy generate api handles overrides

* legacy generate handles subsequent setup, on_attach retains deep copies of legacy config

* add wiki link to generated on_attach

* add opts helper function for on_attach, prefixing 'nvim-tree: '

---------

Co-authored-by: kiyan <yazdani.kiyan@protonmail.com>
Co-authored-by: baahrens <bahrens@compeon.de>
Co-authored-by: Richard Li <38484873+chomosuke@users.noreply.github.com>
Co-authored-by: gegoune <69750637+gegoune@users.noreply.github.com>
Co-authored-by: rishabhjain9191 <rishabh.jain9191@gmail.com>
Co-authored-by: Anton <14187674+antosha417@users.noreply.github.com>
Co-authored-by: Eric Haynes <ehaynes99@gmail.com>
2023-02-27 14:19:50 +11:00
Alexander Courtis
bcb969c869
doc(#1997): clarify renderer.highlight_ and correct highlight group names (#2007) 2023-02-19 11:24:35 +11:00
Alexander Courtis
36e29c3a95
fix(#1970): disable git integration after 5 timeouts (#1990)
* fix(#1970): additional log function gating for efficiency when not logging

* fix(#1970): additional log function gating for efficiency when not logging

* fix(#1970): disable git integration after 10 timeouts

* fix(#1970): disable git integration after 10 timeouts

* fix(#1970): disable git integration after 10 timeouts

* fix(#1970): cleanly kill timed out git processes

* fix(#1970): revert git kill, to be completed via #1974 experiment

* fix(#1970): revert git kill, to be completed via #1974 experiment
2023-02-12 14:28:48 +11:00
Alexander Courtis
215b29bfad
feat(api): api.tree.open feature parity with api.tree.toggle (#1955) 2023-01-31 12:27:10 +11:00
Alexander Courtis
9fcd50d3e1 doc: clarify open/toggle defaults, more robust legacy argument handling 2023-01-30 11:49:21 +11:00
Alexander Courtis
fb775b3353
feat(view): deprecate open_on_setup.* in favour of https://github.com/nvim-tree/nvim-tree.lua/wiki/Open-At-Startup (#1951) 2023-01-30 10:10:41 +11:00
Peter van der Meulen
e05ed6a60f
feat(view): add view.width.padding (#1941)
* fix: variable width accounts for sign/number columns

* Add dynamic sizing padding options

with https://github.com/neovim/neovim/pull/20621 merged in it is now
possible to fully customize the status-column in nvim (the column on the
left containing line-numbers, fold info, signs and borders).

A fair few cool implementations have popped up like:
- https://github.com/CKolkey/config/blob/master/nvim/after/plugin/statuscolumn.lua
- https://github.com/luukvbaal/statuscol.nvim
- and my own personal one (based on CKolkey's fantastic work) https://git.hendrikpeter.net/hendrikpeter/pico-vim/-/blob/main/lua/peva/status_column.lua

The problem with nvim-tree however is that dynamic sizing doesn't take
the custom size of a status column into account and the end of file
names get clipped off. This little patch should fix that (and give some
examples to help other status_column modders get started).

Thanks for looking at this and thanks for making this amazing plugin,
I've been using it for a while and I really like it!

* allow padding function, update docs, rollback readme

* typo in example setup

* help formatting

---------

Co-authored-by: Alexander Courtis <alex@courtis.org>
2023-01-28 14:07:14 +11:00
Alexander Courtis
9e87ee2d6e fix(#1940): NvimTreeFindFileToggle focus tree 2023-01-26 10:38:47 +11:00
Joanjajas
7944e479c1
doc: fix incorrect tag (#1938) 2023-01-24 12:55:59 +11:00
Alexander Courtis
f1c2d6d372
feat(api): api.tree.open/toggle: add current_window option (#1935)
* feat(api): api.tree.open: add current_window option

* feat(api): api.tree.toggle: add current_window option

* feat(api): api.tree.toggle: add current_window option

* doc: api.tree.*

* doc: api.tree.*
2023-01-24 08:30:49 +11:00
ramezgerges
96506fee49
feat(view): add view.width.min/max replacing adaptive_size, allowing upper bound (#1915)
* feat: max_width for adaptive_size

* view grow calculates size correctly based on sign column visibility

* limit width to a minimum of 20

* adaptive_size -> min/max table

* harden view size calculations against bad user input

* style

* add back an extra column of padding to adaptive resizing

* back out: limit width to a minimum of 20

* revert unnecessary change

* backout: view grow calculates size correctly based on sign column visibility

* remove adaptive_size from help

* backout unnecessary change M.View.config

Co-authored-by: Alexander Courtis <alex@courtis.org>
2023-01-21 15:21:18 +11:00
Alexander Courtis
13adc94e8e doc: clarify system_open, specifying defaults 2023-01-21 11:54:24 +11:00
Alexander Courtis
e8a89db1bb doc: move vinegar-style to wiki 2023-01-17 12:02:42 +11:00
Alexander Courtis
1b13a49f91
fix(#1916): suppress EPERM watcher failures on windows (#1919) 2023-01-16 13:00:57 +11:00
Alexander Courtis
1f0fc8d6e8
feat(event): add au, global: NvimTreeRequired, NvimTreeSetup (#1912)
* feat(even): add autocommands NvimTreeRequired, NvimTreeSetup

* feat(event): add vim.g.NvimTreeRequired, vim.g.NvimTreeSetup
2023-01-15 10:12:50 +11:00
Telman Babayev
ccb6d8a518
feat: add ui.confirm.remove and ui.confirm.trash, deprecate trash.require_confirm (#1887)
* Implement turning off y/n prompt for file deletion

* Refactor different prompt configs to single ui table

* Remove unused fields

* add ui.confirm doc, format/tidy

* trash.require_confirm -> ui.confirm.trash

* Fix nil value trash field

Co-authored-by: Alexander Courtis <alex@courtis.org>
2023-01-08 17:43:01 +11:00
Alexander Courtis
f43f3110a5
feat(event): add TreeAttachedPost (#1877)
* feat(event): add OnAttachPost

* feat(event): add TreeAttachPost

* feat(event): add TreeAttachPost

* feat(event): TreeAttachedPost fired after all mappings created, not just on_attach
2023-01-07 11:50:41 +11:00
Alexander Courtis
bac962caf4
feat(api): add api.config.mappings.active, api.config.mappings.default (#1876)
* feat(api): add config.mappings.current and config.mappings.default

* feat(api): add config.mappings.current and config.mappings.default

* feat(api): add config.mappings.current and config.mappings.default
2023-01-03 13:13:49 +11:00
Richard Li
951b6e7e55
fix(#1836): add view.debounce_delay (#1871)
* fix(#1836):add view.debounce_delay to avoid some unnecessary explorer reloads

* fixed BufReadPost & BufUnload nil pointer

* update_focused_file.debouce_delay to view.debounce_delay

* changed docs to be more accurate

* added debounce on modified update

* Using same event for filter buffer

* removed unused View.debounce_delay

* changed docs to be more accurate

Co-authored-by: doot <gugegby@gmail.com>
Co-authored-by: Alexander Courtis <alex@courtis.org>
2023-01-02 07:32:56 +11:00
Richard Li
dcc344cc72
feat(view): indicate modified buffers (#1835)
* Outlined new options

* highlight_modified is highlight_opened_files

* prototype with autocmd

* moved modified into glyphs

* show_on_dirs and show_on_open_dirs

* icon placement before & after

* _get_filename_offset

* fixed :wq doesn't update modified indicator

* highlight_modified, signcolumn modified_placement

Refactored to make everything use HighlightedString to remove all the complex `insert_highlight` calculation.
Not tested.

* updated doc to match the reality of no multi char for glyphs.modified

* fixed git signcolumn doesn't show

* fixed highlight_modified gets replaced by highlight_opened_files

* fixed renderer.icons.show.modified = false crash

* updated doc to reflect empty icon not breaking rendering

* removed debounce_delay to implement in a later PR

* doc nit: order placement

* change modified dirs default to be consistent with git

* illegal git & modified placement changed to default

* don't assume icon exist

* nit remove comment

* Noted in doc that glyphs can't have more than 2 characters if in signcolumn

* Don't sign_define if placement isn't signcolumn

Co-authored-by: Alexander Courtis <alex@courtis.org>
2022-12-31 15:54:04 +11:00
youkwhd
9ad93b6ac0
feat(view): add view.cursorline (#1859)
* feat(#1814): added cursorline config to DEFAULT_OPTS

Extends #1814

Currently, the config cursorline is set to `true` by default.

This behaviour can only be changed by a hacky way of listening to an event, as @alex-courtis mentioned that: "The user can change this default if they want via event".

This PR generalizes the configuration to be easier to config via the function `setup()`.

* doc: add cursorline

Co-authored-by: Alexander Courtis <alex@courtis.org>
2022-12-31 15:27:31 +11:00
Alexander Courtis
3c4958ab3d
fix(#1831): remove windows executable functionality due to occasional vim freeze and performance concerns (#1868)
* #1831 exploratory testing: disable file executable checks

* fix(#1831): remove windows executable functionality
2022-12-31 12:34:55 +11:00
Richard Li
29788cc32a
fix(git): git folder fixes and improvements (#1809)
* coding style

* outlined git.show_on_open_dirs behavior

* show some icon on opendir even if show_on_open_dir=false

and show all children's status on parent

* fixed renamed icon not showing

* sorted icons

* removed DU from deleted as file will show up in tree

* fixed update_git_status in reloaders not tested

* fixed Api.git.reload()

Tested update_git_status in reloaders.lua

* sort icon only if not git signcolumn

* fixed crashing when root dir isn't git dir

* made git.show_on_dirs doc more concise

* git_statuses -> git_status for consistency

* explorer/common.lua -> explorer/node.lua

* fixed #1784 conflict

* don't order icons

* Revert "don't order icons"

This reverts commit 23f6276ef7.
2022-12-17 17:05:33 +11:00
Alexander Courtis
87409bb4af
fix(#1815): don't schedule find_file calls, debounce update_focused_file with 15ms default (#1828)
* Revert "Revert "fix(#1815): don't schedule find_file calls, debounce update_focused_file with 15ms default (#1820)""

This reverts commit a8d26bb088.

* fix(#1723): find_file for externally created new file results in folder unable to be opened

* fix(#1723): find_file for externally created new file results in folder unable to be opened
2022-12-16 15:35:09 +11:00
David Sierra DiazGranados
d85b6718ce
feat(picker): allow custom function actions.open_file.window_picker.picker (#1782)
* feat: allow passing a custom function as a window picker

WIP

* fix: move logic expression to if statement

If `M.window_picker.custom_function()` returns `nil` then `pick_win_id()`
will run (the or part). We don't want that. More verbose, but better.

* feat(open): add window_picker.picker

* feat(open): add window_picker.picker

* style nit

* feat(open): add window_picker.picker

* docs: add window_picker.picker documentation

* docs: add window_picker.picker documentation

Co-authored-by: Alexander Courtis <alex@courtis.org>
2022-12-16 15:14:33 +11:00
Alexander Courtis
cdb40dc42e neovim requirement 0.7.0 -> 0.8.0, remove WinSeparator/VertSplit compatibility shims 2022-12-16 13:45:16 +11:00
Ian Homer
949913f186
feat(api): rename_basename API and action (#1791)
* relative rename action

* 🔥 remove debug print statement

* 🐛 better handling of dot files

Also pickout extension in filename with more one dot

* 🔧 keymap e for relative-rename action

* 📝 update help with relative-rename mapping

*  add API for rename_relative

* 🚨 correct lint warnings

* rename_relative -> rename_root

* stylua

* ♻️ use fnamemodify instead of custom logic

* 💥 refactor renaming api using vim filename modifiers

Rename API now supports filename modifiers as arguments, although
only with limited support of options. The function signature however
will allow improvements going forward. The API signature is backward
compatible, although the behviour has changed as per the next comment.

This change changes the default behaviour of the renames, rename_full is
what rename was, rename now just renames the tail (i.e. the filename)

* 🐛 make api rename, without args, functional

*  allow modifier argument to be used in API call

* 📝 update documentation with new command name

* rename-file.fn takes only a modifier as argument

* add Api.fs.rename_basename, specify modifiers for rename, rename_sub

* add Api.fs.rename_node

* rename-file tidy allowed modifiers

* 🐛 fix bugs after last refactoring

rename ":t" and ":t:r" was moving file to root of project and not
maintaining sub-directory

* 🐛 correct absolute rename

which was loosing sub-directory on rename

* 🔥 remove debug print statements

* stylua

Co-authored-by: Alexander Courtis <alex@courtis.org>
2022-12-16 13:32:48 +11:00
Alexander Courtis
a8d26bb088 Revert "fix(#1815): don't schedule find_file calls, debounce update_focused_file with 15ms default (#1820)"
This reverts commit 623cecb809.
2022-12-16 13:15:32 +11:00
Alexander Courtis
623cecb809
fix(#1815): don't schedule find_file calls, debounce update_focused_file with 15ms default (#1820)
* fix(#1815): don't schedule find file calls

* fix(#1815): debounce BufEnter find_file

* fix(#1815): deprecate nvim-tree.find_file

* fix(#1815): debounce BufEnter find_file

* fix(#1815): debounce BufEnter find_file
2022-12-16 13:01:37 +11:00
Eric Haynes
7177d95ac0
feat: paste and create always target closed folder, remove create_in_closed_folder (#1802)
* Fix default for file creation in closed directories

* Make paste in closed directories consistent with create

* doc: clarify create_in_closed_folder

* Remove create_in_closed_folder option

* doc: clarify create_in_closed_folder removal message (whoops)

Co-authored-by: Alexander Courtis <alex@courtis.org>
2022-12-11 14:40:38 +11:00