Virt-Indent.nvim/lua/vindent/init.lua

24 lines
507 B
Lua
Raw Normal View History

2024-04-15 06:31:43 -05:00
local M = {}
function M.ftplugin_setup()
if vim.b.did_ftplugin then
return
end
vim.b.did_ftplugin = true
vim.b.vindent_enabled = true
local vindent = require("vindent.indent"):new()
if vindent then
vindent:attach()
end
end
---Gets the current VirtualIndent instance
---@param buf? number Buffer number or 0 for current buffer
---@return VirtualIndent? The VirtualIndent instance if it exists
function M.get_buf_vindent(buf)
return require("vindent.indent"):new(buf)
end
return M