Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/christianrondeau/vim-base64
Vim plugin to encode/decode base64 strings
https://github.com/christianrondeau/vim-base64
base64 decode encode vim vim-plugin vim-scripts
Last synced: 22 days ago
JSON representation
Vim plugin to encode/decode base64 strings
- Host: GitHub
- URL: https://github.com/christianrondeau/vim-base64
- Owner: christianrondeau
- License: mit
- Created: 2016-10-12T03:12:27.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2021-02-02T21:47:01.000Z (almost 4 years ago)
- Last Synced: 2024-04-15T01:19:47.889Z (7 months ago)
- Topics: base64, decode, encode, vim, vim-plugin, vim-scripts
- Language: Vim script
- Homepage:
- Size: 18.6 KB
- Stars: 44
- Watchers: 2
- Forks: 14
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Vim Base64
Encodes/decodes base64 strings using `base64` on Linux and `Python` on Windows
[![Build Status](https://travis-ci.org/christianrondeau/vim-base64.svg?branch=master)](https://travis-ci.org/christianrondeau/vim-base64)
[![asciicast](https://asciinema.org/a/90272.png)](https://asciinema.org/a/90272)
_Note: In this video, `atob` and `btoa` are reversed!_
# Installation
## Prerequisites
* On Linux, you need `base64` from `coreutils` installed.
* On Windows, you need [Python](https://www.python.org/downloads/windows/).## Vundle
Use your preferred Vim plugin installation method.
If you like [Vundle](https://github.com/VundleVim/Vundle.vim):
Add to your `.vimrc`:
Plugin 'christianrondeau/vim-base64'
And install it:
:so ~/.vimrc
:PluginInstallOr with [vim-plug](https://github.com/junegunn/vim-plug):
Add to your `.vimrc`:
Plug 'christianrondeau/vim-base64'
And install it:
:so ~/.vimrc
:PlugInstall# Usage
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.
## In a Visual Selection (`v`)
After replacement, the new text will automatically be visually selected.
* `atob` to convert from base64 to a string
* `btoa` to convert from a string to base64## Doing a regex replacement
You can also, in normal mode, replace all instances of a regular expression by their base64 representation, using `btoa/` or `atob/`. This will insert a command mode string, with your cursor directly where you can type the regular expression.
# Contributions
Before making pull requests, make sure that [tests](tests/) still pass. They are using [Vader.vim](https://github.com/junegunn/vader.vim).
To run tests, either use `:Vader tests/*` from the `vim-base64` folder, or `:Vader %` from within a test file.