/preserve.nvim

Neovim plugin to preserve cursor position when reformatting

Primary LanguageLuaMIT LicenseMIT

preserve.nvim

A plugin that provides a function to preserve cursor position in a file, where possible, when running a command that reformats the file.

Installation

  1. Install via your favorite package manager.
-- lazy.nvim
{
   "akmassey/preserve.nvim",
   opts = {}
},
  1. Setup the plugin in your init.lua. This step is not needed with lazy.nvim if opts is set as above.
require("preserve").setup()