malbertzard / inline-fold.nvim

A neovim version of the inline fold plugin
MIT License
84 stars 2 forks source link

Turning inline fold on automatically #7

Closed hubcio2115 closed 1 year ago

hubcio2115 commented 1 year ago

Is there a way to turn the folding on automatically instead of doing it the manual way?

I tried using Neovim's autocmd feature but, I can't seem to find the right event. I tried:

When I've set it to BufWritePost it works. But I'd really like for it to turn on after opening a new buffer. 😞

Here is my config:

-- init.lua
local autocmd = vim.api.nvim_create_autocmd

autocmd({ "BufWritePost" }, {
  pattern = {
    "*.svelte",
    "*.jsx",
    "*.tsx",
    "*.html",
  },
  command = "InlineFoldToggle",
})
hubcio2115 commented 1 year ago

Thank you @3719e04! The autocmd from your pull request works. I'm really new to all of this neovim stuff.