Monday, October 11, 2010

Vim 7.3 Encryption and persistent undo

Now that vim 7.3 has been released files can be encrypted strongly by setting in your .vimrc:

setlocal cm=blowfish

then you can just type :X and a prompt for the password will show up asking you to type it twice then when you save it the file will be encrypted

every time you open a file do it as you would normally, just type the password when prompted.

About persistent undo (another feature incorporated in vim 7.3) just create the directory ~/.vim/undodir and use these settings and you would be ready to go:

"setting persistent undo, for undo after reloading a file
set undodir=~/.vim/undodir
set undofile
set undolevels=1000 "maximum number of changes that can be undone
set undoreload=10000 "maximum number lines to save for undo on a buffer reload

see also:
http://amix.dk/blog/post/19548

Monday, September 27, 2010

vim add on manager

install addon manager:

  1. cd ~
  2. mkdir vim-addons
  3. cd vim-addons
  4. git clone git://github.com/MarcWeber/vim-addon-manager.git
Add the following to your .vimrc to activate your add on manger:

fun ActivateAddons()
set runtimepath+=~/vim-addons/vim-addon-manager
try
call scriptmanager#Activate([])
catch /.*/
echoe v:exception
endtry
endf


now you can try :ActivateAddons and the program will ask you to download the database of add on, choose y and the next time you will be able to autocomplete addon names to install them!

for more info read:

http://github.com/MarcWeber/vim-addon-manager/blob/master/doc/vim-addon-manager.txt