This is a read-only archive. Find the latest Linux articles, documentation, and answers at the new Linux.com!

Linux.com

Feature

Adding a little Cream to (g)Vim

By Scott Nesbitt on May 16, 2007 (8:00:00 AM)

Share    Print    Comments   

Even though I'm a die-hard Emacs user, there are times when I have to use the vi editor -- specifically gVim, the graphical face of the popular vi clone Vim. Since I use gVim so infrequently, I don't readily remember many of the editor's basic commands. Either I muddle through or reach for my well-thumbed copy of the vi Editor Pocket Reference. That was until I discovered Cream. With Cream, gVim becomes an easy-to-use editor -- so easy, in fact, you might not believe that you're using vi.

Cream is a set of scripts and add-ons that sit on top of gVim. Cream doesn't change the appearance of gVim, but it does change the way it behaves. You no longer need to remember or use the traditional colon followed by one or more letters to execute a command -- for example, :w to save a file. Instead, you can use keystroke combinations that are common to many Linux and Windows text editors, such as Ctrl-C to copy text or Alt-F to open the File menu. Cream's developers bill it as "a modern configuration of the Vim text editor."

Getting Cream is easy. You can download the sources, as well as packages for Debian, Gentoo, Ubuntu, and FreeBSD, from the Cream Web site. A Windows installer is also available. Ubuntu users can get Cream using the Synaptic Package Manager, while users of Linspire and Freespire can install it via the CNR Service. If you use Debian, just run apt-get install cream at the command line.

Cream's gVim menus
Cream's gVim menus - click to enlarge
Getting to work

You start Cream by either clicking the icon that was added to your menu (Applications -> Accessories in Ubuntu), or by typing cream at the command line or in your application launcher. If you've used gVim before, you'll notice that, post-Cream, the menus have changed. As one friend of mine put it, "Cream un-techified Vim." Gone are menus like Syntax and Buffers, which have been replaced by more user-friendly menus with names like Format, Settings, and Insert. You don't have to dig as deeply through Cream's menus to find the command that you're looking for; those commands are just a couple of clicks away.

Cream retains just about all of Vim's features, and it has a few interesting ones of its own. Some of the more useful are a tabbed interface (only available if you're using Vim 7.0 or newer), the ability to quickly wrap or justify text, and a spelling checker. While version 7.0 of Vim has an on-the-fly spelling checker, that feature is missing from older versions of the editor -- like the one I use, version 6.4.6. You can also switch between using Cream keystrokes and commands and those used by vi or Vim. That way, you get the best of both worlds, if you're so inclined.

One aspect of Cream that I found a bit frustrating was not being able to use the handful of Vim extensions that I'd installed. For example, when I open a LaTeX document in gVim, the LaTeX extension displays three additional menus that help me edit and compile files -- but not if I have Cream installed. I wasn't able to find a way to get around this problem.

Files via Cream
Files via Cream - click to enlarge
Using add-ons and plugins

Add-ons are functions that add extra flexibility to Cream. Cream comes with 20 add-ons, some of which you may find useful and others you can do without. With the add-ons, you can strip ASCII text from a binary file, convert a text file to HTML, sort lines, and reformat an email address so that it's not vulnerable to harvesting by spammers. There's also a slide generator add-on that can create an HTML-based slide show using images in a directory that you specify, and a built-in typing tutor for users who wants to improve their typing speed.

Cream also comes with some useful plugin utilities. One is the File Tree, which acts a lot like the Emacs Speedbar extension. Using the File Tree, I quickly navigate around my file system and open files without using the Open File dialog box. While I don't find it incredibly useful, I know a couple of Cream aficionados who can't live without the Calendar plugin, which embeds a calendar within the editor.

If you're a long-time user of Vim and/or gVim, Cream probably isn't for you. You're undoubtedly familiar with many of Vim's commands, and don't need the assistance of a CUA-enabled editor. On the other hand, if you use gVim infrequently or want to take advantage of the power of Vim without learning the editor's commands, then Cream is definitely worth a look.

Scott Nesbitt is a freelance journalist and technical writer based in Toronto, Canada.

Share    Print    Comments   

Comments

on Adding a little Cream to (g)Vim

Note: Comments are owned by the poster. We are not responsible for their content.

Notepad?

Posted by: Anonymous Coward on May 16, 2007 11:00 PM
I'm always amused by people who try to convert ViM into another KWrite/Gedit/Notepad.

Why to butcher ViM? Why not to use originals? - and leave ViM for people who really are using it for its unique features - not Notepad copycats?

I'm bothered by all the stuff, because not on single distro I heard horror stories of VIM being totally unusable. With little research, it usually turning out that packagers have screwed configs for VIM to behave more like Notepad. Or like Emacs. And that's just silly.

If normally one starts by customizing his/her favorite editor. Now people start by de-customizing editors (disabling all the stuff) just to find where the editor itself - and where the all stupid bells'n'whistles are. Because otherwise customization would screw things to worse - since it would conflict with all the funny stuff editor was forced to swallow by packagers.

<nobr> <wbr></nobr>... Ctrl-C to copy text or Alt-F to open the File menu<nobr> <wbr></nobr>...


