Code for Concinnity

beautiful and elegant solutions


Vrapper: open source vim plugin for eclipse

Found out Vrapper recently. The fact that it is open source deserves a lot of merits. For years eclipse users only had the commercial option ViPlugin which didn’t work quite well for something that charges money, considering the NetBeans folks have the excellent jVi which is also open source.

Considering eclipse is free and open source, Vrapper only seems more fitting than ViPlugin. I’ve tried it for a week and it seems most essential functions are there, and I’ve been using vi for a couple of years so I think my set of “essential functions” shouldn’t be too narrow :p

Published by kizzx2, on April 8th, 2010 at 5:49 pm. Filled under: Useful tips Tags: , , , , , No Comments

gvim — E303: Unable to open swap file for “[No Name]“, recovery impossible

vim is my editor of choice and I install it in Windows. All is working quite good except one little annoyance — when I open the editor fresh and started editing by going into insert mode, it will give this error message:

1
E303: Unable to open swap file for "[No Name]", recovery impossible

This is usually harmless, as soon as I save the file everything would be great, it’s just that 1 – 2 seconds of pause that doesn’t make me feel good, so today I tried to pin down the problem and here’s how it went:

1
2
3
4
5
6
7
:help E303
(So it's related to the swap file. Let's see where our swap file fails to be created.)
:set directory?
directory=.;c:\tmp;c:\temp
(Oh, those are the default %TEMP% which I moved to another drive! But anyway, the first priority should be the current directory. So let's see where we're now)
:pwd
C:\Windows\system32

Solution

OK it’s pretty obvious now. It probably needs a little bit of manual fixing. Let’s put this in our .vimrc

1
2
3
4
5
" Thanks for an anonymous guest to provide this generic, better solution
set directory=.,$TEMP

" This is line I used at first. The above line is better than this

set directory=.,d:\temp

Great, problem solved!

Published by kizzx2, on November 6th, 2009 at 3:58 am. Filled under: Useful tips Tags: , , , 11 Comments