ms-jpq / chadtree Goto Github PK
View Code? Open in Web Editor NEWFile manager for Neovim. Better than NERDTree.
File manager for Neovim. Better than NERDTree.
Please check here. Shougo/defx.nvim#220
Hi, thanks for this cool plugin.
I found a small issue. When I trying to close the last window that is a chadtree buffer, I get the following exception in the messages area:
Traceback (most recent call last):
File "/home/jubnzv/.local/share/nvim/plugged/chadtree/rplugin/python3/chadtree/__init__.py", line 84, in run
fut.result()
File "/usr/lib/python3.8/concurrent/futures/_base.py", line 439, in result
return self.__get_result()
File "/usr/lib/python3.8/concurrent/futures/_base.py", line 388, in __get_result
raise self._exception
File "/home/jubnzv/.local/share/nvim/plugged/chadtree/rplugin/python3/chadtree/__init__.py", line 104, in run
new_state = await fn(
File "/home/jubnzv/.local/share/nvim/plugged/chadtree/rplugin/python3/chadtree/transitions.py", line 175, in c_quit
await call(nvim, cont)
File "/home/jubnzv/.local/share/nvim/plugged/chadtree/rplugin/python3/chadtree/nvim.py", line 27, in cont
ret = fn()
File "/home/jubnzv/.local/share/nvim/plugged/chadtree/rplugin/python3/chadtree/transitions.py", line 173, in cont
kill_fm_windows(nvim, settings=settings)
File "/home/jubnzv/.local/share/nvim/plugged/chadtree/rplugin/python3/chadtree/wm.py", line 136, in kill_fm_windows
nvim.api.win_close(window, True)
File "/home/jubnzv/.local/lib/python3.8/site-packages/pynvim/api/nvim.py", line 182, in request
res = self._session.request(name, *args, **kwargs)
File "/home/jubnzv/.local/lib/python3.8/site-packages/pynvim/msgpack_rpc/session.py", line 104, in request
raise self.error_wrapper(err)
pynvim.api.common.NvimError: Vim:E444: Cannot close last window
Vim:E444: Cannot close last window
Steps to reproduce:
nvim $(mktemp)
:CHADOpen<cr>
<C-w>o
q
For NERDTree there's a NERDTreeWinSize
to configure the default columns. How do I do that on the chardtree?
From the reddit post I understand that the intention is to eventually create a vim compatible version of chadtree (which I'd love). I'd appreciate having an issue that tracks the progress on vim compatibility (even if it's far future), so that I can subscribe to it and be notified once that lands, so I thought I'd create it. Of course it would also be a good place for discussing the topic.
@ms-jpq Let me know how you feel about that and feel free to close if that's not what you want!
maybe i can show a 🗺 of the window with each one labeled, and users can pick from there
Why set so much gif into the repo.. It makes repo size large. you can upload your gif into an issue. then copy the image url and set them into wiki page.
This happens from time to time when I use fzf.vim / coc-fzf / vimspector. No idea why, perhaps because when the future gets resolved the window is already gone?
-- CHADTree
level: ERROR
time: 2020-08-18 12:24:27
module: __init__
line: 93
function: run
message: |-
Invalid window id
Traceback (most recent call last):
File "/Users/frederick/.vim/plugged/chadtree/rplugin/python3/chadtree/__init__.py", line 91, in run
fut.result()
File "/usr/local/Cellar/[email protected]/3.8.5/Frameworks/Python.framework/Versions/3.8/lib/python3.8/concurrent/futures/_base.py", line 439, in result
return self.__get_result()
File "/usr/local/Cellar/[email protected]/3.8.5/Frameworks/Python.framework/Versions/3.8/lib/python3.8/concurrent/futures/_base.py", line 388, in __get_result
raise self._exception
File "/Users/frederick/.vim/plugged/chadtree/rplugin/python3/chadtree/__init__.py", line 115, in run
await redraw(self.nvim, state=self.state, focus=stage.focus)
File "/Users/frederick/.vim/plugged/chadtree/rplugin/python3/chadtree/transitions.py", line 122, in redraw
await call(nvim, cont)
File "/Users/frederick/.vim/plugged/chadtree/rplugin/python3/chadtree/nvim.py", line 28, in cont
ret = fn()
File "/Users/frederick/.vim/plugged/chadtree/rplugin/python3/chadtree/transitions.py", line 120, in cont
update_buffers(nvim, state=state, focus=focus)
File "/Users/frederick/.vim/plugged/chadtree/rplugin/python3/chadtree/wm.py", line 273, in update_buffers
for window, buffer in find_fm_windows(nvim):
File "/Users/frederick/.vim/plugged/chadtree/rplugin/python3/chadtree/wm.py", line 49, in find_fm_windows
buffer: Buffer = nvim.api.win_get_buf(window)
File "/Users/frederick/Library/Python/3.8/lib/python/site-packages/pynvim/api/nvim.py", line 182, in request
res = self._session.request(name, *args, **kwargs)
File "/Users/frederick/Library/Python/3.8/lib/python/site-packages/pynvim/msgpack_rpc/session.py", line 104, in request
raise self.error_wrapper(err)
For the first time calling :CHADopen
, I got the following error message:
error caught in notification handler '/Users/someone/dotfiles/vim/plugged/chadtree/rplugin/python3/chadtree:command:CHADopen []'
Traceback (most recent call last):
File "/Users/someone/Library/Python/3.7/lib/python/site-packages/pynvim/plugin/host.py", line 145, in _on_notification
handler(*args)
File "/Users/someone/Library/Python/3.7/lib/python/site-packages/pynvim/plugin/host.py", line 86, in _wrap_delayed_function
plugin = cls(self._configure_nvim_for(cls))
File "/Users/someone/dotfiles/vim/plugged/chadtree/rplugin/python3/chadtree/__init__.py", line 57, in __init__
user_config=user_config, user_view=user_view, user_ignores=user_ignores,
File "/Users/someone/dotfiles/vim/plugged/chadtree/rplugin/python3/chadtree/settings.py", line 42, in initial
hl_context = parse_ls_colours()
File "/Users/someone/dotfiles/vim/plugged/chadtree/rplugin/python3/chadtree/ls_colours.py", line 247, in parse_ls_colours
segment.partition("=") for segment in colours.strip(":").split(":")
File "/Users/someone/dotfiles/vim/plugged/chadtree/rplugin/python3/chadtree/ls_colours.py", line 246, in <dictcomp>
for k, _, v in (
File "/Users/someone/dotfiles/vim/plugged/chadtree/rplugin/python3/chadtree/ls_colours.py", line 228, in parseHLGroup
ctermbg = str(cast(AnsiColour, bg).value - 1) if type(fg) is AnsiColour else None
AttributeError: 'NoneType' object has no attribute 'value'
Then I call the :CHADopen
again, it'll show:
no notification handler registered for "/Users/someone/dotfiles/vim/plugged/chadtree/rplugin/python3/chadtree:command:CHADopen"
My environment is:
Hello. Thanks for this package and sharing it with the world.
I was wondering if you kindly could include 2 features I found very important in my workflow.
Thanks in advance.
It would be nice to be able to close the parent directory of the file under the cursor, which would speed up navigating the tree quite a bit. NERDTree offers the x
key mapping, which is quite convenient. The collapse
command closes sub-folders, no command for closing the parent folder available.
A key binding is added to collapse the parent folder.
Possible candidates: P
, X
, <s-`>
P
for "parent", upper-case because p
is already in use
X
for convenience, upper-case because x
is already in use
<s-`>
as `
is used for collapsing sub folders
If none of these are acceptable, no default should be fine as well
Hi,
thanks again for your cool plugin. I have a suggestions:
It would be great if the explorer window would open on the leftmost site with full height. Currently (for me at least), the top-leftmost window (if there are more than one vertically split windows) gets split and used for the browser. See the accompanying screenshot. The cursor was in the bottom-rightmost window, the browser opened in the top-left.
Daniel
Hello !
When I'm in the CHADtree buffer, if I call the expand
function, it returns me an empty string.
: echom expand('%')
It would be great if it could return something like 'CHADtree' as it's useful for some custom behaviors.
For instance, I'm trying to not use the CHADtree buffer if I open a file with fzf
.
With nerdtree you can do something like this
Looks like a cool plugin. Would love to try (the session support is what caught my eye)
here is the output of :UpdateRemotePlugins
getting an import error
Encountered ImportError loading plugin at /home/avraham/.config/nvim/plugged/chadtree
/rplugin/python3/chadtree: cannot import name 'create_task'
Traceback (most recent call last):
File "/home/avraham/.local/lib/python3.6/site-packages/pynvim/plugin/host.py", line
171, in _load
module = imp.load_module(name, file, pathname, descr)
File "/usr/lib/python3.6/imp.py", line 245, in load_module
return load_package(name, filename)
File "/usr/lib/python3.6/imp.py", line 217, in load_package
return _load(spec)
File "<frozen importlib._bootstrap>", line 684, in _load
File "<frozen importlib._bootstrap>", line 665, in _load_unlocked
ImportError: cannot import name 'create_task'
remote/host: python3 host registered plugins []
:version
NVIM v0.4.3
Build type: RelWithDebInfo
LuaJIT 2.0.5
Compilation: /usr/bin/gcc-5 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1 -O2 -g -DMIN_LOG_LE
VEL=3 -Og -g -Wall -Wextra -pedantic -Wno-unused-parameter -Wstrict-prototypes -std=g
nu99 -Wshadow -Wconversion -Wmissing-prototypes -Wvla -fstack-protector-strong -fdiag
nostics-color=auto -DINCLUDE_GENERATED_DECLARATIONS -D_GNU_SOURCE -DNVIM_MSGPACK_HAS_
FLOAT32 -DNVIM_UNIBI_HAS_VAR_FROM -I/home/travis/build/neovim/bot-ci/build/neovim/bui
ld/config -I/home/travis/build/neovim/bot-ci/build/neovim/src -I/home/travis/build/ne
ovim/bot-ci/build/neovim/.deps/usr/include -I/usr/include -I/home/travis/build/neovim
/bot-ci/build/neovim/build/src/nvim/auto -I/home/travis/build/neovim/bot-ci/build/neo
vim/build/include
Compiled by travis@travis-job-9a287301-34f2-4b86-92e3-462594f51f36
Features: +acl +iconv +tui
See ":help feature-compile"
system vimrc file: "$VIM/sysinit.vim"
fall-back for $VIM: "
/home/travis/build/neovim/bot-ci/build/neovim/build/nvim.AppDir/usr/share/nvim"
With the following mapping in my init.vim
nnoremap - :CHADopen<cr>
Every successive press of -
will make the chadtree buffer smaller. It does not happen with any other key, just with -
.
For now I have worked around this by using space instead.
nnoremap <space> :CHADopen<cr>
I suspect this is because it's conflicting with the smaller
option for chadtree.
Thanks for the nice work!
I couldn't get some of the keybindings to work. In particular [.] for toggling hidden files view and Ctrl+r.
Also could you add a shortcut for opening in a new tab?
Hi the plugin looks so interesting but I got problems to load it after many tries.
My environment is:
Here is what I do to install:
Not an editor command: CHADopen
Any insights where I did wrong
重命名文件的时候,名字会出现重复的字符。
I might have a bit of an odd use case which currently prevents me from using this plugin entirely. I track my entire home directory within git and have a .gitignore
file containing just *
so that everything is ignored by default. I can then add what I want into git's view via git add -f <file>
. However, what this means is that unless a file or directory is tracked via git, chadtree won't display it. For the most part, this is a good feature and probably okay as a default. However, in this specific use case, I'm unable to access any other file unless I show hidden files. I don't want to see all my dotfiles, just untracked files and directories. There should be a way to turn off the honoring of .gitignore
for specific directories or something.
I'm a maintainer from the vim-emoji-icon-theme plugin that extends vim-devicons, using icons that are replaced by emojis instead of custom fonts. Will need a lot of work on it, but I'm already using daily.
For NERDTree shows like this:
I want to add support for chadtree. To achieve that this plugin needs to use WebDevIconsGetFileTypeSymbol()
function from the vim-webdevicons plugin to get the icon for the filetype.
Thanks for this cool plugin!
Updated CHADTree today through VimPlug and trying to open the tree in neovim is giving me an error.
Current commit: 81da653
Error:
error caught in notification handler '/home/hplar/.config/nvim/plugged/chadtree/rplugin/python3/chadtree:command:CHADopen []'
Traceback (most recent call last):
File "/home/hplar/.pyenv/envs/neovim3/lib/python3.8/site-packages/pynvim/plugin/host.py", line 145, in _on_notification
handler(*args)
File "/home/hplar/.pyenv/envs/neovim3/lib/python3.8/site-packages/pynvim/plugin/host.py", line 86, in _wrap_delayed_function
plugin = cls(self._configure_nvim_for(cls))
File "/home/hplar/.config/nvim/plugged/chadtree/rplugin/python3/chadtree/__init__.py", line 66, in __init__
settings = initial_settings(
File "/home/hplar/.config/nvim/plugged/chadtree/rplugin/python3/chadtree/settings.py", line 69, in initial
hl_context = parse_ls_colours(colours)
File "/home/hplar/.config/nvim/plugged/chadtree/rplugin/python3/chadtree/ls_colours.py", line 262, in parse_ls_colours
hl_lookup: Dict[str, HLgroup] = {
File "/home/hplar/.config/nvim/plugged/chadtree/rplugin/python3/chadtree/ls_colours.py", line 263, in <dictcomp>
k: parseHLGroup(parse_styling(v), colours=colours)
File "/home/hplar/.config/nvim/plugged/chadtree/rplugin/python3/chadtree/ls_colours.py", line 228, in parseHLGroup
colours.bit8_mapping[cast(AnsiColour, fg).name]
KeyError: 'Grey'
Neovim version:
NVIM v0.4.3
Build type: Release
LuaJIT 2.1.0-beta3
Compilation: /usr/lib/ccache/bin/cc -fstack-clash-protection -D_FORTIFY_SOURCE=2 -mtune=generic -O2 -pipe -g -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1 -O2 -DNDEBUG -DMIN_LOG_LEVEL=3 -Wall -Wextra -pedantic
-Wno-unused-parameter -Wstrict-prototypes -std=gnu99 -Wshadow -Wconversion -Wmissing-prototypes -Wimplicit-fallthrough -Wvla -fstack-protector-strong -fdiagnostics-color=auto -DINCLUDE_GENERATED_DECLAR
ATIONS -D_GNU_SOURCE -DNVIM_MSGPACK_HAS_FLOAT32 -DNVIM_UNIBI_HAS_VAR_FROM -I/builddir/neovim-0.4.3/build/config -I/builddir/neovim-0.4.3/src -I/usr/include -I/builddir/neovim-0.4.3/build/src/nvim/auto -
I/builddir/neovim-0.4.3/build/include
Compiled by void-buildslave@a-hel-fi
Features: +acl +iconv +tui
If you need more info, please let me know.
I'm looking into becoming a chad instead of a nerd, but was initially thrown off by the default colorscheme.
I use gruvbox dark with hard contrast, and the default folder colors are barely visible.
Some icons take on the same color as filenames.
I realize that the colors can be configured, but I think a slightly more nerdy default colorscheme might help.
First, awesome plugin. Thanks for all the work.
I am looking for a NERDTree
alternative, and your plugin is pretty awesome. However, an issue I am having is with what directory does the CHADopen
opens in.
I have this mapping to show as an example:
nnoremap <plug>file_browser :NERDTreeToggle <c-r>=getcwd()<cr><cr>
So let's say I have 2 windows split, but with files in completely different folders. CHADopen
recognizes the folder change if both splits show files in the same root directory. But if one of the windows changes to a different root folder, let's say a different git repo it does not notices the change.
Hopefully this not too confusing 😄
If I open chadtree and expand some nodes and open a few files. Then I call :mksession
it saves the session. If I close vim and reopen and run :source Session.vim
it loads the files I had open and a [No Name
buffer where chadtree was. If I reopen chadtree, it resumes where I left it, but it doesn't repopulate the pane where it was.
Thanks for making a cool NERDTree alternative. When I saw session support I was like whoa!
Maybe I'm doing something wrong. I have python 3.8 and
health#mkdp#check
========================================================================
- INFO: Platform: linux
- INFO: Nvim Version: NVIM v0.4.3
- INFO: Pre build: /home/avraham/.config/nvim/plugged/markdown-preview.nvim/app/bin/markdown-preview-linux
- INFO: Pre build version: 0.0.9
- OK: Using pre build
...
## Python 3 provider (optional)
- INFO: Using: g:python3_host_prog = "/usr/bin/python3.8"
- INFO: Executable: /usr/bin/python3.8
- INFO: Python version: 3.8.5
- INFO: pynvim version: 0.4.1
- OK: Latest pynvim is installed.
CHADTree looks good and sometimes I just want to open it to see where I am XD
So it'd be nice if CHADTree can provide an option somewhat similar as vista.vim
's g:vista_stay_on_open
to move cursor back to the window that I'm working in.
Copied the line from README Plug 'ms-jpq/chadtree', {'branch': 'chad', 'do': ':UpdateRemotePlugins'}
and pasted that into the vim-plug section.
Re-launched nvim and ran PlugInstall
; it did show it installed the plugin.
Re-launched nvim and ran :CHADopen
and got the error from the title.
It would be great if a user could for example press t
and this would run tests for either the file you're cursor is on or a visual selection of those files.
Thoughts?
Hi, thank you for developing and maintaining such a cool plugin.
When termguicolors
is set ( :set termguicolors), the color of chadtree becomes disable.
notermguicolors | termguicolors |
---|---|
Here is a minimal set for reproducing,
init.vim
call plug#begin('~/.vim/plugged')
Plug 'ms-jpq/chadtree', {'branch': 'chad', 'do': ':UpdateRemotePlugins'}
call plug#end()
set termguicolors
$LS_COLORS
export LS_COLORS='di=0;36:fi=0:ln=31:pi=5:so=5:bd=5:cd=5:or=31:mi=0:ex=0;32:*.rpm=0:*.tar=0;31'
I'm not sure resolving this problem is possible as I have not yet looked into the source codes in details..., but the solution will make the plugin more splendid.
Thank you.
I often need to duplicate a file in the same directory and then modify the new file. Right now if I select a file then p
in the same place, CHADTree only tells me that the file already exists then aborts the operation. It'd be great if it can suggest a new name and allow users to modify the suggested name.
As stated in the title, every time I run the comand to open the CHADTree :CHADopen
a new empty buffer appears in my current tab.
I'm on Neovim 0.4.3
MacOS Catalina 10.15.6
I don't know if you have encountered this problem before.
Also, when opening CHADtree there is a flicker which leads me to think that it first creates a split and then resizes, which is only a visual thing, but worth noting in case you haven't yet.
And lastly, the buffer with the tree has line numbers, I don't know if this is something that has to be deactivated by the user manually, but I guess it would be good to have it already implemented.
I love the idea and really want to see it progress!!
Hey, is there any way to do the above?
I copied https://github.com/joshbenham/linux-dotfiles/blob/master/dircolors/Dracula.dircolors to ~/.dir_colors
, what do i need to do?
I would like to open a file/directory with a single <leftmouse>
click. I tried configuring it as you can see in the following vimc:
set runtimepath+=~/.local/share/nvim/plugins/chadtree
set mouse=a
lua vim.api.nvim_set_var("chadtree_settings", { keymap = { primary = {"<leftmouse>"} }})
However, this doesn't work properly. Instead of moving the cursor to the file/dir which I clicked on and opening the respective file/dir, the cursor doesn't move and opens instead the file/dir which it was placed on before clicking on another file/dir.
Nice plugin, looks very promising. Some features missing that I need before I can see myself using it.
Really enjoy the speed. It's already faster than NERDTree. Will be watching this plugin and plan to use it when it is more mature.
As I can see from the readme is talking to close the sidebar but not opening.
There is a toggle command as example?
You may want to add something in your readme about a comparison to COC - explorer. The plugin and even it's bindings are pretty close so for someone coming in you who is comparing a bunch of different file explorer plugins, it might help them to see a comparison of features between the more popular ones.
NVIM v0.5.0-622-gf26df8bb6
Arch Linux
set runtimepath+=~/.local/share/nvim/plugins/chadtree
set mouse=a
:CHADopen<cr>
<cr>
After opening a file chadtree gets resized to the default chadtree-width.
After opening a file chadtree should keep its new width which was adjusted with the mouse.
Getting this python error when calling the open command
Traceback (most recent call last):
File "/Users/mhartington/.config/nvim/.cache/init.vim/.dein/rplugin/python3/chadtree/__init__.py", line 72, in run
fut.result()
File "/usr/local/Cellar/[email protected]/3.7.8_1/Frameworks/Python.framework/Versions/3.7/lib/python3.7/concurrent/futures/_base.py", line 435, in resul
t
return self.__get_result()
File "/usr/local/Cellar/[email protected]/3.7.8_1/Frameworks/Python.framework/Versions/3.7/lib/python3.7/concurrent/futures/_base.py", line 384, in __get
_result
raise self._exception
File "/Users/mhartington/.config/nvim/.cache/init.vim/.dein/rplugin/python3/chadtree/__init__.py", line 89, in run
state = await self._curr_state()
File "/Users/mhartington/.config/nvim/.cache/init.vim/.dein/rplugin/python3/chadtree/__init__.py", line 81, in _curr_state
self.state = await initial_state(self.nvim, settings=self.settings)
File "/Users/mhartington/.config/nvim/.cache/init.vim/.dein/rplugin/python3/chadtree/state.py", line 61, in initial
vc = VCStatus() if settings.version_ctl.defer else await status()
File "/Users/mhartington/.config/nvim/.cache/init.vim/.dein/rplugin/python3/chadtree/git.py", line 70, in status
r, stats = await gather(root(), stat())
File "/Users/mhartington/.config/nvim/.cache/init.vim/.dein/rplugin/python3/chadtree/git.py", line 17, in root
ret = await call("git", "rev-parse", "--show-toplevel")
File "/Users/mhartington/.config/nvim/.cache/init.vim/.dein/rplugin/python3/chadtree/da.py", line 53, in call
proc = await create_subprocess_exec(prog, *args, stdout=PIPE, stderr=PIPE)
File "/usr/local/Cellar/[email protected]/3.7.8_1/Frameworks/Python.framework/Versions/3.7/lib/python3.7/asyncio/subprocess.py", line 217, in create_subp
rocess_exec
stderr=stderr, **kwds)
File "/usr/local/Cellar/[email protected]/3.7.8_1/Frameworks/Python.framework/Versions/3.7/lib/python3.7/asyncio/base_events.py", line 1544, in subproces
s_exec
bufsize, **kwargs)
File "/usr/local/Cellar/[email protected]/3.7.8_1/Frameworks/Python.framework/Versions/3.7/lib/python3.7/asyncio/unix_events.py", line 193, in _make_subp
rocess_transport
self._child_watcher_callback, transp)
File "/usr/local/Cellar/[email protected]/3.7.8_1/Frameworks/Python.framework/Versions/3.7/lib/python3.7/asyncio/unix_events.py", line 941, in add_child_
handler
"Cannot add child handler, "
RuntimeError: Cannot add child handler, the child watcher does not have a loop attached
Cannot add child handler, the child watcher does not have a loop attached
Check my checkhealth
results and python3 is all setup correctly. Not sure where to go from here.
Hello,
It seems i'm able again to see the flickering when opening chadtree after plugin update, It seems it opens to default window width and then resized.
Cheers
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.