<feed xmlns='http://www.w3.org/2005/Atom'>
<title>dotvim/bundle/diff-corrections, branch master</title>
<subtitle>My vim configuration</subtitle>
<link rel='alternate' type='text/html' href='https://git.teddywing.com/dotvim/'/>
<entry>
<title>diff-corrections: Apply diff corrections on BufEnter</title>
<updated>2023-12-08T23:20:40+00:00</updated>
<author>
<name>Teddy Wing</name>
</author>
<published>2023-12-08T21:08:41+00:00</published>
<link rel='alternate' type='text/html' href='https://git.teddywing.com/dotvim/commit/?id=0e40dbd6cd88228127eaec0e50290236bf573644'/>
<id>0e40dbd6cd88228127eaec0e50290236bf573644</id>
<content type='text'>
Ensure that diff corrections are applied in a `vimdiff` context, where
we haven't run `:diffthis` manually.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Ensure that diff corrections are applied in a `vimdiff` context, where
we haven't run `:diffthis` manually.
</pre>
</div>
</content>
</entry>
<entry>
<title>diff_corrections: Use better autocmds</title>
<updated>2019-06-07T22:20:54+00:00</updated>
<author>
<name>Teddy Wing</name>
</author>
<published>2019-06-07T22:20:54+00:00</published>
<link rel='alternate' type='text/html' href='https://git.teddywing.com/dotvim/commit/?id=1f7b977e7568d0759131c5f91459661f3e030691'/>
<id>1f7b977e7568d0759131c5f91459661f3e030691</id>
<content type='text'>
Thanks to Christian Brabandt
(https://vi.stackexchange.com/users/71/christian-brabandt) for
describing better autocmds for detecting diff mode:
https://vi.stackexchange.com/questions/12847/automatically-disable-cursorline-when-in-diff-mode/12852#12852

And for making the patch
(https://github.com/vim/vim/commit/04f62f881c5743d2fdaf7324f6a715381f0d5fcf)
that allows diff mode to be detected with the OptionSet event.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Thanks to Christian Brabandt
(https://vi.stackexchange.com/users/71/christian-brabandt) for
describing better autocmds for detecting diff mode:
https://vi.stackexchange.com/questions/12847/automatically-disable-cursorline-when-in-diff-mode/12852#12852

And for making the patch
(https://github.com/vim/vim/commit/04f62f881c5743d2fdaf7324f6a715381f0d5fcf)
that allows diff mode to be detected with the OptionSet event.
</pre>
</div>
</content>
</entry>
<entry>
<title>diff_corrections: Set 'wrap'</title>
<updated>2019-06-03T20:18:36+00:00</updated>
<author>
<name>Teddy Wing</name>
</author>
<published>2019-06-03T20:18:36+00:00</published>
<link rel='alternate' type='text/html' href='https://git.teddywing.com/dotvim/commit/?id=0254acfd71877910ce19ec3404cd8e25c1b13e6b'/>
<id>0254acfd71877910ce19ec3404cd8e25c1b13e6b</id>
<content type='text'>
Soft wrap in diffs. Recently encountered diffs with super long lines and
thought it would be nice to be able to see everything on one page
without having to scroll horizontally.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Soft wrap in diffs. Recently encountered diffs with super long lines and
thought it would be nice to be able to see everything on one page
without having to scroll horizontally.
</pre>
</div>
</content>
</entry>
<entry>
<title>diff_corrections: Add `cx` mapping to close tab</title>
<updated>2019-06-03T19:58:21+00:00</updated>
<author>
<name>Teddy Wing</name>
</author>
<published>2019-06-03T19:58:21+00:00</published>
<link rel='alternate' type='text/html' href='https://git.teddywing.com/dotvim/commit/?id=cea8855836335942886b4e2a3fea4a3d7d549b3c'/>
<id>cea8855836335942886b4e2a3fea4a3d7d549b3c</id>
<content type='text'>
Add a mapping to quickly close a tab. Makes it easier to close files
that I've finished reviewing.

Thanks to user9433424
(https://vi.stackexchange.com/users/6960/user9433424) on the Vi Stack
Exchange for the very detailed explanation of how to restore a mapping:
https://vi.stackexchange.com/questions/7734/how-to-save-and-restore-a-mapping/7735#7735

Using user9433424's mapping restore code, and ignoring the case where a
mapping is defined both globally and local to a buffer.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Add a mapping to quickly close a tab. Makes it easier to close files
that I've finished reviewing.

Thanks to user9433424
(https://vi.stackexchange.com/users/6960/user9433424) on the Vi Stack
Exchange for the very detailed explanation of how to restore a mapping:
https://vi.stackexchange.com/questions/7734/how-to-save-and-restore-a-mapping/7735#7735

Using user9433424's mapping restore code, and ignoring the case where a
mapping is defined both globally and local to a buffer.
</pre>
</div>
</content>
</entry>
<entry>
<title>diff-corrections: Don't load if the lambda feature isn't available</title>
<updated>2019-05-17T20:59:56+00:00</updated>
<author>
<name>Teddy Wing</name>
</author>
<published>2019-05-17T20:59:56+00:00</published>
<link rel='alternate' type='text/html' href='https://git.teddywing.com/dotvim/commit/?id=d9f940343daacfd547d9000b8664f06908a9b8e4'/>
<id>d9f940343daacfd547d9000b8664f06908a9b8e4</id>
<content type='text'>
I wrote the `s:SaveCommentColor()` function using a lambda for
`filter()`ing. However, not all Vims have `lambda` support. And it
doesn't exist before Vim 7.4 I think. Use this guard to avoid causing
errors on startup for those Vims without lambdas.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
I wrote the `s:SaveCommentColor()` function using a lambda for
`filter()`ing. However, not all Vims have `lambda` support. And it
doesn't exist before Vim 7.4 I think. Use this guard to avoid causing
errors on startup for those Vims without lambdas.
</pre>
</div>
</content>
</entry>
<entry>
<title>diff-corrections/plugin: Add load guard</title>
<updated>2019-05-17T20:51:58+00:00</updated>
<author>
<name>Teddy Wing</name>
</author>
<published>2019-05-17T20:51:58+00:00</published>
<link rel='alternate' type='text/html' href='https://git.teddywing.com/dotvim/commit/?id=b2f94159f0cd922259847727b917a6271a4b6be3'/>
<id>b2f94159f0cd922259847727b917a6271a4b6be3</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>diff-corrections: Restore old 'cursorline' and Comment highlight</title>
<updated>2019-05-17T20:48:07+00:00</updated>
<author>
<name>Teddy Wing</name>
</author>
<published>2019-05-17T20:48:07+00:00</published>
<link rel='alternate' type='text/html' href='https://git.teddywing.com/dotvim/commit/?id=d389fdd35788385415dc972dd5c4ef7dcb3448c0'/>
<id>d389fdd35788385415dc972dd5c4ef7dcb3448c0</id>
<content type='text'>
When diff mode is deactivated, the old values for 'cursorline' and the
Comment highlight colour should be restored.

Thanks to Tony Mechelynck
(http://vim.1045645.n5.nabble.com/template/NamlServlet.jtp?macro=user_nodes&amp;user=28373)
for the tip on how to save and restore highlight colours:

&gt; The following is untested. It requires Vim version 7.
&gt;
&gt; function SaveCursorColor()
&gt;         redir =&gt; highlight
&gt;         silent hi Cursor
&gt;         redir END
&gt;         if highlight =~ 'links to '
&gt;                 let s:hl-link = matchstr(highlight, 'links to \zs\S*')
&gt;         elseif highlight =~ '\&lt;cleared\&gt;'
&gt;                 let s:hl-link = 'NONE'
&gt;         else
&gt;                 let s:hl-link = ''
&gt;                 for substr in ['term', 'cterm', 'ctermfg', 'ctermbg',
&gt;                         \ 'gui', 'guifg', 'guibg', 'guisp']
&gt;                         if highlight =~ substr . '='
&gt;                                 let s:hl-{substr} = matchstr(highlight,
&gt;                                         \ substr . '=\S*')
&gt;                         else
&gt;                                 let s:hl-{substr} = ''
&gt;                         endif
&gt;                 endfor
&gt;         endif
&gt; endfunction
&gt; function RestoreCursorColor()
&gt;         if !exists('s:hl-link')
&gt;                 echoerr 'Cursor not saved, cannot restore'
&gt;                 return
&gt;         endif
&gt;         hi clear Cursor
&gt;         if s:hl-link == ''
&gt;                 exe 'hi Cursor' s:hl-term s:hl-cterm s:hl-ctermfg
&gt;                         \ s:hl-ctermbg s:hl-gui s:hl-guifg s:hl-guibg
&gt;                         \ s:hl-guisp
&gt;         elseif hl-link != 'NONE'
&gt;                 exe 'hi link Cursor' s:hl-link
&gt;         endif
&gt; endfunction
&gt;
&gt;
&gt; Best regards,
&gt; Tony.
http://vim.1045645.n5.nabble.com/How-to-save-restore-the-hightlight-for-cursor-td1182624.html
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
When diff mode is deactivated, the old values for 'cursorline' and the
Comment highlight colour should be restored.

Thanks to Tony Mechelynck
(http://vim.1045645.n5.nabble.com/template/NamlServlet.jtp?macro=user_nodes&amp;user=28373)
for the tip on how to save and restore highlight colours:

&gt; The following is untested. It requires Vim version 7.
&gt;
&gt; function SaveCursorColor()
&gt;         redir =&gt; highlight
&gt;         silent hi Cursor
&gt;         redir END
&gt;         if highlight =~ 'links to '
&gt;                 let s:hl-link = matchstr(highlight, 'links to \zs\S*')
&gt;         elseif highlight =~ '\&lt;cleared\&gt;'
&gt;                 let s:hl-link = 'NONE'
&gt;         else
&gt;                 let s:hl-link = ''
&gt;                 for substr in ['term', 'cterm', 'ctermfg', 'ctermbg',
&gt;                         \ 'gui', 'guifg', 'guibg', 'guisp']
&gt;                         if highlight =~ substr . '='
&gt;                                 let s:hl-{substr} = matchstr(highlight,
&gt;                                         \ substr . '=\S*')
&gt;                         else
&gt;                                 let s:hl-{substr} = ''
&gt;                         endif
&gt;                 endfor
&gt;         endif
&gt; endfunction
&gt; function RestoreCursorColor()
&gt;         if !exists('s:hl-link')
&gt;                 echoerr 'Cursor not saved, cannot restore'
&gt;                 return
&gt;         endif
&gt;         hi clear Cursor
&gt;         if s:hl-link == ''
&gt;                 exe 'hi Cursor' s:hl-term s:hl-cterm s:hl-ctermfg
&gt;                         \ s:hl-ctermbg s:hl-gui s:hl-guifg s:hl-guibg
&gt;                         \ s:hl-guisp
&gt;         elseif hl-link != 'NONE'
&gt;                 exe 'hi link Cursor' s:hl-link
&gt;         endif
&gt; endfunction
&gt;
&gt;
&gt; Best regards,
&gt; Tony.
http://vim.1045645.n5.nabble.com/How-to-save-restore-the-hightlight-for-cursor-td1182624.html
</pre>
</div>
</content>
</entry>
<entry>
<title>plugin/diff_corrections.vim: Increase 'tabpagemax' to 200</title>
<updated>2019-05-17T18:51:55+00:00</updated>
<author>
<name>Teddy Wing</name>
</author>
<published>2019-05-17T18:51:55+00:00</published>
<link rel='alternate' type='text/html' href='https://git.teddywing.com/dotvim/commit/?id=7d2e4fb741f9d99186bb0dd740f26cc853f69d7d'/>
<id>7d2e4fb741f9d99186bb0dd740f26cc853f69d7d</id>
<content type='text'>
The default is 10. Set it to a ridiculously large number so that we can
open one tab per file during a code review.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The default is 10. Set it to a ridiculously large number so that we can
open one tab per file during a code review.
</pre>
</div>
</content>
</entry>
<entry>
<title>diff-corrections: Move corrections to `autoload`</title>
<updated>2019-05-10T22:02:59+00:00</updated>
<author>
<name>Teddy Wing</name>
</author>
<published>2019-05-10T22:02:59+00:00</published>
<link rel='alternate' type='text/html' href='https://git.teddywing.com/dotvim/commit/?id=4f2dc2a1692568deb65b677188d38d666cbd469d'/>
<id>4f2dc2a1692568deb65b677188d38d666cbd469d</id>
<content type='text'>
Makes the code a little nicer and more extensible without the line
continuations.

Only change the highlight colour for the 'twilight256' colour scheme.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Makes the code a little nicer and more extensible without the line
continuations.

Only change the highlight colour for the 'twilight256' colour scheme.
</pre>
</div>
</content>
</entry>
<entry>
<title>Add 'diff-corrections' to adjust settings during diff mode</title>
<updated>2019-05-10T21:57:25+00:00</updated>
<author>
<name>Teddy Wing</name>
</author>
<published>2019-05-10T21:54:05+00:00</published>
<link rel='alternate' type='text/html' href='https://git.teddywing.com/dotvim/commit/?id=e4a1cf9aa0d4cefcd8d54bfab724c77f92299e5c'/>
<id>e4a1cf9aa0d4cefcd8d54bfab724c77f92299e5c</id>
<content type='text'>
* Changes `Comment` colour for better readability on red backgrounds.
* Turns of 'cursorline' so that diff background highlighting doesn't
  get shadowed.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* Changes `Comment` colour for better readability on red backgrounds.
* Turns of 'cursorline' so that diff background highlighting doesn't
  get shadowed.
</pre>
</div>
</content>
</entry>
</feed>
