mcchrish / nnn.vim

File manager for vim/neovim powered by n³
BSD 2-Clause "Simplified" License
646 stars 25 forks source link

It takes forever to open, is it normal? #107

Closed hrqmonteiro closed 3 years ago

hrqmonteiro commented 3 years ago

Describe the bug

When i do :NnnPicker it takes more than 10 seconds to show nnn.

To Reproduce

Open vim, do :NnnPicker

Expected behavior

Not to take forever to open it...

Screenshots

https://user-images.githubusercontent.com/17055027/128684360-116067f2-4e35-4e2d-82d9-9c6f75e6d1e7.mp4

Environment:

mcchrish commented 3 years ago

Can you provide the minimum vimrc/init.lua that reproduce the problem? It would help a lot to isolate what's causing the issue. Does nnn run ok outside of neovim (just on the plain terminal)?

hrqmonteiro commented 3 years ago

If i run it with a minimal init.lua that just includes nnn.vim, the problem persists.

https://user-images.githubusercontent.com/17055027/128693540-69e72be2-0e0d-4f90-a518-5ee3ca7789ac.mp4

And yes, outside nvim nnn runs just fine.

hrqmonteiro commented 3 years ago

I just updated my nvim config to a literal minimal config with just packer and nnn.vim

I removed all my plugins from .local/share/nvim and just installed these two. Here's my config for reference.

And it still takes more than 10 seconds to open nnn. Very strange.

https://user-images.githubusercontent.com/17055027/128698512-11b129c8-cb25-47b8-8a4c-a4761c03b136.mp4

mcchrish commented 3 years ago

Thanks for the details. Very strange indeed. What shell are you using within vim? You can check using :echo &shell. What happens when change it to something else like bash or zsh? You can change it using set shell=.

jarun commented 3 years ago

The command that nnn.vim uses to invoke nnn, can you share that? Does that take long? How many contexts in nnn? Are you having sessions?

hrqmonteiro commented 3 years ago

Thanks for the details. Very strange indeed. What shell are you using within vim? You can check using :echo &shell. What happens when change it to something else like bash or zsh? You can change it using set shell=.

The default that :echo &shell returns is /bin/fish I only have bash installed, if i do :set shell=/bin/bash, nnn still takes the same amount of time to appear when i do :NnnPicker

The command that nnn.vim uses to invoke nnn, can you share that? Does that take long? How many contexts in nnn? Are you having sessions?

I don't get what do you mean by that. How do i share it?

And no, i don't have sessions.

jarun commented 3 years ago

The command is for @mcchrish to share.

mcchrish commented 3 years ago

It's nnn -p <tempfile>.

mcchrish commented 3 years ago

I'm unable to replicate the issue so far. I tried with an env as close as I can:

Here's my config if you want to take a look https://github.com/mcchrish/dotfiles/tree/master/vim/Library/Preferences/nvim

I have realized that run :set shell= might not have changed the behavior that I was expecting. So I'm still inclined it might be related to the shell. Can you try if changing the g:nnn#shell config would help? (or setup { shell = '/bin/bash' } for example if you are using lua setup).

hrqmonteiro commented 3 years ago

g:nnn#shell

That worked!! Although it didn't work setting it in lua, as you said.

I had to do

vim.cmd ([[
  let g:nnn#shell = 'bash'
]], "")

Now it is opening normaly. Thanks!