Age | Commit message (Collapse) | Author |
|
Ensure that diff corrections are applied in a `vimdiff` context, where
we haven't run `:diffthis` manually.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
|
|
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&user=28373)
for the tip on how to save and restore highlight colours:
> The following is untested. It requires Vim version 7.
>
> function SaveCursorColor()
> redir => highlight
> silent hi Cursor
> redir END
> if highlight =~ 'links to '
> let s:hl-link = matchstr(highlight, 'links to \zs\S*')
> elseif highlight =~ '\<cleared\>'
> let s:hl-link = 'NONE'
> else
> let s:hl-link = ''
> for substr in ['term', 'cterm', 'ctermfg', 'ctermbg',
> \ 'gui', 'guifg', 'guibg', 'guisp']
> if highlight =~ substr . '='
> let s:hl-{substr} = matchstr(highlight,
> \ substr . '=\S*')
> else
> let s:hl-{substr} = ''
> endif
> endfor
> endif
> endfunction
> function RestoreCursorColor()
> if !exists('s:hl-link')
> echoerr 'Cursor not saved, cannot restore'
> return
> endif
> hi clear Cursor
> if s:hl-link == ''
> exe 'hi Cursor' s:hl-term s:hl-cterm s:hl-ctermfg
> \ s:hl-ctermbg s:hl-gui s:hl-guifg s:hl-guibg
> \ s:hl-guisp
> elseif hl-link != 'NONE'
> exe 'hi link Cursor' s:hl-link
> endif
> endfunction
>
>
> Best regards,
> Tony.
http://vim.1045645.n5.nabble.com/How-to-save-restore-the-hightlight-for-cursor-td1182624.html
|
|
The default is 10. Set it to a ridiculously large number so that we can
open one tab per file during a code review.
|
|
Makes the code a little nicer and more extensible without the line
continuations.
Only change the highlight colour for the 'twilight256' colour scheme.
|
|
* Changes `Comment` colour for better readability on red backgrounds.
* Turns of 'cursorline' so that diff background highlighting doesn't
get shadowed.
|