mirror of
1
0
Fork 0

Updated plugins

This commit is contained in:
Amir 2020-05-10 10:24:38 -04:00
parent 8c90331742
commit d895af51c9
38 changed files with 724 additions and 307 deletions

View File

@ -0,0 +1,4 @@
" Author: Ian2020 <https://github.com/Ian2020>
" Description: shellcheck linter for bats scripts.
call ale#handlers#shellcheck#DefineLinter('bats')

View File

@ -0,0 +1,24 @@
" Author: Jon Gjengset <jon@thesquareplanet.com>
" Description: The next generation language server for Rust
call ale#Set('rust_analyzer_executable', 'rust-analyzer')
call ale#Set('rust_analyzer_config', {})
function! ale_linters#rust#analyzer#GetCommand(buffer) abort
return '%e'
endfunction
function! ale_linters#rust#analyzer#GetProjectRoot(buffer) abort
let l:cargo_file = ale#path#FindNearestFile(a:buffer, 'Cargo.toml')
return !empty(l:cargo_file) ? fnamemodify(l:cargo_file, ':h') : ''
endfunction
call ale#linter#Define('rust', {
\ 'name': 'analyzer',
\ 'lsp': 'stdio',
\ 'lsp_config': {b -> ale#Var(b, 'rust_analyzer_config')},
\ 'executable': {b -> ale#Var(b, 'rust_analyzer_executable')},
\ 'command': function('ale_linters#rust#analyzer#GetCommand'),
\ 'project_root': function('ale_linters#rust#analyzer#GetProjectRoot'),
\})

View File

@ -1,107 +1,4 @@
" Author: w0rp <devw0rp@gmail.com>
" Description: This file adds support for using the shellcheck linter with
" shell scripts.
" Description: shellcheck linter for shell scripts.
" This global variable can be set with a string of comma-separated error
" codes to exclude from shellcheck. For example:
"
" let g:ale_sh_shellcheck_exclusions = 'SC2002,SC2004'
call ale#Set('sh_shellcheck_exclusions', get(g:, 'ale_linters_sh_shellcheck_exclusions', ''))
call ale#Set('sh_shellcheck_executable', 'shellcheck')
call ale#Set('sh_shellcheck_dialect', 'auto')
call ale#Set('sh_shellcheck_options', '')
call ale#Set('sh_shellcheck_change_directory', 1)
function! ale_linters#sh#shellcheck#GetDialectArgument(buffer) abort
let l:shell_type = ale#handlers#sh#GetShellType(a:buffer)
if !empty(l:shell_type)
" Use the dash dialect for /bin/ash, etc.
if l:shell_type is# 'ash'
return 'dash'
endif
return l:shell_type
endif
" If there's no hashbang, try using Vim's buffer variables.
if getbufvar(a:buffer, 'is_bash', 0)
return 'bash'
elseif getbufvar(a:buffer, 'is_sh', 0)
return 'sh'
elseif getbufvar(a:buffer, 'is_kornshell', 0)
return 'ksh'
endif
return ''
endfunction
function! ale_linters#sh#shellcheck#GetCommand(buffer, version) abort
let l:options = ale#Var(a:buffer, 'sh_shellcheck_options')
let l:exclude_option = ale#Var(a:buffer, 'sh_shellcheck_exclusions')
let l:dialect = ale#Var(a:buffer, 'sh_shellcheck_dialect')
let l:external_option = ale#semver#GTE(a:version, [0, 4, 0]) ? ' -x' : ''
let l:cd_string = ale#Var(a:buffer, 'sh_shellcheck_change_directory')
\ ? ale#path#BufferCdString(a:buffer)
\ : ''
if l:dialect is# 'auto'
let l:dialect = ale_linters#sh#shellcheck#GetDialectArgument(a:buffer)
endif
return l:cd_string
\ . '%e'
\ . (!empty(l:dialect) ? ' -s ' . l:dialect : '')
\ . (!empty(l:options) ? ' ' . l:options : '')
\ . (!empty(l:exclude_option) ? ' -e ' . l:exclude_option : '')
\ . l:external_option
\ . ' -f gcc -'
endfunction
function! ale_linters#sh#shellcheck#Handle(buffer, lines) abort
let l:pattern = '\v^([a-zA-Z]?:?[^:]+):(\d+):(\d+)?:? ([^:]+): (.+) \[([^\]]+)\]$'
let l:output = []
for l:match in ale#util#GetMatches(a:lines, l:pattern)
if l:match[4] is# 'error'
let l:type = 'E'
elseif l:match[4] is# 'note'
let l:type = 'I'
else
let l:type = 'W'
endif
let l:item = {
\ 'lnum': str2nr(l:match[2]),
\ 'type': l:type,
\ 'text': l:match[5],
\ 'code': l:match[6],
\}
if !empty(l:match[3])
let l:item.col = str2nr(l:match[3])
endif
" If the filename is something like <stdin>, <nofile> or -, then
" this is an error for the file we checked.
if l:match[1] isnot# '-' && l:match[1][0] isnot# '<'
let l:item['filename'] = l:match[1]
endif
call add(l:output, l:item)
endfor
return l:output
endfunction
call ale#linter#Define('sh', {
\ 'name': 'shellcheck',
\ 'executable': {buffer -> ale#Var(buffer, 'sh_shellcheck_executable')},
\ 'command': {buffer -> ale#semver#RunWithVersionCheck(
\ buffer,
\ ale#Var(buffer, 'sh_shellcheck_executable'),
\ '%e --version',
\ function('ale_linters#sh#shellcheck#GetCommand'),
\ )},
\ 'callback': 'ale_linters#sh#shellcheck#Handle',
\})
call ale#handlers#shellcheck#DefineLinter('sh')

View File

