Martins3 / My-Linux-Config

:clap: Modern neovim configuration based on native lsp
https://martins3.github.io/My-Linux-Config/
GNU General Public License v3.0
342 stars 62 forks source link

hbac.nvim doesn't work well with persisted.nvim #146

Closed Martins3 closed 1 year ago

Martins3 commented 1 year ago
[persisted.nvim]: Error loading the session! vim/_editor.lua:0: VimEnter Autocommands for "*"..script nvim_exec2() called at VimEnter Autocommands for "*":0../home/martins3/.local/share/nvim/sessions/%home%martins3%core%mm@@main.vim, line 116: Vim(bwipeo
ut):E517: No buffers were wiped out: bwipe 1
Martins3 commented 1 year ago

yes, it's the problem of hbac.nvim

diff --git a/nvim/lua/usr/init.lua b/nvim/lua/usr/init.lua
index 3f2ebf64babb..9e6df0bad838 100644
--- a/nvim/lua/usr/init.lua
+++ b/nvim/lua/usr/init.lua
@@ -12,10 +12,13 @@ require("usr.telescope")
 require("usr.version")
 require("usr.which-key")
 require("usr.colorscheme")
-require("usr.alpha")
+-- require("usr.alpha")
 require("colorizer").setup({ "css", "javascript", "vim", html = { mode = "foreground" } })
 require("nvim-surround").setup()
-require("persisted").setup({ autoload = true })
+require("auto-session").setup({
+  log_level = "error",
+  auto_session_suppress_dirs = { "~/" },
+})
 require("gitsigns").setup({ signcolumn = false, numhl = true })
 require("leap").add_default_mappings()
 require("nvim-autopairs").setup()
diff --git a/nvim/lua/usr/lazy.lua b/nvim/lua/usr/lazy.lua
index 0ac1a85b3c4e..18a8230b60a6 100644
--- a/nvim/lua/usr/lazy.lua
+++ b/nvim/lua/usr/lazy.lua
@@ -128,7 +128,7 @@ require("lazy").setup({
   { "crusj/bookmarks.nvim", branch = "main" }, -- 书签
   "tyru/open-browser.vim", -- 使用 gx 打开链接
   "keaising/im-select.nvim", -- 自动切换输入法
-  "olimorris/persisted.nvim", -- 打开 vim 的时候,自动恢复为上一次关闭的状态
+  "rmagatti/auto-session", -- 打开 vim 的时候,自动恢复为上一次关闭的状态
   "anuvyklack/hydra.nvim", -- 消除重复快捷键,可以用于调整 window 大小等
   "ojroques/vim-oscyank", -- 让 nvim 在远程 server 上拷贝到本地剪切板上
   "azabiong/vim-highlighter", -- 高亮多个搜索内容