Snippet for creating a sandboxed environment #39
Replies: 5 comments 1 reply
-
Nice one! I tested it on nixos and it works fine. mkdir nvim-plugin-test
cd nvim-plugin-test
git clone https://github.com/folke/lazy.nvim --depth 1
mkdir -p config/nvim/lua/plugins
cat << 'EOF' > config/nvim/init.lua
local lazypath = vim.fn.expand("$PWD/lazy.nvim")
vim.opt.rtp:prepend(lazypath)
-- Make Lua able to find the plugins module
package.path = vim.fn.expand("$PWD/config/nvim/lua/?.lua;") .. package.path
require("lazy").setup("plugins")
EOF
mkdir -p vaults/test-vault
cat << 'EOF' > config/nvim/lua/plugins/init.lua
return {
{
"obsidian-nvim/obsidian.nvim",
version = "*",
dependencies = { "nvim-lua/plenary.nvim" },
opts = {
workspaces = {
{
name = "test",
path = vim.fs.joinpath(vim.uv.cwd(), "vaults", "test-vault")
},
},
},
},
}
EOF
XDG_CONFIG_HOME=$PWD/config \
XDG_DATA_HOME=$PWD/data \
XDG_STATE_HOME=$PWD/state \
XDG_CACHE_HOME=$PWD/cache \
nvim -u config/nvim/init.lua Also do you think we to add a picker? |
Beta Was this translation helpful? Give feedback.
-
I created a pure lua version based on folke's repro approach (in the hope that it will work on windows) #50 |
Beta Was this translation helpful? Give feedback.
-
I have merged the new changes, feel free to try them! |
Beta Was this translation helpful? Give feedback.
-
mkdir nvim-plugin-test
cd nvim-plugin-test
git clone [email protected]:obsidian-nvim/obsidian.nvim.git
CONF_PATH=$(pwd)/obsidian.nvim/minimal.lua
XDG_CONFIG_HOME=$PWD/config
XDG_DATA_HOME=$PWD/data
XDG_STATE_HOME=$PWD/state
XDG_CACHE_HOME=$PWD/cache
nvim -u $CONF_PATH Gave it a run, definitely much simpler now, thanks. A lot of external dependencies for the minimal ( You have a vision behind going that way? |
Beta Was this translation helpful? Give feedback.
-
Solved with "tip" in https://github.com/obsidian-nvim/obsidian.nvim?tab=readme-ov-file#-installation |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I wanted to have a sandboxed way to test Obsidian on its own without the experiments polluting my global nvim config.
Below is a snippet that will install obsidian and run nvim with a custom config all from a sandboxed environment (limited just to that folder).
The neovim still has to be in path.
Tested this on Ubuntu 24.04.
Beta Was this translation helpful? Give feedback.
All reactions