A plugin that provides a function to preserve cursor position in a file, where possible, when running a command that reformats the file.
- Install via your favorite package manager.
-- lazy.nvim
{
"akmassey/preserve.nvim",
opts = {}
},
- Setup the plugin in your
init.lua
. This step is not needed with lazy.nvim ifopts
is set as above.
require("preserve").setup()