How to open "a layout" at VimEnter? (namely Neo-tree and Aerial) #3139
-
Hi all, I would like to open -- Autocmds are automatically loaded on the VeryLazy event
-- Default autocmds that are always set: https://github.com/LazyVim/LazyVim/blob/main/lua/lazyvim/config/autocmds.lua
-- Add any additional autocmds here
local function augroup(name)
return vim.api.nvim_create_augroup("lazyvim_" .. name, { clear = true })
end
-- open neo-tree at launch
vim.api.nvim_create_autocmd({ "VimEnter" }, {
pattern = "*",
group = augroup "neotreeonopen",
once = true,
callback = function(_)
if vim.fn.argc() == 0 then
vim.cmd "Neotree"
end
end,
}) Please and thank you. ps shower thought: perhaps there is a LazyVim toggle that one can set in configs? |
Beta Was this translation helpful? Give feedback.
Answered by
dpetka2001
May 11, 2024
Replies: 1 comment 9 replies
-
That autocmd only opens neo-tree when you invoke Neovim without any file arguments, like when doing |
Beta Was this translation helpful? Give feedback.
9 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
For me the path always opens where the file is.
For
edgy
and moving the cursor to file you could do