<feed xmlns='http://www.w3.org/2005/Atom'>
<title>vim-nohai/plugin, branch master</title>
<subtitle>Search commands with nohlsearch</subtitle>
<link rel='alternate' type='text/html' href='https://git.teddywing.com/vim-nohai/'/>
<entry>
<title>Add license (GNU GPLv3+)</title>
<updated>2019-12-14T19:02:46+00:00</updated>
<author>
<name>Teddy Wing</name>
</author>
<published>2019-12-14T19:02:46+00:00</published>
<link rel='alternate' type='text/html' href='https://git.teddywing.com/vim-nohai/commit/?id=c85ebc483e4ce512edef128a563f7be08f9c6994'/>
<id>c85ebc483e4ce512edef128a563f7be08f9c6994</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Add guards around the default mappings</title>
<updated>2019-12-14T17:43:42+00:00</updated>
<author>
<name>Teddy Wing</name>
</author>
<published>2019-12-14T17:43:42+00:00</published>
<link rel='alternate' type='text/html' href='https://git.teddywing.com/vim-nohai/commit/?id=26dbeebebf9ff0315b1abd6925a451c080a66d56'/>
<id>26dbeebebf9ff0315b1abd6925a451c080a66d56</id>
<content type='text'>
Don't define the default `g/` and `g?` mappings if there are already
Nohai mappings or if those are already defined.

Add a `g:nohai_no_maps` variable to disable plugin mappings.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Don't define the default `g/` and `g?` mappings if there are already
Nohai mappings or if those are already defined.

Add a `g:nohai_no_maps` variable to disable plugin mappings.
</pre>
</div>
</content>
</entry>
<entry>
<title>plugin/nohai.vim: Add a load guard</title>
<updated>2019-12-14T16:53:55+00:00</updated>
<author>
<name>Teddy Wing</name>
</author>
<published>2019-12-14T16:53:55+00:00</published>
<link rel='alternate' type='text/html' href='https://git.teddywing.com/vim-nohai/commit/?id=92067a48d822307a9167908648f87c1f370612c5'/>
<id>92067a48d822307a9167908648f87c1f370612c5</id>
<content type='text'>
In addition to the default, don't load the plugin if the `CmdlineEnter`
and `CmdlineLeave` autocmd events don't exist.

Learned that these events were introduced in Vim 8.0.1206:
https://vi.stackexchange.com/questions/15875/how-to-test-if-certain-event-is-supported
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
In addition to the default, don't load the plugin if the `CmdlineEnter`
and `CmdlineLeave` autocmd events don't exist.

Learned that these events were introduced in Vim 8.0.1206:
https://vi.stackexchange.com/questions/15875/how-to-test-if-certain-event-is-supported
</pre>
</div>
</content>
</entry>
<entry>
<title>Move functions to autoload/</title>
<updated>2019-12-14T16:32:10+00:00</updated>
<author>
<name>Teddy Wing</name>
</author>
<published>2019-12-14T16:32:10+00:00</published>
<link rel='alternate' type='text/html' href='https://git.teddywing.com/vim-nohai/commit/?id=6d86b086fd480c2403eb93775f72ac67aea41ca1'/>
<id>6d86b086fd480c2403eb93775f72ac67aea41ca1</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Add descriptions to script functions</title>
<updated>2019-12-14T16:25:45+00:00</updated>
<author>
<name>Teddy Wing</name>
</author>
<published>2019-12-14T16:20:53+00:00</published>
<link rel='alternate' type='text/html' href='https://git.teddywing.com/vim-nohai/commit/?id=7c9b04778a88926e2349770a5e8e3e8c09221bc7'/>
<id>7c9b04778a88926e2349770a5e8e3e8c09221bc7</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Rename `s:CR()` to `s:CRAndNohlsearch()`</title>
<updated>2019-12-14T16:15:00+00:00</updated>
<author>
<name>Teddy Wing</name>
</author>
<published>2019-12-14T16:15:00+00:00</published>
<link rel='alternate' type='text/html' href='https://git.teddywing.com/vim-nohai/commit/?id=abbb118307779a07067427ccd611f71719da143b'/>
<id>abbb118307779a07067427ccd611f71719da143b</id>
<content type='text'>
Seemed like I should make the name more explicit.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Seemed like I should make the name more explicit.
</pre>
</div>
</content>
</entry>
<entry>
<title>Remove unnecessary code in `CmdlineEnter` command</title>
<updated>2019-12-14T16:02:03+00:00</updated>
<author>
<name>Teddy Wing</name>
</author>
<published>2019-12-14T16:02:03+00:00</published>
<link rel='alternate' type='text/html' href='https://git.teddywing.com/vim-nohai/commit/?id=fdee7afc4e9378f0235ef52fb35e63b8219e7ffd'/>
<id>fdee7afc4e9378f0235ef52fb35e63b8219e7ffd</id>
<content type='text'>
* The `s:Nohai()` function is unnecessary, as it does the same thing as
  `s:AddMapping()`. Call `s:AddMapping()` directly instead.
