York Zhao | 1 May 2011 18:44
Picon

Re: How do I paste in insert mode

Hi Vegard,

Thanks for applying my patch.

While I was merging the master branch and my local branch I noticed that your changes to "C-o" doesn't seem to be correct. "C-o" in Vim is supposed to escape to command mode for only ONE command and then comes back to insert mode. It is similar to 'r' command which enters inert mode to replace the current char and returns back to command mode immediately. In our case here, the existing 'viper-escape-to-vi' function escapes to command mode but never comes back to insert mode again, thus, I don't think it can be binded directly to 'C-o', and this is why I added the 'viper-escape-to-vi-state' function which switches back to insert mode after one command. Plus, depending on the setting of 'viper-ESC-moves-cursor-back', the cursor position may need to be adjusted by '(viper-forward-char 1)' (even though the 'vipre-ESC-moves-cursor-back' option itself doesn't work which is another bug).

Thanks,

York

On Sat, Apr 30, 2011 at 11:07 AM, Vegard Øye <vegard_oye <at> hotmail.com> wrote:
On 2011-04-26 18:30 +0200, York Zhao wrote:

> Please find attached my patches for three added features. Note that
> I have included Christoph Lange's "g; and g," as well.

Applied in commits c07634c, 32d845f and 1cd84be, with some small
adjustments. It turns out that Viper has an unbound command for
temporarily exiting to vi state, `viper-escape-to-vi', so I bound
that to "C-o" in Insert state.

--
Vegard

_______________________________________________
implementations-list mailing list

_______________________________________________
implementations-list mailing list
implementations-list <at> lists.ourproject.org
https://lists.ourproject.org/cgi-bin/mailman/listinfo/implementations-list
Vegard Øye | 2 May 2011 10:46
Picon
Favicon

Re: How do I paste in insert mode

On 2011-05-01 18:44 +0200, York Zhao wrote:

> In our case here, the existing 'viper-escape-to-vi' function escapes
> to command mode but never comes back to insert mode again, thus, I
> don't think it can be binded directly to 'C-o'

It does come back to Insert state in my setup (Viper version 3.14
of November 22, 2008). Here is the docstring of `viper-escape-to-vi':

    Escape from Emacs state to Vi state for one Vi 1-character
    command. If the Vi command that the user types has a prefix
    argument, e.g., `d2w', then Vi's prefix argument will be used.
    Otherwise, the prefix argument passed to `viper-escape-to-vi'
    is used.

If I am in vi state and type "i C-o x e", then I enter Insert state,
delete the character under the cursor, and insert "e"; I remain in
Insert state.

--

-- 
Vegard
argetek senvx | 2 May 2011 16:07
Picon

Short edits with vimpulse

Hi,

I am hoping to use vimpulse in the following manner:

To have it disabled globally, but bind viper-escape-to-vi to a custom
key so I could perform a quick editing operation when necessary.

I haven't found a documented way of doing this so far so I hope
someone can help me with disabling viper globally...

--

-- 
Regards,

      ~ argetek
Nikolai Weibull | 2 May 2011 17:03
Picon
Gravatar

Re: Short edits with vimpulse

On Mon, May 2, 2011 at 16:07, argetek senvx <argetek.senvx <at> gmail.com> wrote:

> I am hoping to use vimpulse in the following manner:
>
> To have it disabled globally, but bind viper-escape-to-vi to a custom
> key so I could perform a quick editing operation when necessary.
>
> I haven't found a documented way of doing this so far so I hope
> someone can help me with disabling viper globally...

Doesn’t Ctrl-Z do this?

_______________________________________________
implementations-list mailing list
implementations-list <at> lists.ourproject.org
https://lists.ourproject.org/cgi-bin/mailman/listinfo/implementations-list
argetek senvx | 2 May 2011 18:14
Picon

Re: Short edits with vimpulse

Hi!

On Mon, May 2, 2011 at 4:03 PM, Nikolai Weibull <now <at> bitwi.se> wrote:

> Doesn't Ctrl-Z do this?

Yes, toggling it is fine but I am looking at the reverse direction in
general:

I want viper disabled (by default, globally) except for when I
explicitly need it and, that too, should immediately switch back to
normal emacs behaviour as soon as I perform that one-off operation.  So,
I want all buffers to start without viper and I haven't found a way to
do that yet.

I hope this description makes sense.

--

-- 
Regards,

      ~ argetek
York Zhao | 2 May 2011 20:34
Picon

Re: How do I paste in insert mode

I just tested it again, although some minor thing is not handled elegantly, for example, the cursor and the state indicator letter is not changing to confirm with the current state, it did work. Sorry about that.

On the other hand, I still think the document is a bit confusing, the wording is "Escape from Emacs state to Vi state", I didn't think 'Emacs' state is identical to 'insert' state. Maybe my understanding was not correct? :)

Thanks,

York


On Mon, May 2, 2011 at 4:46 AM, Vegard Øye <vegard_oye <at> hotmail.com> wrote:
On 2011-05-01 18:44 +0200, York Zhao wrote:

> In our case here, the existing 'viper-escape-to-vi' function escapes
> to command mode but never comes back to insert mode again, thus, I
> don't think it can be binded directly to 'C-o'

It does come back to Insert state in my setup (Viper version 3.14
of November 22, 2008). Here is the docstring of `viper-escape-to-vi':

   Escape from Emacs state to Vi state for one Vi 1-character
   command. If the Vi command that the user types has a prefix
   argument, e.g., `d2w', then Vi's prefix argument will be used.
   Otherwise, the prefix argument passed to `viper-escape-to-vi'
   is used.

If I am in vi state and type "i C-o x e", then I enter Insert state,
delete the character under the cursor, and insert "e"; I remain in
Insert state.

--
Vegard

_______________________________________________
implementations-list mailing list

_______________________________________________
implementations-list mailing list
implementations-list <at> lists.ourproject.org
https://lists.ourproject.org/cgi-bin/mailman/listinfo/implementations-list
York Zhao | 2 May 2011 20:39
Picon

Re: Short edits with vimpulse

As we have discussed, 'viper-escape-to-vi' only switch to vi for one command, not sure if this is what you want. You can actually switch between vi state and emacs state by pressing 'C-z'.

York


On Mon, May 2, 2011 at 10:07 AM, argetek senvx <argetek.senvx <at> gmail.com> wrote:
Hi,

I am hoping to use vimpulse in the following manner:

To have it disabled globally, but bind viper-escape-to-vi to a custom
key so I could perform a quick editing operation when necessary.

I haven't found a documented way of doing this so far so I hope
someone can help me with disabling viper globally...

--
Regards,

      ~ argetek

_______________________________________________
implementations-list mailing list

_______________________________________________
implementations-list mailing list
implementations-list <at> lists.ourproject.org
https://lists.ourproject.org/cgi-bin/mailman/listinfo/implementations-list
York Zhao | 2 May 2011 20:47
Picon

Re: Short edits with vimpulse

Sorry I didn't read the replies, but what's the point of switching to Vi for just one command?


On Mon, May 2, 2011 at 2:39 PM, York Zhao <gtdplatform <at> gmail.com> wrote:
As we have discussed, 'viper-escape-to-vi' only switch to vi for one command, not sure if this is what you want. You can actually switch between vi state and emacs state by pressing 'C-z'.

York


On Mon, May 2, 2011 at 10:07 AM, argetek senvx <argetek.senvx <at> gmail.com> wrote:
Hi,

I am hoping to use vimpulse in the following manner:

To have it disabled globally, but bind viper-escape-to-vi to a custom
key so I could perform a quick editing operation when necessary.

I haven't found a documented way of doing this so far so I hope
someone can help me with disabling viper globally...

--
Regards,

      ~ argetek

_______________________________________________
implementations-list mailing list

_______________________________________________
implementations-list mailing list
implementations-list <at> lists.ourproject.org
https://lists.ourproject.org/cgi-bin/mailman/listinfo/implementations-list
argetek senvx | 2 May 2011 21:21
Picon

Re: Short edits with vimpulse

On Mon, May 2, 2011 at 8:09 PM, argetek senvx <argetek.senvx <at> gmail.com> wrote:
> Hi,
>
> On Mon, May 2, 2011 at 7:47 PM, York Zhao <gtdplatform <at> gmail.com> wrote:
>> Sorry I didn't read the replies, but what's the point of switching to Vi for
>> just one command?
>
> For one, it would allow an existing emacs user to test waters and
> transition into vimpulse without causing various regressions in their
> key bindings and workflows. :-)

I only want to be able to use terse editing commands occasionally eg
for text objects.  Because viper will be disabled the rest of the
time, I can simply carry on using everything as I normally do with my
fine-tuned configuration.

--

-- 
Regards,

      ~ argetek
argetek senvx | 2 May 2011 21:27
Picon

Re: Short edits with vimpulse

On Mon, May 2, 2011 at 8:21 PM, argetek senvx <argetek.senvx <at> gmail.com> wrote:
> On Mon, May 2, 2011 at 8:09 PM, argetek senvx <argetek.senvx <at> gmail.com> wrote:
>> Hi,
>>
>> On Mon, May 2, 2011 at 7:47 PM, York Zhao <gtdplatform <at> gmail.com> wrote:
>>> Sorry I didn't read the replies, but what's the point of switching to Vi for
>>> just one command?
>>
>> For one, it would allow an existing emacs user to test waters and
>> transition into vimpulse without causing various regressions in their
>> key bindings and workflows. :-)
>
> I only want to be able to use terse editing commands occasionally eg
> for text objects.  Because viper will be disabled the rest of the
> time, I can simply carry on using everything as I normally do with my
> fine-tuned configuration.
>

The frequency will change and I might want to increase the Vi editing
time occasionally (I used to be a Vim user a few years ago) but I
don't want to invest time in viper's key binding settings and
mode-specific overriding because I am waiting to invest that time when
evil is available hopefully with its flexible design.

--

-- 
Regards,

      ~ argetek

Gmane