This supports authentication via access token (instead of username and password), so users don't need to store their password in plaintext in their .vimrc if they don't want. It maintains backwards-compatibility with any current config, but adds a new :WriteAsAuth command that fetches a Write.as access token users can store in their .vimrc. This keeps their password more secure, and has the benefit of speeding up publishing, as authentication is a time-consuming operation.
These changes also let users avoid storing any authentication information in .vimrc and just enter their username and password on the fly when publishing.
I'm not experienced with Vim plugins or Python, but I used vim's input and inputsecret functions for getting user input. Not sure if there's a better way to do that -- but feel free to improve in any way!
This supports authentication via access token (instead of username and password), so users don't need to store their password in plaintext in their .vimrc if they don't want. It maintains backwards-compatibility with any current config, but adds a new
:WriteAsAuth
command that fetches a Write.as access token users can store in their .vimrc. This keeps their password more secure, and has the benefit of speeding up publishing, as authentication is a time-consuming operation.These changes also let users avoid storing any authentication information in .vimrc and just enter their username and password on the fly when publishing.
I'm not experienced with Vim plugins or Python, but I used vim's
input
andinputsecret
functions for getting user input. Not sure if there's a better way to do that -- but feel free to improve in any way!