https://github.com/roxma/vim-encode
Provides simple stirng encode/escape functionality inside vim
https://github.com/roxma/vim-encode
Last synced: 7 months ago
JSON representation
Provides simple stirng encode/escape functionality inside vim
- Host: GitHub
- URL: https://github.com/roxma/vim-encode
- Owner: roxma
- Created: 2016-08-15T02:57:21.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2017-02-12T01:20:49.000Z (over 9 years ago)
- Last Synced: 2025-01-06T01:43:53.233Z (over 1 year ago)
- Language: Vim script
- Homepage:
- Size: 7.81 KB
- Stars: 8
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Vim-encode
## Description
Vim-encode provides simple stirng encode/escape functionality inside vim. It
helps make your life easier when you need to copy some text as string into your
code.
supported encode/escape type:
- html
- xml
- url
- hex
- cstring
- cstring_pretty
## Usage
press `e` the way you use vim's standard operators like `d`(delete)
Screencast here:
[](https://asciinema.org/a/ew105rtskuxg65a1f442stegg)
## Key Mapping
If you don't want default mapping, add `let g:vim_encode_default_mapping=0`
into your vimrc. Use `(encode)` for your own mapping.
If you want shorter keys for more specific encoding, html encode for example:
```vim
nnoremap encode#begin('html')
vnoremap encode#begin('html')
```
## How to Unencode?
Well, this feature is not yet implemented.
This plugin is for encoding pasted text for you code. You should keep the
original text as comment for readability or somewhere else anyway.
## How to add my own encode type?
Call `encode#add(type,handler)`, the hander here is a function that takes raw
string as parameter and return the encoded string.