lua port of command! W w !sudo tee % > /dev/null
(yet it has heavy dependencies now, this gist may inspire you a simpler impl.)
- just works
- the use of ffi may crash nvim
- nvim 0.9.*
- haolian9/infra.nvim
- haolian9/cthulhu.nvim
:lua require'sudowrite'(api.nvim_get_current_buf())
this plugin is inspired by @asn from matrix nvim room: https://git.cryptomilk.org/users/asn/dotfiles.git/tree/nvim/.config/nvim/lua/utils.lua