{"id":16995804,"url":"https://github.com/qtc-de/vve","last_synced_at":"2025-09-07T06:36:39.562Z","repository":{"id":55509679,"uuid":"238862813","full_name":"qtc-de/vve","owner":"qtc-de","description":"Adding encoding capabilities to the vim editor","archived":false,"fork":false,"pushed_at":"2022-12-14T22:55:58.000Z","size":870,"stargazers_count":11,"open_issues_count":0,"forks_count":5,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-26T01:11:13.442Z","etag":null,"topics":["decoding","encoding","encoding-capabilities","vim","vim-editor","vim-encoders","vim-plugin","viml","vimlang","vve"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/qtc-de.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-02-07T07:02:18.000Z","updated_at":"2024-09-17T21:58:46.000Z","dependencies_parsed_at":"2022-08-15T02:01:14.484Z","dependency_job_id":null,"html_url":"https://github.com/qtc-de/vve","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qtc-de%2Fvve","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qtc-de%2Fvve/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qtc-de%2Fvve/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qtc-de%2Fvve/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/qtc-de","download_url":"https://codeload.github.com/qtc-de/vve/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248525162,"owners_count":21118617,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["decoding","encoding","encoding-capabilities","vim","vim-editor","vim-encoders","vim-plugin","viml","vimlang","vve"],"created_at":"2024-10-14T03:50:16.058Z","updated_at":"2025-04-12T05:41:14.732Z","avatar_url":"https://github.com/qtc-de.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"### Various Vim Encoders\n\n----\n\n![](https://github.com/qtc-de/vve/workflows/master%20Python%20CI/badge.svg?branch=master)\n![](https://github.com/qtc-de/vve/workflows/develop%20Python%20CI/badge.svg?branch=develop)\n[![](https://img.shields.io/badge/version-1.1.0-blue)](https://github.com/qtc-de/vve/releases)\n![](https://img.shields.io/badge/python-9%2b-blue)\n[![](https://img.shields.io/badge/license-GPL%20v3.0-blue)](https://github.com/qtc-de/vve/blob/master/LICENSE)\n\n*Various Vim Encoders* is a small Vim plugin which adds encoding capabilities to the Vim editor.\nIt configures key mappings for the most commonly used encoding schemes and enables you to transform\ntext without leaving your editor. Some of its features include:\n\n* Base64 encoding/decoding\n* HTML encoding/decoding\n* URL encoding/decoding\n* HEX encoding/decoding\n* Binary encoding/decoding\n* [...]\n\n\n![vve-example](https://tneitzel.eu/73201a92878c0aba7c3419b7403ab604/vve.gif)\n\n\nThe current version of *vve* does also support some features which are not really encoding related.\nThese features have proven to be useful, but may be removed in future versions. Some of these\nfeatures include:\n\n* Number conversion\n* In place arithmetic\n* Endian Swapper\n* Length Calculation\n* [...]\n\n\n### Installation \n\n----\n\n*vve* is structured according to Vim's plugin specifications and can be consumed by Vim's native\npackage manager as well as by several other tools like *Vundle* or *Pathogen*. \n\nIf you use Vim's native package manager, just clone the repository in either the ``start`` or ``opt``\nfolder of your Vim configuration folder. E.g.:\n\n```console\n[user@host ~]$ cd ~/.vim/pack/plugins/start/\n[user@host ~/.vim/pack/plugins/start/]$ git clone https://github.com/qtc-de/vve\n```\n\nIf you have chosen the ``start`` folder, *vve* will be available on each startup of Vim. If you decided\nto use the ``opt`` folder, you have to call ``:packadd vve`` from within Vim to enable it. \n\nIf you use an external package manager please read the corresponding manual on how to add additional\nplugins.\n\n\n### Usage\n\n-----\n\n*vve* makes extensive usage of Vim's Python3 integration and uses VimL functions as wrappers around the\nactual python code. However, interfacing with the functions directly should not be required and only the\nkey mappings are of interest in this description.\n\n*vve* defines key mappings with identical functionality for normal and visual mode. While the visual mode\nmappings operate on the data that has been selected, the normal mode mappings switch to operator pending\nmode and expect a motion to define the area of effect.\n\nBy default, most mappings expect the encoded input and decoded output to be represented in *UTF-8* format.\nIf *UTF-8* representation is not possible (e.g. when decoding stuff like ``//8=``), you should use the\n*ASCII* version of the *vve operation*. *ASCII* in the context of *vve* means, that all *ASCII* characters\nare displayed as normal, while all others are displayed as escape sequences (e.g. ``\\xff``). Check the\n[Unprintable Characters](#unprintable-characters) section for more details.\n\nThe following mappings are currently defined (notice that each key combination needs to be prefixed by your `\\\u003cleader\\\u003e` key):\n\n\n**Visual Mode Only Mappings**\n\n| Key       |Description                                                  |\n|:---------:|-------------------------------------------------------------|\n| ce        |Open ChangeEncoding menu                                     |\n\n\n**Encoding Related Mappings Operating on UTF-8**\n\n| Key       |Description                                                  |\n|:---------:|-------------------------------------------------------------|\n| ea        |Encode as ascii                                              |\n| eb        |Encode as binary                                             |\n| eB        |Encode as base64                                             |\n| ee        |Encode HTML special characters (entities)                    |\n| eE        |Encode all characters as HTML (entities)                     |\n| eh        |Encode as hex                                                |\n| eH        |Encode as hex string                                         |\n| ej        |Encode as JSON string                                        |\n| eJ        |Encode all characters as JSON                                |\n| eu        |Encode URL special characters                                |\n| eU        |Encode all characters as URL                                 |\n| ex        |Encode XML special characters                                |\n| eX        |Currently the same as ex                                     |\n| da        |Decode ascii                                                 |\n| db        |Decode binary                                                |\n| dB        |Decode base64                                                |\n| dh        |Decode hex                                                   |\n| dH        |Decode hex string                                            |\n| dj        |Decode JSON string                                           |\n| dJ        |Decode JSON string                                           |\n| du        |Decode URL                                                   |\n| dU        |Decode URL Full                                              |\n| de        |Decode HTML                                                  |\n| dE        |Decode HTML Full                                             |\n| dx        |Decode XML                                                   |\n| dX        |Decode XML Full                                              |\n\n\n**Encoding Related Mappings Operating on ASCII**\n\n| Key       |Description                                                  |\n|:---------:|-------------------------------------------------------------|\n| Eb        |Encode as binary                                             |\n| EB        |Encode as base64                                             |\n| Ee        |Encode all characters as HTML (entities)                     |\n| EE        |Encode all characters as HTML (entities)                     |\n| Eh        |Encode as hex                                                |\n| EH        |Encode as hex string                                         |\n| Eu        |Encode URL special characters                                |\n| EU        |Encode all characters as URL                                 |\n| Ex        |Encode all characters as XML (entities)                      |\n| EX        |Encode all characters as XML (entities)                      |\n| Db        |Decode binary                                                |\n| DB        |Decode base64                                                |\n| Dh        |Decode hex                                                   |\n| DH        |Decode hex string                                            |\n| Du        |Decode URL                                                   |\n| DU        |Decode URL Full                                              |\n| De        |Decode HTML                                                  |\n| DE        |Decode HTML Full                                             |\n| Dx        |Decode XML                                                   |\n| DX        |Decode XML Full                                              |\n\n\n**Number Related Mappings**\n\n| Key       |Description                                                  |\n|:---------:|-------------------------------------------------------------|\n| th        |To hex format                                                |\n| tH        |To hex string format                                         |\n| tb        |To binary format                                             |\n| to        |To octal format                                              |\n| td        |To decimal format                                            |\n| ma        |In place addition                                            |\n| ms        |In place subtraction                                         |\n| mm        |In place multiplication                                      |\n| md        |In place division                                            |\n\n\n**String Related Mappings**\n\n| Key       |Description                                                  |\n|:---------:|-------------------------------------------------------------|\n| se        |Swap endianess of hex strings                                |\n| sc        |Echo string length                                           |\n| sC        |Echo hex string length                                       |\n| su        |Convert to upper                                             |\n| sl        |Convert to lower                                             |\n| sn        |Echo number of selected lines                                |\n| fc        |Convert to camelCase (from snake_case)                       |\n| fs        |Convert to snake_case (from camelCase)                       |\n| fm        |Convert to markdown anchor                                   |\n| fM        |Convert to markdown anchor reference                         |\n\nApart from the mappings, *vve* defines one encoding related *vim-command*: ``ChangeEncoding``.\nWhile being in *visual mode*, you can either use ``\u003cleader\u003ece`` or type ``:\u003cc-u\u003eChangeEncoding``\nto open the encoding menu. ``ChangeEncoding`` expects two arguments.\n\n1. The encoding you are coming from.\n2. The encoding you are going to.\n\nE.g. after selecting some *base64* encoded text, you can use ``:ChangeEncoding base64 hex``\nto convert the *base64* encoded text directly into *hex* format.\n\n\n### Unprintable Characters\n\n----\n\nDecoding arbitrary portions of text inside of an editor has of course certain limitations.\nIf the decoded result contains non *UTF-8* conform character codes, the decoding operation\nmight fail. In these cases, *vve* will show an error like:\n\n```\n[Error] - Decoded result cannot be encoded as UTF-8.\n```\n\nHowever, in certain situations working with non *UTF-8* data is desired and *vve* supports\ntwo workarounds to allow it:\n\n1. For (almost) each operation, *vve* supports an *ascii* variant. In the context of *vve*\n   *ascii* encoding means basically that *ascii* characters are displayed like usual,\n   while all other characters are displayed as escape sequences.\n   \n   As an example, consider you want to decode the base64 encoded value ``SGVsbG8g/yBXb3JsZA==``.\n   Using the ordinary ``\u003cleader\u003edB`` command will fail, as the result contains non valid unicode\n   characters. The *ascii* variant (``\u003cleader\u003eDB``), on the other hand, will decode this\n   to ``Hello \\xff World``.\n\n2. A common scenario for dealing with non printable characters is when switching encoding.\n   E.g. consider you want to switch from the hex encoded string ``aafefaeac3b1`` to its\n   base64 variant. Decoding the value with ``\u003cleader\u003edh`` and encoding it with ``\u003cleader\u003eeB``\n   will not work, as the decoding operation results in non *UTF-8* characters.\n   \n   To allow such operations, *vve* supports the ``:ChangeEncoding`` command. Just visual select\n   the hex string ``aafefaeac3b1`` and type ``:ChangeEncoding hex base64`` and the value\n   should be encoded as ``qv766sOx`` (you can also type ``\u003cleader\u003ece`` to open the ``ChangeEncoding``\n   menu).\n\n\n### Full Operations\n\n----\n\n*vve* defines several operations that have the term *Full* as part of their name. The meaning of *Full*\nslightly differs depending whether the corresponding operation is an encoding or decoding operation.\n\n* **For encoding operations**, *Full* does basically mean that all characters are converted. Using\n  *URL encoding* as example, the string ``Hello World`` would normally be encoded as ``Hello+World``,\n  as the space character is the only one that really needs to be encoded. The *Full* operation, on the\n  other hand, will encode all characters no matter whether encoding is required.\n\n* **For decoding operations**, *Full* operations are basically an alternative implementation. Lets take\n  *URL encoding* again as an example. When using the ordinary *URL decode* operation (``\u003cleader\u003edu``),\n  *vve* will just use a library function for decoding. This is fine for *90%* of the cases, but\n  sometimes it causes unexpected results. E.g. when using the library function to decode ``%ff``\n  to *ascii* representation (``\u003cleader\u003eDu``), you will get ``\\xef\\xbf\\xbd``. This is because the library\n  function tries to apply *UTF-8* encoding, but ``%ff`` is no valid *UTF-8* format.\n  The *Full* (alternative) implementation (``\u003cleader\u003eDU``) will decode ``%ff`` to ``\\xff`` which is probably\n  what you expect.\n\nIn most situation, using the *non-Full* operations should be fine. However, when working with non-printable\ncharacters, the *non-Full* operations can behave unexpected and using *Full* operations might fix that.\n\n\n### Final Remark\n\n----\n\nTo be honest, working with encodings is just a nightmare. There are plenty different possibilities how to\nimplement different encodings and taking these design decisions is just a mess. Don't expect *vve* to work\n*100%* reliable. We invested some effort to make this tool working reliable for general usage, but there\nare certainly some edge cases that are not covered yet.\n\n\n*Copyright 2022, Tobias Neitzel and the vve contributors.*\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fqtc-de%2Fvve","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fqtc-de%2Fvve","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fqtc-de%2Fvve/lists"}