Encodes/decodes base64 strings using base64
on Linux and Python
on Windows
Note: In this video, atob
and btoa
are reversed!
- On Linux, you need
base64
fromcoreutils
installed. - On Windows, you need Python.
Use your preferred Vim plugin installation method.
If you like Vundle:
Add to your .vimrc
:
Plugin 'christianrondeau/vim-base64'
And install it:
:so ~/.vimrc
:PluginInstall
Or with vim-plug:
Add to your .vimrc
:
Plug 'christianrondeau/vim-base64'
And install it:
:so ~/.vimrc
:PlugInstall
You can encode and decode base64 string in several modes.
Note that if you provide invalid base64 strings, your text will ben replaced by the error message.
After replacement, the new text will automatically be visually selected.
<leader>atob
to convert from base64 to a string<leader>btoa
to convert from a string to base64
You can also, in normal mode, replace all instances of a regular expression by their base64 representation, using <leader>btoa/
or <leader>atob/
. This will insert a command mode string, with your cursor directly where you can type the regular expression.
Before making pull requests, make sure that tests still pass. They are using Vader.vim.
To run tests, either use :Vader tests/*
from the vim-base64
folder, or :Vader %
from within a test file.