24 lines
507 B
Lua
24 lines
507 B
Lua
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
|