Jan

9th

Vim: the Swiss Army Knife of Programming and Website Development Tools

Software | Website Development


Paraphrasing the Peter Allen song, ‘Everything Old is New Again’ would be the perfect way to describe using the recent editions of Vim in its role as a premier tool in the arsenal of well-equipped web developers and programmers. Vim supports contextual intelligence and support for HTML, C, C++, CSS, PHP, Python, Javascript, Ruby and many other languages, with the ability to add others as they gain favor!   This powerful free and open source program which has been a mainstay of the Unix/Linux community for decades is now available in versions for Windows and Mac machines.  I recently revisited this marvelous software after first seeing it several decades ago, and was impressed enough after spending a few days getting re-acquainted to adopt it as a mainstay in my programming arsenal.  This is an excellent and powerful tool which will provide much of the ammunition any data infomancer or development guru will need to create and maintain a thoroughly professional product!

Long ago, before the PC had gained acceptance in the computing community, I was engaged in developing a well funded futures trading software platform using the Unix system which interacted with data stored (as I recall) on an Informix platform.  The workings of the program were in C language, and the most convenient method of writing the code was a program called Vi, which came as part of the Unix package.  It was, I thought at the time, a prodigiously inconvenient and non-intuitive piece of software.  Very soon thereafter, PCs gained acceptance within the organization, and we were able to port the C code over to the PC, adopt another more convenient tool for programming, called Personal Editor (PE) which had a much more friendly interface.  Although the C programs were written on the PC, they were compiled and run on a mainframe and we happily bid a fond farewell to the quirky Unix system.

In parallel to this migration, Linux came of age, and the Vi editor was replaced by Vim (Vi improved).  Unix and Linux acquired a GUI capability, and the developers and programmers grew in their expectations and level of sophistication.  I was recently re-introduced to the Vim editor, which has a graphics component.  And the quirky commands with which I grew so frustrated years ago, I quickly came to appreciate.

And I have spent the last several weeks experimenting and out-fitting my Vim editor with a set of new and powerful tools which have made my life a lot easier.

Index - a php context sensitive file with appropriate highlightingAt Paladin, we do a lot of database programming to which access is usually gained through the web (either internet, or intra net).  Modern practice and convention now suggests that even what was previously the province of ‘desktop’ data-enabled applications are now run using industrial strength database management systems ( such as Oracle, Sql Server, MySQL, or Informix) communicated with and from through a browser (Internet Explorer, Google Chrome, Firefox, etc.)  This has occurred in no small part because of the reluctance of the IT professionals to cede to standards of internet and data processing and delivery to one company whose name begins with ‘M’.

PHP and HTML context highlighting in VimSo the state of the art today allows 6 or 7 different types of Browsers to request and receive information from dozens of mainstream industrial-strength database managers.  This configuration has given rise to a Tower of Babel in which the processing and parsing of data through these channels is typically handled by a variety of languages – each with different grammar, purposes, characteristics and strengths.  As a matter of fact, in any web based data application, it would not be at all unusual for as many as a dozen languages/technologies to be required.

For example:

  1. All communications with the users’ screen is done through HTML, or HTML 5.
  2. The screen appearance can be modified and enhanced using CSS
  3. Variable information sent to the screen comes from the database and is called using PHP, or some similar language
  4. Once the data arrives at the desktop, it is parsed and sorted using Javascript
  5. Jquery encapsulates that data so it appears similar, no matter what browser the user is using
  6. Depending on what data arrives, the screen can be changed using AJAX
  7. XML and XSLT technology can allow runtime applications to dictate output and appearance
  8. Database languages, either Ansi SQL or Javascript may be used to interact with the database proper.

For every one of the above languages, Vim provides support in syntax files, indenting formats, pairing of parentheses, braces, brackets, and control expressions.  There are plugins available in many of the languages which will test for grammatical errors and unclosed expressions.  There is support for many other languages, too: C, C++, Ruby, Python, and others in addition to its power macro and scripting languages.

There is command support within the editor for taking a file from a buffer (many files can be edited concurrently) and sending it to a browser to see if the results are as you expected immediately.  The software allows you to create your own dictionaries (context sensitive, of course), shortcut keys, abbreviations, and a whole host of other very productive stuff.  The product is quirky, to be sure, but it has the aroma of genius.

And here’s a list of Vim resources:

Be Sociable, Share!

2 Responses to “Vim: the Swiss Army Knife of Programming and Website Development Tools”

  1. Thank you for sharing excellent information. Your web site is very cool. I’m impressed by the details that you have on this web site. It reveals how nicely you understand this subject. Bookmarked this website page, will come back for more articles. You, my friend, ROCK! I found just the information I already searched everywhere and just could not come across. What a perfect web site.

  2. Incredible points. Solid arguments. Keep up the great work.|

Leave a Reply