I am using neovim config from custom directory and also want that it stores its data in custom directory. So i set this in my ~/.config/nvimcustom/init.lua
:
vim.opt.data_dir = '~/.local/share/nvimcustom/'
But on running nvim -u ~/.config/nvimcustom/init.lua
, I am getting this error
Error detected while processing /home/venom/.config/nvimcustom/init.lua:
E5113: Error while calling lua chunk: vim/_meta.lua:0: Invalid option (not found): 'data_dir'
stack traceback:
[C]: in function 'nvim_get_option_info'
vim/_meta.lua: in function '__index'
vim/_meta.lua: in function ''
vim/_meta.lua: in function '__newindex'
/home/venom/.config/nvimcustom/init.lua:2: in main chunk
I just want that my neovim config is present in custom directory and also all the plugins and otther data it stores due to this custom config is stored in a custom directory. How to do that. I want to do it so that when I run normal nvim, I can have different configuration and whne I run nvim using -u flag, I can have different configuration
data_dir
option in neither Neovim nor Vim. I guess you want to configure$XDG_DATA_HOME
depending on your use-case? See also here: neovim.io/doc/user/starting.html#xdg