-
Notifications
You must be signed in to change notification settings - Fork 0
/
base64.txt
93 lines (64 loc) · 2.87 KB
/
base64.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
*base64.txt* Base64 encoding and decoding plugin
Author : Bakudankun
License: Vim License (see |license|)
==============================================================================
CONTENTS *base64-contents*
INTRODUCTION............................................|base64|
COMMANDS................................................|base64-commands|
FUNCTIONS...............................................|base64-functions|
OPTIONS.................................................|base64-options|
==============================================================================
INTRODUCTION *base64*
This plugin provides Base64 encoding and decoding commands and functions.
Note that you can safely decode a Base64 to a string only if it contains a
string, and also the string is encoded in the same encoding as Vim's
'encoding' option.
==============================================================================
COMMANDS *base64-commands*
If you don't need gb and gB mappings, See |g:base64_config.auto_map| to
disable them.
*base64-gb*
<Plug>(base64-encode){motion} *<Plug>(base64-encode)*
gb{motion} Base64 encode {motion} text.
{Visual}<Plug>(base64-encode) *base64-v_gb*
{Visual}gb Base64 encode the highlighted text (for {Visual} see
|Visual-mode|).
gbgb *base64-gbgb* *base64-gbb*
gbb Base64 encode current line.
*base64-gB*
<Plug>(base64-decode){motion} *<Plug>(base64-decode)*
gB{motion} Base64 decode {motion} text.
{Visual}<Plug>(base64-decode) *base64-v_gB*
{Visual}gB Base64 decode the highlighted text (for {Visual} see
|Visual-mode|).
gBgB *base64-gBgB* *base64-gBB*
gBB Base64 decode current line.
==============================================================================
FUNCTIONS *base64-functions*
Functions are exported in Vim9 script so that you can |:import| them.
>
import autoload 'base64.vim'
echo base64.Decode2Str('WW91IHNlZSB0aGUgYm9tYiBpcyBibG93aW5nIHVwIQ==')
<
*base64#Encode()*
base64#Encode(input: blob | string | list<string>): string
Returns Base64 encoded string of {input}. If {input}
is list<string>, each item will be considered as a
line and <NL> in the strings will be considered as
<Nul>.
*base64#Decode()*
base64#Decode(input: string): blob
Decode Base64 string {input} and return it as a |Blob|.
*base64#Deocde2Str()*
base64#Decode2Str(input: string): list<string>
Decode Base64 string {input} to list of strings. Each
strings are a line of decoded text. <Nul> bytes are
replaced with <NL>.
==============================================================================
OPTIONS *base64-options*
Every options are containd in *g:base64_config* dictionary.
*g:base64_config.auto_map*
auto_map (default: true)
If |falthy|, gb and gB mappings are not created.
See also |base64-commands|.
vim:tw=78:ts=8:noet:ft=help:norl: