Ask for encryption key
Example
Normal 0 / 4Command-line 1 / 4Awaiting character 2 / 4Awaiting confirmation 3 / 4Normal 4 / 4Ask for encryption key.
Buffer encryption
- key
empty- Disk file
plaintext, unchanged
Command entered · ready to apply
Buffer encryption
- key
empty- Disk file
plaintext, unchanged
Command line
- Typed text
:X- Insertion offset
2
The :X command prompts for a key without echoing its characters.
Buffer encryption
- key
empty- Disk file
plaintext, unchanged
Encryption key prompt
- Prompt
Enter encryption key:
The example key was entered; Vim now asks for the same key again.
Buffer encryption
- key
empty- Disk file
plaintext, unchanged
Encryption key confirmation
- Prompt
Enter same key again:- Entered key
hidden
Enter an example key twice at the hidden prompts. :X stores it in the key option; encryption is applied on a later write.
Buffer encryption
- key
set (hidden)- Disk file
plaintext, unchanged until write
Before & after
Before
Buffer encryption
- key
empty- Disk file
plaintext, unchanged
After
Buffer encryption
- key
set (hidden)- Disk file
plaintext, unchanged until write
Documentation-backed illustration. Vim has +cryptv; matching key and confirmation are supplied to :X; no key or file access is performed by this illustration. Enter an example key twice at the hidden prompts. :X stores it in the key option; encryption is applied on a later write. Primary help: :X.
alpha
beta
gammaCursor on line 1, column 1Details & Vim help
Ask for encryption key. This Ex reference uses the full command name; the alphabetical index omits arguments. Supply the ranges, arguments, flags and prerequisite state documented in the linked help. Press Enter to submit a complete command. Availability and exact behavior can depend on Vim build features, options, mappings and editor state; the linked help is authoritative.