@ -0,0 +1,107 @@
" Author: w0rp <devw0rp@gmail.com>
" Description: This file adds support for using the shellcheck linter
function! ale#handlers#shellcheck#GetDialectArgument(buffer) abort
let l:shell_type = ale#handlers#sh#GetShellType(a:buffer)
if !empty(l:shell_type)
" Use the dash dialect for /bin/ash, etc.
if l:shell_type is# 'ash'
return 'dash'
endif
return l:shell_type
endif
" If there's no hashbang, try using Vim's buffer variables.
if getbufvar(a:buffer, 'is_bash', 0)
return 'bash'
elseif getbufvar(a:buffer, 'is_sh', 0)
return 'sh'
elseif getbufvar(a:buffer, 'is_kornshell', 0)
return 'ksh'
endif
return ''
endfunction
function! ale#handlers#shellcheck#GetCommand(buffer, version) abort
let l:options = ale#Var(a:buffer, 'sh_shellcheck_options')
let l:exclude_option = ale#Var(a:buffer, 'sh_shellcheck_exclusions')
let l:dialect = ale#Var(a:buffer, 'sh_shellcheck_dialect')
let l:external_option = ale#semver#GTE(a:version, [0, 4, 0]) ? ' -x' : ''
let l:cd_string = ale#Var(a:buffer, 'sh_shellcheck_change_directory')
\ ? ale#path#BufferCdString(a:buffer)
\ : ''
if l:dialect is# 'auto'
let l:dialect = ale#handlers#shellcheck#GetDialectArgument(a:buffer)
endif
return l:cd_string
\ . '%e'
\ . (!empty(l:dialect) ? ' -s ' . l:dialect : '')
\ . (!empty(l:options) ? ' ' . l:options : '')
\ . (!empty(l:exclude_option) ? ' -e ' . l:exclude_option : '')
\ . l:external_option
\ . ' -f gcc -'
endfunction
function! ale#handlers#shellcheck#Handle(buffer, lines) abort
let l:pattern = '\v^([a-zA-Z]?:?[^:]+):(\d+):(\d+)?:? ([^:]+): (.+) \[([^\]]+)\]$'
let l:output = []
for l:match in ale#util#GetMatches(a:lines, l:pattern)
if l:match[4] is# 'error'
let l:type = 'E'
elseif l:match[4] is# 'note'
let l:type = 'I'
else
let l:type = 'W'
endif
let l:item = {
\ 'lnum': str2nr(l:match[2]),
\ 'type': l:type,
\ 'text': l:match[5],
\ 'code': l:match[6],
\}
if !empty(l:match[3])
let l:item.col = str2nr(l:match[3])
endif
" If the filename is something like <stdin>, <nofile> or -, then
" this is an error for the file we checked.
if l:match[1] isnot# '-' && l:match[1][0] isnot# '<'
let l:item['filename'] = l:match[1]
endif
call add(l:output, l:item)
endfor
return l:output
endfunction
function! ale#handlers#shellcheck#DefineLinter(filetype) abort
" This global variable can be set with a string of comma-separated error
" codes to exclude from shellcheck. For example:
" let g:ale_sh_shellcheck_exclusions = 'SC2002,SC2004'
call ale#Set('sh_shellcheck_exclusions', get(g:, 'ale_linters_sh_shellcheck_exclusions', ''))
call ale#Set('sh_shellcheck_executable', 'shellcheck')
call ale#Set('sh_shellcheck_dialect', 'auto')
call ale#Set('sh_shellcheck_options', '')
call ale#Set('sh_shellcheck_change_directory', 1)
call ale#linter#Define(a:filetype, {
\ 'name': 'shellcheck',
\ 'executable': {buffer -> ale#Var(buffer, 'sh_shellcheck_executable')},
\ 'command': {buffer -> ale#semver#RunWithVersionCheck(
\ buffer,
\ ale#Var(buffer, 'sh_shellcheck_executable'),
\ '%e --version',
\ function('ale#handlers#shellcheck#GetCommand'),
\ )},
\ 'callback': 'ale#handlers#shellcheck#Handle',
\})
endfunction

View File

@ -0,0 +1,13 @@
===============================================================================
ALE Bats Integration *ale-bats-options*
===============================================================================
shellcheck *ale-bats-shellcheck*
The `shellcheck` linter for Bats uses the sh options for `shellcheck`; see:
|ale-sh-shellcheck|.
===============================================================================
vim:tw=78:ts=2:sts=2:sw=2:ft=help:norl:

View File

@ -9,7 +9,7 @@ Integration Information
files for Rust distributed in Vim >=8.0.0501 or upstream:
https://github.com/rust-lang/rust.vim
Note that there are three possible linters for Rust files:
Note that there are several possible linters and fixers for Rust files:
1. rustc -- The Rust compiler is used to check the currently edited file.
So, if your project consists of multiple files, you will get some errors
@ -23,7 +23,12 @@ Integration Information
over cargo. rls implements the Language Server Protocol for incremental
compilation of Rust code, and can check Rust files while you type. `rls`
requires Rust files to contained in Cargo projects.
4. rustfmt -- If you have `rustfmt` installed, you can use it as a fixer to
4. analyzer -- If you have rust-analyzer installed, you might prefer using
this linter over cargo and rls. rust-analyzer also implements the
Language Server Protocol for incremental compilation of Rust code, and is
the next iteration of rls. rust-analyzer, like rls, requires Rust files
to contained in Cargo projects.
5. rustfmt -- If you have `rustfmt` installed, you can use it as a fixer to
consistently reformat your Rust code.
Only cargo is enabled by default. To switch to using rustc instead of cargo,
@ -36,6 +41,25 @@ Integration Information
Also note that rustc 1.12. or later is needed.
===============================================================================
analyzer *ale-rust-analyzer*
g:ale_rust_analyzer_executable *g:ale_rust_analyzer_executable*
*b:ale_rust_analyzer_executable*
Type: |String|
Default: `'rust-analyzer'`
This variable can be modified to change the executable path for
`rust-analyzer`.
g:ale_rust_analyzer_config *g:ale_rust_analyzer_config*
*b:ale_rust_analyzer_config*
Type: |Dictionary|
Default: `{}`
Dictionary with configuration settings for rust-analyzer.
===============================================================================
cargo *ale-rust-cargo*

View File

@ -35,6 +35,8 @@ Notes:
* `shell` (-n flag)
* `shellcheck`
* `shfmt`
* Bats
* `shellcheck`
* BibTeX
* `bibclean`
* Bourne Shell
@ -408,6 +410,7 @@ Notes:
* Rust
* `cargo`!!
* `rls`
* `rust-analyzer`
* `rustc` (see |ale-integration-rust|)
* `rustfmt`
* Sass

View File

@ -2279,6 +2279,8 @@ documented in additional help files.
gcc...................................|ale-asm-gcc|
awk.....................................|ale-awk-options|
gawk..................................|ale-awk-gawk|
bats....................................|ale-bats-options|
shellcheck............................|ale-bats-shellcheck|
bib.....................................|ale-bib-options|
bibclean..............................|ale-bib-bibclean|
c.......................................|ale-c-options|
@ -2579,6 +2581,7 @@ documented in additional help files.
sorbet................................|ale-ruby-sorbet|
standardrb............................|ale-ruby-standardrb|
rust....................................|ale-rust-options|
analyzer..............................|ale-rust-analyzer|
cargo.................................|ale-rust-cargo|
rls...................................|ale-rust-rls|
rustc.................................|ale-rust-rustc|

View File

@ -44,6 +44,8 @@ formatting.
* shell [-n flag](https://www.gnu.org/software/bash/manual/bash.html#index-set)
* [shellcheck](https://www.shellcheck.net/)
* [shfmt](https://github.com/mvdan/sh)
* Bats
* [shellcheck](https://www.shellcheck.net/)
* BibTeX
* [bibclean](http://ftp.math.utah.edu/pub/bibclean/)
* Bourne Shell
@ -417,6 +419,7 @@ formatting.
* Rust
* [cargo](https://github.com/rust-lang/cargo) :floppy_disk: (see `:help ale-integration-rust` for configuration instructions)
* [rls](https://github.com/rust-lang-nursery/rls) :warning:
* [rust-analyzer](https://github.com/rust-analyzer/rust-analyzer) :warning:
* [rustc](https://www.rust-lang.org/) :warning:
* [rustfmt](https://github.com/rust-lang-nursery/rustfmt)
* Sass

View File

@ -52,6 +52,7 @@ endfunction
function! lightline#ale#linted() abort
return get(g:, 'ale_enabled', 0) == 1
\ && getbufvar(bufnr(''), 'ale_enabled', 1)
\ && getbufvar(bufnr(''), 'ale_linted', 0) > 0
\ && ale#engine#IsCheckingBuffer(bufnr('')) == 0
endfunction

View File

@ -1,6 +1,10 @@
name: CI
on: [push, pull_request]
on:
push:
branches:
- master
pull_request:
jobs:
test:

View File

@ -17,23 +17,31 @@ https://github.com/itchyny/lightline.vim
### solarized dark
![lightline.vim - solarized_dark](https://raw.githubusercontent.com/wiki/itchyny/lightline.vim/image/solarized_dark.png)
![lightline.vim - solarized dark](https://raw.githubusercontent.com/wiki/itchyny/lightline.vim/image/solarized_dark.png)
### solarized light
![lightline.vim - solarized_light](https://raw.githubusercontent.com/wiki/itchyny/lightline.vim/image/solarized_light.png)
![lightline.vim - solarized light](https://raw.githubusercontent.com/wiki/itchyny/lightline.vim/image/solarized_light.png)
### PaperColor dark
![lightline.vim - PaperColor dark](https://raw.githubusercontent.com/wiki/itchyny/lightline.vim/image/PaperColor_dark.png)
### PaperColor light
![lightline.vim - PaperColor](https://raw.githubusercontent.com/wiki/itchyny/lightline.vim/image/PaperColor.png)
![lightline.vim - PaperColor light](https://raw.githubusercontent.com/wiki/itchyny/lightline.vim/image/PaperColor_light.png)
### seoul256
![lightline.vim - seoul256](https://raw.githubusercontent.com/wiki/itchyny/lightline.vim/image/seoul256.png)
### one
### one dark
![lightline.vim - one](https://raw.githubusercontent.com/wiki/itchyny/lightline.vim/image/one.png)
![lightline.vim - one dark](https://raw.githubusercontent.com/wiki/itchyny/lightline.vim/image/one_dark.png)
### one light
![lightline.vim - one light](https://raw.githubusercontent.com/wiki/itchyny/lightline.vim/image/one_light.png)
### landscape

View File

@ -0,0 +1,42 @@
" =============================================================================
" Filename: autoload/lightline/colorscheme/ayu_dark.vim
" Author: danielpeng2
" License: MIT License
" Last Change: 2020/05/01 19:37:33.
" =============================================================================
let s:base0 = '#e6e1cf'
let s:base1 = '#e6e1cf'
let s:base2 = '#3e4b59'
let s:base3 = '#e6e1cf'
let s:base00 = '#14191f'
let s:base01 = '#14191f'
let s:base02 = '#0f1419'
let s:base023 = '#0f1419'
let s:base03 = '#e6b673'
let s:yellow = '#e6b673'
let s:orange = '#ff7733'
let s:red = '#f07178'
let s:magenta = '#ffee99'
let s:blue = '#36a3d9'
let s:cyan = s:blue
let s:green = '#b8cc52'
let s:p = {'normal': {}, 'inactive': {}, 'insert': {}, 'replace': {}, 'visual': {}, 'tabline': {}}
let s:p.normal.left = [ [ s:base02, s:blue ], [ s:base3, s:base01 ] ]
let s:p.normal.middle = [ [ s:base2, s:base02 ] ]
let s:p.normal.right = [ [ s:base02, s:base0 ], [ s:base1, s:base01 ] ]
let s:p.inactive.left = [ [ s:base1, s:base01 ], [ s:base3, s:base01 ] ]
let s:p.inactive.middle = [ [ s:base1, s:base023 ] ]
let s:p.inactive.right = [ [ s:base1, s:base01 ], [ s:base2, s:base02 ] ]
let s:p.insert.left = [ [ s:base02, s:green ], [ s:base3, s:base01 ] ]
let s:p.replace.left = [ [ s:base023, s:red ], [ s:base3, s:base01 ] ]
let s:p.visual.left = [ [ s:base02, s:magenta ], [ s:base3, s:base01 ] ]
let s:p.tabline.tabsel = [ [ s:base02, s:base03 ] ]
let s:p.tabline.left = [ [ s:base3, s:base00 ] ]
let s:p.tabline.middle = [ [ s:base2, s:base02 ] ]
let s:p.tabline.right = [ [ s:base2, s:base00 ] ]
let s:p.normal.error = [ [ s:base03, s:red ] ]
let s:p.normal.warning = [ [ s:base023, s:yellow ] ]
let g:lightline#colorscheme#ayu_dark#palette = lightline#colorscheme#fill(s:p)

View File

@ -2,24 +2,26 @@
" Filename: autoload/lightline/colorscheme/ayu_light.vim
" Author: christalib
" License: MIT License
" Last Change: 2020/02/15 18:45:57.
" Last Change: 2020/05/01 19:38:21.
" =============================================================================
let s:base0 = [ '#5C6773', 244 ]
let s:base1 = [ '#5C6773', 247 ]
let s:base2 = [ '#828C99', 248 ]
let s:base3 = [ '#5C6773', 252 ]
let s:base00 = [ '#FFFFFF', 242 ]
let s:base01 = [ '#FFFFFF', 240 ]
let s:base02 = [ '#FAFAFA', 238 ]
let s:base023 = [ '#FAFAFA', 236 ]
let s:base03 = [ '#E6B673', 235 ]
let s:yellow = [ '#E6B673', 180 ]
let s:orange = [ '#FF7733', 173 ]
let s:red = [ '#f07178', 203 ]
let s:magenta = [ '#A37ACC', 216 ]
let s:blue = [ '#59c2ff', 117 ]
let s:base0 = '#5C6773'
let s:base1 = '#5C6773'
let s:base2 = '#828C99'
let s:base3 = '#5C6773'
let s:base00 = '#FFFFFF'
let s:base01 = '#FFFFFF'
let s:base02 = '#FAFAFA'
let s:base023 = '#FAFAFA'
let s:base03 = '#E6B673'
let s:yellow = '#E6B673'
let s:orange = '#FF7733'
let s:red = '#f07178'
let s:magenta = '#A37ACC'
let s:blue = '#59c2ff'
let s:cyan = s:blue
let s:green = [ '#86B300', 119 ]
let s:green = '#86B300'
let s:p = {'normal': {}, 'inactive': {}, 'insert': {}, 'replace': {}, 'visual': {}, 'tabline': {}}
let s:p.normal.left = [ [ s:base02, s:blue ], [ s:base3, s:base01 ] ]
let s:p.normal.middle = [ [ s:base2, s:base02 ] ]
@ -36,4 +38,5 @@ let s:p.tabline.middle = [ [ s:base2, s:base02 ] ]
let s:p.tabline.right = [ [ s:base2, s:base00 ] ]
let s:p.normal.error = [ [ s:base03, s:red ] ]
let s:p.normal.warning = [ [ s:base023, s:yellow ] ]
let g:lightline#colorscheme#ayu_light#palette = lightline#colorscheme#flatten(s:p)
let g:lightline#colorscheme#ayu_light#palette = lightline#colorscheme#fill(s:p)

View File

@ -2,24 +2,26 @@
" Filename: autoload/lightline/colorscheme/ayu_mirage.vim
" Author: impulse
" License: MIT License
" Last Change: 2019/08/11 11:52:20.
" Last Change: 2020/05/01 19:37:21.
" =============================================================================
let s:base0 = [ '#d9d7ce', 244 ]
let s:base1 = [ '#d9d7ce', 247 ]
let s:base2 = [ '#607080', 248 ]
let s:base3 = [ '#d9d7ce', 252 ]
let s:base00 = [ '#272d38', 242 ]
let s:base01 = [ '#272d38', 240 ]
let s:base02 = [ '#212733', 238 ]
let s:base023 = [ '#212733', 236 ]
let s:base03 = [ '#ffc44c', 235 ]
let s:yellow = [ '#ffc44c', 180 ]
let s:orange = [ '#ffae57', 173 ]
let s:red = [ '#f07178', 203 ]
let s:magenta = [ '#d4bfff', 216 ]
let s:blue = [ '#59c2ff', 117 ]
let s:base0 = '#d9d7ce'
let s:base1 = '#d9d7ce'
let s:base2 = '#607080'
let s:base3 = '#d9d7ce'
let s:base00 = '#272d38'
let s:base01 = '#272d38'
let s:base02 = '#212733'
let s:base023 = '#212733'
let s:base03 = '#ffc44c'
let s:yellow = '#ffc44c'
let s:orange = '#ffae57'
let s:red = '#f07178'
let s:magenta = '#d4bfff'
let s:blue = '#59c2ff'
let s:cyan = s:blue
let s:green = [ '#bbe67e', 119 ]
let s:green = '#bbe67e'
let s:p = {'normal': {}, 'inactive': {}, 'insert': {}, 'replace': {}, 'visual': {}, 'tabline': {}}
let s:p.normal.left = [ [ s:base02, s:blue ], [ s:base3, s:base01 ] ]
let s:p.normal.middle = [ [ s:base2, s:base02 ] ]
@ -36,4 +38,5 @@ let s:p.tabline.middle = [ [ s:base2, s:base02 ] ]
let s:p.tabline.right = [ [ s:base2, s:base00 ] ]
let s:p.normal.error = [ [ s:base03, s:red ] ]
let s:p.normal.warning = [ [ s:base023, s:yellow ] ]
let g:lightline#colorscheme#ayu_mirage#palette = lightline#colorscheme#flatten(s:p)
let g:lightline#colorscheme#ayu_mirage#palette = lightline#colorscheme#fill(s:p)

View File

@ -23,9 +23,9 @@ let s:p.inactive.left = s:p.inactive.right[1:]
let s:p.insert.left = [ [ '#292c33', '#61afef', s:term_black, s:term_blue, 'bold' ], [ '#61afef', '#292c33', s:term_blue, s:term_black ] ]
let s:p.insert.right = [ [ '#292c33', '#61afef', s:term_black, s:term_blue ], [ '#ABB2BF', '#3E4452', s:term_white, s:term_grey ], [ '#61afef', '#292c33', s:term_blue, s:term_black ] ]
let s:p.replace.left = [ [ '#292c33', '#e06c75', s:term_black, s:term_red, 'bold' ], [ '#e06c75', '#292c33', s:term_red, s:term_black ] ]
let s:p.replace.right = [ [ '#292c33', '#e06c75', s:term_black, s:term_red, 'bold' ], s:p.normal.right[1], [ '#e06c75', '#292c33', s:term_red, s:term_black ] ]
let s:p.replace.right = [ [ '#292c33', '#e06c75', s:term_black, s:term_red ], s:p.normal.right[1], [ '#e06c75', '#292c33', s:term_red, s:term_black ] ]
let s:p.visual.left = [ [ '#292c33', '#c678dd', s:term_black, s:term_purple, 'bold' ], [ '#c678dd', '#292c33', s:term_purple, s:term_black ] ]
let s:p.visual.right = [ [ '#292c33', '#c678dd', s:term_black, s:term_purple, 'bold' ], s:p.normal.right[1], [ '#c678dd', '#292c33', s:term_purple, s:term_black ] ]
let s:p.visual.right = [ [ '#292c33', '#c678dd', s:term_black, s:term_purple ], s:p.normal.right[1], [ '#c678dd', '#292c33', s:term_purple, s:term_black ] ]
let s:p.normal.middle = [ [ '#abb2bf', '#292c33', s:term_white, s:term_black ] ]
let s:p.insert.middle = s:p.normal.middle
let s:p.replace.middle = s:p.normal.middle

View File

@ -0,0 +1,49 @@
" =============================================================================
" Filename: autoload/lightline/colorscheme/selenized_black.vim
" Author: itchyny
" License: MIT License
" Last Change: 2020/05/02 16:56:50.
" =============================================================================
" https://github.com/jan-warchol/selenized/blob/master/the-values.md#selenized-black
let s:bg_1 = ['#252525', 0]
let s:bg_2 = ['#3b3b3b', 8]
let s:dim_0 = ['#777777', 7]
let s:red = ['#ed4a46', 1]
let s:green = ['#70b433', 2]
let s:yellow = ['#dbb32d', 3]
let s:blue = ['#368aeb', 4]
let s:magenta = ['#eb6eb7', 5]
let s:cyan = ['#3fc5b7', 6]
let s:brred = ['#ff5e56', 9]
let s:brgreen = ['#83c746', 10]
let s:bryellow = ['#efc541', 11]
let s:brblue = ['#4f9cfe', 12]
let s:brmagenta = ['#ff81ca', 13]
let s:brcyan = ['#56d8c9', 14]
let s:p = {'normal': {}, 'inactive': {}, 'insert': {}, 'replace': {}, 'visual': {}, 'tabline': {}}
let s:p.normal.right = [[ s:bg_1, s:blue ], [ s:cyan, s:bg_2 ], [ s:dim_0, s:bg_1 ]]
let s:p.normal.left = [[ s:bg_1, s:blue ], [ s:cyan, s:bg_2 ]]
let s:p.normal.middle = [[ s:bg_1, s:bg_1 ]]
let s:p.normal.error = [[ s:bg_1, s:red ]]
let s:p.normal.warning = [[ s:bg_1, s:yellow ]]
let s:p.insert.right = [[ s:bg_1, s:green ], [ s:cyan, s:bg_2 ], [ s:dim_0, s:bg_1 ]]
let s:p.insert.left = [[ s:bg_1, s:green ], [ s:cyan, s:bg_2 ]]
let s:p.visual.right = [[ s:bg_1, s:magenta ], [ s:cyan, s:bg_2 ], [ s:dim_0, s:bg_1 ]]
let s:p.visual.left = [[ s:bg_1, s:magenta ], [ s:cyan, s:bg_2 ]]
let s:p.inactive.left = [[ s:brblue, s:bg_2 ], [ s:cyan, s:bg_2 ]]
let s:p.inactive.right = [[ s:brblue, s:bg_2 ], [ s:cyan, s:bg_2 ]]
let s:p.replace.right = [[ s:bg_1, s:red ], [ s:cyan, s:bg_2 ], [ s:dim_0, s:bg_1 ]]
let s:p.replace.left = [[ s:bg_1, s:red ], [ s:cyan, s:bg_2 ]]
let s:p.tabline.right = [[ s:bg_1, s:red ]]
let s:p.tabline.left = [[ s:cyan, s:bg_2 ]]
let s:p.tabline.tabsel = [[ s:bg_1, s:blue ]]
let g:lightline#colorscheme#selenized_black#palette = lightline#colorscheme#flatten(s:p)

View File

@ -2,49 +2,48 @@
" Filename: autoload/lightline/colorscheme/selenized_dark.vim
" Author: Charles Hall
" License: MIT License
" Last Change: 2019/07/22 11:05:34.
" Last Change: 2020/05/02 16:53:17.
" =============================================================================
" https://github.com/jan-warchol/selenized/blob/master/the-values.md#selenized-dark
let s:black = [ "#184956", 0 ]
let s:red = [ "#fa5750", 1 ]
let s:green = [ "#75b938", 2 ]
let s:yellow = [ "#dbb32d", 3 ]
let s:blue = [ "#4695f7", 4 ]
let s:magenta = [ "#f275be", 5 ]
let s:cyan = [ "#41c7b9", 6 ]
let s:white = [ "#72898f", 7 ]
let s:brblack = [ "#2d5b69", 8 ]
let s:brred = [ "#ff665c", 9 ]
let s:brgreen = [ "#84c747", 10 ]
let s:bryellow = [ "#ebc13d", 11 ]
let s:brblue = [ "#58a3ff", 12 ]
let s:brmagenta = [ "#ff84cd", 13 ]
let s:brcyan = [ "#53d6c7", 14 ]
let s:brwhite = [ "#cad8d9", 15 ]
let s:bg_1 = ['#184956', 0]
let s:bg_2 = ['#2d5b69', 8]
let s:dim_0 = ['#72898f', 7]
let s:red = ['#fa5750', 1]
let s:green = ['#75b938', 2]
let s:yellow = ['#dbb32d', 3]
let s:blue = ['#4695f7', 4]
let s:magenta = ['#f275be', 5]
let s:cyan = ['#41c7b9', 6]
let s:brred = ['#ff665c', 9]
let s:brgreen = ['#84c747', 10]
let s:bryellow = ['#ebc13d', 11]
let s:brblue = ['#58a3ff', 12]
let s:brmagenta = ['#ff84cd', 13]
let s:brcyan = ['#53d6c7', 14]
let s:p = {'normal': {}, 'inactive': {}, 'insert': {}, 'replace': {}, 'visual': {}, 'tabline': {}}
let s:p.normal.right = [[ s:black, s:blue ],[ s:cyan, s:brblack ],[ s:white, s:black ]]
let s:p.normal.left = [[ s:black, s:blue ],[ s:cyan, s:brblack ]]
let s:p.normal.middle = [[ s:black, s:black ]]
let s:p.normal.error = [[ s:black, s:red ]]
let s:p.normal.warning = [[ s:black, s:yellow ]]
let s:p.normal.right = [[ s:bg_1, s:blue ], [ s:cyan, s:bg_2 ], [ s:dim_0, s:bg_1 ]]
let s:p.normal.left = [[ s:bg_1, s:blue ], [ s:cyan, s:bg_2 ]]
let s:p.normal.middle = [[ s:bg_1, s:bg_1 ]]
let s:p.normal.error = [[ s:bg_1, s:red ]]
let s:p.normal.warning = [[ s:bg_1, s:yellow ]]
let s:p.insert.right = [[ s:black, s:green ],[ s:cyan, s:brblack ],[ s:white, s:black ]]
let s:p.insert.left = [[ s:black, s:green ],[ s:cyan, s:brblack ]]
let s:p.insert.right = [[ s:bg_1, s:green ], [ s:cyan, s:bg_2 ], [ s:dim_0, s:bg_1 ]]
let s:p.insert.left = [[ s:bg_1, s:green ], [ s:cyan, s:bg_2 ]]
let s:p.visual.right = [[ s:black, s:magenta ],[ s:cyan, s:brblack ],[ s:white, s:black ]]
let s:p.visual.left = [[ s:black, s:magenta ],[ s:cyan, s:brblack ]]
let s:p.visual.right = [[ s:bg_1, s:magenta ], [ s:cyan, s:bg_2 ], [ s:dim_0, s:bg_1 ]]
let s:p.visual.left = [[ s:bg_1, s:magenta ], [ s:cyan, s:bg_2 ]]
let s:p.inactive.left = [[ s:brblue, s:brblack ],[ s:cyan, s:brblack ]]
let s:p.inactive.right = [[ s:brblue, s:brblack ],[ s:cyan, s:brblack ]]
let s:p.inactive.left = [[ s:brblue, s:bg_2 ], [ s:cyan, s:bg_2 ]]
let s:p.inactive.right = [[ s:brblue, s:bg_2 ], [ s:cyan, s:bg_2 ]]
let s:p.replace.right = [[ s:black, s:red ],[ s:cyan, s:brblack ],[ s:white, s:black ]]
let s:p.replace.left = [[ s:black, s:red ],[ s:cyan, s:brblack ]]
let s:p.replace.right = [[ s:bg_1, s:red ], [ s:cyan, s:bg_2 ], [ s:dim_0, s:bg_1 ]]
let s:p.replace.left = [[ s:bg_1, s:red ], [ s:cyan, s:bg_2 ]]
let s:p.tabline.right = [[ s:black, s:red ]]
let s:p.tabline.left = [[ s:cyan, s:brblack ]]
let s:p.tabline.tabsel = [[ s:black, s:blue ]]
let s:p.tabline.right = [[ s:bg_1, s:red ]]
let s:p.tabline.left = [[ s:cyan, s:bg_2 ]]
let s:p.tabline.tabsel = [[ s:bg_1, s:blue ]]
let g:lightline#colorscheme#selenized_dark#palette = lightline#colorscheme#flatten(s:p)

View File

@ -0,0 +1,49 @@
" =============================================================================
" Filename: autoload/lightline/colorscheme/selenized_light.vim
" Author: itchyny
" License: MIT License
" Last Change: 2020/05/02 16:58:00.
" =============================================================================
" https://github.com/jan-warchol/selenized/blob/master/the-values.md#selenized-light
let s:bg_1 = ['#ece3cc', 0]
let s:bg_2 = ['#d5cdb6', 8]
let s:dim_0 = ['#909995', 7]
let s:red = ['#d2212d', 1]
let s:green = ['#489100', 2]
let s:yellow = ['#ad8900', 3]
let s:blue = ['#0072d4', 4]
let s:magenta = ['#ca4898', 5]
let s:cyan = ['#009c8f', 6]
let s:brred = ['#cc1729', 9]
let s:brgreen = ['#428b00', 10]
let s:bryellow = ['#a78300', 11]
let s:brblue = ['#006dce', 12]
let s:brmagenta = ['#c44392', 13]
let s:brcyan = ['#00978a', 14]
let s:p = {'normal': {}, 'inactive': {}, 'insert': {}, 'replace': {}, 'visual': {}, 'tabline': {}}
let s:p.normal.right = [[ s:bg_1, s:blue ], [ s:cyan, s:bg_2 ], [ s:dim_0, s:bg_1 ]]
let s:p.normal.left = [[ s:bg_1, s:blue ], [ s:cyan, s:bg_2 ]]
let s:p.normal.middle = [[ s:bg_1, s:bg_1 ]]
let s:p.normal.error = [[ s:bg_1, s:red ]]
let s:p.normal.warning = [[ s:bg_1, s:yellow ]]
let s:p.insert.right = [[ s:bg_1, s:green ], [ s:cyan, s:bg_2 ], [ s:dim_0, s:bg_1 ]]
let s:p.insert.left = [[ s:bg_1, s:green ], [ s:cyan, s:bg_2 ]]
let s:p.visual.right = [[ s:bg_1, s:magenta ], [ s:cyan, s:bg_2 ], [ s:dim_0, s:bg_1 ]]
let s:p.visual.left = [[ s:bg_1, s:magenta ], [ s:cyan, s:bg_2 ]]
let s:p.inactive.left = [[ s:brblue, s:bg_2 ], [ s:cyan, s:bg_2 ]]
let s:p.inactive.right = [[ s:brblue, s:bg_2 ], [ s:cyan, s:bg_2 ]]
let s:p.replace.right = [[ s:bg_1, s:red ], [ s:cyan, s:bg_2 ], [ s:dim_0, s:bg_1 ]]
let s:p.replace.left = [[ s:bg_1, s:red ], [ s:cyan, s:bg_2 ]]
let s:p.tabline.right = [[ s:bg_1, s:red ]]
let s:p.tabline.left = [[ s:cyan, s:bg_2 ]]
let s:p.tabline.tabsel = [[ s:bg_1, s:blue ]]
let g:lightline#colorscheme#selenized_light#palette = lightline#colorscheme#flatten(s:p)

View File

@ -0,0 +1,49 @@
" =============================================================================
" Filename: autoload/whiteline/colorscheme/selenized_white.vim
" Author: itchyny
" License: MIT License
" Last Change: 2020/05/03 19:34:07.
" =============================================================================
" https://github.com/jan-warchol/selenized/blob/master/the-values.md#selenized-white
let s:bg_1 = ['#ebebeb', 0]
let s:bg_2 = ['#cdcdcd', 8]
let s:dim_0 = ['#878787', 7]
let s:red = ['#d6000c', 1]
let s:green = ['#1d9700', 2]
let s:yellow = ['#c49700', 3]
let s:blue = ['#0064e4', 4]
let s:magenta = ['#dd0f9d', 5]
let s:cyan = ['#00ad9c', 6]
let s:brred = ['#bf0000', 9]
let s:brgreen = ['#008400', 10]
let s:bryellow = ['#af8500', 11]
let s:brblue = ['#0054cf', 12]
let s:brmagenta = ['#c7008b', 13]
let s:brcyan = ['#009a8a', 14]
let s:p = {'normal': {}, 'inactive': {}, 'insert': {}, 'replace': {}, 'visual': {}, 'tabline': {}}
let s:p.normal.right = [[ s:bg_1, s:blue ], [ s:cyan, s:bg_2 ], [ s:dim_0, s:bg_1 ]]
let s:p.normal.left = [[ s:bg_1, s:blue ], [ s:cyan, s:bg_2 ]]
let s:p.normal.middle = [[ s:bg_1, s:bg_1 ]]
let s:p.normal.error = [[ s:bg_1, s:red ]]
let s:p.normal.warning = [[ s:bg_1, s:yellow ]]
let s:p.insert.right = [[ s:bg_1, s:green ], [ s:cyan, s:bg_2 ], [ s:dim_0, s:bg_1 ]]
let s:p.insert.left = [[ s:bg_1, s:green ], [ s:cyan, s:bg_2 ]]
let s:p.visual.right = [[ s:bg_1, s:magenta ], [ s:cyan, s:bg_2 ], [ s:dim_0, s:bg_1 ]]
let s:p.visual.left = [[ s:bg_1, s:magenta ], [ s:cyan, s:bg_2 ]]
let s:p.inactive.left = [[ s:brblue, s:bg_2 ], [ s:cyan, s:bg_2 ]]
let s:p.inactive.right = [[ s:brblue, s:bg_2 ], [ s:cyan, s:bg_2 ]]
let s:p.replace.right = [[ s:bg_1, s:red ], [ s:cyan, s:bg_2 ], [ s:dim_0, s:bg_1 ]]
let s:p.replace.left = [[ s:bg_1, s:red ], [ s:cyan, s:bg_2 ]]
let s:p.tabline.right = [[ s:bg_1, s:red ]]
let s:p.tabline.left = [[ s:cyan, s:bg_2 ]]
let s:p.tabline.tabsel = [[ s:bg_1, s:blue ]]
let g:lightline#colorscheme#selenized_white#palette = lightline#colorscheme#flatten(s:p)

View File

@ -22,7 +22,7 @@
### PaperColor light
![lightline.vim - PaperColor light](https://raw.githubusercontent.com/wiki/itchyny/lightline.vim/image/PaperColor.png)
![lightline.vim - PaperColor light](https://raw.githubusercontent.com/wiki/itchyny/lightline.vim/image/PaperColor_light.png)
### Tomorrow
@ -52,6 +52,10 @@
![lightline.vim - ayu light](https://raw.githubusercontent.com/wiki/itchyny/lightline.vim/image/ayu_light.png)
### ayu_dark
![lightline.vim - ayu dark](https://raw.githubusercontent.com/wiki/itchyny/lightline.vim/image/ayu_dark.png)
### darcula
![lightline.vim - darcula](https://raw.githubusercontent.com/wiki/itchyny/lightline.vim/image/darcula.png)
@ -68,13 +72,25 @@
![lightline.vim - selenized dark](https://raw.githubusercontent.com/wiki/itchyny/lightline.vim/image/selenized_dark.png)
### selenized black
![lightline.vim - selenized black](https://raw.githubusercontent.com/wiki/itchyny/lightline.vim/image/selenized_black.png)
### selenized light
![lightline.vim - selenized light](https://raw.githubusercontent.com/wiki/itchyny/lightline.vim/image/selenized_light.png)
### selenized white
![lightline.vim - selenized white](https://raw.githubusercontent.com/wiki/itchyny/lightline.vim/image/selenized_white.png)
### solarized dark
![lightline.vim - solarized_dark](https://raw.githubusercontent.com/wiki/itchyny/lightline.vim/image/solarized_dark.png)
![lightline.vim - solarized dark](https://raw.githubusercontent.com/wiki/itchyny/lightline.vim/image/solarized_dark.png)
### solarized light
![lightline.vim - solarized_light](https://raw.githubusercontent.com/wiki/itchyny/lightline.vim/image/solarized_light.png)
![lightline.vim - solarized light](https://raw.githubusercontent.com/wiki/itchyny/lightline.vim/image/solarized_light.png)
### materia
@ -96,9 +112,13 @@
![lightline.vim - seoul256](https://raw.githubusercontent.com/wiki/itchyny/lightline.vim/image/seoul256.png)
### one
### one dark
![lightline.vim - one](https://raw.githubusercontent.com/wiki/itchyny/lightline.vim/image/one.png)
![lightline.vim - one dark](https://raw.githubusercontent.com/wiki/itchyny/lightline.vim/image/one_dark.png)
### one light
![lightline.vim - one light](https://raw.githubusercontent.com/wiki/itchyny/lightline.vim/image/one_light.png)
### srcery_drk

View File

@ -4,7 +4,7 @@ Version: 0.1
Author: itchyny (https://github.com/itchyny)
License: MIT License
Repository: https://github.com/itchyny/lightline.vim
Last Change: 2020/02/15 18:44:06.
Last Change: 2020/05/02 17:05:15.
CONTENTS *lightline-contents*
@ -227,11 +227,13 @@ OPTIONS *lightline-option*
g:lightline.colorscheme *g:lightline.colorscheme*
The colorscheme for lightline.vim.
Currently, wombat, solarized, powerline, powerlineish,
jellybeans, molokai, seoul256, darcula, selenized_dark,
jellybeans, molokai, seoul256, darcula,
selenized_dark, selenized_black, selenized_light, selenized_white,
Tomorrow, Tomorrow_Night, Tomorrow_Night_Blue,
Tomorrow_Night_Bright, Tomorrow_Night_Eighties, PaperColor,
landscape, one, materia, material, OldHope, nord, deus,
srcery_drk, ayu_mirage, ayu_light and 16color are available.
simpleblack, srcery_drk, ayu_mirage, ayu_light, ayu_dark and
16color are available.
The default value is:
>
let g:lightline.colorscheme = 'default'

View File

@ -5,7 +5,10 @@
- **.PATCH**: Pull Request Title (PR Author) [PR Number](Link to PR)
-->
#### 6.7
- **.7**: Put '%' argument in bufname() for backwards compatibility. (PhilRunninger) [#1105](https://github.com/preservim/nerdtree/pull/1105)
- **.10**: Do not consider the tree root to be "cascadable". (lifecrisis) [#1120](https://github.com/preservim/nerdtree/pull/1120)
- **.9**: Force `:NERDTreeFocus` to allow events to be fired when switching windows. (PhilRunninger) [#1118](https://github.com/preservim/nerdtree/pull/1118)
- **.8**: Fix example code for the `NERDTreeAddKeyMap()` function. (PhilRunninger) [#1116](https://github.com/preservim/nerdtree/pull/1116)
- **.7**: Put `'%'` argument in `bufname()` for backwards compatibility. (PhilRunninger) [#1105](https://github.com/preservim/nerdtree/pull/1105)
- **.6**: If a file's already open in the window, don't edit it again. (PhilRunninger) [#1103](https://github.com/preservim/nerdtree/pull/1103)
- **.5**: Prevent unneeded tree creation in `:NERDTreeToggle[VCS] <path>` (PhilRunninger) [#1101](https://github.com/preservim/nerdtree/pull/1101)
- **.4**: Add missing calls to the `shellescape()` function (lifecrisis) [#1099](https://github.com/preservim/nerdtree/pull/1099)

View File

@ -1353,12 +1353,12 @@ NERDTreeAddKeyMap({options}) *NERDTreeAddKeyMap()*
Example: >
call NERDTreeAddKeyMap({
\ 'key': 'foo',
\ 'callback': 'NERDTreeCDHandler',
\ 'callback': 'NERDTreeEchoPathHandler',
\ 'quickhelpText': 'echo full path of current node',
\ 'scope': 'DirNode' })
function! NERDTreeCDHandler(dirnode)
call a:dirnode.changeToDir()
function! NERDTreeEchoPathHandler(dirnode)
echo a:dirnode.path.str()
endfunction
<
This code should sit in a file like ~/.vim/nerdtree_plugin/mymapping.vim.

View File

@ -96,9 +96,9 @@ endfunction
"FUNCTION: s:NERDTree.CursorToTreeWin(){{{1
"Places the cursor in the nerd tree window
function! s:NERDTree.CursorToTreeWin()
function! s:NERDTree.CursorToTreeWin(...)
call g:NERDTree.MustBeOpen()
call nerdtree#exec(g:NERDTree.GetWinNum() . 'wincmd w', 1)
call nerdtree#exec(g:NERDTree.GetWinNum() . 'wincmd w', a:0 >0 ? a:1 : 1)
endfunction
" Function: s:NERDTree.ExistsForBuffer() {{{1

View File

@ -377,11 +377,17 @@ endfunction
" 1. If cascaded, we don't know which dir is bookmarked or is a symlink.
" 2. If the parent is a symlink or is bookmarked, you end up with unparsable
" text, and NERDTree cannot get the path of any child node.
" Also, return false if this directory is the tree root, which should never be
" part of a cascade.
function! s:TreeDirNode.isCascadable()
if g:NERDTreeCascadeSingleChildDir ==# 0
return 0
endif
if self.isRoot()
return 0
endif
if self.path.isSymLink
return 0
endif

View File

@ -217,7 +217,7 @@ endfunction
function! NERDTreeFocus()
if g:NERDTree.IsOpen()
call g:NERDTree.CursorToTreeWin()
call g:NERDTree.CursorToTreeWin(0)
else
call g:NERDTreeCreator.ToggleTabTree('')
endif

View File

@ -137,12 +137,15 @@ The same caveat applies to line number highlighting as to line highlighting just
If you switch off both line highlighting and signs, you won't see the sign column.
To keep your Vim snappy, vim-gitgutter will suppress the signs when a file has more than 500 changes. As soon as the number of changes falls below the limit vim-gitgutter will show the signs again. You can configure the threshold with:
In older Vims (pre 8.1.0614 / Neovim 0.4.0) vim-gitgutter will suppress the signs when a file has more than 500 changes, to avoid slowing down the UI. As soon as the number of changes falls below the limit vim-gitgutter will show the signs again. You can configure the threshold with:
```viml
let g:gitgutter_max_signs = 500 " default value
let g:gitgutter_max_signs = 500 " default value (Vim < 8.1.0614, Neovim < 0.4.0)
let g:gitgutter_max_signs = -1 " default value (otherwise)
```
You can also remove the limit by setting `g:gitgutter_max_signs = -1`.
#### Hunks
You can jump between hunks:
@ -287,19 +290,14 @@ Please note that vim-gitgutter won't override any colours or highlights you've s
#### Sign column
By default vim-gitgutter will make the sign column look like the line number column.
To customise your sign column's background color, first tell vim-gitgutter to leave it alone:
Set the `SignColumn` highlight group to change the sign column's colour. For example:
```viml
let g:gitgutter_override_sign_column_highlight = 0
```
" vim-gitgutter used to do this by default:
highlight! link SignColumn LineNr
And then either update your colorscheme's `SignColumn` highlight group or set it in your vimrc:
```viml
highlight SignColumn ctermbg=whatever " terminal Vim
highlight SignColumn guibg=whatever " gVim/MacVim
" or you could do this:
highlight SignColumn guibg=whatever ctermbg=whatever
```
By default the sign column will appear when there are signs to show and disappear when there aren't. To always have the sign column, add to your vimrc:
@ -318,13 +316,15 @@ let g:gitgutter_sign_allow_clobber = 1
#### Signs' colours and symbols
If you or your colourscheme has defined `GitGutter*` highlight groups, the plugin will use those for the signs' colours.
If you or your colourscheme has defined `GitGutter*` highlight groups, the plugin will use them for the signs' colours.
Otherwise it will use your colourscheme's `Diff*` highlight groups.
If you want the background colours to match the sign column, but don't want to update the `GitGutter*` groups yourself, you can get the plugin to do it:
Either way the signs' background colours will be set to the sign column's background colour.
```viml
let g:gitgutter_set_sign_backgrounds = 1
```
If you don't like the colours, specify the ones you want in your vimrc (see `:help highlight-guifg` and `:help highlight-ctermfg`). For example, to get vim-gitgutter's original colours (based on git-diff's colours in my terminal):
If no `GitGutter*` highlight groups exist, the plugin will check the `Diff*` highlight groups. If their foreground colours differ the plugin will use them; if not, these colours will be used:
```viml
highlight GitGutterAdd guifg=#009900 ctermfg=2

View File

@ -182,7 +182,7 @@ function! gitgutter#diff#handler(bufnr, diff) abort
let modified_lines = gitgutter#diff#process_hunks(a:bufnr, gitgutter#hunk#hunks(a:bufnr))
let signs_count = len(modified_lines)
if signs_count > g:gitgutter_max_signs
if g:gitgutter_max_signs != -1 && signs_count > g:gitgutter_max_signs
call gitgutter#utility#warn_once(a:bufnr, printf(
\ 'exceeded maximum number of signs (%d > %d, configured by g:gitgutter_max_signs).',
\ signs_count, g:gitgutter_max_signs), 'max_signs')

View File

@ -64,14 +64,6 @@ function! gitgutter#highlight#linenr_toggle() abort
endfunction
function! gitgutter#highlight#define_sign_column_highlight() abort
if g:gitgutter_override_sign_column_highlight
highlight! link SignColumn LineNr
else
highlight default link SignColumn LineNr
endif
endfunction
function! gitgutter#highlight#define_highlights() abort
let [guibg, ctermbg] = s:get_background_colors('SignColumn')
@ -84,26 +76,24 @@ function! gitgutter#highlight#define_highlights() abort
highlight default link GitGutterChangeDeleteInvisible GitGutterChangeInvisible
" When they are visible.
" If GitGutter* highlights are already defined, either by the user or the colourscheme,
" set their backgrounds to the sign column's.
for type in ["Add", "Change", "Delete"]
if hlexists("GitGutter".type)
" Were the highlight self-contained we could just declare the
" background attributes and they would be merged. But it might be a
" link, in which case it would be overwritten. So re-declare it in its
" entirety.
let [guifg, ctermfg] = s:get_foreground_colors('GitGutter'.type)
execute "highlight GitGutter".type." guifg=".guifg." guibg=".guibg." ctermfg=".ctermfg." ctermbg=".ctermbg
if g:gitgutter_set_sign_backgrounds
execute "highlight GitGutter".type." guibg=".guibg." ctermbg=".ctermbg
endif
continue
elseif s:useful_diff_colours()
let [guifg, ctermfg] = s:get_foreground_colors('Diff'.type)
else
let [guifg, ctermfg] = s:get_foreground_fallback_colors(type)
endif
execute "highlight GitGutter".type." guifg=".guifg." guibg=".guibg." ctermfg=".ctermfg." ctermbg=".ctermbg
endfor
" By default use Diff* foreground colors with SignColumn's background.
for type in ['Add', 'Change', 'Delete']
let [guifg, ctermfg] = s:get_foreground_colors('Diff'.type)
execute "highlight GitGutter".type."Default guifg=".guifg." guibg=".guibg." ctermfg=".ctermfg." ctermbg=".ctermbg
execute "highlight default link GitGutter".type." GitGutter".type."Default"
endfor
if hlexists("GitGutterChangeDelete") && g:gitgutter_set_sign_backgrounds
execute "highlight GitGutterChangeDelete guibg=".guibg." ctermbg=".ctermbg
endif
highlight default link GitGutterChangeDelete GitGutterChange
" Highlights used for the whole line.
@ -236,3 +226,20 @@ function! s:get_background_colors(group) abort
let guibg = s:get_hl(a:group, 'bg', 'gui')
return [guibg, ctermbg]
endfunction
function! s:useful_diff_colours()
let [guifg_add, ctermfg_add] = s:get_foreground_colors('DiffAdd')
let [guifg_del, ctermfg_del] = s:get_foreground_colors('DiffDelete')
return guifg_add != guifg_del && ctermfg_add != ctermfg_del
endfunction
function! s:get_foreground_fallback_colors(type)
if a:type == 'Add'
return ['#009900', '2']
elseif a:type == 'Change'
return ['#bbbb00', '3']
elseif a:type == 'Delete'
return ['#ff2222', '1']
endif
endfunction

View File

@ -162,7 +162,7 @@ endfunction
function! gitgutter#utility#cd_cmd(bufnr, cmd) abort
let cd = s:unc_path(a:bufnr) ? 'pushd' : (gitgutter#utility#windows() ? 'cd /d' : 'cd')
let cd = s:unc_path(a:bufnr) ? 'pushd' : (gitgutter#utility#windows() && s:dos_shell() ? 'cd /d' : 'cd')
return cd.' '.s:dir(a:bufnr).' && '.a:cmd
endfunction
@ -170,6 +170,10 @@ function! s:unc_path(bufnr)
return s:abs_path(a:bufnr, 0) =~ '^\\\\'
endfunction
function! s:dos_shell()
return &shell == 'cmd.exe' || &shell == 'command.com'
endfunction
function! s:use_known_shell() abort
if has('unix') && &shell !=# 'sh'
let [s:shell, s:shellcmdflag, s:shellredir] = [&shell, &shellcmdflag, &shellredir]

View File

@ -306,7 +306,7 @@ Signs:~
|g:gitgutter_sign_removed|
|g:gitgutter_sign_removed_first_line|
|g:gitgutter_sign_modified_removed|
|g:gitgutter_override_sign_column_highlight|
|g:gitgutter_set_sign_backgrounds|
Hunk previews:~
@ -412,13 +412,16 @@ Default: 0
Determines whether or not to show line number highlights.
*g:gitgutter_max_signs*
Default: 500
Default: 500 (Vim < 8.1.0614, Neovim < 0.4.0)
-1 (otherwise)
Sets the maximum number of signs to show in a buffer. Vim is slow at updating
signs, so to avoid slowing down the GUI the number of signs is capped. When
the number of changed lines exceeds this value, the plugin removes all signs
and displays a warning message.
When set to -1 the limit is not applied.
*g:gitgutter_sign_priority*
Default: 10
@ -447,26 +450,14 @@ Defaults:
You can use unicode characters but not images. Signs must not take up more than
2 columns.
*g:gitgutter_override_sign_column_highlight*
Default: 1
*g:gitgutter_set_sign_backgrounds*
Default: 0
Controls whether to make the sign column look like the line-number column (i.e.
the |hl-LineNr| highlight group).
To customise your sign column's background color, first tell vim-gitgutter to
leave it alone:
>
let g:gitgutter_override_sign_column_highlight = 0
<
And then either update your colorscheme's |hlSignColumn| highlight group or set
it in your |vimrc|:
Desired appearance Command ~
Same as line-number column highlight clear SignColumn
User-defined (terminal Vim) highlight SignColumn ctermbg={whatever}
User-defined (graphical Vim) highlight SignColumn guibg={whatever}
Only applies to existing GitGutter* highlight groups. See
|gitgutter-highlights|.
Controls whether to override the signs' background colours to match the
|hl-SignColumn|.
*g:gitgutter_preview_win_floating*
Default: 0 (Vim)
@ -538,6 +529,10 @@ To change the signs' colours, specify these highlight groups in your |vimrc|:
See |highlight-guifg| and |highlight-ctermfg| for the values you can use.
If you do not like the signs' background colours and you do not want to update
the GitGutter* highlight groups yourself, you can get the plugin to do it
|g:gitgutter_set_sign_backgrounds|.
To change the line highlights, set up the following highlight groups in your
colorscheme or |vimrc|:
>
@ -593,8 +588,11 @@ c. Why can't I unstage staged changes?
d. Why are the colours in the sign column weird?
Your colorscheme is configuring the |hl-SignColumn| highlight group weirdly.
Please see |g:gitgutter_override_sign_column_highlight| on customising the
sign column.
Here are two ways you could change the colours:
>
highlight! link SignColumn LineNr
highlight SignColumn guibg=whatever ctermbg=whatever
<
e. What happens if I also use another plugin which uses signs (e.g. Syntastic)?

View File

@ -22,6 +22,13 @@ function! s:set(var, default) abort
endif
endfunction
function! s:obsolete(var)
if exists(a:var)
call gitgutter#utility#warn(a:var.' is obsolete and has no effect.')
endif
endfunction
call s:set('g:gitgutter_preview_win_location', 'bo')
if exists('*nvim_open_win')
call s:set('g:gitgutter_preview_win_floating', 1)
@ -29,7 +36,11 @@ else
call s:set('g:gitgutter_preview_win_floating', 0)
endif
call s:set('g:gitgutter_enabled', 1)
call s:set('g:gitgutter_max_signs', 500)
if exists('*sign_unplace')
call s:set('g:gitgutter_max_signs', -1)
else
call s:set('g:gitgutter_max_signs', 500)
endif
call s:set('g:gitgutter_signs', 1)
call s:set('g:gitgutter_highlight_lines', 0)
call s:set('g:gitgutter_highlight_linenrs', 0)
@ -40,7 +51,7 @@ if (has('nvim-0.4.0') || exists('*sign_place')) && !exists('g:gitgutter_sign_all
let g:gitgutter_sign_allow_clobber = 1
endif
call s:set('g:gitgutter_sign_allow_clobber', 0)
call s:set('g:gitgutter_override_sign_column_highlight', 1)
call s:set('g:gitgutter_set_sign_backgrounds', 0)