Skip to content

Commit

Permalink
feat: add equalprg
Browse files Browse the repository at this point in the history
  • Loading branch information
heygarrett committed Dec 11, 2024
1 parent f4e8837 commit 865dcad
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions lua/conform/formatters/equalprg.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---@type conform.FileLuaFormatterConfig
return {
meta = {
url = "https://github.com/stevearc/conform.nvim/blob/master/lua/conform/formatters/equalprg.lua",
description = "Vim's own equalprg",
},
format = function(self, ctx, lines, callback)
local cursor_position = vim.api.nvim_win_get_cursor(0)
vim.cmd.normal("gg")
vim.cmd.normal("=G")
vim.api.nvim_win_set_cursor(0, cursor_position)
callback(nil, nil)
end,
}

0 comments on commit 865dcad

Please sign in to comment.