Wednesday, October 16, 2013

Essential vim plugins for computational physicists

Vim is a very popular and powerful text editor, no question about that. And, without risking to run into the editor war once again, it can be safely said that many scientists and computational physicists use some flavour or other of vim for their day-to-day work.

  While, vim is very powerful by himself, the strong user base of vim lead to a huge number of plugins, there is almost one for your every need. Assuming computational physicists use fortran90(+) for coding and latex most often then not, here is a list of vim plugins that will make their life a lot easier.

Disclaimer: This is not an extensive list, this is just my choice, that I worked with and I love.
General Plugins: First thing first: some language independent plugins:
  1. Pathogen : This must be the first plugin one should install before doing anything else. This makes managing the rest of the plugins "super-easy".
    Alternative: Absolute must, no alternative.
  2. Commentary: Commenting a number of lines in vim is pain. With no plugins, one possiblly can do ":a,b/^/^!/g" for fortran or ":a,b/^/^%/g" for latex. Get rid of this with this minimal extension! You can do only 3 things with this, and possibly those are all you will ever need.
    Alternative: nerd-commentor (used this for long, much more options, those I have hardly used.).
  3. Project: While working in a multifile code, this is an absolute-must. Once configured, it will give you a treeview of files in your project for easy navigation.
    Vim Screenshot with Project Plugin. One project expanded

    Alternative: IDE is a good alternative, it is an extension of Project.
  4. Nerdtree: Explores full filesystem.
  5. Taglist: This is a sourcecode browser. "Provides an overview of the structure of source code files and allows you to efficiently browse through source code files for different programming languages."
    Vim Screenshot with taglist plugin with a f90 code
  6. Ultisnips: "UltiSnips is a mature template library for Vim. Thus you can write code snippets once then refer to them by short words and make Vim expand them.":  The developer of the Ultisnips, Marc Weber says it all.
    NB: There are atleast 2 Ultisnips, one by SirVer and other, that is linked here, is by Marc. Marc's is a fork or SirVer. Both are good, but I will recommend Marc's. If for nothing else, the big point is Marc is very approachable and helping.

On my experience, for day to day coding with vim, this 6 plugins are indispensable, and once you get used to with them, these will increase your efficiency a lot.

Plugin for Fortran:

  1. codecomplete: Actually, we don't have much plugins for fortran. But this one (along with fortran.vim, that ships with vim itself)  is very helpful. It completes the structure of fortran code. 
Plugin for Latex:
  1. Vim-Latex: This is a ultimate plugin. It has huge number of functionalities, and hence, a steep learning (and forgetting) curve. But if you get used to with it, it makes writing latex code a pleasure.



For using them, one need to tweak the .vimrc a lot.  I am pasting my working .vimrc. Feel free to modify them for your own use.


Sunday, September 27, 2009

Hemanta Mukherjee

Onek din age, amar tokhon 9 bochor boyesh, anandabazar er prothom patar ekta heading aaj o mone aache "অবিস্মরনীয় কন্ঠ চিরস্তব্ধ //চোখের জলে বিদায় হেমন্তর". Mone aache tar ager diner sondhe tar ktha-o. Jemon ti cinema y hoy: loadshedding, baire brishti, chouki te ami amar jethtuto dada r sathe harricane er aaloy golp korchi. Ma-Jethima ekbar o bolche na "porte bosh"....aapon mone sune jachche ektar por ekta gaan....tader koishor er gaan! ja ar keu gaibe na konodin.....jini gaiten tini জীবনমরন সীমানা ছাড়িয়ে chole geche....sedin dupure chole gechen Hemanta Mukhopadhyay.
Boyesh hisabe dekhle ami dabi korte pari na ami hemanto r gaan sunte sunte boro hoyechi. Se somoy ta ekanto i sumon chottopadhyay(kabir sumon) er. kintu oi j....Obiswaranio: eta bodh hoy tar jonnei khate.
Amar theke o baje sur-tal gyaan nie amar thekeo cofidence er sathe gaan gaite ami khub kom lok kei dekhechi; ebong ami ja gun gun kortam(ekta bishes somoy sobai to gaan gay) pray sob i hemonter gaan. se "nijhum sondhay" hok ba "bose aachi potho cheye, faguner o gaan geye". Onno ekti matro gaan ja eder modhey jayga kore uthte perechilo seta holo "prothom school e jabar din, prothombar prem"......mone rakha dorkar sei gungun er somy hemonto nei 5-6 bochor hoye geche....tar o ontoto 9 bochor age chole geche tar mookh - Uttamkumar. kintu sei 60's-70's er gaan emon dokhol kore chilo aamya...se r bhola gelo na. Emonki ekhono, eka thakar somoy mone pore jay "jar chokh take ar mone pore na".