Guys, if you are using Ctrl-C or menu, than you are most likely not a target audience of VIM.

VIM has stream-lined textual interface which allows one to never ever let his hands off keyboard - nor to change their position. (The abomination to text processing called "Mouse" is totally optional.) VIM is still one of the few (actually single I know) editors suitable for touch typists.

Not everybody is touch typist. But the general accessibility model of serial command like interface (fully accessible from keyboard) is precisely why VIM is so popular with its users.

VIM isn't Notepad - where people are for editor. VIM is "editor for people" which does precisely what I say it to do - not more but not less.

<nobr> <wbr></nobr>... File Tree<nobr> <wbr></nobr>...


Ever tried<nobr> <wbr></nobr>:E? Not the same, but works without "plug-ins"/"add-ons".

On the other hand, if you use gVim infrequently or want to take advantage of the power of Vim without learning the editor's commands, then Cream is definitely worth a look.


IOW trying to learn to swim without leaving coast? Don't be silly.

I have recommended and helped with VIM to many people. And learning is only problem. But unless one would start learning VIM commands - using ViM is pretty much pointless. Since otherwise ViM really is a weird equivalent of Notepad.

You wanna learn VIM - then learn it. Internet is filled with tutorials (which compared to emacs tutorial are actually readable and useful) e.g. <a href="http://www.oualline.com/vim-cook.html" title="oualline.com">VIM Cookbook by Steve Oualline</a oualline.com> or <a href="http://www.google.com/search?q=vim%20tutorial" title="google.com">even dumb web search</a google.com>.

#

Re:Notepad?

Posted by: Anonymous Coward on May 17, 2007 12:49 AM
<a href="http://www.gentoo.org/doc/en/vi-guide.xml" title="gentoo.org">http://www.gentoo.org/doc/en/vi-guide.xml</a gentoo.org>
This is not bad if you want to refresh (very) basic commands. 'vimtutor' is a good starting point. Otherwise use another text editor.

#

Re:Notepad?

Posted by: Anonymous Coward on May 17, 2007 07:18 AM
"Cream doesn't change the appearance of gVim."
"If you've used gVim before, you'll notice that, post-Cream, the menus have changed. As one friend of mine put it, 'Cream un-techified Vim.' Gone are menus like Syntax and Buffers, which have been replaced by more user-friendly menus with names like Format, Settings, and Insert. You don't have to dig as deeply through Cream's menus to find the command that you're looking for; those commands are just a couple of clicks away."


So it actually does change the appearance of gVim quite a bit...

#

Re:Notepad?

Posted by: Anonymous Coward on May 17, 2007 01:29 PM
Amen!

#

Re:Notepad?

Posted by: Anonymous Coward on May 17, 2007 05:24 PM
You're absolutely right. Who needs Cream? Cream is for user stick to old pardigm and who don't understand the textual interface of vim. People often complain, that vim is to complicated to learn and to remember all of its commands. Hey, it is _NOT_ necessary to learn _ALL_ commands, you only need to learn the basics of editing (20 minutes, vimtutor) and after that you should keep in mind not to repeat yourself (DRY) while editing. If you feel so, you can look up<nobr> <wbr></nobr>:help for a special solution. I recommend to see Bram Moolenaar google-video about "7 Habits For Effective Text Editing" on <a href="http://video.google.de/videoplay?docid=2538831956647446078" title="google.de">http://video.google.de/videoplay?docid=2538831956<nobr>6<wbr></nobr> 47446078</a google.de>

#

What's the point?

Posted by: Anonymous Coward on May 17, 2007 12:14 AM

What's the point of trying to make vi look like a different editor? Just use the other editor.


In the proprietary world, making program A look like program B has some point: you avoid paying for program B. But that doesn't apply to FOSS. There are dozens of free (in every sense) editors. Pick the one you like. Use it.

#

Re:What's the point?

Posted by: Anonymous Coward on May 17, 2007 04:28 PM
Vim's huge list of languages it can provide syntax highlighting in
is a reason you might want to set it up for a developer who hasn't much vi experience.

All of these are available under the cream configuration while their
finger memory and familar concepts help them get the work done.
After people get used to it,
I've often then taught them how to get at command mode to perform more complex tasks.
They will be assimilated<nobr> <wbr></nobr>:-)

#

Stick to emacs

Posted by: Anonymous Coward on May 17, 2007 09:02 PM
Vim is not for you it seems...

#

Linux is about choice and Cream is one more

Posted by: Anonymous Coward on May 18, 2007 04:09 AM
So drop the attack swords. Some people like their mouse.

Good work, Cream, and thanks for contributing to open source.

#

I tried but..

Posted by: Administrator on May 17, 2007 07:25 PM
I emerged cream but after typing a little, I unmerged it again. I think this addon removes most of Vim utility.

"ESC doesn't work and ":" appears all over the place, why?" -Vim addict writing in another text editor.

#

This story has been archived. Comments can no longer be posted.



 
Tableless layout Validate XHTML 1.0 Strict Validate CSS Powered by Xaraya