On 28/11/06, Bram Moolenaar <[EMAIL PROTECTED]> wrote:
Life Jazzer wrote: > I am using GVim version 7.0 on Microsoft Windows XP box. I have a question > regarding Vim capability to encrypt a text file (the :X command). > > These are steps how I create the encrypted text file: > - I fire up Vim ; > - Type :X and enter an encryption key twice ; > - Type some text ; > - Write the buffer into a file with :w encrypted_text.txt ; > - Quit Vim with :q ; > > When I fire up Vim back and type :e encrypted_text.txt, it sweetly prompts me > for the encryption key to read the content. > > The problem is when I open the from Windows Explorer by right clicking on the > file and choose `Edit with Vim` from the popped menu, Vim display the content > of the file in plain text without prompting for the encryption key that was > set to the text file. > > I checked gui_w32.txt file and read about adding `Edit with Vim` entry via > registry. I do not see any parameters were set in there so I assumed, choosing > `Edit with Vim` is simple running `gvim.exe file_name.ext`. So, I manually try > running `gvim.exe encrypted_text.txt` from console and yes, it DOES NOT prompt > me for encryption key and the content of the file is displayed in plain text. > > Curios about this issue, I switch to my GNU/Linux box (Slackware 10.2 with the > vim-6.8). I recreate the encrypted_text.txt and by running the command > `gvim encrypted_text.txt` from console, it DOES PROMPT me efor the encryption > key to view the content. > > I have asked folks in #vim on Freenode and one of them said that when they do > the same thing as I've described here, it DOES prompt for the encryption key. > > My questions are: > - Is it a `feature`? :) ; > - Any idea what possibly could cause this if it is not a `feature`? > > Many thanks in advanced if any Vim enlightened user would share some > knowledge. It works fine for me. Perhaps you have something in your startup scripts that prevents the prompt from showing up. Try running "gvim -u NONE thefile". If it works OK then, put a "finish" command in various positions in your _vimrc or remove plugins to find out which one causes the problem. -- FATHER: Who are you? PRINCE: I'm ... your son ... FATHER: Not you. LAUNCELOT: I'm ... er ... Sir Launcelot, sir. "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD /// Bram Moolenaar -- [EMAIL PROTECTED] -- http://www.Moolenaar.net \\\ /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ \\\ download, build and distribute -- http://www.A-A-P.org /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///
Hi, folks! Regarding my question previously why Vim does not prompt for encryption when opening via `Edit with Vim` option available by right click on the file from Windows Explorer, I think I have found out why. In my _vimrc file, I put a line to remove the toolbar by running `:emenu Edit.Global Settings.Toggle Toolbar` command instead of `set guioptions-=T` command. Removing this line makes Vim prompt for the file encryption key while opening an encrypted file. Is this really how Vim is expected to act in this situation? Well, that just solved the problem of which Vim does not prompt for encryption key. Regarding Vim display the content of the encrypted file without prompting for encryption key, may be it's just something I did though I don't know what. I decide so because when I try to reproduce the situation, it does not show the content of the encrypted file in plain text. I apologize for this false report. Many thanks for the response.