Bangali r 3 doshoker prem manei jeno Hemanta-Sondhya! Jekhane "hoyto tomari jonno" nieo dhukte paren ni Manna; lata-kishor ba lata-rafi o paren ni tader samrajey dhukte.
Aar aaj 20 bochor holo tini chole gechen. Ei muhurte ami sweden e, laptop samne kaj kore jachchi....r background e beje jachche "Amar ganer Swarolipi"!!

Thursday, August 27, 2009

তোরা পাবার জিনিষ হাটে কিনিস...

In today's software, there are 2 (or may be 3) way of availing a package; namely freeware and proprietary software (we will refer to this class of software as software for brevity) and the third type is somewhere between this two extreme: shareware.
The concern is not generally on price, but the freedom you get even after you buy a software. Most often then not, you have to be happy with a executable and not the source code, so your sky is narrower from the point you buy one. You can't share it with your dad's PC. If each of your family member got his/her own PC/laptop and each of them need a certain software, you have to buy it individually. The best known example is, perhaps, Microsoft products.
Ever wonder what is the way out? How can you do the same thing you do with those of software? Yeah, there are a lot, and actually the are even better in some sense then what you got in exchange to your bucks: The FREEWARE.
Just to make you belief, use openoffice (a sun product). The graphics may not be the same, but you can do almost all you ever want to do with its proprietary competitor. With an added freedom. Just to give a small example (rather trivial), the city where I live, changed her name from Calcutta to Kolkata. But some package still contains the name Calcutta. What you will do with Ms....nothing! you have to accept it and wait for the developers to correct it. While with free source softwares I use, I just go to the source and change the name.....thats it, and as simple. Or, while making a presentation, I can choose a banner to come in header of every slide.....I don't need to do that each time, or with each presentation.
And there is always other issues like backword compatibility so that you are forced to buy latest edition each time even you are sure that you are not going to use added features. what more!! read this web on windows7sins.

Monday, May 25, 2009

শহরে বৃষ্টি

A new(well, almost) bengali year and a fresh new rainy season. This time, it was much awaited after the loo-ed april and how it comes!! Every rainy season is fresh and so enjoyable, so full of memories....you just can't stop become romantic(if you are not a flu patient).
But somehow, I can't enjoy rain in kollkata as much as I used to do in my home. In my memory, rain has a sound....sound of rain in asbestos roof, which almost sounds like ghungur in ladies feet.
For me, rain still means football in mudded playground of our school....after half an hour play, you can easily do a 'catch-me-if-you-can' with your dad, I bet.
And, also for me, it is khichudi-beguni-maach_bhaja. It is also about loadshedding(this two was almost same in my memory, as electric office can't risk electricity with overhead wire)...a relief from homework and rupkotha and bhuter golpo by a old lady, who was working in our house as a randhuni in a dimly litted lanthen er aalo.All these are missing these days here in kolkata; no rupkotha left in life...no romance comes with barsha...."asharashya prathom dibosh" passes as any other dull day of the year.