Shougo / defx.nvim

:file_folder: The dark powered file explorer implementation for neovim/Vim8
MIT License
1.17k stars 86 forks source link

Unknow function _defx_init #337

Closed PowerzinBR closed 9 months ago

PowerzinBR commented 9 months ago

Problems summary

Cannot open Defx due to unknow function (_defx_init)

Expected

Open defx

Environment Information

Provide a minimal init.vim/vimrc with less than 50 lines (Required!)

" Fundamentals "{{{
" ---------------------------------------------------------------------

" init autocmd
autocmd!
" set script encoding
scriptencoding utf-8
" stop loading config if it's on tiny or small
if !1 | finish | endif

set nocompatible
set number
syntax enable
set fileencodings=utf-8,sjis,euc-jp,latin
set encoding=utf-8
set title
set autoindent
set background=dark
set nobackup
set hlsearch
set showcmd
set cmdheight=1
set laststatus=2
set scrolloff=10
set expandtab
"let loaded_matchparen = 1
set shell=fish
set backupskip=/tmp/*,/private/tmp/*

" incremental substitution (neovim)
if has('nvim')
  set inccommand=split
endif

" Suppress appending <PasteStart> and <PasteEnd> when pasting
set t_BE=

set nosc noru nosm
" Don't redraw while executing macros (good performance config)
set lazyredraw
"set showmatch
" How many tenths of a second to blink when matching brackets
"set mat=2
" Ignore case when searching
set ignorecase
" Be smart when using tabs ;)
set smarttab
" indents
filetype plugin indent on

" More down, max of 50 lines

The reproduce ways from neovim/Vim starting (Required!)

  1. nvim
  2. :Defx

Generate a logfile if appropriate

  1. export NVIM_PYTHON_LOG_FILE=/tmp/log
  2. export NVIM_PYTHON_LOG_LEVEL=DEBUG
  3. nvim -u minimal.vimrc
  4. some works
  5. cat /tmp/log_{PID}

Screen shot (if possible)

image

Upload the log file

?

Shougo commented 9 months ago

Please execute :UpdateRemotePlugins command.

PowerzinBR commented 9 months ago

Hello, i did that and the result was:

remote/host: python3 host registered plugins [] remote/host: generated rplugin manifest: C:\Users\Power\AppData\Local\nvim-data/rplugin.vim

Shougo commented 9 months ago

I think defx.nvim is lazy loaded. :UpdateRemotePlugins must be executed after load.

Note: Why don't you upload the minimal vimrc?

PowerzinBR commented 8 months ago

Hey, Shougo. I'm so sorry for that delay, i didn't have seen this message. Here's the minimal vimrc that you asked, i used :UpdateRemotePlugins.

Note: I use Windows, is that related to the error? I have seen a lot of people use defx.nvim without errors, didn't understand this one.

" Fundamentals "{{{
" ---------------------------------------------------------------------
autocmd!
if !1 | finish | endif

set nocompatible
set number
syntax enable
set fileencodings=utf-8,sjis,euc-jp,latin
set encoding=utf-8
set title
set autoindent
set background=dark
set nobackup
set hlsearch
set showcmd
set cmdheight=1
set laststatus=2
set scrolloff=10
set expandtab
set shell=pwsh
set backupskip=/tmp/*,/private/tmp/*
if has('nvim')
  set inccommand=split
endif
set t_BE=
set nosc noru nosm
set lazyredraw
set path+=**
set wildignore+=*/node_modules/*
autocmd InsertLeave * set nopaste
set formatoptions+=r
"}}}

" Highlights "{{{
" ---------------------------------------------------------------------
set cursorline
highlight Visual cterm=NONE ctermbg=236 ctermfg=NONE guibg=Grey40
highlight LineNr cterm=none ctermfg=240 guifg=#2b506e guibg=#000000
augroup BgHighlight
  autocmd!
  autocmd WinEnter * set cul
  autocmd WinLeave * set nocul
augroup END
if &term =~ "screen"
  autocmd BufEnter * if bufname("") !~ "^?[A-Za-z0-9?]*://" | silent! exe '!echo -n "\ek[`hostname`:`basename $PWD`/`basename %`]\e\\"' | endif
  autocmd VimLeave * silent!  exe '!echo -n "\ek[`hostname`:`basename $PWD`]\e\\"'
endif
"}}}

" File types "{{{
" ---------------------------------------------------------------------
au BufNewFile,BufRead *.es6 setf javascript
au BufNewFile,BufRead *.tsx setf typescriptreact
au BufNewFile,BufRead *.md set filetype=markdown
au BufNewFile,BufRead *.mdx set filetype=markdown
au BufNewFile,BufRead *.flow set filetype=javascript
au BufNewFile,BufRead *.fish set filetype=fish
set suffixesadd=.js,.es,.jsx,.json,.css,.less,.sass,.styl,.php,.py,.md
autocmd FileType coffee setlocal shiftwidth=2 tabstop=2
autocmd FileType ruby setlocal shiftwidth=2 tabstop=2
autocmd FileType yaml setlocal shiftwidth=2 tabstop=2
"}}}

" Imports "{{{
" ---------------------------------------------------------------------
runtime ./plug.vim
runtime ./maps.vim
"}}}

" Syntax theme "{{{
" ---------------------------------------------------------------------
if exists("&termguicolors") && exists("&winblend")
  syntax enable
  set termguicolors
  set winblend=0
  set wildoptions=pum
  set pumblend=5
  set background=dark
  let g:neosolarized_termtrans=1
  runtime ./colors/NeoSolarized.vim
  colorscheme NeoSolarized
endif
"}}}

" Extras "{{{
" ---------------------------------------------------------------------
set exrc
"}}}
[...]
Shougo commented 8 months ago

runtime ./plug.vim

is important. Why you don't upload the file?

PowerzinBR commented 8 months ago

nvim.zip Well, here's my Neovim setup, since you asked. (I tryed to send the plug.vim but is not supported)

Shougo commented 8 months ago

Hm... It seems not lazy loaded. So you don't execute :UpdateRemotePlugins command.

Please check defx.nvim path is added in your runtimepath.

If you use in Windows, you can test defx.nvim on WSL environment.

PowerzinBR commented 8 months ago

Hello @Shougo. Thank you for your responses, i will later give a look on all this and see it, thanks for the support along these two months.

Cheers 😄

PowerzinBR commented 7 months ago

Update on this: I tested it on Arch Linux, Pynvim installed, etc, and it still gave me the same error So i don't really know whats happening anymore :/

Shougo commented 7 months ago

Really??

Please execute :UpdateRemotePlugins and check the messages. And rplugin.vim file is created under stdpath('data'). I think it is empty.

What is :checkhelth result?

Shougo commented 6 months ago

Please see this.

https://github.com/neovim/pynvim/issues/564

PowerzinBR commented 6 months ago

Okay, i will check it

I was on a trip without my computer and i wasn't able to answer you later, sorry.

svermeulen commented 3 months ago

I had this problem. @Shougo is correct about the source of issue being the above linked pynvim issue.

As of right now, pynvim doesn't have a new release with this fix, so my workaround was:

pip install git+https://github.com/neovim/pynvim.git@d6dc8cfe71c6f05382ef50fb8bb0ce7e750ab0da

Since this is the commit for the MR with the fix