Closed ElPiloto closed 2 years ago
Hey,
cheovim doesn't expose anything like that right now yet I'll make a small patch to expose current selected profile (and its init.lua
path) soon.
In the meantime you could use something like this:
local loader = require("cheovim.loader")
-- Grab the selected profile from the profiles file
local selected_profile, _ = loader.get_profiles(vim.fn.stdpath("config") .. "/profiles.lua")
local current_init = selected_profile[1] .. "/init.lua"
Cheers
Oops, didn't meant to close this until I push the patch, my apologies!
Thank you, your snippet works well enough until that patch.
After a closer look, I guess there's no need for a convenience function. Since cheovim manipulates vim.fn.stdpath
to return the location of the loaded profile, I can get the location of the loaded config via that. Just need to change my keymapping, which should work both with and without cheovim.
I typically have a keymapping to edit my init.lua file, but I find that doesn't work with cheovim. Does cheovim expose the currently loaded init.lua file somehow?