1
0
Fork 0
mirror of synced 2024-07-26 18:11:12 -04:00

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)
call s:set('g:gitgutter_sign_added', '+')
call s:set('g:gitgutter_sign_modified', '~')
call s:set('g:gitgutter_sign_removed', '_')
@ -65,7 +76,10 @@ call s:set('g:gitgutter_use_location_list', 0)
call s:set('g:gitgutter_git_executable', 'git')
if !executable(g:gitgutter_git_executable)
call gitgutter#utility#warn('cannot find git. Please set g:gitgutter_git_executable.')
if g:gitgutter_enabled
call gitgutter#utility#warn('cannot find git. Please set g:gitgutter_git_executable.')
endif
finish
endif
let default_grep = 'grep'
@ -83,7 +97,6 @@ if !empty(g:gitgutter_grep)
endif
endif
call gitgutter#highlight#define_sign_column_highlight()
call gitgutter#highlight#define_highlights()
call gitgutter#highlight#define_signs()
@ -260,7 +273,7 @@ augroup gitgutter
autocmd VimResume * call gitgutter#all(1)
endif
autocmd ColorScheme * call gitgutter#highlight#define_sign_column_highlight() | call gitgutter#highlight#define_highlights()
autocmd ColorScheme * call gitgutter#highlight#define_highlights()
" Disable during :vimgrep
autocmd QuickFixCmdPre *vimgrep* let g:gitgutter_enabled = 0

View file

