Softpanorama
(slightly skeptical) Open Source Software Educational Society

May the source be with you, but remember the KISS principle ;-)

Google   


Vim - The editor

Softpanorama
Western Orthodox Editors Page

 (VIM6 -- Folding VI-style Editor)

News See also Recommended Links Beginner Tutorials Advanced
Info
Reference Ctags Usenet and maillists
Pipes and ! command Text buffer execution Regular Expressions Searching and replacing Syntax Highlighting Multi
Windows support
Macros Cut and Paste
Tips Perl support Folding ex commands .exrc files History Humor Etc

The introductory paper Orthodox Editors introduced some ideas on which this page was build. Here is the abstract of the paper:

This paper tried to introduce a new concept: orthodox editors as a special category of editors that have command line set of command and respective glue macrolanguage. We have found two such families:

We define the notion of  "orthodox editors" as having at least three distinct features:

This article is a modest attempt to create a basic classification useful for further studying this important class of editors. The author argues that this class of editors can serve as viable mid-weight editors for programmers (see a companion paper A Note on Size-based Classification of Text Editors for discussion of this editor classification)

Read more

I would like to stress the currently vim  is probably the best implementation of vi philosophy.  It preserved two modes editing paradigm and all important achievements of the original vi including:

At the same time vim editing mode (especially in gvim -- GUI version of vim) resembles more typical Windows editor editing mode. It also has better windows control, Perl interface (starting with version 5.x), folding (from  version 6). 

Folding in VIM

Plain vanilla folding primitives in vim6 are too low level to be convenient for the most users. I highly recommend you to install allfold macros  developed by Marion Berryman. It's better to add basic script (allfold_basic.vim)  to plugin directory. It provides all the necessary folding functionality. He also provided more complex experimental script (allfold_full.vim)  that you can play with if you became addicted to this folding ;-).  Some ideas developed by Marion in those two scripts are really good !!!. Here is a short description of the plugin:

The allfold scripts implement a feature set which allows VIM users to view ALL interesting lines in a buffer and FOLD the rest away.  Lines are selected to be interesting in one of the two following ways:

1. They match a regular expression pattern.
2. They are in a block of lines delimited inclusively by a line that matches
   a beginning RE pattern and a line that matches an ending RE pattern.

Sets of lines matching different selection criteria can be combined using logical "and" and "or" operations. The selections may be inverted so that lines not matching the selection criteria are actually selected.

Beyond these basics other features do such things as manipulating lists of selection commands and using the raw selection "bit-map" directly to enhance the capabilities and ease of use of the scripts.

I would change the mnemonic to include the word "all" to respect history of this command. For example:

command! -nargs=+ Allb :call AFB_fold_blocks(<f-args>)
command! -nargs=0 Allf :call AFB_freshen()
command! -nargs=+ Allg :call AFB_grab_view_map(<f-args>)
command! -nargs=0 Allh :call AFB_has_folds()
command! -nargs=? Alli :call AFB_invert(<f-args>)
command! -nargs=+ All :call AFB_fold_pattern(<f-args>)
command! -nargs=0 ALL :call AFB_fold_remove()
command! -nargs=0 Allu :call AFB_undo_prev()

Please note that in the definitions above "All" is command to fold text and "ALL" to unfold. Actually if no parameters supplied to All, it can unfold the text (remove folding).  This was the original Xedit semantic and it makes sense to preserve it.

Like in other orthodox editors the central idea of vi is the idea of the command line command set, the idea that as I stressed before is in some respects more powerful and convenient than getting the same functionality implicitly via cascading menus. An interesting and pretty logical extensions of this idea in vi is the ability to generate command-line command parameters (or even whole commands) using screen.

I think that in its main ideas vi is pretty close to the orthodox editors paradigm that I discussed on the main page of the section.

I would like to reproduce Bill's Joy recollection of how vi was really written  (from  Linux Magazine November 1999 FEATURES The Joy of Unix):

LM:: What inspired you to write vi?

BJ: What happened is that Ken Thompson came to Berkeley and brought this broken Pascal system, and we got this summer job to fix it. While we were fixing it, we got frustrated with the editor we were using which was named ed. ed is certainly frustrating.

We got this code from a guy named George Coulouris at University College in London called em -- Editor for Mortals -- since only immortals could use ed to do anything. By the way, before that summer, we could only type in uppercase. That summer we got lowercase ROMs for our terminals. It was really exciting to finally use lowercase.

LM: What year was that?

BJ: '76 or '77. It was the summer Carter was president. So we modified em and created en. I don't know if there was an eo or an ep but finally there was ex. [laughter] I remember en but I don't know how it got to ex. So I had a terminal at home and a 300 baud modem so the cursor could move around and I just stayed up all night for a few months and wrote vi.

LM: So you didn't really write vi in one weekend like everybody says?

BJ: No. It took a long time. It was really hard to do because you've got to remember that I was trying to make it usable over a 300 baud modem. That's also the reason you have all these funny commands. It just barely worked to use a screen editor over a modem. It was just barely fast enough. A 1200 baud modem was an upgrade. 1200 baud now is pretty slow.

9600 baud is faster than you can read. 1200 baud is way slower. So the editor was optimized so that you could edit and feel productive when it was painting slower than you could think. Now that computers are so much faster than you can think, nobody understands this anymore.

The people doing Emacs were sitting in labs at MIT with what were essentially fibre-channel links to the host, in contemporary terms. They were working on a PDP-10, which was a huge machine by comparison, with infinitely fast screens.

So they could have funny commands with the screen shimmering and all that, and meanwhile, I'm sitting at home in sort of World War II surplus housing at Berkeley with a modem and a terminal that can just barely get the cursor off the bottom line.

It was a world that is now extinct. People don't know that vi was written for a world that doesn't exist anymore -- unless you decide to get a satellite phone and use it to connect to the Net at 2400 baud, in which case you'll realize that the Net is not usable at 2400 baud. It used to be perfectly usable at 1200 baud. But these days you can't use the Web at 2400 baud because the ads are 24 kilobytes.

Peter Salus in his Open Source Library - Papers gives the following version of events:

The original UNIX editor was ed. It was a line editor of reluctant and recalcitrant style. When UNIX (version 4) got to Queen Mary College, London, in 1973, George Coulouris -- a Professor of Computing -- wasn't happy with it. So he wrote a screen editor, which he called "em," or "ed for mortals."

Coulouris went on sabbatical to Berkeley, where he installed em on "his" machine. A graduate student noticed it one day, and asked about it. Coulouris explained. He then went off to New Jersey to Bell Labs, and when he returned to Berkeley, he found that em had been transmuted into ex, a display editor that is a superset of ed and a number of extensions -- primarily the one that enables display editing.

At the beginning of 1978, the first Berkeley Software Distribution was available. It consisted of a tape of the Berkeley Pascal System and the ex text editor. The graduate student was Bill Joy, and the distribution cost $50. The next year Berkeley got some ADM-3a terminals, and Joy rewrote em to vi -- a truly visual editor.

In sum, ed came out of Bell Labs in New Jersey, went to Queen Mary College in London, from there to the University of California at Berkeley, and from there back to New Jersey, where it was incorporated into the next edition of UNIX.

Dr. Nikolai Bezroukov


Notes:
  • Those pages are written by people for whom English is not a native language. Some amount of grammar and spelling errors should be expected.
  • This is a Spartan WHYFF (We Help You For Free) site. It cannot replace the best teachers and the best books.
  • The site contain some obsolete pages as it develops like a living tree... Some links on older pages are broken. Please try to use Google, Open directory, etc. to find a replacement link (see HOWTO search the WEB for details). We would appreciate if you can mail us a correct link.

Search Amazon by keywords:

Google   
Open directory

Research Index

 

Old News ;-)

2004 2003 2002 2001 2000
 

[Feb 6, 2008] Eclim 1.3.4 by Eric Van Dewoestine

About: Eclim (Eclipse integration in vim) is a set of eclipse and vim plugins that bring Eclipse functionality to the vim editor. It exposes Eclipse features through a server interface and includes a set of vim plugins that communicate with Eclipse over that interface.

[Feb 6, 2008] freshmeat.net Project details for Cream for Vim

Cream is a configuration of the famous Vim text editor that makes it easier to use, like an Apple- or Windows-style text editor. It uses Vim's own extensibility to improve menus, keyboard shortcuts, and editing behavior. Cream seamlessly maintains Vim's insertmode to access all the power of the original Vim plus many custom Cream extensions.

Release focus: Minor feature enhancements

Changes:
This is a minor release that adds three common keyboard shortcuts, an updated French translation for menus, better Apple/Mac behavior, and improvements to the Email Prettyfier and Slide Generator add-ons. Cream is now distributed under the newest version of the GNU General Public License, now version 3.

Linux.com Vim tips Using tabs By Joe 'Zonker' Brockmeier

January 24, 2007 | Linux.com
Before Vim 7.0 was released last May, I usually had six or seven xterms or Konsole windows open, each with a single Vim session in which I was editing a single file. This takes up a lot of screen space, and isn't very efficient. With Vim 7.0, users now have the option of using tabs within Vim. With Vim's tab features you can consolidate all your sessions into one window and move between files more easily.

If you're using an version of Vim older than 7.0, you won't have access to this feature. By now, though, most distros have moved to Vim 7.0, so if you're using a recent release you should be OK.

Opening a tab

Let's start by opening a new tab in Vim. There are a few ways to do this. Probably the easiest to remember is to run the :tabnew command while in normal mode. This will open a new tab with an empty buffer. If you want to edit a file in the new tab, you can run :tabnew filename and Vim will load the file in the new tab.

Another way to do this is to open more than one file at startup using the -p option. If you want to open three files in separate tabs, you'd use this syntax:

vim -p file1 file2 file3

This will start a Vim session with file1 in the first tab, file2 in the second tab, and file3 in the third.

Vim will open up as many tabs as you like on startup, up to the maximum number of tabs set in the .vimrc file. The default maximum is 10 tabs, but you can change this by setting the tabpagemax option in your .vimrc, like so:

set tabpagemax=15

If you exceed the number of tabs allowed by tabpagemax Vim will simply open the maximum number of tabs, and the other files will be open but not displayed. You can edit the remaining files by using the :next or :last command to move to the files that are not displayed in a tab. Note that this setting only applies to the maximum number of tabs Vim will open on startup -- you can still open more tabs during your Vim session.

The :tabf command allows you to search for a file in your current path and open it in a new tab. For instance, if you want to open a file called inventory.txt that's in your current path, you could run:

:tabf inven*

That will search for a file that matches the string inven and any number of characters after it. If only one file is found, Vim will open it in a new tab. If you have several files that match, Vim will complain that too many files match, and you'll have to narrow the search a little. The :tabn command will do autocompletion of file names in your path, so you can just type the first few characters of a filename and hit Tab to find the right file.

 

Figure 1  
Figure 1
 

Moving between tabs

You can switch between tabs using :tabn and :tabp, or you can use gt while you're in normal mode. Of course, if you're using Vim's GUI, GVim, you can also use the mouse to switch between tabs or use keyboard shortcuts. In GVim, you can also access a context menu for tabs by right-clicking on the tab bar. Here you can open new tabs with a new buffer or an existing file, or close the current tab.

If you have a lot of tabs open, you can use :tabfirst, or just :tabfir, to jump to the first tab, and :tablast to jump to the last tab that's open.

By default, the tab labels are shown at the top of the Vim window only when tabs are open. If you want to see the tab bar all the time, you can modify the showtabline option in your .vimrc. To set this to display all of the time, use:

set showtabline=2

If you want to turn it off altogether, use 0 instead of 2.

Note that the tabs are still there, even if the tab bar isn't displayed. If you have the tabline option set to 0, you can still see what tabs are open by using the :tabs command, which will provide a summary of open tabs, as you can see in the figure.

Speaking of setting options, if you don't like the existing shortcuts for the tab commands, you can add your own. For instance, if you want to make it easy to open a new tab, you might insert this into your .vimrc:

imap ,t <Esc>:tabnew<CR>

This tells Vim to set up a keymap for ,t in insert mode, to run Esc to put Vim into normal mode, then :tabnew and a carriage return to run the command. You can set up mappings for all of the tab commands that you use regularly. For more on setting up mappings, see our article Using Vim mappings and abbreviations.

Rearranging tabs

If you're really meticulous and want to position tabs just so in Vim, you can move the tabs to a specific spot in the tab order using :tabm n , where n is the position number that you want to use. If you don't give the :tabm command an argument, then the current tab will be moved to the last spot.

Vim starts tab numbering from 0, so if you have six tabs open, you'll have tab 0 through tab 5. So, if you're in the first tab and want to move it to the fourth position, you'd run :tab 3.

Note that you can still use viewports normally within tabbed windows, and tabs are useful for doing a quick edit in a file when you have a main Vim window set up with a couple of viewports arranged just right.

Running commands in tabs

Let's say you're editing six or seven files in Vim and realize that you need to replace a variable name with a new one. Using the :tabdo command, you can run a search and replace through all of the tabs at once rather than changing each file individually. For instance, if you want to replace foo with bar, you'd run this:

:tabdo %s/foo/bar/g

That will run through each open tab and run the search and replace command (%s/foo/bar/g) in each one.

Tabs can be extremely useful, and it only takes a short while to become proficient with them. For more on working with tabs in Vim, run :help tab-page-intro within Vim.

[Nov 6, 2007] Adding a little Cream to (g)Vim By Scott Nesbitt

 May 16, 2007 | Linux.com
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.

 

[Nov 5, 2007] Linux.com A more informative status line for Vim

This article is excerpted from the recently published book Hacking Vim.

To the right, the default status line shows the number of the current row and column and to the left it shows name of the file currently open (if any). Whenever you execute a Vim command, the status line disappears and the command buffer is shown in that line instead. If the command you execute writes any messages, then those are shown on the right of the status line.

For simple and fast file editing, this status line is adequate. But if you use Vim every day and for a lot of different file formats, it would be nice to have a more informative status line.

The command that sets how the status line should look is called:

:set statusline format

where format is a printf-like string that describes how the status line should look.

If you look in the Vim help system by typing :help 'statusline', you will see that the status line can contain a wide variety of information. Some pieces are more useful in your daily work than others.

My status line always contains information about:

The following command will turn your status line into a true information bar with all the above information:

:set statusline=%F%m%r%h%w\ [FORMAT=%{&ff}]\ [TYPE=%Y]\ [ASCII=\%03.3b]\ [HEX=\%02.2B]\ [POS=%04l,%04v][%p%%]\ [LEN=%L] 

I have added a '[ ]' around each of the pieces of information so that it is easier to distinguish them from each other. This is purely to give a visual effect; you can leave them out.

Even after entering that command, the status line still shows the old non-informative status line, as in the default installation. This problem occurs because Vim, by default, does not show the status line at all. Instead, it just shows the command buffer with a little bit of information in it. To tell Vim that you would like to have a real status line shown, you have to add the following setting to your vimrc file. This command will make sure that your status line is always shown as the second last line in the editor window:

:set laststatus=2 

You will then see that the command buffer gets a place of its own in the last line of the editor window. This way there's always room for the status line, and you will always have information about the file right in front of you. The status line does of course take up some of the editing area. You can always remove it for the rest of the editing session by executing the following command from within Vim:

:set laststatus=0

Toggle menu and toolbar

If you are used to working with Vim in the console mode, you are used to having no menus and toolbars at the top of the window. Gvim, however, provides both a menu and toolbar by default in the GUI.

Many users believe that extra room for text is more important than the menu and the toolbar. However, some scripts add useful functionality in the menu, and it is therefore important to have the menus. The solution for this could be toggling whether the menu and toolbar is shown.

The following code maps the key combination Ctrl-F2 to toggle the menu and toolbar in Gvim. You can add it to your vimrc file if you want this functionality.

map <silent> <C-F2> :if &guioptions =~# 'T' <Bar>
                         \set guioptions-=T <Bar>
                         \set guioptions-=m <bar>

                    \else <Bar>
                         \set guioptions+=T <Bar>
                         \set guioptions+=m <Bar>

                    \endif<CR> 

Now, whenever you don't need the menu and toolbar, you can just press Ctrl-F2 and you will get the full space for your text.

If you want either the menu or the toolbar to be hidden all the time, add one of the following lines to your vimrc file. To remove the menu completely:

:set guioptions-=m 

To remove the toolbar completely:

:set guioptions-=T 

Other parts of the GUI can be modified with the setguioptions command. To find out what you can modify, look in :help 'guioptions'.

[Oct 5, 2007] Turn Vim into a bash IDE By Joe 'Zonker' Brockmeier

June 11, 2007 | Linux.com
By itself, Vim is one of the best editors for shell scripting. With a little tweaking, however, you can turn Vim into a full-fledged IDE for writing scripts. You could do it yourself, or you can just install Fritz Mehner's Bash Support plugin.
To install Bash Support, download the zip archive, copy it to your ~/.vim directory, and unzip the archive. You'll also want to edit your ~/.vimrc to include a few personal details; open the file and add these three lines:
let g:BASH_AuthorName   = 'Your Name'
let g:BASH_Email        = 'my@email.com'
let g:BASH_Company      = 'Company Name'

These variables will be used to fill in some headers for your projects, as we'll see below.

The Bash Support plugin works in the Vim GUI (gVim) and text mode Vim. It's a little easier to use in the GUI, and Bash Support doesn't implement most of its menu functions in Vim's text mode, so you might want to stick with gVim when scripting.

When Bash Support is installed, gVim will include a new menu, appropriately titled Bash. This puts all of the Bash Support functions right at your fingertips (or mouse button, if you prefer). Let's walk through some of the features, and see how Bash Support can make Bash scripting a breeze.

Header and comments

If you believe in using extensive comments in your scripts, and I hope you are, you'll really enjoy using Bash Support. Bash Support provides a number of functions that make it easy to add comments to your bash scripts and programs automatically or with just a mouse click or a few keystrokes.

When you start a non-trivial script that will be used and maintained by others, it's a good idea to include a header with basic information -- the name of the script, usage, description, notes, author information, copyright, and any other info that might be useful to the next person who has to maintain the script. Bash Support makes it a breeze to provide this information. Go to Bash -> Comments -> File Header, and gVim will insert a header like this in your script:

#!/bin/bash
#===============================================================================
#
#          FILE:  test.sh
#
#         USAGE:  ./test.sh
#
#   DESCRIPTION:
#
#       OPTIONS:  ---
#  REQUIREMENTS:  ---
#          BUGS:  ---
#         NOTES:  ---
#        AUTHOR:  Joe Brockmeier, jzb@zonker.net
#       COMPANY:  Dissociated Press
#       VERSION:  1.0
#       CREATED:  05/25/2007 10:31:01 PM MDT
#      REVISION:  ---
#===============================================================================

You'll need to fill in some of the information, but Bash Support grabs the author, company name, and email address from your ~/.vimrc, and fills in the file name and created date automatically. To make life even easier, if you start Vim or gVim with a new file that ends with an .sh extension, it will insert the header automatically.

As you're writing your script, you might want to add comment blocks for your functions as well. To do this, go to Bash -> Comment -> Function Description to insert a block of text like this:

#===  FUNCTION  ================================================================
#          NAME:
#   DESCRIPTION:
#    PARAMETERS:
#       RETURNS:
#===============================================================================

Just fill in the relevant information and carry on coding.

The Comment menu allows you to insert other types of comments, insert the current date and time, and turn selected code into a comment, and vice versa.

Statements and snippets

Let's say you want to add an if-else statement to your script. You could type out the statement, or you could just use Bash Support's handy selection of pre-made statements. Go to Bash -> Statements and you'll see a long list of pre-made statements that you can just plug in and fill in the blanks. For instance, if you want to add a while statement, you can go to Bash -> Statements -> while, and you'll get the following:

while _; do
done

The cursor will be positioned where the underscore (_) is above. All you need to do is add the test statement and the actual code you want to run in the while statement. Sure, it'd be nice if Bash Support could do all that too, but there's only so far an IDE can help you.

However, you can help yourself. When you do a lot of bash scripting, you might have functions or code snippets that you reuse in new scripts. Bash Support allows you to add your snippets and functions by highlighting the code you want to save, then going to Bash -> Statements -> write code snippet. When you want to grab a piece of prewritten code, go to Bash -> Statements -> read code snippet. Bash Support ships with a few included code fragments.

Another way to add snippets to the statement collection is to just place a text file with the snippet under the ~/.vim/bash-support/codesnippets directory.

Running and debugging scripts

Once you have a script ready to go, and it's testing and debugging time. You could exit Vim, make the script executable, run it and see if it has any bugs, and then go back to Vim to edit it, but that's tedious. Bash Support lets you stay in Vim while doing your testing.

When you're ready to make the script executable, just choose Bash -> Run -> make script executable. To save and run the script, press Ctrl-F9, or go to Bash -> Run -> save + run script.

Bash Support also lets you call the bash debugger (bashdb) directly from within Vim. On Ubuntu, it's not installed by default, but that's easily remedied with apt-get install bashdb. Once it's installed, you can debug the script you're working on with F9 or Bash -> Run -> start debugger.

If you want a "hard copy" -- a PostScript printout -- of your script, you can generate one by going to Bash -> Run -> hardcopy to FILENAME.ps. This is where Bash Support comes in handy for any type of file, not just bash scripts. You can use this function within any file to generate a PostScript printout.

Bash Support has several other functions to help run and test scripts from within Vim. One useful feature is syntax checking, which you can access with Alt-F9. If you have no syntax errors, you'll get a quick OK. If there are problems, you'll see a small window at the bottom of the Vim screen with a list of syntax errors. From that window you can highlight the error and press Enter, and you'll be taken to the line with the error.

Put away the reference book...

Don't you hate it when you need to include a regular expression or a test in a script, but can't quite remember the syntax? That's no problem when you're using Bash Support, because you have Regex and Tests menus with all you'll need. For example, if you need to verify that a file exists and is owned by the correct user ID (UID), go to Bash -> Tests -> file exists and is owned by the effective UID. Bash Support will insert the appropriate test ([ -O _]) with your cursor in the spot where you have to fill in the file name.

To build regular expressions quickly, go to the Bash menu, select Regex, then pick the appropriate expression from the list. It's fairly useful when you can't remember exactly how to express "zero or one" or other regular expressions.

Bash Support also includes menus for environment variables, bash builtins, shell options, and a lot more.

Hotkey support

Vim users can access many of Bash Support's features using hotkeys. While not as simple as clicking the menu, the hotkeys do follow a logical scheme that makes them easy to remember. For example, all of the comment functions are accessed with \c, so if you want to insert a file header, you use \ch; if you want a date inserted, type \cd; and for a line end comment, use \cl.

Statements can be accessed with \a. Use \ac for a case statement, \aie for an "if then else" statement, \af for a "for in..." statement, and so on. Note that the online docs are incorrect here, and indicate that statements begin with \s, but Bash Support ships with a PDF reference card (under .vim/bash-support/doc/bash-hot-keys.pdf) that gets it right.

Run commands are accessed with \r. For example, to save the file and run a script, use \rr; to make a script executable, use \re; and to start the debugger, type \rd. I won't try to detail all of the shortcuts, but you can pull up a reference using :help bashsupport-usage-vim when in Vim, or use the PDF. The full Bash Support reference is available within Vim by running :help bashsupport, or you can read it online.

Of course, we've covered only a small part of Bash Support's functionality. The next time you need to whip up a shell script, try it using Vim with Bash Support. This plugin makes scripting in bash a lot easier.

 

[Nov 14, 2006] Vifm

Vifm is a ncurses based file manager with vi like keybindings. If you use vi, vifm gives you complete keyboard control over your files without having to learn a new set of commands.

Basic Movement

Marks

Searching Additional Normal Mode Keys Commands File Filters
 

[Oct 25, 2006] Vim 7!

May 8, 2006 (vimannonce grroup) Vim 7 is ready! After years of development this feature packed editor
is waiting for you.

Since Vim 6.4 many new features have been added. To mention a few:

- Spell checking support for about 50 languages
- Intelligent completion for C, HTML, Ruby, Python, PHP, etc.
- Tab pages, each containing multiple windows
- Undo branches: never accidentally lose text again

- Vim script supports Lists and Dictionaries (similar to Python)
- Vim script profiling
- Improved Unicode support
- Highlighting of cursor line, cursor column and matching braces
- Translated manual pages support.
- Internal grep; works on all platforms, searches compressed files
- Browsing remote directories, zip and tar archives
- Printing multi-byte text

Once you have installed Vim 7.0 you can find details about the changes
since Vim 6.4 with ":help version7".

[May 25, 2006] Linux.com Vim tips Folding fun

The problem with writing and editing on a computer, versus having words on paper, is that it's usually hard to compare text from different sections of a document when they don't fit on the screen together. One way to do it is to use Vim's viewports feature. Another is to "fold" the text. Using Vim's folding features, you can tuck away portions of a file's text so that they're out of sight until you want to work with them again. Here's how.

Vim's folding commands begin with z -- which, as the Vim docs point out, sort of looks like a folded piece of paper. OK, maybe not much, but at least the commands are consistent. If you want to do something with folding, it probably starts with z. (Since Vim 7 added spellchecking, some of the spellcheck commands also start with z, but that's a topic for another article.)

Creating folds

Let's start with some simple folding actions. Pick a text file, preferably a longer one like your xorg.conf, or just about any text file that's too big to fit on the screen by itself. Open it in Vim, and place the cursor at the beginning of a paragraph. Make sure you're in normal mode, and type zf2j. After you press j, Vim will create a fold covering three lines -- the line you started the fold on, and the next two lines. If you're familiar with Vim's movement commands, you know that the command 2j would usually tell Vim to move down two lines. Vim uses the same movement commands to define folds.

Folding also works in visual mode. If you enter visual mode using v or V, then select a few lines of text using the movement keys, and type zf, Vim will create a fold comprising those lines.

Another option is to specify a range in command mode. For instance, if you wanted to create a fold from lines 20 through 101, you could just use :20,101 fold and press Enter. In fact, you don't even need to type the entire word -- you can use fo instead of fold if you want to save a couple of keystrokes. Note that this will work backwards as well -- so if you use :.,20 fo when the cursor is on line 101, Vim will reverse the range and create the fold from lines 20 to 101.

Vim can also make some smart text selections. Let's say you're working on a script or program and you have a block of text within braces ({}). Position the cursor on the first brace, and type zfa}. Vim will create a fold from the line with the first brace through the last; it's not necessary to know which lines you're working with, Vim will just look for the closing brace. This also works with other block enclosures -- parenthesis, brackets ([]), and angle brackets (<>).

As an added bonus, Vim also recognizes nested blocks, so it will create the fold based on matching delimiters, and not the first closing bracket it comes across. Vim will also work backwards. If you're on a closing brace, type zfa{ and Vim will create a fold from the current spot to the beginning brace.

Folds are nestable as well -- that is to say, you can create a fold, and then include that within a larger section of folded text.

Finally, you can create a fold from the cursor position to a search result. If you run zf/string , Vim will create a fold from the cursor position to the first instance of the search string. Again, this is useful when you know you want a fold to go from the line you're on to a line further down in the file, but you're not sure what the line number is.

Once you've created a fold you'll see a single line of text that shows how many lines are folded, as well as the initial text, like this:

+-- 15 lines: set_up_socket_dir () {--------------------------------------------

The dashes indicate the foldlevel of the particular fold. For a top-level fold, you should see two dashes. Nested folds will have more dashes. We'll cover the foldlevel in more depth in just a bit.

Vim folding commands
zf#j creates a fold from the cursor down # lines.
zf/string creates a fold from the cursor to string .
zj moves the cursor to the next fold.
zk moves the cursor to the previous fold.
zo opens a fold at the cursor.
zO opens all folds at the cursor.
zm increases the foldlevel by one.
zM closes all open folds.
zr decreases the foldlevel by one.
zR decreases the foldlevel to zero -- all folds will be open.
zd deletes the fold at the cursor.
zE deletes all folds.
[z move to start of open fold.
]z move to end of open fold.
 

Using folds

Creating folds is only half the fun. At some point, you'll no doubt want to unfold the text. One way to do this is to place the cursor on the same line as the fold and type zo. This will "open" the fold, but not delete it. So if you want to do a quick check on some text that's been folded, use zo, and then zc to close it back up when you're finished.

To move between folds quickly, use the zj and zk commands to move to the next and previous fold. Note that it doesn't matter whether the folds are open or closed; if they exist, zj and zk will move backwards and forwards between them. These commands should be easy to remember, since they combine the fold command (z) with movement commands (j to move down a line, and k to move up a line). If you want to move between the start and end of a fold, use [z and ]z, respectively.

As we've already covered, Vim will create nested folds. If you use zo on a nested fold, it will open only the first fold -- the remaining folds will stay closed. However, if you'd like to open all of the nested folds on that line, use zO -- Vim will open all of the folds. Running zc in normal mode will close all the folds after using zO.

The zr command will open all first-level folds in Vim, and zR will open all of the folds in the file. The zm command will re-fold the first-level folds, and zM will close all open folds in a file. If you have multiple foldlevels, a fold within a fold within a fold, running zm will refold them sequentially -- so if all folds are open it will refold the deepest folds, then folds on the next foldlevel, and so on. The zr command works the same way, only in reverse -- it will open the top-level fold, then the next level, and so forth.

When you decide you want to get rid of a fold entirely, position the cursor on the fold and run zd. This will work whether the fold is open or closed. To zap all of the folds at once, type zE. Delete with caution, however. Vim's undo and redo features don't apply to folds; if you delete a fold, you can't press u and bring it back, and the . command won't run the last fold command.

You might be wondering, how does Vim treat text within folds when you are searching for text, or doing a search and replace on a file? Vim treats the text normally. If you search for a string of text that's within a fold, Vim will unfold the text when the cursor moves to the string within the fold. Unfortunately, Vim is a little less than tidy in this regard -- if a search causes a fold to be expanded, Vim doesn't re-fold the text after moving the cursor outside the fold. However, a quick zm will restore the folds.

Vim also treats a folded section of text as a single line for the purpose of deleting and yanking text. If you place the cursor on a section of folded text and use dd, it will delete the entire section, not just the first line. Vim will also allow you to yank the entire folded section of text just by placing the cursor on the folded text and typing Y or yy. The folded section can then be pasted into another section of the text using the p or P commands.

The foldmethod option

Vim's foldmethod option might be of interest to programmers. The default foldmethod is manual -- that is, creating folds manually. However, Vim can also create folds based on the way a file is indented, its syntax, or markers in the text.

To set the foldmethod according to the way a file is indented, run :set foldmethod=indent. This will automatically create folds at every indent. Consider a Cascading Style Sheet (CSS) file like this one:

body {
        background-color: #CCCCCC;
	font-family: arial, helvetica, sans-serif;
}

strong.header {
        font-family: arial, helvetica, sans-serif;
        color: #1D3C47;
}

Once you've set foldmethod=indent, it will look like this:

body {
+---  2 lines: background-color: #CCCCCC;---------------------------------------
}

strong.header {
+---  2 lines: font-family: arial, helvetica, sans-serif;-----------------------
}

Vim also offers a marker method, where folds are set by visible text markers rather than invisible manual marks. To set this mode, run :set foldmethod=marker. Then, when you set a fold, you'll see a marker with three braces at the beginning and end of the fold, like this:

/*{{{*/
Folded text goes here...
/*}}}*/

The braces are set off by comment characters, depending on the type of file. So, if you're working with an HTML file, you'll see <!--{{{-->, and if you're editing a Python script, you'll see #{{{. You can also insert fold markers manually if you want, and Vim will recognize them as well. Vim will also delete the markers with the zd command, whether they were set manually or not.

Fold created with the marker method are subject to undo and redo operations, unlike normal manual folds.

It's possible to set the foldmarker to something other than {{{ if you need to, but the Vim docs recommend that you stick with the defaults. To change the foldmarker, use :set foldmarker=nnn,mmm where nnn is the character string to start the marker, and mmm is the string to end the marker.

If you want to use a foldmethod other than "manual" all the time, add this line to your ~/.vimrc:

set foldmethod=foldoption

Vim has a few other foldmethods that may come in useful. See the foldmethod documentation in the Vim reference materials for more on the foldmethod option.

Saving folds

After you've gone to all the trouble of creating several folds in a longer document, it'd be a shame to lose them when you close the file. If you'd like to save the folds before you leave the file, run :mkview. When you reload the file, run :loadview, and Vim will restore the folds to the state the file was in at the time you ran :mkview.

The :mkview command supports multiple revisions of a file's state, so you can give a view a number and reload later on. For example, if you run :mkview 2, make a few changes, and then run :loadview 2, it will revert to the previous state of the file as far as folds are concerned. Note that it won't restore the file itself to the previous state; if you delete 10 lines of text after saving a view, Vim won't restore those lines when you load an older view using :loadview.

But why do something manually when you can do it automatically? To see to it that Vim saves and restores folds when a file is closed and re-opened, add these two lines to your ~/.vimrc:

au BufWinLeave * mkview
au BufWinEnter * silent loadview

Now, each time you close a file, its fold state will be saved and reloaded when you reopen the file in Vim.

When you add folds to other features like viewports and marks and jumps, Vim becomes an insanely productive tool for text editing and programming.

[May 17, 2006] Linux.com Vim tips Moving around using marks and jumps by Joe 'Zonker' Brockmeier

Basically, a mark is a bookmark or placeholder that allows you to return to a spot in the file where you were editing. This can be handy when you're working on longer projects, whether you're writing a long paper, making changes to your Apache configuration, or writing code.

Jumps are movements within a file. For example, when you use G to move to the last line of a file from your current position, that's a jump. Vim not only makes it easy to move from one point in the file to another, it also makes it easy to retrace your steps.

m marks the spot

Let's take a look at Vim marks. All you need to do to set a mark is to enter normal mode, then type mx , where x is the letter you want to assign to the mark.

For example, if you're typing and decide that you need to set a mark so you can return to a sentence or line of code you're not entirely happy with, press Esc to leave insert mode, then type ma to set a mark at the spot your cursor was on.

You can use any letter in the alphabet, upper or lower case. However, capital letters are global marks, so you should use them only in special circumstances, which I'll explain in just a bit. It's not necessary to use them in alphabetical order; you can set mark z right after setting mark a if you like, or skip a altogether and start with z.

To return to the mark you've set, enter normal mode (if you're not in normal mode already) and type `x where x is the letter associated with the mark you want to revisit. The backtick (`) will return you to the exact spot where the mark was set. You can also use the single quote ('), which will return you to the beginning of the line you were at, but not the exact cursor position.

Marks set with lowercase letters are specific to the file that they're set in. That is to say, if you are using a Vim session to edit two files in a split viewport, then you can set mark a in both files. When you're editing file 1, using `a would take you to mark a in file 1. When in file 2, `a would take you to the spot in file 2 marked a -- which is probably what you'd expect.

However, if you're using Vim to edit two files and you've set mark A, it will be specific to that file. So, if you're editing file 2, and have mark A set in file 1 and use `A, Vim will close the current file and take you to mark A in file 1. If file 2 has unsaved changes, Vim will complain that you haven't written the file since the last change, and refuse to open the new file.

While global bookmarks are useful on occasion, it's usually best to stick to lower-case marks unless you have a specific need for global bookmarks.

Now where did I leave that?

After spending an hour or two editing a file, you might forget exactly where you've set marks in a file. If you'd like to see where they are, you can enter command mode and use the :marks command. Vim will display the name of each mark, the line and column number where it is set, and part of the text from that line. Note that Vim won't start the display on the column where the mark begins -- instead, you'll see the beginning of the line where the mark is set. So, if you've set marks for a, b, and c, you will see where those marks are set, but you'll also see a few other marks that you might not recognize. Here's a shortish example:

mark line  col file/text
 '    112    0
 a     11    3 <p>For example, if you're typing and decide that you
 b    103    0 <p>By default, when you exit Vim, the marks that you've
 D     26    0 ~/src/gaim-2.0.0beta2/src/Makefile
 0     61   60 <p>The " mark is set to the last position of the cursor
 1    103    0 <p>By default, when you exit Vim, the marks that you've
 "     35    0 <p><strong><code style="background-color: yellow;">'"</code>
 [     52    0
 ]     54    0
 ^     54    0
 .     73  115 <p>The . mark will take you to the last position a change
Press ENTER or type command to continue
Vim mark quick reference
 

mx tells Vim to add a mark called x.

`x tells Vim to return to the line and column for mark x.

'x tells Vim to return to the beginning of the line where mark x is set.

`. moves the cursor to the line and column where the last edit was made.

'. moves the cursor to the line where the last edit was made.

'" moves the cursor to the last position of the cursor when you exited the previous session.

:marks shows all marks set.

:marks x shows the mark named x.

:jumps shows the jumplist.

Ctrl-o moves the cursor to the last jump.

Ctrl-i moves the cursor to the previous jump.

H moves the cursor to the top of the screen or viewport.

M moves the cursor to the middle of the screen or viewport.

L moves the cursor to the bottom of the screen or viewport.

Specifically, you'll see marks for ., [, ], ", ', and a few others. Those marks are present whether you've set any marks manually or not. The [ and ] marks indicate the last changed or copied ("yanked") text. The [ mark is the first character of the text that's been changed or yanked, the ] is the last character of that text. Note that these marks don't work until you actually make a change in the file.

The . mark will take you to the last position a change was made. So, '. will take you to the line where the last change was made in your file, and `. will take you to the cursor position where the last change was made.

If you make a jump within a file -- that is, if you use a movement or search command to move within the file -- the ` character will return you to the position you started from. For example, using the G movement command you can jump to the bottom of the file. If you want to return to the last cursor position, use `` and you'll be moved back to the last location of the cursor before using G. We'll discuss jumps in more detail a bit later.

The " mark is set to the last position of the cursor when you exited the previous Vim session, if you have Vim configured to save your session information using a viminfo file. We'll cover that in just a bit too.

Finally, if your session information is being saved, you can also use numbered marks to return to the last position the cursor was at when you closed a file. Using numbered marks, `0 will move the cursor to the last position it was at when you closed a file. `1 will move the cursor to the last position it was at when you closed the file the time before last, and so forth.

If you just want to know where a specific mark is in the file, you can use :marks markname to display just those marks. To see marks a and B, for instance, you'd just use :marks aB. This is pretty useful when you have 10 or 20 marks set.

Advanced marking

Marks are useful for more than just moving about a file -- though that feature alone is very useful. Marks can also be used to specify a range for commands. Normally, if you want to delete a few lines, you can use line numbers to specify the line, like so:

:22,55 d

That will delete lines 22 through 55. But it's much easier to remember marks than line names most of the time. If you have line 22 marked as g and 55 marked as k, you could substitute :'g,'k d and remove those lines without having to go back and confirm the line numbers. This works with other commands too, so you could just as easily write those lines to a file using :'g,'k w filename or use the range for a substitution command like this:

:'g,'k s/foo/bar/g

The jumplist

Vim stores a list of your movements throughout a file, whether they're associated with marks or not. To see a full list of jumps within a file, use :jumps. Here's a short sample:

:jumps
 jump line  col file/text
    3     1    0 /**
    2   608    0 }
    1    33    0 #include "log.h"
>
Press ENTER or type command to continue

Vim lists the jump number, line number, and column of the last location of the cursor for each jump, as well as a bit of text to help provide context. You can cycle between jump locations using the Ctrl-o and Ctrl-i keybindings. Ctrl-o will move you to the last jump, then the next-to-last, and so forth. In this instance, if you use Ctrl-o, you'd be taken to line 33, then line 608, then 1. To move forwards through the jump history, use Ctrl-i -- which would take you from line 1 (jump 3) to line 608, then line 33.

Though they're not jumps, since we're discussing moving around a file easily, you might want to familiarize yourself with the movement commands G, gg, H, M, and L. G, as we've already discussed, will take you to the bottom of the file. The gg command will move you to the top of the file. The H, M, and L commands will move you to the top, middle, and bottom of the screen, respectively.

Saving marks and jumps

By default, when you exit Vim, the marks and jumps that you've created are lost. Luckily, there's an easy way to save the marks you've created by making use of the viminfo file, which saves state information between Vim sessions.

To make sure this feature is enabled, open your .vimrc and look for a line that begins with set viminfo=. If you don't have that line, insert it. It should look something like this:

set viminfo='100,f1

If you have viminfo set, it will save local marks (a-z) by default. The '100 tells Vim to save marks and other information for up to 100 files. The f1 directive tells Vim to also save global marks (A-Z) when it exits. If you don't want Vim to do this, set it to f0 instead.

You can use the viminfo file for a lot more than saving marks and jumps, but we'll have to cover that in a future installment.
 

[May 10, 2006] Linux.com Vim tips Using viewports

A lot of folks use Vim, but many exploit only a small percentage of the editor's features. Sure, you might know how to do the basics in Vim, but what about using more advanced features such as folding, split windows, and marks? With a little practice, you can really boost your productivity with Vim.

In this and future articles, I'm going to cover Vim features that you may not be familiar with if you're a casual Vim user. If you're confident using Vim to edit configuration files or make short edits in text files, but maybe not too comfortable with undertaking major writing or coding in Vim, then these articles should be for you.

Splitting Vim's viewport

A really useful feature in Vim is the ability to split the viewable area between one or more files, or just to split the window to view two bits of the same file more easily. The Vim documentation refers to this as a viewport or window, interchangeably.

You may already be familiar with this feature if you've ever used Vim's help feature by using :help topic or pressing the F1 key. When you enter help, Vim splits the viewport and opens the help documentation in the top viewport, leaving your document open in the bottom viewport.

Vim viewport keybinding quick reference
 

:sp will split the Vim window horizontally. Can be written out entirely as :split .

:vsp will split the Vim window vertically. Can be written out as :vsplit .

Ctrl-w Ctrl-w moves between Vim viewports.

Ctrl-w j moves one viewport down.

Ctrl-w k moves one viewport up.

Ctrl-w h moves one viewport to the left.

Ctrl-w l moves one viewport to the right.

Ctrl-w = tells Vim to resize viewports to be of equal size.

Ctrl-w - reduce active viewport by one line.

Ctrl-w + increase active viewport by one line.

Ctrl-w q will close the active window.

Ctrl-w r will rotate windows to the right.

Ctrl-w R will rotate windows to the left.

If you want to use this feature for something other than viewing Vim's help files, you can split the viewport by using :sp, :split, or Ctrl-w n -- they do the same thing, but just typing :sp will save you a few characters, and it's easier to use with arguments, such as filenames. Remember the Ctrl-w part, though, because it will come in handy for most operations with windows.

The :sp command will divvy up the viewport into two equal viewports for the file that you have open. If you'd like to work on two files simultaneously, no problem -- just follow the command with the filename you'd like to use, like this:

:sp filename

That will open filename in the new viewport. You can even add a search string to that to move directly to the first instance of a keyword, like so:

:sp +/searchstring filename

Easy as falling off a log. What if you don't want to have equal viewports? For example, let's say you want to open a reference file in the top viewport, but want the majority of the viewport available for the file you're actually editing. No problem. Just prepend a number to the sp command, and the new viewport will fill that number of lines:

:10 sp filename

Now you have a viewport with 10 lines, but what if you've decided that you'd like to give both viewports equal real estate? That's easy enough too. Instead of going into command mode, you can use a normal keybinding to accomplish this. Ctrl-w = tells Vim to assign an equal number of lines to each viewport.

To move between the viewports while working, use Ctrl-w j to move down, and Ctrl-w k to move up. This should prove easy to remember -- Ctrl-w for "window" commands, and the normal vi movement commands j for down and k for up. You can also cycle between viewports by using Ctrl-w Ctrl-w.

You can increase or decrease a viewport's size after it's been created. Use Ctrl-w + to increase the active viewport, and Ctrl-w - to decrease its size by one line. If one line at a time isn't sufficient, add a modifier before the + or -. For instance, to add 13 lines, use Ctrl-w 13+.

If horizontal viewports just don't do it for you, Vim also supports splitting viewports vertically. To do this, just use :vsp, or :vsplit if you prefer to spell it out. Movement between vertical viewports is similar to moving between horizontal viewports. Ctrl-w Ctrl-w works, and instead of using the j and k movement keys, use the h and l movement keys to move back and forth between viewports. To move to the viewport to the right, for example, you'd use Ctrl-w l.

It's also worth mentioning that you can open a file in a viewport just to view the file, without opening it to edit. To do this, use the :sview filename command. To do it vertically, use :vert sview filename .

You can close a window in one of several ways. The easiest is to just use the quit command, :q, or you can use Ctrl-w q. Note that if it's the only window open with a file, Vim will prompt you to save the file if it isn't saved already.

Also, it's possible to rotate the windows, if you decide you'd prefer to have the top window on the bottom or vice versa. To do this, use Ctrl-w r to move windows to the right or down. When you do this, for example, in a Vim session with three horizontal viewports open, the top viewport would go to the middle position, the middle viewport would take the bottom position, and the bottom viewport would rotate to the top. To go in the opposite direction, use Ctrl-w R instead.

Vim often offers several different ways to achieve the same things. For instance, as I pointed out, :sp, :split, and Ctrl-w n all create a new viewport. I haven't listed all of the possible commands or keybindings to accomplish all of the tasks here.

Over the years, I've found Vim's split windows features to be very useful. I often use it to edit a column or article in one viewport, and to read and copy from notes in another viewport.

[Mar 28, 2006] All about Linux Vim author gets hired by Google

Things have changed though - at least for Mr Moolenaar, because he has just been hired by Google and will start working for the search giant in Zurich. Does that mean, further development of Vim is going to take a back seat? Not at all! Bram has committed himself to its further support and development albeit at a reduced pace.

On a different note, I came across this cool cheatsheet which acts as a spring board in getting up and running in using vi / vim with ease. Of course, this is not in any way related to the official project.

[Nov 15, 2005] Windows Manager - 1.0

winmanager.vim is a plugin which implements a classical windows type IDE in Vim-6.0. Vim6.0 has some very cool features one of which is vertical splitting of windows. The time was thus ripe to make something like this. People have already made excellent File and Buffer explorers seperately and I thought that it might be a cool idea to combine them both.

winmanager.vim combines the standard File Explorer which ships with Vim6.0 and a Buffer Explorer written by Jeff Lanzarotta into one package. Unfortunately, I had to change a few features here and there so instead of using the packages as is, I have to ship a relatively very small plugin with all of the original code from both packages basically just dumped at the end with just a few things changed here and there. When you open up a new file, simply type in :WManager. This will start up the file explorer.

[Jun 01, 2005] perl-support.vim : Perl-IDE

Write and run Perl-scripts using menus and hotkeys. (2.6) + blocks: opening brace no longer on a new line (adjustable for backward compatibility). + Vim (without GUI): new key mappings: all entries in the run menu do have mappings now. + Vim (without GUI): perldoc can be read with hotkeys \h and \rp . + Vim (without GUI): perldoc displays docs using plain text converter.+ output into buffer: cursor goes to top of file. + trailing ^M in perldoc window... - Fritz Mehner

[Mar 1, 2005] Vim Color Schemes

Featuring 161 themes:

Continued...


Recommended Links

Configuration

 

Some comparisons


Usenet and mail lists

Please read all of the VIM FAQ before asking questions. Thanks!

Usenet Newsgroup with a lot of vim users: comp.editors

Yahoo! Groups vim


Tutorials


Advanced VI


Reference

see also The VI Pages - All About VI and its clones

Reference cards:

  1. How do I move the cursor in the file?

  2. How do I insert text?

Once you entered input mode, the way to return to command mode is by hitting the Escape key: ESC or CONTROL-[.

  1. How do I delete something?

  2. How to undo and repeat commands?
     

Sun bloggers

The Clingan Zone

Etc

the vi reference mug



Copyright © 1996-2007 by Dr. Nikolai Bezroukov. www.softpanorama.org was created as a service to the UN Sustainable Development Networking Programme (SDNP) in the author free time. Submit comments This document is an industrial compilation designed and created exclusively for educational use and is placed under the copyright of the Open Content License(OPL). Original materials copyright belong to respective owners. Quotes are made for educational purposes only in compliance with the fair use doctrine.

Standard disclaimer: The statements, views and opinions presented on this web page are those of the author and are not endorsed by, nor do they necessarily reflect, the opinions of the author present and former employers, SDNP or any other organization the author may be associated with. We do not warrant the correctness of the information provided or its fitness for any purpose.

Last modified: February 28, 2008