Open Ajaymamtora opened 4 months ago
The way I've done it is just to have an autocommand which is run for files in my scratch directory:
vim.api.nvim_create_autocmd({ "BufEnter" }, {
pattern = vim.fn.stdpath("cache") .. "/scratch.nvim/*",
command = "Codi", -- You can also execute a lua function using `callback` key
})
Thanks, I don't always want to setup a REPL with every scratch file, not sure how I could leverage that to conditionally do a callback?
You can prompt for confirmation inside the lua function? Or write a function which first creates a scratchpad using this plugin and then sets up whatever is required.
Then the prompt would fire every time I create a scratch file right? I don't really want that. Also the 2nd thing is what I'm trying to do, I don't know how to create a scratch file after the plugin has created a file because calling the API pops up the telescope picker.
I've created a fork of this repo instead it seems to work ok
I'm looking to create a scratch file in the middle of a shortcut that sets up a REPL. Is there any way for me to run code once the filetype has been selected from the new scratchfile select?