Saturday, January 29, 2011

Generate CSV list in Vim

Put below mappings in your .vimrc file :

nnoremap \, :%s/$/,/:%g/^/-j
vnoremap \, y:$opmz:'z,$s/$/,/:'z,$g/^/-j


Example :

for example if you have numbers as :
1
2
3
4
5
6
7
8
9
10

inorder to make csv list out of that, after putting those mappings in .vimrc file just press \,
in command mode will generate :
1 2, 3, 4, 5, 6, 7, 8, 9, 10,

you can select particular lines or block using visual mode and can generate csv only for that values also.

Happy Vimming !!

Regards,
Satya

Wednesday, January 5, 2011

Free WinRAR equivalent for Mac(View .rar file contents).

Itz : Zipeg(shareware).
URL : http://www.zipeg.com/

Thanks
Satya

Followers