Just want to notify everyone that there is a 1.31.10 release that rolls out a bunch of bug fixes that were introduced in 1.31.6 (yes I know my version number scheme seems quite arbitrary ><)

  • visual selections where very slow because of an unnecessary paint I was doing
  • when moving a window split in an impossible direction, it would kill that split (now it ignores such an action)
  • using commands that had ouput (such as :source) would not quit properly with ESC or Enter, fixed now.

Its been longer than I had hoped, but I’ve found time to take a look at improving some of Viable. This release I’ve implemented the requested features I got from feedback from users on the forums and by email.

These are the changes:

  • Added the command :set vimwordbound or :set vwb which adds support for usage of vim-like word boundaries (\<\>) in regular expressions.
  • When recording macros, there is now a clear indicator at the bottom of the editor that a macro is being recorded.
  • Added the command :set wrapscan which behaves like vim’s wrapscan, for short use :set ws
  • Fixed a bug where error text produced by incorrect commands would disappear immediately, should display longer now.
  • Added ranges ^,$,[a-zA-z],. that can be prefixed to commands to affect the range that the command is applied to. The breakdown of each is ^ means the beginning of the file, $ means end of file, [a-zA-Z] is any character a-z or A-Z which refers to a mark location, and . means current line.
  • Implemented horizontal splits with :sp
  • Fixed a bug in :vsp where it would always create splits relative to the farthest bottom right window. The behavior should be closer to vim’s now.
  • Can now switch horizontally and vertically between editor splits using ctrl-w-h,j,k,l or equivalently ctrl-w-UP,DOWN,RIGHT,LEFT
  • Added behavior to Viable to allow moving of editors between splits (the eclipse term is moving an editor between editor stacks/ workbooks.) This can be done with the key sequence ctrl-w-m-h,k,l,j or the equivalent arrow keys. This allows moving editors that opened in the incorrect split to the correct split.
  • Added behavior to Viable to allow copying of editors between splits using ctrl-w-n-h,j,k,l or the equivalent arrow key. This is the same as moving an editor between splits, but instead copies it to the destination split and keeps the original.

Remember that if you want to permanently define a behavior for Viable, add it to the configure file, whose location can be found with the command :source. Also remember that keybindings in Viable that use the ctrl key require that no keybinding in eclipse conflicts with it, otherwise they won’t work!

I’m pleased to announce that I’ve been able to find the time to address some of the issues brought up in the forums. This release attempts to fix, or implement the following bugs/features:

  • :s, :%s and :’<,’>s  should be working now.
  • a new :reg command has been implemented to show the contents of registers
  • :set markannot or :set ma for short can be specified to allow marks to be labeled with bookmarks in eclipse.
  • the :bindings and :ebindings commands have been implemented to allow users to bind their own eclipse action to keys in whichever mode. More info here.

I am pleased to announce that my work with eclipse’s CDT parser has finally come to some form of fruition. I’ve marked this release as a major version 1.31.0 (both the Viable Core and Viable CDT features) to celebrate this work.

It is now possible for users of CDT to leverage it to introduce additional text objects in Viable that are not available in Vim. Currently, v1.31.0 implements one trivial example. In the future I hope to introduce many more text objects and motions that use CDT, JDT and possibly PDT (python.)

Viable introduces the text object for function parameters both in function calls and in function declarations. The default binding for this text object is ic. I illustrate its use with an example, suppose you have the C code

/*
 * main.cpp
 *
 *  Created on: 2011-07-04
 *      Author: matt
 */
#include <stdlib.h>

int func1(int v1, int v2)
{
	/*no-op*/
}

int main(int argc, char **argv ){

	func1( func1(1,2), func1( 1+2/3, (4+5)/(4-6)  ) );

	return EXIT_SUCCESS;
}

and suppose that you wish to change func1( 1+2/3, (4+5)/(4-6) ) to func1( (4+5)/(4-6), (4+5)/(4-6) ). Let | denote the cursor position, then you can place the cursor func1( 1+2/3, (|4+5)/(4-6) ) and type yic which will yank the parameter (4+5)/(4-6), then you can place the cursor func1( 1|+2/3, (4+5)/(4-6) ) and type vicp which will visual select the first parameter and paste over it giving you the result. This text object also works for function declarations.

Suppose now you wish to change func1( func1(1,2), func1( 1+2/3, (4+5)/(4-6) ) ); to func1( func1(1,2), 0 );. Placing the cursor func1( func1(1,2), fu|nc1( 1+2/3, (4+5)/(4-6) ) ); and typing cic0 gives the desired result. Similarly, so does vicdi0 which is rather longer but does the same thing with a visual selection.

Jul 052011

This is a quick update to help users figure out where the .viablerc configuration file is located on their systems (for linux users this is simply the $HOME environment variable, but for Mac OSX and Windows users this may vary.) A command :source has been added which prints the location of the configuration file that Viable uses.

This update also introduced the command-line output buffer that will enable printing of register contents in future versions using the :reg command. Also, command-line buffers that extend beyond the width of the current eclipse editor scroll horizontally instead of being simply truncated.

Jul 012011

Rolling another update with the following fixes and new features:

  • Fixed bug where external filters act only on current line even with a selection(yikes!)
  • Now searching with n, N, #, *, /, ? is supported in visual modes
  • Refactoring a class name in JDT no longer causes viable to stop working in that editor
  • Can now yank from read only editors (such as .class file editors in JDT)
  • All jumps in viable are now synchronized with the eclipse navigation history, meaning that running /keyword on a file with the text “keyword” in it and then using C-o or Alt-left will return you to the original location after the search jump. This is very useful.

Finally, after a long time (far longer than it should of taken) I’ve completed more thorough documentation of viable, it can be found here. I’ve opted to change from using Media Wiki to Wikka wiki and as a result, editing the Wiki requires signing up (this is a good way to prevent spam.) Hope this makes using the product a bit clearer.

Now that the documentation is done I can go back to improving the plugin.

A new wiki that will document Viable has been started here. I will be adding more sections to the documentation soon; currently its pretty bare. Thanks to Ryan for the idea :)

Jun 062011

Viable has gone through a thorough set of bug fixes and other improvements in this version, here are some highlights:

  • ctrl+r in command line mode now pastes from specified registers
  • registers are no longer clobbered, that is “xy and “xp now works properly again
  • s, c no longer keep visual selections after completing
  • searching now loops to top or bottom if match is not found
  • line visual mode should work with the o command more than once
  • external filtering works on current line when no selection is specified
  • the vim . range specifier (implying current line) is implemented
  • ctrl u/d now do half page scrolls as they should

The missing documentation is still an outstanding bug :P

There is now only one update site with 1.30.2 as it is the most stable version to date (as far as I’m concerned!)

May 132011

I have finished working on 1.30 and have put it up under the update site located at http://viableplugin.com/update_unstable.

Those who have v1.29  should uninstall it first (by going Help->About->Installation Details in Eclipse 3.6+) before installing 1.30 as the two will not coexist quietly .

v1.30 might have introduced some new bugs so keep your eyes peeled! The features that I promised in 1.30 are mostly implemented though some may be hard to find without some documentation… which I will be writing over the next couple days (or weeks .)

Here’s the short version:

  • go to  vim scripts to learn how to use surround (make sure you select the surround plugin as well when installing)
  • yanking text now yanks into the system clipboard (except in block visual mode)
  • you can paste from the system clipboard into command mode by using ctrl+r while in command mode

The bug fixes are also implemented, so have a ball.

Also, it looks for “.viable.lic” in the root dir of eclipse now (I hope.) If not then the pop up should tell you which directory it is looking in for the license file.