Author Topic: Improved Vi emulation  (Read 25271 times)

dholshou

  • Community Member
  • Posts: 51
  • Hero Points: 1
Improved Vi emulation
« on: June 23, 2006, 05:05:48 pm »
Although I love vslick and my company has purchased many seats, my fellow programmers are slowly moving over to vim.
I have asked before how I can obtain certain vim style capabilities in vslick, eg. keyboard selection (<shift>v selects line, <ctrl>v selects block, etc.)

Is there improvement planned for the vi emulation in vslick and are there places where I can download plugins or extensions that would allow me to build on the vi capabilities.

These are improvements that I believe would improve the product (and bring back my buddies.)
...
So sorry, I just saw at http://www.unixreview.com/documents/s=10083/ur0605n/ur0605n.html that v11 provides this.
http://www.slickedit.com/index.php?option=com_content&task=view&id=411&Itemid=57
« Last Edit: June 23, 2006, 05:20:25 pm by dholshou »

Ryan

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 987
  • Hero Points: 77
Re: Improved Vi emulation
« Reply #1 on: June 23, 2006, 05:26:40 pm »
Thanks so much for your interest in SlickEdit.  Our Vim emulation is one of the areas which we are looking to improve. 

Quote
I have asked before how I can obtain certain vim style capabilities in vslick, eg. keyboard selection (<shift>v selects line, <ctrl>v selects block, etc.)

SlickEdit version 11 does indeed feature line, character, and block visual mode selections for our Vim emulation.  These visual modes are implemented with most all basic navigation commands.  We added several other improvements to our Vim emulation in this release, including split window commands and navigation.  Is there anything specifically you would like to see added?  This type of information can help us in prioritizing our features...thanks!

dholshou

  • Community Member
  • Posts: 51
  • Hero Points: 1
Re: Improved Vi emulation
« Reply #2 on: June 23, 2006, 05:35:15 pm »
Is there a link that details the Vim features currently available in vslick?

drisner

  • Community Member
  • Posts: 15
  • Hero Points: 2
Re: Improved Vi emulation
« Reply #3 on: June 23, 2006, 06:09:39 pm »
One ability that I really like in VIM is being able to visually select an area then hit the ":" to go into command mode where it will automatically have the line range for the visually selected area so I can then do a search and replace on just the visually selected area.  I know that I can do this using the replace dialog, but it is way faster to do this from the command prompt.

Another great feature of Vim is that the word-completion (similar to the Ctrl-Shift-, and Ctrl-Shift-. completion in SlickEdit) searches for words across all open buffers.  This is so very helpful when doing PHP that I almost always use Vim when editing my PHP stuff instead of SlickEdit.

Ryan

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 987
  • Hero Points: 77
Re: Improved Vi emulation
« Reply #4 on: June 23, 2006, 08:07:03 pm »
Quote
Is there a link that details the Vim features currently available in vslick?

I would suggest you download the version 11 trial...in the /docs directory you can find the Vim emulation chart which has all of our commands documented.  This will also let you try out the emulation, if you would like.

Quote
One ability that I really like in VIM is being able to visually select an area then hit the ":" to go into command mode where it will automatically have the line range for the visually selected area so I can then do a search and replace on just the visually selected area.  I know that I can do this using the replace dialog, but it is way faster to do this from the command prompt.

Another great feature of Vim is that the word-completion (similar to the Ctrl-Shift-, and Ctrl-Shift-. completion in SlickEdit) searches for words across all open buffers.  This is so very helpful when doing PHP that I almost always use Vim when editing my PHP stuff instead of SlickEdit.

Exactly the type of thing we are looking for...keep 'em coming.

 

drisner

  • Community Member
  • Posts: 15
  • Hero Points: 2
Re: Improved Vi emulation
« Reply #5 on: June 26, 2006, 06:38:26 pm »
Another couple of helpful VIM commands that I would love to see in SlickEdit:

zt zb z- zz

These are various ways to put the cursor at the top, bottom and middle of the screen in addition to the standard z.

Edit: I just realized that z- is in there already.  I just always used zt and zb so I didn't realize it before...
« Last Edit: June 26, 2006, 07:03:22 pm by drisner »

drisner

  • Community Member
  • Posts: 15
  • Hero Points: 2
Re: Improved Vi emulation
« Reply #6 on: June 26, 2006, 09:50:35 pm »
OK, here are two more neat Vim commands:

* - Search forward for the current word
# - Search backward for the current word

There is also a difference in how the f command works.  In Vim, if the cursor is on the letter q and there is another q later on the line, if I type fq it will go to the next q.  In SlickEdit, it will stay on the q the cursor is already on until I hit ; to do the f again or if I do 2fq instead of fq.