@ -51,8 +51,8 @@ syntax keyword jsFrom contained from skipwhite skipempty nextgroup
syntax match jsModuleComma contained /,/ skipwhite skipempty nextgroup=jsModuleKeyword,jsModuleAsterisk,jsModuleGroup,jsFlowTypeKeyword
" Strings, Templates, Numbers
syntax region jsString start=+\z(["']\)+ skip=+\\\%(\z1\|$\)+ end=+\z1+ end=+$+ contains=jsSpecial,@Spell extend
syntax region jsTemplateString start=+`+ skip=+\\`+ end=+`+ contains=jsTemplateExpression,jsSpecial,@Spell extend
syntax region jsString start=+\z(["']\)+ skip=+\\\%(\z1\|$\)+ end=+\z1+ end=+$+ contains=jsSpecial extend
syntax region jsTemplateString start=+`+ skip=+\\`+ end=+`+ contains=jsTemplateExpression,jsSpecial extend
syntax match jsTaggedTemplate /\<\K\k*\ze`/ nextgroup=jsTemplateString
syntax match jsNumber /\c\<\%(\d\+\%(e[+-]\=\d\+\)\=\|0b[01]\+\|0o\o\+\|0x\x\+\)\>/
syntax keyword jsNumber Infinity
@ -74,14 +74,14 @@ syntax cluster jsRegexpSpecial contains=jsSpecial,jsRegexpBoundary,jsRegexpBa
" Objects
syntax match jsObjectShorthandProp contained /\<\k*\ze\s*/ skipwhite skipempty nextgroup=jsObjectSeparator
syntax match jsObjectKey contained /\<\k*\ze\s*:/ contains=jsFunctionKey skipwhite skipempty nextgroup=jsObjectValue
syntax region jsObjectKeyString contained start=+\z(["']\)+ skip=+\\\%(\z1\|$\)+ end=+\z1\|$+ contains=jsSpecial,@Spell skipwhite skipempty nextgroup=jsObjectValue
syntax region jsObjectKeyString contained start=+\z(["']\)+ skip=+\\\%(\z1\|$\)+ end=+\z1\|$+ contains=jsSpecial skipwhite skipempty nextgroup=jsObjectValue
syntax region jsObjectKeyComputed contained matchgroup=jsBrackets start=/\[/ end=/]/ contains=@jsExpression skipwhite skipempty nextgroup=jsObjectValue,jsFuncArgs extend
syntax match jsObjectSeparator contained /,/
syntax region jsObjectValue contained matchgroup=jsObjectColon start=/:/ end=/[,}]\@=/ contains=@jsExpression extend
syntax match jsObjectFuncName contained /\<\K\k*\ze\_s*(/ skipwhite skipempty nextgroup=jsFuncArgs
syntax match jsFunctionKey contained /\<\K\k*\ze\s*:\s*function\>/
syntax match jsObjectMethodType contained /\<[gs]et\ze\s\+\K\k*/ skipwhite skipempty nextgroup=jsObjectFuncName
syntax region jsObjectStringKey contained start=+\z(["']\)+ skip=+\\\%(\z1\|$\)+ end=+\z1\|$+ contains=jsSpecial,@Spell extend skipwhite skipempty nextgroup=jsFuncArgs,jsObjectValue
syntax region jsObjectStringKey contained start=+\z(["']\)+ skip=+\\\%(\z1\|$\)+ end=+\z1\|$+ contains=jsSpecial extend skipwhite skipempty nextgroup=jsFuncArgs,jsObjectValue
exe 'syntax keyword jsNull null '.(exists('g:javascript_conceal_null') ? 'conceal cchar='.g:javascript_conceal_null : '')
exe 'syntax keyword jsReturn return contained '.(exists('g:javascript_conceal_return') ? 'conceal cchar='.g:javascript_conceal_return : '').' skipwhite nextgroup=@jsExpression'
@ -187,7 +187,7 @@ syntax region jsClassDefinition start=/\<class\>/ end=/\(\<ext
syntax match jsClassProperty contained /\<\K\k*\ze\s*[=;]/ skipwhite skipempty nextgroup=jsClassValue,jsFlowClassDef
syntax region jsClassValue contained start=/=/ end=/\_[;}]\@=/ contains=@jsExpression
syntax region jsClassPropertyComputed contained matchgroup=jsBrackets start=/\[/ end=/]/ contains=@jsExpression skipwhite skipempty nextgroup=jsFuncArgs,jsClassValue extend
syntax region jsClassStringKey contained start=+\z(["']\)+ skip=+\\\%(\z1\|$\)+ end=+\z1\|$+ contains=jsSpecial,@Spell extend skipwhite skipempty nextgroup=jsFuncArgs
syntax region jsClassStringKey contained start=+\z(["']\)+ skip=+\\\%(\z1\|$\)+ end=+\z1\|$+ contains=jsSpecial extend skipwhite skipempty nextgroup=jsFuncArgs
" Destructuring
syntax match jsDestructuringPropertyValue contained /\k\+/

View file

@ -14,7 +14,7 @@ export default $4`!p snip.rv = snip.basename`
endsnippet
# React Hooks
snippet useS "useState Hook" b
const [${1}, set$1`!p snip.rv=t[1].title()`] = useState(${3:"${4}"})
const [${1}, set`!p snip.rv=t[1].title()`] = useState(${3:"${4}"})
endsnippet
snippet useE "useEffect Hook" b
useEffect(() => {

View file

@ -16,6 +16,18 @@ pub fn ${1:function_name}($2)${3/..*/ -> /}$3 {
}
endsnippet
snippet afn "async fn name(?) -> ? {}"
fn ${1:function_name}($2)${3/..*/ -> /}$3 {
${VISUAL}$0
}
endsnippet
snippet pafn "pub async fn name(?) -> ? {}"
pub fn ${1:function_name}($2)${3/..*/ -> /}$3 {
${VISUAL}$0
}
endsnippet
snippet pri "print!(..)" b
print!("$1"${2/..*/, /}$2);
endsnippet

View file

@ -1,3 +1,4 @@
# Languages
snippet #r
#lang racket
snippet #tr
@ -10,56 +11,38 @@ snippet #d
#lang datalog
snippet #wi
#lang web-server/insta
# Defines
snippet def
(define ${1} ${0})
snippet defun
(define (${1})
${0})
snippet defv "define-values"
(define-values (${1}) (${0}))
snippet defm "define/match"
(define/match (${1})
[(${2}) ${3}]
${0})
snippet defs "define-syntax"
(define-syntax (${1})
${0})
# Conditionals
snippet if
(if ${1} ${2} ${0})
snippet ifn
(if (not ${1}) ${2} {0})
(if (not ${1}) ${2} ${0})
snippet ifl
(if ${1}
(let ()
${2})
(let (${2})
${3})
${0})
snippet ifnl
(if (not ${1})
(let ()
${2})
(let (${2})
${3})
${0})
snippet when
(when ${1}
${0})
snippet cond
(cond
[(${1})
${0}])
snippet case
(case ${1}
[(${2})
${0}])
snippet match
(match ${1}
[(${2})
${0}])
snippet letcc
(let/cc here (set! ${1} here) ${0})
snippet for
(for ([${1} ${2}])
${0})
snippet req
(require ${0})
snippet unless
(unless ${1} ${2} ${0})
snippet let
(let ([${1}]) ${0})
snippet begin
(begin
${0})
snippet lambda
(lambda (${1}) ${0})
snippet ifb
(if ${1}
(begin
@ -70,3 +53,79 @@ snippet ifnb
(begin
${2})
${0})
snippet when
(when ${1}
${0})
snippet unless
(unless ${1} ${2} ${0})
snippet cond
(cond
[(${1}) ${0}])
snippet conde
(cond
[(${1}) ${2}]
[else ${0}])
snippet case
(case ${1}
[(${2}) ${0}])
snippet match
(match ${1}
[(${2}) ${0}])
# For iterations
snippet for
(for ([${1}])
${0})
snippet forl "for/list"
(for/list ([${1}])
${0})
snippet forf "for/fold"
(for/fold
([${1}])
([${2}])
${0})
snippet forfr "for/foldr"
(for/foldr
([${1}])
([${2}])
${0})
snippet fora "for/and"
(for/and ([${1}])
${0})
snippet foro "for/or"
(for/or ([${1}])
${0})
snippet fors "for/sum"
(for/sum ([${1}])
${0})
snippet forp "for/product"
(for/product ([${1}])
${0})
snippet forfi "for/first"
(for/first ([${1}])
${0})
snippet forla "for/last"
(for/last ([${1}])
${0})
snippet lambda
(lambda (${1}) ${0})
snippet apply
(apply ${1} ${0})
snippet map
(map ${1} ${0})
snippet filter
(filter ${1} ${0})
snippet req
(require ${0})
snippet prov
(provide ${0})
snippet let
(let ([${1}]) ${0})
snippet letcc
(let/cc here (set! ${1} here) ${0})
snippet begin
(begin
${0})

View file

@ -11,6 +11,14 @@ snippet pfn "Function definition"
pub fn ${1:function_name}(${2})${3} {
${0}
}
snippet afn "Async function definition"
async fn ${1:function_name}(${2})${3} {
${0}
}
snippet pafn "Async function definition"
pub async fn ${1:function_name}(${2})${3} {
${0}
}
snippet bench "Bench function" b
#[bench]
fn ${1:bench_function_name}(b: &mut test::Bencher) {