<feed xmlns='http://www.w3.org/2005/Atom'>
<title>vim-grappele/autoload, branch master</title>
<subtitle>Vim plugin to repeat the last G movement</subtitle>
<link rel='alternate' type='text/html' href='https://git.teddywing.com/vim-grappele/'/>
<entry>
<title>autoload/grappele.vim: If no line is stored, make `gG` a no-op</title>
<updated>2020-09-28T23:48:21+00:00</updated>
<author>
<name>Teddy Wing</name>
</author>
<published>2020-09-28T23:34:50+00:00</published>
<link rel='alternate' type='text/html' href='https://git.teddywing.com/vim-grappele/commit/?id=8126766ab7a37961096ff9edf69feed15d9f3b65'/>
<id>8126766ab7a37961096ff9edf69feed15d9f3b65</id>
<content type='text'>
Previously, if you typed, for example:

    dgGk

this would perform `dk`, deleting the current line and the one above it.
That doesn't really make any sense. Instead, the `gG` should cancel the
operator. Do this by mapping to `&lt;C-c&gt;`.

In normal and visual modes, `gG` would move the cursor to the 0th
column. Returning an empty {rhs} causes the cursor to stay in the same
position it was in before pressing `gG`.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Previously, if you typed, for example:

    dgGk

this would perform `dk`, deleting the current line and the one above it.
That doesn't really make any sense. Instead, the `gG` should cancel the
operator. Do this by mapping to `&lt;C-c&gt;`.

In normal and visual modes, `gG` would move the cursor to the 0th
column. Returning an empty {rhs} causes the cursor to stay in the same
position it was in before pressing `gG`.
</pre>
</div>
</content>
</entry>
<entry>
<title>grappele#Recall(): Remove special handling for visual mode</title>
<updated>2020-09-28T23:34:07+00:00</updated>
<author>
<name>Teddy Wing</name>
</author>
<published>2020-09-28T23:31:17+00:00</published>
<link rel='alternate' type='text/html' href='https://git.teddywing.com/vim-grappele/commit/?id=f8bbf6e991d6a5d9768715c0cc915875bc9d9bc9'/>
<id>f8bbf6e991d6a5d9768715c0cc915875bc9d9bc9</id>
<content type='text'>
Now that this is an `&lt;expr&gt;` mapping, we don't need any special handling
for visual mode as this will be taken care of automatically.

Remove the `mode` argument as it's no longer used.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Now that this is an `&lt;expr&gt;` mapping, we don't need any special handling
for visual mode as this will be taken care of automatically.

Remove the `mode` argument as it's no longer used.
</pre>
</div>
</content>
</entry>
<entry>
<title>grappele#Grappele(): Remove varargs</title>
<updated>2020-09-28T23:28:24+00:00</updated>
<author>
<name>Teddy Wing</name>
</author>
<published>2020-09-28T23:12:15+00:00</published>
<link rel='alternate' type='text/html' href='https://git.teddywing.com/vim-grappele/commit/?id=47a6ae90ca533f32576c88b21b988d92d33f865c'/>
<id>47a6ae90ca533f32576c88b21b988d92d33f865c</id>
<content type='text'>
This function no longer needs any extra arguments.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This function no longer needs any extra arguments.
</pre>
</div>
</content>
</entry>
<entry>
<title>Change v_gG and o_gG to &lt;expr&gt; mappings</title>
<updated>2020-09-28T23:17:26+00:00</updated>
<author>
<name>Teddy Wing</name>
</author>
<published>2020-09-28T23:08:31+00:00</published>
<link rel='alternate' type='text/html' href='https://git.teddywing.com/vim-grappele/commit/?id=b39b957b700e98035dd8aa7608feab71d6181c95'/>
<id>b39b957b700e98035dd8aa7608feab71d6181c95</id>
<content type='text'>
Fix visual mode bug where when the cursor is at the top of a visual
selection, pressing `gG` changes the bottom of the visual selection
instead of the top.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Fix visual mode bug where when the cursor is at the top of a visual
selection, pressing `gG` changes the bottom of the visual selection
instead of the top.
</pre>
</div>
</content>
</entry>
<entry>
<title>grappele#Grappele(): Remove unnecessary `l:line` variable</title>
<updated>2020-09-28T23:17:26+00:00</updated>
<author>
<name>Teddy Wing</name>
</author>
<published>2020-09-28T23:05:41+00:00</published>
<link rel='alternate' type='text/html' href='https://git.teddywing.com/vim-grappele/commit/?id=5b5a30da2230b5cd78434c7195c83bd9e108e744'/>
<id>5b5a30da2230b5cd78434c7195c83bd9e108e744</id>
<content type='text'>
Holdover from old code.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Holdover from old code.
</pre>
</div>
</content>
</entry>
<entry>
<title>autoload/grappele.vim: Remove old commented code</title>
<updated>2020-09-28T23:17:26+00:00</updated>
<author>
<name>Teddy Wing</name>
</author>
<published>2020-09-28T23:03:04+00:00</published>
<link rel='alternate' type='text/html' href='https://git.teddywing.com/vim-grappele/commit/?id=51f66aee90c4362a37b0c203939686283499dae3'/>
<id>51f66aee90c4362a37b0c203939686283499dae3</id>
<content type='text'>
Clean up the file by removing old code that's no longer necessary.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Clean up the file by removing old code that's no longer necessary.
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix `gG` omap by removing count</title>
<updated>2020-09-28T23:17:26+00:00</updated>
<author>
<name>Teddy Wing</name>
</author>
<published>2020-09-26T20:24:54+00:00</published>
<link rel='alternate' type='text/html' href='https://git.teddywing.com/vim-grappele/commit/?id=e07089624f0f8b8ba3f024bbf3c0c1a735522d06'/>
<id>e07089624f0f8b8ba3f024bbf3c0c1a735522d06</id>
<content type='text'>
Previously, if we stored a number in `s:line`, for example with `17G`,
then `&gt;gG` would cause lines .,17 to be indented 17 times due to the use
of `V`.

When I removed `V` from the omap, any commands using `gG` operated
characterwise, when they should operate linewise.

Found this answer from Liu Sha
(https://stackoverflow.com/users/7026980/liu-sha)
https://stackoverflow.com/questions/4261177/discarding-count-in-expr-mappings/53182922#53182922
that shows how to discard the count for different types of mappings:

&gt; nnoremap &lt;expr&gt; s "@_" . ToNthSpace()
&gt; vnoremap &lt;expr&gt; s "@_" . ToNthSpace()
&gt; onoremap &lt;expr&gt; s printf(":normal %s\&lt;cr&gt;", ToNthSpace())

The `:normal!` looks like it discards the count, so this gives us what
we want. Adapted the suggestion into a new `&lt;expr&gt;` omap that indents
only once for e.g. .,17.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Previously, if we stored a number in `s:line`, for example with `17G`,
then `&gt;gG` would cause lines .,17 to be indented 17 times due to the use
of `V`.

When I removed `V` from the omap, any commands using `gG` operated
characterwise, when they should operate linewise.

Found this answer from Liu Sha
(https://stackoverflow.com/users/7026980/liu-sha)
https://stackoverflow.com/questions/4261177/discarding-count-in-expr-mappings/53182922#53182922
that shows how to discard the count for different types of mappings:

&gt; nnoremap &lt;expr&gt; s "@_" . ToNthSpace()
&gt; vnoremap &lt;expr&gt; s "@_" . ToNthSpace()
&gt; onoremap &lt;expr&gt; s printf(":normal %s\&lt;cr&gt;", ToNthSpace())

The `:normal!` looks like it discards the count, so this gives us what
we want. Adapted the suggestion into a new `&lt;expr&gt;` omap that indents
only once for e.g. .,17.
</pre>
</div>
</content>
</entry>
<entry>
<title>Trying to fix omap (WIP)</title>
<updated>2020-09-28T23:15:08+00:00</updated>
<author>
<name>Teddy Wing</name>
</author>
<published>2020-09-26T11:50:44+00:00</published>
<link rel='alternate' type='text/html' href='https://git.teddywing.com/vim-grappele/commit/?id=802d388c9dcc1c75b0acd8bcfe75cbd66c76838d'/>
<id>802d388c9dcc1c75b0acd8bcfe75cbd66c76838d</id>
<content type='text'>
gG omap works characterwise but should work linewise.
Adding V to the gG omap causes &gt;17G to indent 17 times instead of once.

Try changing `G` to an `&lt;expr&gt;` mapping to simplify the code, allowing
it to work more exactly like the normal `G`. This resulted in moving the
logic to `grappele#Recall()`, causing problems for `gG`.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
gG omap works characterwise but should work linewise.
Adding V to the gG omap causes &gt;17G to indent 17 times instead of once.

Try changing `G` to an `&lt;expr&gt;` mapping to simplify the code, allowing
it to work more exactly like the normal `G`. This resulted in moving the
logic to `grappele#Recall()`, causing problems for `gG`.
</pre>
</div>
</content>
</entry>
<entry>
<title>Add operator pending and visual mode `G` mappings</title>
<updated>2020-09-20T21:48:59+00:00</updated>
<author>
<name>Teddy Wing</name>
</author>
<published>2020-09-20T21:28:36+00:00</published>
<link rel='alternate' type='text/html' href='https://git.teddywing.com/vim-grappele/commit/?id=3483e377e93e6381e2fea236ceb0e7d2991aa29e'/>
<id>3483e377e93e6381e2fea236ceb0e7d2991aa29e</id>
<content type='text'>
I previously added o- and v-maps for the `gG` mapping, but hadn't done
so for `G`.

This change allows us to reuse lines given to `G` from other modes. For
example:

    173&gt;&gt;..ygG

Didn't use `&lt;Plug&gt;` mappings here because after testing them, there was
a noticeable delay. Found 07a75d523eadaf1027aa8bf287256602ad05f97f,
which describes a performance penalty, so used direct mappings instead.

Kept the `&lt;Plug&gt;Grappele` mapping for a measure of backward
compatibility.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
I previously added o- and v-maps for the `gG` mapping, but hadn't done
so for `G`.

This change allows us to reuse lines given to `G` from other modes. For
example:

    173&gt;&gt;..ygG

Didn't use `&lt;Plug&gt;` mappings here because after testing them, there was
a noticeable delay. Found 07a75d523eadaf1027aa8bf287256602ad05f97f,
which describes a performance penalty, so used direct mappings instead.

Kept the `&lt;Plug&gt;Grappele` mapping for a measure of backward
compatibility.
</pre>
</div>
</content>
</entry>
<entry>
<title>Add operator-pending and visual mode mappings</title>
<updated>2018-12-13T12:49:40+00:00</updated>
<author>
<name>Teddy Wing</name>
</author>
<published>2018-12-13T12:49:40+00:00</published>
<link rel='alternate' type='text/html' href='https://git.teddywing.com/vim-grappele/commit/?id=1926fc6c9fb6f724660a495f23afccc0830de069'/>
<id>1926fc6c9fb6f724660a495f23afccc0830de069</id>
<content type='text'>
New mappings that allow the stored `G` position to be used in both
visual mode and operator-pending mode for greater flexibility.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
New mappings that allow the stored `G` position to be used in both
visual mode and operator-pending mode for greater flexibility.
</pre>
</div>
</content>
</entry>
</feed>