* Don't bother checking `cmdwin_char`. Because we limit the
  `CmdlineEnter` `autocmd` to `/` and `?`, the `s:AddMapping()` function
  will only ever be called on `/` and `?`, thus checking its value in a
  condition is redundant.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* The `s:Nohai()` function is unnecessary, as it does the same thing as
  `s:AddMapping()`. Call `s:AddMapping()` directly instead.
* Don't bother checking `cmdwin_char`. Because we limit the
  `CmdlineEnter` `autocmd` to `/` and `?`, the `s:AddMapping()` function
  will only ever be called on `/` and `?`, thus checking its value in a
  condition is redundant.
</pre>
</div>
</content>
</entry>
<entry>
<title>Remove old comments and debug `echom`s</title>
<updated>2019-12-14T15:55:29+00:00</updated>
<author>
<name>Teddy Wing</name>
</author>
<published>2019-12-14T15:55:29+00:00</published>
<link rel='alternate' type='text/html' href='https://git.teddywing.com/vim-nohai/commit/?id=3cde5aeae893ee5a5f1c782ec38df3de70e30a13'/>
<id>3cde5aeae893ee5a5f1c782ec38df3de70e30a13</id>
<content type='text'>
Now that the plugin is working as intended, get these old implementation
ideas and iterations out of the way to allow me to see the code more
clearly and work out what else can be improved.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Now that the plugin is working as intended, get these old implementation
ideas and iterations out of the way to allow me to see the code more
clearly and work out what else can be improved.
</pre>
</div>
</content>
</entry>
<entry>
<title>Deactivate nohlsearch when exiting command line without &lt;CR&gt;</title>
<updated>2019-12-14T15:40:23+00:00</updated>
<author>
<name>Teddy Wing</name>
</author>
<published>2019-12-14T15:40:23+00:00</published>
<link rel='alternate' type='text/html' href='https://git.teddywing.com/vim-nohai/commit/?id=d26b7d079468e89a81b10e81f875169e24a26f49'/>
<id>d26b7d079468e89a81b10e81f875169e24a26f49</id>
<content type='text'>
Previously I was deactivating the &lt;CR&gt; mapping in the rhs of the &lt;CR&gt;
mapping. However, you can also exit command mode without pressing &lt;CR&gt;
(e.g., with &lt;C-c&gt;). In that case, the &lt;CR&gt; mapping would still be
active, causing regular search commands to nohlsearch on completion.

Now, use a `CmdlineLeave` `autocmd` instead to remove the mapping and
autocmd. This ensures the plugin always cleans up after itself when the
search line is exited.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Previously I was deactivating the &lt;CR&gt; mapping in the rhs of the &lt;CR&gt;
mapping. However, you can also exit command mode without pressing &lt;CR&gt;
(e.g., with &lt;C-c&gt;). In that case, the &lt;CR&gt; mapping would still be
active, causing regular search commands to nohlsearch on completion.

Now, use a `CmdlineLeave` `autocmd` instead to remove the mapping and
autocmd. This ensures the plugin always cleans up after itself when the
search line is exited.
</pre>
</div>
</content>
</entry>
<entry>
<title>Escape `?` in `CmdlineEnter` autocmd</title>
<updated>2019-12-14T15:02:13+00:00</updated>
<author>
<name>Teddy Wing</name>
</author>
<published>2019-12-14T15:02:13+00:00</published>
<link rel='alternate' type='text/html' href='https://git.teddywing.com/vim-nohai/commit/?id=b772e113b413a1c12ca97cbcd9086d2cb5e3ca35'/>
<id>b772e113b413a1c12ca97cbcd9086d2cb5e3ca35</id>
<content type='text'>
Turns out `?` needs to be escaped in the character class pattern. This
fixes backwards nohlsearch searching.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Turns out `?` needs to be escaped in the character class pattern. This
fixes backwards nohlsearch searching.
</pre>
</div>
</content>
</entry>
</feed>