To me, the Vim behavior seems more intutitive, but maybe it could be an option to select which behavior is used.

dholshou

  • Community Member
  • Posts: 51
  • Hero Points: 1
Re: Improved Vi emulation
« Reply #7 on: July 12, 2006, 08:36:45 pm »
Ok, sorry for the huge post, but when you asked for features, I ran away, started writing, and couldn't stop.

vim specific feature requests:
  1) I 2nd drisner's request to be able to visually select then : to go to a command prompt that applies to the selection only.
    This should apply to commandmode actions on said selection as well. Block mode selections should also be able to make use of this idea. When I use <ctrl>v to select a block of text, I should be able to perform any commandmode action on that selection. Eg. cw to change a visual block to some new content across the whole block or > to shift the block to the right, a '/' search should extend the selection to the next match. etc.
  2) Block cursor while in command mode, 'I' cursor while in insert mode.
  3) Register handling: while in command mode "*y with something selected copies (y for yank) selection to the '*' register. "*p pastes. Vim registers  can do MUCH more, but this is all I use since I can't use <ctrl>c <ctrl>v.
  4) Vim macros. I know vslick has it's own macro language, but...
     I use the macro recording functionality in Vim regularly to do extremely simple tasks repeatedly. I haven't learned slick-c, so I can't comment on how the functionality compares. I'll go do that. It's still a request... While in command mode qm records my next keystrokes (both commandmode and/or insertmode) to macro m, until I hit q again. @m repeats macro m. 100m repeats macro m 100 times.
  5) Work out NDA (or whatever) to actually work with Bram Moolenaar and incorporate the real vim into VSlick... Ok, I can wish, right? ;)

vslick generic feature requests:
  1) Don't undo every cursor movement, only undo edits/actions or offer a setting in preferences on undo behavior.
  2) Undo should only undo 1 action at a time. If I perform a > (vim for shift right) twice, each > is a single undoable action. Ditto with '.' to perform last action again. Each action is one undo step and should only be un[re]done one step at a time.
  3) Make smart next window smarter, ie. <ctrl><tab>. It gets lost sometimes and brings up buffers I haven't accessed recently prior to ones I have. Possibly fixed in a later rev. I'm on rev 9 and just beginning my v11 evaluation period.
  4) Install in "C:\Program Files\" by default on windows platforms instead of C:\.
  5) On windows, default VSLICKCONFIG to "C:\Documents and Settings\USERNAME\Application Data" instead of My Documents or $HOME. I set this specifically, in my environment, a long time ago. I'm not sure if it applies anymore.
« Last Edit: July 12, 2006, 09:24:51 pm by dholshou »

rwehrli

  • Community Member
  • Posts: 13
  • Hero Points: 4
Re: Improved Vi emulation
« Reply #8 on: July 12, 2006, 09:11:03 pm »
Exactly the type of thing we are looking for...keep 'em coming.

Ryan,

Is there some cool way to automagically switch between emulation modes?  There are a LOT of times that I'd like to immediately pop into ViM mode, but then very soon thereafter, return to my normal emulation mode.  I haven't tried it yet, as I tend to just close the open file, open it in ViM and make the ViM edits needed and then reopen the file in SE.

Something else, is there any inherent "danger" is swapping between emulation modes as often as one might like?


Take Care.

Rob!

dholshou

  • Community Member
  • Posts: 51
  • Hero Points: 1
Re: Improved Vi emulation
« Reply #9 on: July 12, 2006, 09:15:00 pm »
Careful with swapping emulations.
You loose all of your key bindings.

BTW: Why is that? Can that be fixed?

Ryan

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 987
  • Hero Points: 77
Re: Improved Vi emulation
« Reply #10 on: July 12, 2006, 09:30:34 pm »
Exactly the type of thing we are looking for...keep 'em coming.

Ryan,

Is there some cool way to automagically switch between emulation modes?  There are a LOT of times that I'd like to immediately pop into ViM mode, but then very soon thereafter, return to my normal emulation mode.  I haven't tried it yet, as I tend to just close the open file, open it in ViM and make the ViM edits needed and then reopen the file in SE.

Something else, is there any inherent "danger" is swapping between emulation modes as often as one might like?


Take Care.

Rob!

dholshou is right...swapping emulations will nuke all of your custom key bindings. What you could do is maintain an rwherli_setup.e file which you could quickly load to regain all of your custom key bindings after switching to/from Vim emulation.  You could also maintain a second configuration directory, and use the -sc invokation option to quickly launch another instance of SlickEdit in Vim mode.  These options might not be too appealing to you...but right now that's pretty much it.

