1
0
forked from aniani/vim

Change 'cryptmethod' from a number to a string option. Make it global-local.

This commit is contained in:
Bram Moolenaar
2010-07-20 17:32:38 +02:00
parent c7040a5615
commit 49771f4fb0
14 changed files with 176 additions and 82 deletions

View File

@@ -1371,10 +1371,17 @@ the file is encrypted.
To disable the encryption, reset the 'key' option to an empty value: >
:set key=
You can use the 'cryptmethod' option to select the type of encryption. Do
this before writing the file. When reading an encrypted file it will be set
automatically to the method used when that file was written. You can change
'cryptmethod' before writing that file to change the method.
You can use the 'cryptmethod' option to select the type of encryption, use one
of these two: >
:setlocal cm=zip " weak method, backwards compatible
:setlocal cm=blowfish " strong method
Do this before writing the file. When reading an encrypted file it will be
set automatically to the method used when that file was written. You can
change 'cryptmethod' before writing that file to change the method.
To set the default method, used for new files, use one of these in your
|vimrc| file: >
set cm=zip
set cm=blowfish
When writing an undo file, the same key and method will be used for the text
in the undo file. |persistent-undo|.

View File

@@ -2074,15 +2074,15 @@ A jump table for the options with a short description can be found at |Q_op|.
*'cryptmethod'* *'cm'*
'cryptmethod' number (default 0)
local to buffer
'cryptmethod' string (default "zip")
global or local to buffer |global-local|
{not in Vi}
Method used for encryption when the buffer is written to a file:
*pkzip*
0 PkZip compatible method. A weak kind of encryption.
zip PkZip compatible method. A weak kind of encryption.
Backwards compatible with Vim 7.2 and older.
*blowfish*
1 Blowfish method. Strong encryption. Requires Vim 7.3
blowfish Blowfish method. Strong encryption. Requires Vim 7.3
or later, files can NOT be read by Vim 7.2 and older.
This adds a "seed" to the file, every time you write
the file the encrypted bytes will be different.
@@ -2091,10 +2091,16 @@ A jump table for the options with a short description can be found at |Q_op|.
to the detected method of the file being read. Thus if you write it
without changing 'cryptmethod' the same method will be used.
Changing 'cryptmethod' does not mark the file as modified, you have to
explicitly write it when not making modifications.
Also see |:X|.
explicitly write it, you don't get a warning unless there are other
modifications. Also see |:X|.
When setting the global value to an empty string, it will end up with
the value "zip". When setting the local value to an empty string the
buffer will use the global value.
When a new encryption method is added in a later version of Vim, and
the current version does not recognize it, you will get *E821* .
You need to edit this file with the later version of Vim.
*'cscopepathcomp'* *'cspc'*

View File

@@ -30,19 +30,10 @@ be worked on, but only if you sponsor Vim development. See |sponsor|.
*known-bugs*
-------------------- Known bugs and current work -----------------------
GTK: torn-off menu doesn't work. Because of patch for file selector?
Win64: diff.exe crashes on Win64. (Julianne Bailey, 2006 Dec 12)
Build another diff.exe somehow?
GTK: torn-off menu doesn't work.
:find completion has duplicates. (Bjorn Winckler, 2010 Jul 18)
Conceal: don't show for 'hlmatch' when 'modifiable' is off?
And don't care about 'cursorline'.
Make 'cryptmethod' global-local, so that a default specified in a .vimrc file
is used for new files. (Christian J. Robinson)
Cursor positioning wrong with 0x200e character. (John Becket, 2010 May 6)
Test 69 breaks on MS-Windows, both 32 and 64 builds. (George Reilly, 2010 Feb

View File

@@ -7265,7 +7265,7 @@ Added the |strchars()|, |strwidth()| and |strdisplaywidth()| functions.
Support GDK_SUPER_MASK for GTK on Mac. (Stephan Schulz)
Made CTRL modifier work for mouse wheel. (Benjamin Haskell)
Made CTRL and ALT modifier work for mouse wheel. (Benjamin Haskell)
When the buffer is in diff mode, have :TOhtml create HTML to show the diff
side-by-side. (Christian Brabandt)
@@ -10031,5 +10031,10 @@ Window title not updated after file dropped.
"g8" doesn't work properly on a NUL.
Fixed crash for ":find" completion, might also happen in other path expansion
usage.
When 'searchhl' causes a hang make CTRL-C disable 'shearchhl'.
vim:tw=78:ts=8:ft=help:norl: