Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

[REBOL] Re: GVIM Editor

From: joel:neely:fedex at: 13-Mar-2002 14:15

Hi, all, Just for the sake of clarification, comparison, and contrast (not for advocacy -- I suspect that the more one thinks about it the smaller the differences appear), let me offer corresponding information for vim. the current official version of vim (6.0 -- 6.1 is still considered beta). Chris wrote:
> Emacs-21.1 is the latest (and best) version of Emacs, you can > obtain it from > > ftp://ftp.gnu.org/gnu/windows/emacs/21.1/emacs-21.1-fullbin-i386.tar.gz >
Vim 6.0 is the latest user release (6.1 is beta as of this note), and is available from many mirrors, including ftp://ftp.us.vim.org/pub/vim/
> The file is about 16Mb, winzip can understand the tar.gz - you > just need to unpack it somewhere on your system and run > emacs-21.1\bin\emacs.exe >
IIRC you can get everything in one file, for example on w32, ftp://ftp.us.vim/org/pub/vim/pc/gvim60.exe which is about 3.5 Mb. Download and execute it to start the install.
> For an example of the different between emacs an vim, take your > recent cut and paste problem. In emacs you just highlight the > section of text you want to cut and either select "Cut" from the > Edit menu, or press Ctrl-w (to copy something simply select the text > - that automagically sticks it in the clipboard). To paste stuff off > the clipboard, more the cursor to where you want it to go and press > Ctrl-y or move the mouse over the location you want it to go and press > the middle mouse button. Copy and paste between other programs via the > clipboard works as well. >
I just did essentially the same thing in gvim 6.0 on my work box running w2k. I selected text by dragging across it with the mouse, right clicked to get a menu containing "Copy", clicked in a different location, right clicked to get a menu containing "Paste" et voila... I could also have used the "Copy" and "Paste" commands from the menu bar in the gvim window, or I could have set the cursor position with the mouse and used keyboard commands "+P or [p to put the copied text before the cursor or "+p or ]p to put the text after the cursor.
> Emacs also offers multiple buffers visible in a single window, >
As does vim.
> or multiple windows each with multiple buffers (makes working on > multiple sources easy). >
Which I've done on a few occasions by simply starting vim twice (or more).
> You can even launch a DOS prompt inside the editor to test your > code without having to start DOS explicitly (press Alt-X, then > type 'shell') >
Using vim on A Real O/S you can: - use :!<command> to run a command and then return to vim (this also works on wimp-dos), - use control-z to suspend vi/vim (if you're using a shell with job control, such as ksh), do something else, and then resume vi/vim with the fg commmand, or - use :!<shellname> to suspend vi/vim and run the named shell (such as sh, ksh, etc.) then type exit to return to the editing session. In the latter two cases, of course, you can run anything you want, whether compiles or whatever.
> Loading files is just a matter of selecting Open File.. from the > file menu >
Same with gvim
> (or pressing Ctrl-C, Ctrl-F) >
which is equivalent to one of :e <filename> or :browse e (which brings up the system file-open dialogue) in gvim.
> saving is done via the menu of Ctrl-C, Ctrl-S. >
Via "Save" or "Save as..." in the menu, or simply by :w in a buffer that was read from a file, or :sav to do the equivalent of "Save as...".
> You can also load a directory list (Ctrl-x, Ctrl-d or look in the > File menu) from which you can load files just by highlighting them > wiht the mouse (navigattion through the directory tree is also > possible). >
See the above description of ":browse e"
> You can switch between buffers by pressing Ctrl and the left mouse > button to get a list, then select the buffer from the menu. >
You can select which buffer you want in the current window/frame by picking it from the "Buffers" menu. Typing :e# switches you to "the other" (most recent) edit buffer for the individual frame you are in. If you have two (or more) frames open in the window, each frame as two buffers that it can switch between with the above command. You can also use keyboard commands such as :#b (where "#" is a number, not the character "#") to pick which buffer to display in the current window/frame, or :#bn (where, again "#" indicates a number) to pick the buffer that is # positions next/forward in the (circular) list of buffers. There are lots of variations, but these make the point that you can be working on (and viewing) multiple files simultaneously in gvim, and can move among them quickly using either the mouse/menus or keystrokes.
> There are modes for more or less every programming language > (including rebol), >
gvim has syntax coloring (with some fairly sophisticated control, see the March 2002 issue of Linux Magazine for an article that shows how to have intelligent syntax coloring that supports a mixture of Scheme and Perl in the same file. As for "mode" in the sense of distinct editing behavior depending on the contents of the edit buffer, one can define macros to do specific. arbitrarily complex editing actions. Those definitions can be either global to the editing session or local to a specific buffer.
> configuration of the program's options is done via a hierarchical > menu system, >
Also available with gvim.
> you can even interactively launch internal operations by pressing > Alt-X and then typing th ecommand (with autocomplete no less) > and... >
vim can be compiled to have a Perl or Python interface, thus allowing you to script vim in either of those languages to manipulate text being edited. When using (for example) a Perl-scriptable copy of vim, you can have a Perl command executed against a specified range of the current buffer, all with a single entry on the command line. I could point out that having an open-source version of REBOL would allow us to have a REBOL-scripted editor (but I won't do so... ;-) Again, my point here is not advocacy, but rather the assertion that both emacs and gvim have evolved along parallel trajetories so that most features/capabilities of one appear somewhere in the other, although with some variation of details. By all means, try all the editors you can get your hands on (and have time to fiddle with) then make your selection based on what meets your own needs. My choice for editors was driven by the same philosophical issues that attracted me to REBOL 1) cross-platform 2) compact but YMMV! -jn-