Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migration guide #674

Closed
kyazdani42 opened this issue Oct 1, 2021 · 28 comments
Closed

Migration guide #674

kyazdani42 opened this issue Oct 1, 2021 · 28 comments

Comments

@kyazdani42
Copy link
Member

kyazdani42 commented Oct 1, 2021

nvim-tree.lua once used global variables to define options. These have been moved into setup options.

  • g:nvim_tree_disable_netrw -> disable_netrw
  • g:nvim_tree_hijack_netrw -> hijack_netrw
  • g:nvim_tree_auto_open -> open_on_setup
  • g:nvim_tree_tab_open -> open_on_tab
  • g:nvim_tree_update_cwd -> update_cwd
  • g:nvim_tree_hijack_cursor -> hijack_cursor
  • g:nvim_tree_system_open_command -> system_open.cmd
  • g:nvim_tree_system_open_command_args -> system_open.args
  • g:nvim_tree_follow -> update_focused_file.enable
  • g:nvim_tree_follow_update_path -> update_focused_file.update_cwd
  • g:nvim_tree_lsp_diagnostics -> lsp_diagnostics
  • g:nvim_tree_auto_resize -> actions.open_file.resize_window
  • g:nvim_tree_bindings -> view.mappings.list
  • g:nvim_tree_hide_dotfiles -> filters.dotfiles
  • g:nvim_tree_ignore -> filters.custom
  • g:nvim_tree_gitignore -> git.ignore
  • g:nvim_tree_disable_window_picker -> actions.open_file.window_picker.enable
  • g:nvim_tree_window_picker_chars -> actions.open_file.window_picker.chars
  • g:nvim_tree_window_picker_exclude -> actions.open_file.window_picker.exclude
  • g:nvim_tree_change_dir_global -> actions.change_dir.global
  • g:nvim_tree_quit_on_open -> actions.open_file.quit_on_open
  • g:nvim_tree_indent_markers -> renderer.indent_markers.enable
  • g:nvim_tree_add_trailing -> renderer.add_trailing
  • g:nvim_tree_highlight_opened_files -> renderer.highlight_opened_files
    • 0 -> "none"
    • 1 -> "icon"
    • 2 -> "name"
    • 3 -> "all"
  • g:nvim_tree_root_folder_modifier -> renderer.root_folder_modifier
  • g:nvim_tree_special_files -> renderer.special_files
  • g:nvim_tree_icon_padding -> renderer.icons.padding
  • g:nvim_tree_symlink_arrow -> renderer.icons.symlink_arrow
  • g:nvim_tree_show_icons -> renderer.icons.show
    • files -> file
    • folders ->folder
    • folder_arrows -> folder_arrow
  • g:nvim_tree_icons -> renderer.icons.glyphs
  • g:nvim_tree_git_hl -> renderer.highlight_git
  • g:nvim_tree_group_empty -> renderer.group_empty
  • g:nvim_tree_respect_buf_cwd -> respect_buf_cwd
  • g:nvim_tree_create_in_closed_folder -> create_in_closed_folder

g:auto_close feature was removed. See readme.

g:nvim_tree_disable_keybindings and g:nvim_tree_disable_default_keybindings have been replaced by using view.mappings.custom_only.
Setting view.mappings.custom_only to true and view.mappings.list to {} would do the same as g:nvim_tree_disable_keybindings and view.mappings.custom_only to true with your list of keybindings would do the same as nvim_tree_disable_default_keybindings.

@wookayin
Copy link

wookayin commented Oct 2, 2021

Please pin this or add a link to README! I was just surprised to find these options are gone.

michalsvorc added a commit to michalsvorc/profile that referenced this issue Oct 3, 2021
kiran94 added a commit to kiran94/dotfiles that referenced this issue Oct 3, 2021
They changed the interface to be more lua based.
nvim-tree/nvim-tree.lua#674
@JarnoB
Copy link

JarnoB commented Oct 5, 2021

Thanks, this is helpful!
But isn't nvim_tree_tab_open -> tab_open supposed to be nvim_tree_tab_open -> open_on_tab?

@kyazdani42
Copy link
Member Author

good catch !

@k1nxx
Copy link

k1nxx commented Oct 13, 2021

Auto open doesn't work btw!

config

require'nvim-tree'.setup {
open_on_setup       = true,
}

@kyazdani42
Copy link
Member Author

exactly like described in the guide 😄

@ismikhail
Copy link

The view config does not seem to be working for me.
I installed the plugin with Packer like this:

  use {
    'kyazdani42/nvim-tree.lua',
    requires = 'kyazdani42/nvim-web-devicons'
  }

Then use this setup

require'nvim-tree'.setup {
  auto_close = true,
  view = {
    side = 'right',
    width = 70
  }
}

The auto_close setting works but the view does not have any effect.

@nshen
Copy link

