summaryrefslogtreecommitdiffstats
path: root/.config/nvim/after/ftplugin/python.lua
diff options
context:
space:
mode:
authorThomas Vanbesien <tvanbesi@proton.me>2026-06-11 19:53:59 +0200
committerThomas Vanbesien <tvanbesi@proton.me>2026-06-11 20:08:37 +0200
commitb62430bb2610198bffb076a59755ad74b4a3d50a (patch)
tree1fd55be01a1e31b35440b56bb5c6176dc59c0eb4 /.config/nvim/after/ftplugin/python.lua
parent796b523aa141dd6aff2d100ddcc46f2895859ecd (diff)
downloaddotfiles-b62430bb2610198bffb076a59755ad74b4a3d50a.tar.gz
dotfiles-b62430bb2610198bffb076a59755ad74b4a3d50a.zip
refactor(nvim): rewrite the buffer formatting flow
Diffstat (limited to '.config/nvim/after/ftplugin/python.lua')
-rw-r--r--.config/nvim/after/ftplugin/python.lua12
1 files changed, 1 insertions, 11 deletions
diff --git a/.config/nvim/after/ftplugin/python.lua b/.config/nvim/after/ftplugin/python.lua
index fa39ee8..63045ed 100644
--- a/.config/nvim/after/ftplugin/python.lua
+++ b/.config/nvim/after/ftplugin/python.lua
@@ -4,14 +4,4 @@ vim.opt_local.complete = {
"o", -- 'omnifunc'
}
-vim.b.autoformat = true
-vim.b.format_func = function()
- local ret = vim.system({ "black", "--check", "-" }, { stdin = vim.api.nvim_buf_get_lines(0, 0, -1, false) }):wait()
- if ret.code > 1 then
- vim.notify("black failed (" .. ret.code .. "):\n" .. ret.stderr, vim.log.levels.WARN)
- return
- end
- local view = vim.fn.winsaveview()
- vim.cmd("%!black --quiet -")
- vim.fn.winrestview(view)
-end
+vim.b.format = true -- See plugin/50-format.lua