Quote
BTW: Why is that? Can that be fixed?

We realize that this has been a limitation of our emulations/key bindings and changing this is high on our priority list for v12.

alex

  • Community Member
  • Posts: 64
  • Hero Points: 6
Re: Improved Vi emulation
« Reply #11 on: September 30, 2006, 01:04:06 pm »
I'm a Vim user migrating to SlickEdit at work, and while SlickEdit has a lot of features I like, there are still some annoyances in the Vim emulation.

The other Vim feature requests above, by the way, are  generally pretty important to me, especially the ability to execute ex functions in visual mode.

Quote
SlickEdit version 11 does indeed feature line, character, and block visual mode selections for our Vim emulation.  These visual modes are implemented with most all basic navigation commands.

Request 1: I guess by basic you mean things like h,j,k,l?  It's important to me that it also work for things like {,}, w, b, etc.  Basically, every movement command should work in visual mode.  I use it a lot to select a range of text before applying an action, and it doesn't work. In fact, in Vim you can do a search to select a range.  When I looked at the implementation of all the movements that don't work, they use searches.  Maybe if you just get selection for searche working, then that would cover all of them.  I just noticed that SlickEdit *does* support selection using search.  This is great.  I wonder if that can be used to get the rest of the movement commands working?

Request 2: make '. and '' work like they do in vim.  Basically, '. takes you to the last editted line, and '' undos the last major cursor movement.  (E.g., if you do a search.)  In particular, it would  be awesome if '' would work with things like push-tag.  I know that '' is partially implemented in SlickEdit, but it's just not tightly integrated with the rest of the SlickEdit world so it's not as useful as it could be.  '. just doesn't exist, but it's really sweet.

Request 3: Make aliases expand anywhere on the line rather than just at the beginning.  Even if it's only in Vim emulation mode, it would be nice if aliases could be used anywhere; I use it a lot to shorten typing, and I've taken to using AutoHotKey to handle my aliases since SlickEdit doesn't seem support mid-line alias expansion.

Anyway, I can probably write macros that do some of these things, but if you're looking to improve basic support for Vim, this is a good place to start.
« Last Edit: September 30, 2006, 01:14:12 pm by alex »

hmtavares

  • New Community Member
  • Posts: 1
  • Hero Points: 0
Vi Tag files
« Reply #12 on: October 02, 2006, 05:16:53 pm »
Can Slick Edit be made to use unix tag files, or perhaps there is a utility that can convert a tag file to a Slick Edit tag file?

We have a very large codebase that lives on remote unix servers. The couple if times I've tried to get Slick Edit to tag the whole thing I've aborted after several hours. Our build system automatically generates tag and id files for us so all the Vim and Emacs users make fun of me :(

I survive by just Slick Edit tagging a couple of high traffic directories and bailing out to vim if I need to explore further. Suboptimal to say the least.

Thanks for any help.

=MikeT

hs2

  • Senior Community Member
  • Posts: 2733
  • Hero Points: 284
Re: Improved Vi emulation
« Reply #13 on: October 02, 2006, 05:56:54 pm »
I afraid this request won't get a hi prio.
And probably it's not even possible to get all the details Slick stuffs in it's tag databases from a external tag file built by e.g. (which version ?) ctags tool.

Have a look here http://community.slickedit.com/index.php?topic=376.0
or http://community.slickedit.com/index.php?topic=253.0
and roll your own over-night-run script ...

Good luck,

HS2

Clark

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 4157
  • Hero Points: 294
Re: Improved Vi emulation
« Reply #14 on: October 09, 2006, 03:29:30 pm »
How many files are you trying to tag?   We tag the Linux source code as a test case.  It has 40,000 files in it. On my machine with a bad cache size of 32 meg (get thrashing), it took about 15 minutes to build this WITHOUT references.  With a 132 meg cache, it took about 6 minutes to build the same tag file WITH references.  Go to Tools>Options>General>Virtual Memory and set the tagging cache size.

Are the files you are trying to tag remote?  If so, I definitely recommend tagging them locally since this will make a HUGE difference.  This could mean tagging the files with SlickEdit running on the server which has the files.  This is especially useful when there are team of developers using SlickEdits since the tag file only needs to be built once.  Build the tag file overnight.  You can create a workspace and then run vsmktags.exe to retag the workspace every night. 

If you want to refer to this tag file from another workspace, open the second workspace, go to Tools/Tag Files and add the huge workspace tag file to the "Auto Updated-Tag Files" list.