nshen commented Nov 2, 2021

The view config does not seem to be working for me. I installed the plugin with Packer like this:

  use {
    'kyazdani42/nvim-tree.lua',
    requires = 'kyazdani42/nvim-web-devicons'
  }

Then use this setup

require'nvim-tree'.setup {
  auto_close = true,
  view = {
    side = 'right',
    width = 70
  }
}

The auto_close setting works but the view does not have any effect.

same here. I can't set width, in either way.

@Olyve
Copy link

Olyve commented Nov 2, 2021

Just to chime in here, I am also unable to get the width set using the above two comments method in the setup method.

@b0o
Copy link

b0o commented Nov 6, 2021

It would be nice if you added a link to this issue inside the deprecation warning messages. If you think the URL is too long, you could use GitHub's git.io URL shortener, e.g. git.io/JPhyt. Alternatively, you could add this information to nvim-tree-lua.txt.

@kyazdani42
Copy link
Member Author

@ismikhail @nshen @sgalizia i cannot reproduce, could you open a new issue if this is still happening to you please ?

joaofnds added a commit to joaofnds/dotfiles that referenced this issue Nov 28, 2021
@AlvaroPata
Copy link

Hi! Is there a reason why I still get this warning even with the default configuration?

incinn added a commit to incinn/neovim_config that referenced this issue Jun 10, 2022
@alex-courtis
Copy link
Member

Hi! Is there a reason why I still get this warning even with the default configuration?

Are you receiving

  1. "Following options were moved to setup..." warning
  2. "unknown/invalid option".

For 2, please see #1334

1 indicates that you have global g: variabled defined somewhere.

@AlvaroPata
Copy link

Thanks! I found some g. settings i had forgotten about!

nathanielevan added a commit to nathanielevan/dotfiles that referenced this issue Jun 14, 2022
rnestler added a commit to rnestler/dotfiles that referenced this issue Jun 15, 2022
cevhyruz added a commit to cevhyruz/dotfiles that referenced this issue Jun 17, 2022
@nobody4t
Copy link

I can not understand here. I use the latest version and I got the warning each time I open nvim. Should I do some manually work here?

@kyazdani42
Copy link
Member Author

kyazdani42 commented Jun 20, 2022

You might have some g:nvim_tree... options left. What does the warning print ?

@nobody4t
Copy link

@kyazdani42
Thanks for your reply. I have resolved this. I need to modify my config accordingly.

DanielCardeal added a commit to DanielCardeal/dotfiles that referenced this issue Jun 21, 2022
usommerl added a commit to usommerl/configuration-nvim that referenced this issue Jun 24, 2022
The config option `respect_buf_cwd` was moved to the setup function
See: nvim-tree/nvim-tree.lua#674
svenXY pushed a commit to svenXY/dotnvim that referenced this issue Jul 4, 2022
fnichol added a commit to fnichol/dotneovim that referenced this issue Jul 6, 2022
peienxie added a commit to peienxie/dotfiles that referenced this issue Jul 18, 2022
- vim.g.nvim_tree_icons -> renderer.icons.glyphs
- view.auto_resize -> actions.open_file.resize_window
- update_to_buf_dir -> hijack_directories

ref: nvim-tree/nvim-tree.lua#674
michaelbrister pushed a commit to michaelbrister/.dotfiles that referenced this issue Jul 22, 2022
asoderlind added a commit to asoderlind/MonkeVim that referenced this issue Jul 28, 2022
fahchen added a commit to fahchen/dotfiles that referenced this issue Aug 15, 2022
tluijken added a commit to tluijken/.dotfiles that referenced this issue Aug 30, 2022
gvolpe added a commit to gvolpe/neovim-flake that referenced this issue Sep 4, 2022
datsudo added a commit to datsudo/Neovim-from-scratch that referenced this issue Sep 5, 2022
This migrates and renamed the following options to `nvim_tree.setup` in accordance to nvim-tree migration guide:

* vim.g.nvim_tree_icons -> moved to setup.renderer.icons.glyphs
* setup.auto_close -> feature has been removed
* setup.update_to_buf_dir -> renamed to hijack_directories
* setup.quit_on_open -> moved to setup.actions.open_file
* setup.git_hl -> renamed to highlight_git and moved to setup.renderer
* setup.disable_window_picker -> renamed to window_picker and moved to setup.actions
* setup.root_folder_modifier -> moved to setup.renderer
* setup.show_icons -> moved to setup.renderer.icons.show; removed tree_width

Migration guide: nvim-tree/nvim-tree.lua#674
nvim-tree docs : https://github.com/kyazdani42/nvim-tree.lua/blob/master/doc/nvim-tree-lua.txt
Philiks added a commit to Philiks/dotfiles that referenced this issue Sep 17, 2022
eliseshaffer added a commit to eliseshaffer/dotfiles that referenced this issue Jun 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests