Skip to content

roxma/vim-encode

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 

Repository files navigation

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 <Leader>e the way you use vim's standard operators like d(delete)

Screencast here:

asciicast

Key Mapping

If you don't want default mapping, add let g:vim_encode_default_mapping=0 into your vimrc. Use <Plug>(encode) for your own mapping.

If you want shorter keys for more specific encoding, html encode for example:

nnoremap <expr> <your_keys> encode#begin('html')
vnoremap <expr> <your_keys> 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.

About

Provides simple stirng encode/escape functionality inside vim

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published