Struggling to work with neo-tree #269
Answered
by
exformation
exformation
asked this question in
Q&A
-
I want neo-tree to already be open when I open neovim. This nearly works but the neo-tree buffer doesn't quite load properly. I think it might not be closing properly. return {
'rmagatti/auto-session',
config = function()
vim.o.sessionoptions = 'blank,buffers,curdir,folds,help,tabpages,winsize,winpos,terminal,localoptions'
-- vim.cmd [[autocmd VimLeavePre * windo Neotree close]]
-- vim.cmd [[autocmd VimEnter * windo Neotree filesystem show]]
require('auto-session').setup {
auto_session_pre_save_cmds = { 'Neotree close' },
-- auto_session_post_restore_cmds = { 'Neotree filesystem show' },
}
end,
} With persistence I only have to show neo-tree after the session has been loaded. I don't need to close it. return {
'folke/persistence.nvim',
opts = {
options = { 'blank', 'buffers', 'curdir', 'folds', 'help', 'tabpages', 'winsize', 'winpos', 'terminal', 'localoptions' },
},
config = function()
vim.api.nvim_create_autocmd('VimEnter', {
group = vim.api.nvim_create_augroup('restore_session', { clear = true }),
callback = function()
if vim.fn.getcwd() ~= vim.env.HOME then
require('persistence').load()
vim.cmd [[Neotree filesystem show]]
end
end,
nested = true,
})
require('persistence').setup()
end,
} Any thoughts on how to get neo-tree to close properly, or to just be saved as part of the session properly? |
Beta Was this translation helpful? Give feedback.
Answered by
exformation
Feb 14, 2024
Replies: 1 comment 1 reply
-
Typos ... ended up with something like this return {
'rmagatti/auto-session',
config = function()
vim.o.sessionoptions = 'blank,buffers,curdir,folds,help,tabpages,winsize,winpos,terminal,localoptions'
vim.keymap.set('n', '<leader>p', require('auto-session.session-lens').search_session)
require('auto-session').setup {
pre_save_cmds = { 'Neotree close' },
post_restore_cmds = { 'Neotree filesystem show' },
}
end,
} |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
exformation
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Typos ... ended up with something like this