This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Treesitter automatic Python format strings | |
vim.api.nvim_create_augroup("py-fstring", { clear = true }) | |
vim.api.nvim_create_autocmd("InsertCharPre", { | |
pattern = { "*.py" }, | |
group = "py-fstring", | |
--- @param opts AutoCmdCallbackOpts | |
--- @return nil | |
callback = function(opts) | |
-- Only run if f-string escape character is typed | |
if vim.v.char ~= "{" then return end |