lua port of command! W w !sudo tee % > /dev/null
- just works (tm)
- it heavily uses ffi which may crash nvim
- nvim 0.8.*
- 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