DEV Community

loading...

Discussion on: Installing neovim nightly alongside stable

Collapse
jakewvincent profile image
Jake Vincent • Edited

Thank you, this is helpful! I found this after giving up on having two separate installations but was still struggling to use two separate config and data directories for an older setup with init.vim and a newer setup with init.lua. I could get everything to work except that I couldn't get paq-nvim to install packages anywhere but ~/.local/share/nvim, when I wanted it to install them in ~/.local/share/nvim-lua (it's less configurable than packer and only refers to stdpath("data")).

What I ended up doing was the following:

  • creating ~/.local/share-nvim
  • symlinking my nvim-lua data directory in ~/.local/share to ~/.local/share-nvim as nvim
  • setting up an alias nvim.paq that opens nvim with init.lua and sets the data directory to ~/.local/share-nvim (by setting the XDG_DATA_HOME env variable) and only installing/updating packages with this instance of nvim
  • setting up a separate alias nvim.lua that uses the init.lua config but doesn't change XDG_DATA_HOME

It's very hacky, but with the above, and with runtimepath and packpath settings based on what you suggest above, I can get Paq to install packages to ~/.local/share/nvim-lua indirectly via the symlink and get nvim to use those packages. I would just always set XDG_DATA_HOME to the special data directory when I want to use init.lua, but I get some weird issues compiling TeX documents when XDG_DATA_HOME is changed.

Collapse
creativenull profile image
Arnold Chand Author

Hey!

This is nice! But a bit overly complicated, and I guess that's one of the limitations of keeping separately namespaced nvim configs that would lead to doing the hacky way you provided. Don't get me wrong that's a nice implementation 🙂

Although here is something you can try with paq-nvim if you have the time. I've checked through paq-nvim docs and, while a bit obscure, there is a way to change where to install the plugins, and that is thru the setup() function.

Make sure you git clone paq-nvim to the correct directory that was set in your packpaths, following your folder convention:

git clone --depth=1 https://github.com/savq/paq-nvim.git \
    "${XDG_DATA_HOME:-$HOME/.local/share}"/nvim-lua/site/pack/paqs/start/paq-nvim
Enter fullscreen mode Exit fullscreen mode

Before you provide your plugins within paq, you need to call the setup function and provide the path there, following your folder convention:

local paq = require 'paq-nvim'

paq.setup {
  path = vim.env.HOME .. '/.local/share/nvim-lua/site/pack/paqs/'
}

paq {
  'savq/paq-nvim';

  -- your plugins below
}
Enter fullscreen mode Exit fullscreen mode

I have not tried this myself so do let me know if this helps out or not with keeping your configs separate with different directories.