Author Topic: VIM gI - insert text in column 1  (Read 5956 times)

ncrutcher

  • Community Member
  • Posts: 5
  • Hero Points: 0
VIM gI - insert text in column 1
« on: August 18, 2008, 05:43:18 pm »
I've been using VIM for years and really like "gI" command to insert text at column 1.  I also use the normal "I" command to insert text at the first non-blank position, but sometimes I really want to insert at column 1.

The SlickEdit VIM mode doesn't have a "gI" command.  I figured this would be no problem, so I first modified vi_maybe_text_motion() to add it, but the "." (vi_repeat_last_insert_or_delete) command didn't work for "gI".  Then I tried modifying vi_insert_mode() as well, but still couldn't figure out how to get "." to work.  Finally I started studying vi_repeat_info(), vi_repeat_last_insert_or_delete(), etc. but got lost and gave up.

Could anyone help me get "gI" working so that "." also repeats it?  Is there any documentation explaining how to use vi_repeat_info() and vi_repeat_last_insert_or_delete() for this sort of thing?

Thanks,
Nat

Ryan

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 986
  • Hero Points: 77
Re: VIM gI - insert text in column 1
« Reply #1 on: August 18, 2008, 08:40:39 pm »
I'll file a feature request to fully implement "gI" in the next rev of Vim enhancements, but unfortunately I can't help much off the top of my head with the vi_repeat_info mechanism...that stuff is kind of a beast.  Most likely I'll need to actually implement it to give you any helpful advice.  Oh and no, there is no documentation on how that works.

Any other commands that you are used to that you have found missing from SlickEdit?

- Ryan

ncrutcher

  • Community Member
  • Posts: 5
  • Hero Points: 0
Re: VIM gI - insert text in column 1
« Reply #2 on: August 19, 2008, 10:54:25 pm »
There were a few more things I noticed:
1) If I copy text in a different Windows program, I cannot paste it with the VIM "p", but have to use the menu Edit -> Paste instead.
2) The smart brace deletion doesn't work with the VIM "x" or "X".
3) If I visually select a block using the mouse, I can copy it with "y", but cannot delete it with "d".
4) "yy" puts the copied line in the system clipboard (so I can paste it from other apps), but if I visually select a block and yank it with "y", it doesn't end up in the system clipboard.
5) I haven't investigated too much, but it appears that the EX mode searching and searching with "/" and "?" use the SlickEdit regular expressions. It would be nice if they either used the UNIX RegEx or the type of RegEx selected in Options -> Editing -> Search.

Thanks,
Nat
« Last Edit: August 20, 2008, 05:16:06 pm by ncrutcher »

pieps

  • Community Member
  • Posts: 5
  • Hero Points: 0
Re: VIM gI - insert text in column 1
« Reply #3 on: June 09, 2009, 02:43:21 pm »
Is there any plan to implement #5 above? I would greatly appreciate the ability to use Perl or UNIX regexes in Vi search/substitute.