|
|
@@ -2,6 +2,30 @@
|
|
|
vim.g.loaded_netrw = 1
|
|
|
vim.g.loaded_netrwPlugin = 1
|
|
|
|
|
|
+-- override stdpath locations, so that config is fully hermetic
|
|
|
+local orig_stdpath = vim.fn.stdpath
|
|
|
+vim.fn.stdpath = function(value)
|
|
|
+ local config_path = orig_stdpath("config")
|
|
|
+
|
|
|
+ if value == "config" then
|
|
|
+ return config_path
|
|
|
+ end
|
|
|
+
|
|
|
+ if value == "data" then
|
|
|
+ return config_path .. "/data"
|
|
|
+ end
|
|
|
+
|
|
|
+ if value == "cache" then
|
|
|
+ return config_path .. "/cache"
|
|
|
+ end
|
|
|
+
|
|
|
+ if value == "state" then
|
|
|
+ return config_path .. "/state"
|
|
|
+ end
|
|
|
+
|
|
|
+ return orig_stdpath(value)
|
|
|
+end
|
|
|
+
|
|
|
-- package manager
|
|
|
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
|
|
|
if not (vim.uv or vim.loop).fs_stat(lazypath) then
|
|
|
@@ -186,7 +210,9 @@ require("nvim-tree").setup({
|
|
|
},
|
|
|
on_attach = function (bufnr)
|
|
|
local api = require "nvim-tree.api"
|
|
|
- api.config.mappings.default_on_attach(bufnr)
|
|
|
+ --api.config.mappings.default_on_attach()
|
|
|
+ api.map.on_attach.default(bufnr)
|
|
|
+
|
|
|
vim.keymap.set("n", ".", api.tree.change_root_to_node,
|
|
|
{noremap=true, silent=true, buffer=bufnr, nowait=true})
|
|
|
end,
|