Vim Tips Wiki
Advertisement

Obsolete tip

This tip has been merged into another tip.
See VimTip184 for the current tip.

Please do not edit this tip, and do not edit the discussion page.
If anything needs to be improved, please fix VimTip184.


Tip 726 Printable Monobook Previous Next

created May 17, 2004 · complexity basic · author Devin Weaver · version 6.0


Here is a panic button, so no one accidentally sees words they aren't supposed to.

noremap <Leader>r ggg?G``

With this in your vimrc you can hit \r in a panic and all the text goes to gibberish. So in case you can't type :wqa! fast enough or :mksession

Running this again reverses it. It uses Vim's rot13 command on the whole file.

Comments

This is a good idea, however, the solution is not quite versatile.

ROT13 works only for pure English text. i.e. a-z and A-Z.

For programs which have lots of symbols, the ROT13 encoded text still looks like a program. So this is not a good "boss key".

For most non-Enligsh texts, characters other than a-z and A-Z will be widely used, and ROT13 will have no effect on non-English texts. Still, this is a case when the ROT13 is not a good "boss key".

Try a better encoding algorithm for boss key, or you'll be "catched" by your boss!


Why not use

imap <silent> <A-v><A-v> <C-o>:suspend<CR>
vmap <silent> <A-v><A-v> :<C-u>suspend<CR>

to simply minimize the window?


How about:

map <F1> :w<CR>:e ~/i_nominate_x_for_nobull_prise.txt<CR>

I'd use something other than Vim-features to implement a Boss key:

In windowmaker: Meta-M (Minimize Window)

Running screen: CTRL-A + D (Detach session)


Advertisement