Shougo / defx.nvim

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

Command for vertical split not working anymore #61

Closed oblitum closed 5 years ago

oblitum commented 5 years ago

Warning: I will close the issue without the minimal init.vim and the reproduction instructions.

Problems summary

Command for vertical split not working anymore:

:Defx -split=vertical -winwidth=50 -direction=topleft -columns=icons:filename:type

It's just opening full window.

Expected

Open a sidebar as it worked previously

Environment Information

health#defx#check
========================================================================
## defx.nvim
  - OK: has("python3") was successful
  - OK: Python 3.6.1+ was successful

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

" Your minimal init.vim/vimrc
set runtimepath+=~/path/to/defx.nvim/

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

  1. :Defx -split=vertical -winwidth=50 -direction=topleft -columns=icons:filename:type

Extra

Bad commit: https://github.com/Shougo/defx.nvim/commit/bf78fd809fc8a95d045046617fc6c42cc83eade9

sandangel commented 5 years ago

@oblitum I have the same problem. Here is my work around

nnoremap <silent> <F3> :call DefxDrawerToggle()<CR>
" nnoremap <silent> <F3> :Defx -columns=git:mark:filename:type -toggle -split=vertical -winwidth=60 -direction=botright<CR>
fun! DefxDrawerToggle()
  if bufwinnr('defx') > 0
    execute "bd! " . bufnr('defx')
  else
    rightbelow vert split
    Defx `expand('%:p:h')`
    vert resize 60
  endif
endfun
oblitum commented 5 years ago

@sandangel thanks! though this makes things way more complicated to have a simple split as most file browsers provide...

oblitum commented 5 years ago

Looks like the cause is the fix for issue #60. Not sure how :Defx -split=vertical -winwidth=50 -direction=topleft -columns=icons:filename:type should be translated to the new way of doing the same, if there's one.

oblitum commented 5 years ago

OK, looks like I just needed to:

  call defx#custom#option('_', {
  \   'columns': 'icons:filename:type',
  \   'direction': 'topleft',
  \   'split': 'vertical',
  \   'winwidth': 50
  \ })

And :Defx would open as :Defx -split=vertical -winwidth=50 -direction=topleft -columns=icons:filename:type by default.

This will be enough for me but, I was initially using the command as a mapping:

nnoremap <silent> <leader>D :Defx -split=vertical -winwidth=50 -direction=topleft -columns=icons:filename:type<cr>

And I could have a variation of different mappings with custom settings, this seems not possible anymore as straightforward as it was before.

Shougo commented 5 years ago

Confirmed. It is the bug of defx.

Please update it.