mirror of
1
0
Fork 0

😼 Update plugins

This commit is contained in:
SUPERustam 2021-09-11 14:42:06 +03:00
parent 96bb75d663
commit e3b05f640b
61 changed files with 2215 additions and 830 deletions

View File

@ -0,0 +1,16 @@
" Author: João Pesce <joao@pesce.cc>
" Description: eslint for JSON files.
"
" Requires eslint-plugin-jsonc or a similar plugin to work
"
" Uses the same funtcions as ale_linters/javascript/eslint.vim by w0rp
" <devw0rp@gmail.com>
call ale#linter#Define('json', {
\ 'name': 'eslint',
\ 'output_stream': 'both',
\ 'executable': function('ale#handlers#eslint#GetExecutable'),
\ 'cwd': function('ale#handlers#eslint#GetCwd'),
\ 'command': function('ale#handlers#eslint#GetCommand'),
\ 'callback': 'ale#handlers#eslint#HandleJSON',
\})

View File

@ -0,0 +1,16 @@
" Author: João Pesce <joao@pesce.cc>
" Description: eslint for JSON5 files.
"
" Requires eslint-plugin-jsonc or a similar plugin to work
"
" Uses the same funtcions as ale_linters/javascript/eslint.vim by w0rp
" <devw0rp@gmail.com>
call ale#linter#Define('json5', {
\ 'name': 'eslint',
\ 'output_stream': 'both',
\ 'executable': function('ale#handlers#eslint#GetExecutable'),
\ 'cwd': function('ale#handlers#eslint#GetCwd'),
\ 'command': function('ale#handlers#eslint#GetCommand'),
\ 'callback': 'ale#handlers#eslint#HandleJSON',
\})

View File

@ -0,0 +1,16 @@
" Author: João Pesce <joao@pesce.cc>
" Description: eslint for JSONC files.
"
" Requires eslint-plugin-jsonc or a similar plugin to work
"
" Uses the same funtcions as ale_linters/javascript/eslint.vim by w0rp
" <devw0rp@gmail.com>
call ale#linter#Define('jsonc', {
\ 'name': 'eslint',
\ 'output_stream': 'both',
\ 'executable': function('ale#handlers#eslint#GetExecutable'),
\ 'cwd': function('ale#handlers#eslint#GetCwd'),
\ 'command': function('ale#handlers#eslint#GetCommand'),
\ 'callback': 'ale#handlers#eslint#HandleJSON',
\})

View File

@ -1,4 +1,4 @@
" Author: Vincent (wahrwolf [ät] wolfpit.net)
" Author: Vincent (wahrwolf [at] wolfpit.net)
" Description: languagetool for mails

View File

@ -1,4 +1,4 @@
" Author: Vincent (wahrwolf [ät] wolfpit.net)
" Author: Vincent (wahrwolf [at] wolfpit.net)
" Description: languagetool for markdown files

View File

@ -22,14 +22,17 @@ endfunction
function! ale_linters#python#pyre#GetCommand(buffer) abort
let l:executable = ale_linters#python#pyre#GetExecutable(a:buffer)
let l:exec_args = l:executable =~? 'pipenv\|poetry$'
\ ? ' run pyre persistent'
\ : ' persistent'
let l:exec_args = (l:executable =~? 'pipenv\|poetry$' ? ' run pyre' : '') . ' persistent'
return ale#Escape(l:executable) . l:exec_args
endfunction
function! ale_linters#python#pyre#GetCwd(buffer) abort
let l:local_config = ale#path#FindNearestFile(a:buffer, '.pyre_configuration.local')
return fnamemodify(l:local_config, ':h')
endfunction
call ale#linter#Define('python', {
\ 'name': 'pyre',
\ 'lsp': 'stdio',
@ -37,4 +40,5 @@ call ale#linter#Define('python', {
\ 'command': function('ale_linters#python#pyre#GetCommand'),
\ 'project_root': function('ale#python#FindProjectRoot'),
\ 'completion_filter': 'ale#completion#python#CompletionItemFilter',
\ 'cwd': function('ale_linters#python#pyre#GetCwd'),
\})

View File

@ -0,0 +1,46 @@
" Author: Samuel Branisa <branisa.samuel@icloud.com>
" Description: rflint linting for robot framework files
call ale#Set('robot_rflint_executable', 'rflint')
function! ale_linters#robot#rflint#GetExecutable(buffer) abort
return ale#Var(a:buffer, 'robot_rflint_executable')
endfunction
function! ale_linters#robot#rflint#GetCommand(buffer) abort
let l:executable = ale_linters#robot#rflint#GetExecutable(a:buffer)
let l:flags = '--format'
\ . ' "{filename}:{severity}:{linenumber}:{char}:{rulename}:{message}"'
return l:executable
\ . ' '
\ . l:flags
\ . ' %s'
endfunction
function! ale_linters#robot#rflint#Handle(buffer, lines) abort
let l:pattern = '\v^([[:alnum:][:punct:]]+):(W|E):([[:digit:]]+):([[:digit:]]+):([[:alnum:]]+):(.*)$'
let l:output = []
for l:match in ale#util#GetMatches(a:lines, l:pattern)
call add(l:output, {
\ 'bufnr': a:buffer,
\ 'filename': l:match[1],
\ 'type': l:match[2],
\ 'lnum': str2nr(l:match[3]),
\ 'col': str2nr(l:match[4]),
\ 'text': l:match[5],
\ 'detail': l:match[6],
\})
endfor
return l:output
endfunction
call ale#linter#Define('robot', {
\ 'name': 'rflint',
\ 'executable': function('ale_linters#robot#rflint#GetExecutable'),
\ 'command': function('ale_linters#robot#rflint#GetCommand'),
\ 'callback': 'ale_linters#robot#rflint#Handle',
\})

View File

@ -13,9 +13,9 @@ endfunction
function! ale_linters#thrift#thriftcheck#Handle(buffer, lines) abort
" Matches lines like the following:
"
" file.thrift:1:1:error: "py" namespace must match "^idl\\." (namespace.pattern)
" file.thrift:3:5:warning: 64-bit integer constant -2147483649 may not work in all languages (int.64bit)
let l:pattern = '\v^[a-zA-Z]?:?[^:]+:(\d+):(\d+):(\l+): (.*) \((.*)\)$'
" file.thrift:1:1: error: "py" namespace must match "^idl\\." (namespace.pattern)
" file.thrift:3:5: warning: 64-bit integer constant -2147483649 may not work in all languages (int.64bit)
let l:pattern = '\v^[a-zA-Z]?:?[^:]+:(\d+):(\d+): ?([^:]+): (.+) \(([^\)]+)\)$'
let l:output = []

View File

@ -1001,12 +1001,11 @@ endfunction
function! ale#completion#HandleUserData(completed_item) abort
let l:user_data_json = get(a:completed_item, 'user_data', '')
let l:user_data = !empty(l:user_data_json)
\ ? ale#util#FuzzyJSONDecode(l:user_data_json, v:null)
\ : v:null
let l:user_data = type(l:user_data_json) is v:t_dict
\ ? l:user_data_json
\ : ale#util#FuzzyJSONDecode(l:user_data_json, {})
if type(l:user_data) isnot v:t_dict
\|| get(l:user_data, '_ale_completion_item', 0) isnot 1
if !has_key(l:user_data, '_ale_completion_item')
return
endif

View File

@ -246,6 +246,11 @@ let s:default_registry = {
\ 'suggested_filetypes': ['go'],
\ 'description': 'Fix Go files imports with goimports.',
\ },
\ 'golines': {
\ 'function': 'ale#fixers#golines#Fix',
\ 'suggested_filetypes': ['go'],
\ 'description': 'Fix Go file long lines with golines',
\ },
\ 'gomod': {
\ 'function': 'ale#fixers#gomod#Fix',
\ 'suggested_filetypes': ['gomod'],
@ -301,6 +306,11 @@ let s:default_registry = {
\ 'suggested_filetypes': ['haskell'],
\ 'description': 'Refactor Haskell files with stylish-haskell.',
\ },
\ 'purs-tidy': {
\ 'function': 'ale#fixers#purs_tidy#Fix',
\ 'suggested_filetypes': ['purescript'],
\ 'description': 'Format PureScript files with purs-tidy.',
\ },
\ 'purty': {
\ 'function': 'ale#fixers#purty#Fix',
\ 'suggested_filetypes': ['purescript'],
@ -386,6 +396,11 @@ let s:default_registry = {
\ 'suggested_filetypes': ['dart'],
\ 'description': 'Fix Dart files with dart format.',
\ },
\ 'dotnet-format': {
\ 'function': 'ale#fixers#dotnet_format#Fix',
\ 'suggested_filetypes': ['cs'],
\ 'description': 'Fix C# files with dotnet format.',
\ },
\ 'xmllint': {
\ 'function': 'ale#fixers#xmllint#Fix',
\ 'suggested_filetypes': ['xml'],

View File

@ -1,14 +1,11 @@
" Author: toastal <toastal@protonmail.com>
" Author: toastal <toastal@posteo.net>
" Description: Dhalls built-in formatter
"
function! ale#fixers#dhall_format#Fix(buffer) abort
let l:executable = ale#dhall#GetExecutableWithOptions(a:buffer)
let l:command = l:executable
\ . ' format'
\ . ' --inplace %t'
return {
\ 'command': l:command,
\ 'read_temporary_file': 1,
\ 'command': l:executable
\ . ' format'
\}
endfunction

View File

@ -1,18 +1,14 @@
" Author: toastal <toastal@protonmail.com>
" Author: toastal <toastal@posteo.net>
" Description: Dhalls package freezing
call ale#Set('dhall_freeze_options', '')
function! ale#fixers#dhall_freeze#Freeze(buffer) abort
let l:executable = ale#dhall#GetExecutableWithOptions(a:buffer)
let l:command = l:executable
\ . ' freeze'
\ . ale#Pad(ale#Var(a:buffer, 'dhall_freeze_options'))
\ . ' --inplace %t'
return {
\ 'command': l:command,
\ 'read_temporary_file': 1,
\ 'command': l:executable
\ . ' freeze'
\ . ale#Pad(ale#Var(a:buffer, 'dhall_freeze_options'))
\}
endfunction

View File

@ -1,14 +1,11 @@
" Author: toastal <toastal@protonmail.com>
" Author: toastal <toastal@posteo.net>
" Description: Dhalls built-in linter/formatter
function! ale#fixers#dhall_lint#Fix(buffer) abort
let l:executable = ale#dhall#GetExecutableWithOptions(a:buffer)
let l:command = l:executable
\ . ' lint'
\ . ' --inplace %t'
return {
\ 'command': l:command,
\ 'read_temporary_file': 1,
\ 'command': l:executable
\ . ' lint'
\}
endfunction

View File

@ -0,0 +1,18 @@
" Author: ghsang <gwonhyuksang@gmail.com>
" Description: Integration of dotnet format with ALE.
call ale#Set('cs_dotnet_format_executable', 'dotnet')
call ale#Set('cs_dotnet_format_options', '')
function! ale#fixers#dotnet_format#Fix(buffer) abort
let l:executable = ale#Var(a:buffer, 'cs_dotnet_format_executable')
let l:options = ale#Var(a:buffer, 'cs_dotnet_format_options')
return {
\ 'command': ale#Escape(l:executable)
\ . ' format'
\ . (empty(l:options) ? '' : ' ' . l:options)
\ . ' --folder --include %t "$(dirname %t)"',
\ 'read_temporary_file': 1,
\}
endfunction

View File

@ -0,0 +1,21 @@
" Author Pig Frown <pigfrown@protonmail.com>
" Description: Fix Go files long lines with golines"
call ale#Set('go_golines_executable', 'golines')
call ale#Set('go_golines_options', '')
function! ale#fixers#golines#Fix(buffer) abort
let l:executable = ale#Var(a:buffer, 'go_golines_executable')
let l:options = ale#Var(a:buffer, 'go_golines_options')
let l:env = ale#go#EnvString(a:buffer)
if !executable(l:executable)
return 0
endif
return {
\ 'command': l:env . ale#Escape(l:executable)
\ . (empty(l:options) ? '' : ' ' . l:options)
\}
endfunction

View File

@ -5,6 +5,7 @@ call ale#Set('python_isort_executable', 'isort')
call ale#Set('python_isort_use_global', get(g:, 'ale_use_global_executables', 0))
call ale#Set('python_isort_options', '')
call ale#Set('python_isort_auto_pipenv', 0)
call ale#Set('python_isort_auto_poetry', 0)
function! ale#fixers#isort#GetExecutable(buffer) abort
if (ale#Var(a:buffer, 'python_auto_pipenv') || ale#Var(a:buffer, 'python_isort_auto_pipenv'))
@ -12,24 +13,34 @@ function! ale#fixers#isort#GetExecutable(buffer) abort
return 'pipenv'
endif
if (ale#Var(a:buffer, 'python_auto_poetry') || ale#Var(a:buffer, 'python_isort_auto_poetry'))
\ && ale#python#PoetryPresent(a:buffer)
return 'poetry'
endif
return ale#python#FindExecutable(a:buffer, 'python_isort', ['isort'])
endfunction
function! ale#fixers#isort#Fix(buffer) abort
let l:options = ale#Var(a:buffer, 'python_isort_options')
let l:executable = ale#fixers#isort#GetExecutable(a:buffer)
let l:exec_args = l:executable =~? 'pipenv$'
\ ? ' run isort'
\ : ''
let l:cmd = [ale#Escape(l:executable)]
if !executable(l:executable) && l:executable isnot# 'pipenv'
return 0
if l:executable =~? 'pipenv\|poetry$'
call extend(l:cmd, ['run', 'isort'])
endif
call add(l:cmd, '--filename %s')
let l:options = ale#Var(a:buffer, 'python_isort_options')
if !empty(l:options)
call add(l:cmd, l:options)
endif
call add(l:cmd, '-')
return {
\ 'cwd': '%s:h',
\ 'command': ale#Escape(l:executable) . l:exec_args
\ . ale#Pad('--filename %s')
\ . (!empty(l:options) ? ' ' . l:options : '') . ' -',
\ 'command': join(l:cmd, ' ')
\}
endfunction

View File

@ -0,0 +1,24 @@
" Author: toastal <toastal@posteo.net>
" Description: Integration of purs-tidy with ALE.
call ale#Set('purescript_tidy_executable', 'purs-tidy')
call ale#Set('purescript_tidy_use_global', get(g:, 'ale_use_global_executables', 0))
call ale#Set('purescript_tidy_options', '')
function! ale#fixers#purs_tidy#GetExecutable(buffer) abort
return ale#path#FindExecutable(a:buffer, 'purescript_tidy', [
\ 'node_modules/purescript-tidy/bin/index.js',
\ 'node_modules/.bin/purs-tidy',
\])
endfunction
function! ale#fixers#purs_tidy#Fix(buffer) abort
let l:executable = ale#fixers#purs_tidy#GetExecutable(a:buffer)
let l:options = ale#Var(a:buffer, 'purescript_tidy_options')
return {
\ 'command': ale#Escape(l:executable)
\ . ' format'
\ . ale#Pad(l:options)
\}
endfunction

View File

@ -43,21 +43,25 @@ endfunction
function! ale#handlers#cppcheck#HandleCppCheckFormat(buffer, lines) abort
" Look for lines like the following.
"
"test.cpp:974:6: error: Array 'n[3]' accessed at index 3, which is out of bounds. [arrayIndexOutOfBounds]\
"test.cpp:974:6: error:inconclusive Array 'n[3]' accessed at index 3, which is out of bounds. [arrayIndexOutOfBounds]\
" n[3]=3;
" ^
let l:pattern = '\v^(\f+):(\d+):(\d+): (\w+): (.*) \[(\w+)\]\'
"" OR if cppcheck doesn't support {column} or {inconclusive:text}:
"test.cpp:974:{column}: error:{inconclusive:inconclusive} Array 'n[3]' accessed at index 3, which is out of bounds. [arrayIndexOutOfBounds]\
" n[3]=3;
" ^
let l:pattern = '\v(\f+):(\d+):(\d+|\{column\}): (\w+):(\{inconclusive:inconclusive\})? ?(.*) \[(\w+)\]\'
let l:output = []
for l:match in ale#util#GetMatches(a:lines, l:pattern)
if ale#path#IsBufferPath(a:buffer, l:match[1])
call add(l:output, {
\ 'lnum': str2nr(l:match[2]),
\ 'col': str2nr(l:match[3]),
\ 'col': match(l:match[3],'{column}') >= 0 ? 1 : str2nr(l:match[3]),
\ 'type': l:match[4] is# 'error' ? 'E' : 'W',
\ 'sub_type': l:match[4] is# 'style' ? 'style' : '',
\ 'text': l:match[5],
\ 'code': l:match[6]
\ 'text': l:match[6],
\ 'code': l:match[7]
\})
endif
endfor

View File

@ -45,7 +45,9 @@ function! ale#hover#HandleTSServerResponse(conn_id, response) abort
\&& (l:set_balloons is 1 || l:set_balloons is# 'hover')
call balloon_show(a:response.body.displayString)
elseif get(l:options, 'truncated_echo', 0)
call ale#cursor#TruncatedEcho(split(a:response.body.displayString, "\n")[0])
if !empty(a:response.body.displayString)
call ale#cursor#TruncatedEcho(split(a:response.body.displayString, "\n")[0])
endif
elseif g:ale_hover_to_floating_preview || g:ale_floating_preview
call ale#floating_preview#Show(split(a:response.body.displayString, "\n"), {
\ 'filetype': 'ale-preview.message',

View File

@ -271,6 +271,30 @@ function! ale#lsp_linter#OnInit(linter, details, Callback) abort
call ale#lsp#NotifyForChanges(l:conn_id, l:buffer)
endif
" Tell the relevant buffer that the LSP has started via an autocmd.
if l:buffer > 0
if l:buffer == bufnr('')
silent doautocmd <nomodeline> User ALELSPStarted
else
execute 'augroup ALELSPStartedGroup' . l:buffer
autocmd!
execute printf(
\ 'autocmd BufEnter <buffer=%d>'
\ . ' doautocmd <nomodeline> User ALELSPStarted',
\ l:buffer
\)
" Replicate ++once behavior for backwards compatibility.
execute printf(
\ 'autocmd BufEnter <buffer=%d>'
\ . ' autocmd! ALELSPStartedGroup%d',
\ l:buffer, l:buffer
\)
augroup END
endif
endif
call a:Callback(a:linter, a:details)
endfunction

View File

@ -90,6 +90,39 @@ g:ale_cs_csc_assemblies *g:ale_cs_csc_assemblies*
\]
<
===============================================================================
dotnet-format *ale-cs-dotnet-format*
Installation
-------------------------------------------------------------------------------
Installing .NET SDK should probably ensure that `dotnet` is in your `$PATH`.
For .NET 6 the `dotnet format` tool is already included in the .NET SDK. For
.NET 5 or below you will have to manually install it using the instructions
from listed in this repository: https://github.com/dotnet/format
Options
-------------------------------------------------------------------------------
g:ale_cs_dotnet_format_executable *g:ale_cs_dotnet_format_executable*
*b:ale_cs_dotnet_format_executable*
Type: |String|
Default: `'dotnet'`
This variable can be set to specify an absolute path to the
`dotnet` executable (or to specify an alternate executable).
g:ale_cs_dotnet_format_options *g:ale_cs_dotnet_format_options*
*b:ale_cs_dotnet_format_options*
Type: |String|
Default: `''`
This variable can be set to pass additional options to the `dotnet format`
fixer.
===============================================================================
mcs *ale-cs-mcs*

View File

@ -6,15 +6,15 @@ g:ale_dhall_executable *g:ale_dhall_executable*
Type: |String|
Default: `'dhall'`
g:ale_dhall_options g:ale_dhall_options
b:ale_dhall_options
g:ale_dhall_options *g:ale_dhall_options*
*b:ale_dhall_options*
Type: |String|
Default: `''`
This variable can be set to pass additional options to the 'dhall` executable.
This is shared with `dhall-freeze` and `dhall-lint`.
>
let g:dhall_options = '--ascii'
let g:ale_dhall_options = '--ascii'
<
===============================================================================
@ -30,15 +30,15 @@ dhall-freeze *ale-dhall-freeze*
Dhall
(https://dhall-lang.org/)
g:ale_dhall_freeze_options g:ale_dhall_freeze_options
b:ale_dhall_freeze_options
g:ale_dhall_freeze_options *g:ale_dhall_freeze_options*
*b:ale_dhall_freeze_options*
Type: |String|
Default: `''`
This variable can be set to pass additional options to the 'dhall freeze`
executable.
>
let g:dhall_freeze_options = '--all'
let g:ale_dhall_freeze_options = '--all'
<
===============================================================================

View File

@ -133,6 +133,23 @@ g:ale_go_langserver_options *g:ale_go_langserver_options*
`-gocodecompletion` option is ignored because it is handled automatically
by the |g:ale_completion_enabled| variable.
===============================================================================
golines *ale-go-golines*
g:ale_go_golines_executable *g:ale_go_lines_executable*
*b:ale_go_lines_executable*
Type: |String|
Default: `'golines'`
Location of the golines binary file
g:ale_go_golines_options *g:ale_go_golines_options*
*b:ale_go_golines_options*
Type: |String|
Default: ''
Additional options passed to the golines command. By default golines has
--max-length=100 (lines above 100 characters will be wrapped)
===============================================================================
golint *ale-go-golint*

View File

@ -2,6 +2,15 @@
ALE JSON Integration *ale-json-options*
===============================================================================
eslint *ale-json-eslint*
The `eslint` linter for JSON uses the JavaScript options for `eslint`; see:
|ale-javascript-eslint|.
You will need a JSON ESLint plugin installed for this to work.
===============================================================================
fixjson *ale-json-fixjson*

View File

@ -0,0 +1,15 @@
===============================================================================
ALE JSON5 Integration *ale-json5-options*
===============================================================================
eslint *ale-json5-eslint*
The `eslint` linter for JSON uses the JavaScript options for `eslint`; see:
|ale-javascript-eslint|.
You will need a JSON5 ESLint plugin installed for this to work.
===============================================================================
vim:tw=78:ts=2:sts=2:sw=2:ft=help:norl:

View File

@ -0,0 +1,15 @@
===============================================================================
ALE JSONC Integration *ale-jsonc-options*
===============================================================================
eslint *ale-jsonc-eslint*
The `eslint` linter for JSON uses the JavaScript options for `eslint`; see:
|ale-javascript-eslint|.
You will need a JSONC ESLint plugin installed for this to work.
===============================================================================
vim:tw=78:ts=2:sts=2:sw=2:ft=help:norl:

View File

@ -30,6 +30,33 @@ g:ale_purescript_ls_config g:ale_purescript_ls_config
\ }
\}
===============================================================================
purs-tidy *ale-purescript-tidy*
g:ale_purescript_tidy_executable *g:ale_purescript_tidy_executable*
*b:ale_purescript_tidy_executable*
Type: |String|
Default: `'purs-tidy'`
This variable can be changed to use a different executable for purs-tidy.
g:ale_purescript_tidy_use_global *g:ale_purescript_tidy_use_global*
*b:ale_purescript_tidy_use_global*
Type: |Number|
Default: `get(g:, 'ale_use_global_executables', 0)`
See |ale-integrations-local-executables|
g:ale_purescript_tidy_options *g:ale_purescript_tidy_options*
*b:ale_purescript_tidy_options*
Type: String
Default: `''`
This variable can be set to pass in additional option to the 'purs-tidy'
executable.
>
let g:ale_purescript_options = '--indent 3'
<
===============================================================================
purty *ale-purescript-purty*
g:ale_purescript_purty_executable *g:ale_purescript_purty_executable*

View File

@ -356,6 +356,15 @@ g:ale_python_isort_auto_pipenv *g:ale_python_isort_auto_pipenv*
if true. This is overridden by a manually-set executable.
g:ale_python_isort_auto_poetry *g:ale_python_isort_auto_poetry*
*b:ale_python_isort_auto_poetry*
Type: |Number|
Default: `0`
Detect whether the file is inside a poetry, and set the executable to `poetry`
if true. This is overridden by a manually-set executable.
===============================================================================
mypy *ale-python-mypy*

View File

@ -0,0 +1,16 @@
===============================================================================
ALE Robot Integration *ale-robot-options*
===============================================================================
rflint *ale-robot-rflint*
g:ale_robot_rflint_executable *g:ale_robot_rflint_executable*
*b:ale_robot_rflint_executable*
Type: |String|
Default: `'rflint'`
===============================================================================
vim:tw=78:ts=2:sts=2:sw=2:ft=help:norl:

View File

@ -17,7 +17,7 @@ Notes:
* `gcc`
* `gnatpp`
* Ansible
* `ansible-lint`
* `ansible-lint`!!
* API Blueprint
* `drafter`
* APKBUILD
@ -66,6 +66,7 @@ Notes:
* `uncrustify`
* C#
* `csc`!!
* `dotnet-format`
* `mcs`
* `mcsc`!!
* `uncrustify`
@ -86,7 +87,7 @@ Notes:
* `uncrustify`
* Chef
* `cookstyle`
* `foodcritic`
* `foodcritic`!!
* Clojure
* `clj-kondo`
* `joker`
@ -141,7 +142,7 @@ Notes:
* Elixir
* `credo`
* `dialyxir`
* `dogma`
* `dogma`!!
* `elixir-ls`
* `mix`!!
* Elm
@ -155,7 +156,7 @@ Notes:
* `ruumba`
* Erlang
* `SyntaxErl`
* `dialyzer`
* `dialyzer`!!
* `elvis`!!
* `erlc`
* `erlfmt`
@ -183,6 +184,7 @@ Notes:
* `goimports`
* `golangci-lint`!!
* `golangserver`
* `golines`
* `golint`
* `gometalinter`!!
* `gopls`
@ -240,7 +242,7 @@ Notes:
* `ispc`!!
* Java
* `PMD`
* `checkstyle`
* `checkstyle`!!
* `eclipselsp`
* `google-java-format`
* `javac`
@ -259,16 +261,21 @@ Notes:
* `tsserver`
* `xo`
* JSON
* `eslint`
* `fixjson`
* `jq`
* `jsonlint`
* `prettier`
* `spectral`
* JSON5
* `eslint`
* JSONC
* `eslint`
* Julia
* `languageserver`
* Kotlin
* `kotlinc`!!
* `ktlint`!!
* `ktlint`
* `languageserver`
* LaTeX (tex)
* `alex`!!
@ -389,8 +396,8 @@ Notes:
* Prolog
* `swipl`
* proto
* `protoc-gen-lint`
* `protolint`
* `protoc-gen-lint`!!
* `protolint`!!
* Pug
* `pug-lint`
* Puppet
@ -399,6 +406,7 @@ Notes:
* `puppet-lint`
* PureScript
* `purescript-language-server`
* `purs-tidy`
* `purty`
* Python
* `autoflake`!!
@ -409,7 +417,7 @@ Notes:
* `flake8`
* `isort`
* `mypy`
* `prospector`
* `prospector`!!
* `pycodestyle`
* `pydocstyle`
* `pyflakes`
@ -446,10 +454,12 @@ Notes:
* `textlint`
* `vale`
* `write-good`
* Robot
* `rflint`
* RPM spec
* `rpmlint`
* Ruby
* `brakeman`
* `brakeman`!!
* `debride`
* `prettier`
* `rails_best_practices`!!
@ -544,7 +554,7 @@ Notes:
* `tsserver`
* `typecheck`
* V
* `v`
* `v`!!
* `vfmt`
* VALA
* `uncrustify`
@ -555,7 +565,7 @@ Notes:
* `verilator`
* `vlog`
* `xvlog`
* `yosys`
* `yosys`!!
* VHDL
* `ghdl`
* `vcom`

View File

@ -1,4 +1,4 @@
*ale.txt* Plugin to lint and fix files asynchronously
*ale.txt* Plugin to lint and fix files asynchronously
*ale*
ALE - Asynchronous Lint Engine
@ -2681,6 +2681,7 @@ documented in additional help files.
uncrustify............................|ale-cpp-uncrustify|
c#......................................|ale-cs-options|
csc...................................|ale-cs-csc|
dotnet-format.........................|ale-cs-dotnet-format|
mcs...................................|ale-cs-mcs|
mcsc..................................|ale-cs-mcsc|
uncrustify............................|ale-cs-uncrustify|
@ -2750,6 +2751,7 @@ documented in additional help files.
gofmt.................................|ale-go-gofmt|
golangci-lint.........................|ale-go-golangci-lint|
golangserver..........................|ale-go-golangserver|
golines...............................|ale-go-golines|
golint................................|ale-go-golint|
gometalinter..........................|ale-go-gometalinter|
gopls.................................|ale-go-gopls|
@ -2823,11 +2825,16 @@ documented in additional help files.
standard..............................|ale-javascript-standard|
xo....................................|ale-javascript-xo|
json....................................|ale-json-options|
eslint................................|ale-json-eslint|
fixjson...............................|ale-json-fixjson|
jsonlint..............................|ale-json-jsonlint|
jq....................................|ale-json-jq|
prettier..............................|ale-json-prettier|
spectral..............................|ale-json-spectral|
jsonc...................................|ale-jsonc-options|
eslint................................|ale-jsonc-eslint|
json5...................................|ale-json5-options|
eslint................................|ale-json5-eslint|
julia...................................|ale-julia-options|
languageserver........................|ale-julia-languageserver|
kotlin..................................|ale-kotlin-options|
@ -2933,6 +2940,7 @@ documented in additional help files.
puppet-languageserver.................|ale-puppet-languageserver|
purescript..............................|ale-purescript-options|
purescript-language-server............|ale-purescript-language-server|
purs-tidy.............................|ale-purescript-tidy|
purty.................................|ale-purescript-purty|
pyrex (cython)..........................|ale-pyrex-options|
cython................................|ale-pyrex-cython|
@ -2971,6 +2979,8 @@ documented in additional help files.
restructuredtext........................|ale-restructuredtext-options|
textlint..............................|ale-restructuredtext-textlint|
write-good............................|ale-restructuredtext-write-good|
robot...................................|ale-robot-options|
rflint................................|ale-robot-rflint|
ruby....................................|ale-ruby-options|
brakeman..............................|ale-ruby-brakeman|
debride...............................|ale-ruby-debride|
@ -4300,6 +4310,13 @@ ALEJobStarted *ALEJobStarted-autocmd*
|ale#engine#IsCheckingBuffer()| over |ALELintPre-autocmd|, which is actually
triggered before any linters are executed.
ALELSPStarted *ALELSPStarted-autocmd*
*ALELSPStarted*
This |User| autocommand is trigged immediately after an LSP connection is
successfully initialized. This provides a way to perform any additional
initialization work, such as setting up buffer-level mappings.
ALEWantResults *ALEWantResults-autocmd*
*ALEWantResults*

View File

@ -14,10 +14,10 @@ formatting.
**Legend**
| Key | Definition |
| ------------- | -------------------------------- |
| :floppy_disk: | May only run on files on disk |
| :warning: | Disabled by default |
| Key | Definition |
| ------------- | ----------------------------------------------------------------- |
| :floppy_disk: | May only run on files on disk (see: `help ale-lint-file-linters` |
| :warning: | Disabled by default |
---
@ -26,7 +26,7 @@ formatting.
* [gcc](https://gcc.gnu.org)
* [gnatpp](https://docs.adacore.com/gnat_ugn-docs/html/gnat_ugn/gnat_ugn/gnat_utility_programs.html#the-gnat-pretty-printer-gnatpp) :floppy_disk:
* Ansible
* [ansible-lint](https://github.com/willthames/ansible-lint)
* [ansible-lint](https://github.com/willthames/ansible-lint) :floppy_disk:
* API Blueprint
* [drafter](https://github.com/apiaryio/drafter)
* APKBUILD
@ -75,6 +75,7 @@ formatting.
* [uncrustify](https://github.com/uncrustify/uncrustify)
* C#
* [csc](http://www.mono-project.com/docs/about-mono/languages/csharp/) :floppy_disk: see:`help ale-cs-csc` for details and configuration
* [dotnet-format](https://github.com/dotnet/format)
* [mcs](http://www.mono-project.com/docs/about-mono/languages/csharp/) see:`help ale-cs-mcs` for details
* [mcsc](http://www.mono-project.com/docs/about-mono/languages/csharp/) :floppy_disk: see:`help ale-cs-mcsc` for details and configuration
* [uncrustify](https://github.com/uncrustify/uncrustify)
@ -95,7 +96,7 @@ formatting.
* [uncrustify](https://github.com/uncrustify/uncrustify)
* Chef
* [cookstyle](https://docs.chef.io/cookstyle.html)
* [foodcritic](http://www.foodcritic.io/)
* [foodcritic](http://www.foodcritic.io/) :floppy_disk:
* Clojure
* [clj-kondo](https://github.com/borkdude/clj-kondo)
* [joker](https://github.com/candid82/joker)
@ -119,7 +120,7 @@ formatting.
* [cucumber](https://cucumber.io/)
* CUDA
* [clangd](https://clang.llvm.org/extra/clangd.html)
* [nvcc](http://docs.nvidia.com/cuda/cuda-compiler-driver-nvcc/index.html)
* [nvcc](http://docs.nvidia.com/cuda/cuda-compiler-driver-nvcc/index.html) :floppy_disk:
* Cypher
* [cypher-lint](https://github.com/cleishm/libcypher-parser)
* Cython (pyrex filetype)
@ -134,9 +135,9 @@ formatting.
* Dart
* [analysis_server](https://github.com/dart-lang/sdk/tree/master/pkg/analysis_server)
* [dart-analyze](https://github.com/dart-lang/sdk/tree/master/pkg/analyzer_cli) :floppy_disk:
* [dart-format](https://github.com/dart-lang/sdk/tree/master/utils/dartfmt)
* [dart-format](https://github.com/dart-lang/sdk/tree/master/utils/dartfmt) :floppy_disk:
* [dartanalyzer](https://github.com/dart-lang/sdk/tree/master/pkg/analyzer_cli) :floppy_disk:
* [dartfmt](https://github.com/dart-lang/sdk/tree/master/utils/dartfmt)
* [dartfmt](https://github.com/dart-lang/sdk/tree/master/utils/dartfmt) :floppy_disk:
* [language_server](https://github.com/natebosch/dart_language_server)
* desktop
* [desktop-file-validate](https://www.freedesktop.org/wiki/Software/desktop-file-utils/)
@ -149,7 +150,7 @@ formatting.
* [hadolint](https://github.com/hadolint/hadolint)
* Elixir
* [credo](https://github.com/rrrene/credo)
* [dialyxir](https://github.com/jeremyjh/dialyxir) :floppy_disk:
* [dialyxir](https://github.com/jeremyjh/dialyxir)
* [dogma](https://github.com/lpil/dogma) :floppy_disk:
* [elixir-ls](https://github.com/elixir-lsp/elixir-ls) :warning:
* [mix](https://hexdocs.pm/mix/Mix.html) :warning: :floppy_disk:
@ -164,7 +165,7 @@ formatting.
* [ruumba](https://github.com/ericqweinstein/ruumba)
* Erlang
* [SyntaxErl](https://github.com/ten0s/syntaxerl)
* [dialyzer](http://erlang.org/doc/man/dialyzer.html)
* [dialyzer](http://erlang.org/doc/man/dialyzer.html) :floppy_disk:
* [elvis](https://github.com/inaka/elvis) :floppy_disk:
* [erlc](http://erlang.org/doc/man/erlc.html)
* [erlfmt](https://github.com/WhatsApp/erlfmt)
@ -192,6 +193,7 @@ formatting.
* [goimports](https://godoc.org/golang.org/x/tools/cmd/goimports) :warning:
* [golangci-lint](https://github.com/golangci/golangci-lint) :warning: :floppy_disk:
* [golangserver](https://github.com/sourcegraph/go-langserver) :warning:
* [golines](https://github.com/segmentio/golines)
* [golint](https://godoc.org/github.com/golang/lint)
* [gometalinter](https://github.com/alecthomas/gometalinter) :warning: :floppy_disk:
* [gopls](https://github.com/golang/go/wiki/gopls)
@ -249,7 +251,7 @@ formatting.
* [ispc](https://ispc.github.io/) :floppy_disk:
* Java
* [PMD](https://pmd.github.io/)
* [checkstyle](http://checkstyle.sourceforge.net)
* [checkstyle](http://checkstyle.sourceforge.net) :floppy_disk:
* [eclipselsp](https://github.com/eclipse/eclipse.jdt.ls)
* [google-java-format](https://github.com/google/google-java-format)
* [javac](http://www.oracle.com/technetwork/java/javase/downloads/index.html)
@ -268,16 +270,21 @@ formatting.
* [tsserver](https://github.com/Microsoft/TypeScript/wiki/Standalone-Server-%28tsserver%29)
* [xo](https://github.com/sindresorhus/xo)
* JSON
* [eslint](http://eslint.org/)
* [fixjson](https://github.com/rhysd/fixjson)
* [jq](https://stedolan.github.io/jq/)
* [jsonlint](https://github.com/zaach/jsonlint)
* [prettier](https://github.com/prettier/prettier)
* [spectral](https://github.com/stoplightio/spectral)
* JSON5
* [eslint](http://eslint.org/)
* JSONC
* [eslint](http://eslint.org/)
* Julia
* [languageserver](https://github.com/JuliaEditorSupport/LanguageServer.jl)
* Kotlin
* [kotlinc](https://kotlinlang.org) :floppy_disk:
* [ktlint](https://ktlint.github.io) :floppy_disk:
* [ktlint](https://ktlint.github.io)
* [languageserver](https://github.com/fwcd/KotlinLanguageServer) see `:help ale-integration-kotlin` for configuration instructions
* LaTeX
* [alex](https://github.com/wooorm/alex) :floppy_disk:
@ -393,13 +400,13 @@ formatting.
* Pony
* [ponyc](https://github.com/ponylang/ponyc)
* PowerShell
* [powershell](https://github.com/PowerShell/PowerShell) :floppy_disk:
* [psscriptanalyzer](https://github.com/PowerShell/PSScriptAnalyzer) :floppy_disk:
* [powershell](https://github.com/PowerShell/PowerShell)
* [psscriptanalyzer](https://github.com/PowerShell/PSScriptAnalyzer)
* Prolog
* [swipl](https://github.com/SWI-Prolog/swipl-devel)
* proto
* [protoc-gen-lint](https://github.com/ckaznocha/protoc-gen-lint)
* [protolint](https://github.com/yoheimuta/protolint)
* [protoc-gen-lint](https://github.com/ckaznocha/protoc-gen-lint) :floppy_disk:
* [protolint](https://github.com/yoheimuta/protolint) :floppy_disk:
* Pug
* [pug-lint](https://github.com/pugjs/pug-lint)
* Puppet
@ -408,9 +415,10 @@ formatting.
* [puppet-lint](https://puppet-lint.com)
* PureScript
* [purescript-language-server](https://github.com/nwolverson/purescript-language-server)
* [purs-tidy](https://github.com/natefaubion/purescript-tidy)
* [purty](https://gitlab.com/joneshf/purty)
* Python
* [autoflake](https://github.com/myint/autoflake)
* [autoflake](https://github.com/myint/autoflake) :floppy_disk:
* [autoimport](https://lyz-code.github.io/autoimport/)
* [autopep8](https://github.com/hhatto/autopep8)
* [bandit](https://github.com/PyCQA/bandit) :warning:
@ -418,7 +426,7 @@ formatting.
* [flake8](http://flake8.pycqa.org/en/latest/)
* [isort](https://github.com/timothycrosley/isort)
* [mypy](http://mypy-lang.org/)
* [prospector](https://github.com/PyCQA/prospector) :warning:
* [prospector](https://github.com/PyCQA/prospector) :warning: :floppy_disk:
* [pycodestyle](https://github.com/PyCQA/pycodestyle) :warning:
* [pydocstyle](https://www.pydocstyle.org/) :warning:
* [pyflakes](https://github.com/PyCQA/pyflakes)
@ -455,11 +463,13 @@ formatting.
* [textlint](https://textlint.github.io/)
* [vale](https://github.com/ValeLint/vale)
* [write-good](https://github.com/btford/write-good)
* Robot
* [rflint](https://github.com/boakley/robotframework-lint)
* RPM spec
* [rpmlint](https://github.com/rpm-software-management/rpmlint) :warning: (see `:help ale-integration-spec`)
* Ruby
* [brakeman](http://brakemanscanner.org/) :floppy_disk:
* [debride](https://github.com/seattlerb/debride) :floppy_disk:
* [debride](https://github.com/seattlerb/debride)
* [prettier](https://github.com/prettier/plugin-ruby)
* [rails_best_practices](https://github.com/flyerhzm/rails_best_practices) :floppy_disk:
* [reek](https://github.com/troessner/reek)
@ -553,7 +563,7 @@ formatting.
* [tsserver](https://github.com/Microsoft/TypeScript/wiki/Standalone-Server-%28tsserver%29)
* typecheck
* V
* [v](https://github.com/vlang/v/)
* [v](https://github.com/vlang/v/) :floppy_disk:
* [vfmt](https://github.com/vlang/v/)
* VALA
* [uncrustify](https://github.com/uncrustify/uncrustify)
@ -564,7 +574,7 @@ formatting.
* [verilator](http://www.veripool.org/projects/verilator/wiki/Intro)
* [vlog](https://www.mentor.com/products/fv/questa/)
* [xvlog](https://www.xilinx.com/products/design-tools/vivado.html)
* [yosys](http://www.clifford.at/yosys/)
* [yosys](http://www.clifford.at/yosys/) :floppy_disk:
* VHDL
* [ghdl](https://github.com/ghdl/ghdl)
* [vcom](https://www.mentor.com/products/fv/questa/)

View File

@ -62,6 +62,11 @@ if has('nvim-0.5') && luaeval("pcall(require, 'gitsigns')")
endif
" }}}
" Tree-sitter: {{{
" The nvim-treesitter library defines many global highlight groups that are
" linked to the regular vim syntax highlight groups. We only need to redefine
" those highlight groups when the defaults do not match the dracula
" specification.
" https://github.com/nvim-treesitter/nvim-treesitter/blob/master/plugin/nvim-treesitter.vim
if exists('g:loaded_nvim_treesitter')
" # Misc
hi! link TSPunctSpecial Special
@ -89,6 +94,9 @@ if exists('g:loaded_nvim_treesitter')
hi! link TSTitle DraculaYellow
hi! link TSLiteral DraculaYellow
hi! link TSURI DraculaYellow
" HTML and JSX tag attributes. By default, this group is linked to TSProperty,
" which in turn links to Identifer (white).
hi! link TSTagAttribute DraculaGreenItalic
endif
" }}}

View File

@ -232,7 +232,7 @@ hi! link Question DraculaFgBold
hi! link Search DraculaSearch
call s:h('SignColumn', s:comment)
hi! link TabLine DraculaBoundary
hi! link TabLineFill DraculaBgDarker
hi! link TabLineFill DraculaBgDark
hi! link TabLineSel Normal
hi! link Title DraculaGreenBold
hi! link VertSplit DraculaBoundary

Binary file not shown.

Before

Width:  |  Height:  |  Size: 526 KiB

After

Width:  |  Height:  |  Size: 328 KiB

View File

@ -5,6 +5,8 @@
- **.PATCH**: Pull Request Title (PR Author) [PR Number](Link to PR)
-->
#### 6.10
- **.12**: Answer the question about accessing files over scp or ftp. (PhilRunninger) [#1259](https://github.com/preservim/nerdtree/pull/1259)
- **.11**: Trim filenames created via the fs_menu (elanorigby) [#1243](https://github.com/preservim/nerdtree/pull/1243)
- **.10**: Improve F.A.Q. Answers and Issue Templates (PhilRunninger) [#1249](https://github.com/preservim/nerdtree/pull/1249)
- **.9**: `go` on a bookmark directory will NERDTreeFind it. (PhilRunninger) [#1236](https://github.com/preservim/nerdtree/pull/1236)
- **.8**: Put `Callback` function variables in local scope. (PhilRunninger) [#1230](https://github.com/preservim/nerdtree/pull/1230)

View File

@ -187,3 +187,35 @@ let g:NERDTreeDirArrowExpandable = '▸'
let g:NERDTreeDirArrowCollapsible = '▾'
```
The preceding values are the non-Windows default arrow symbols. Setting these variables to empty strings will remove the arrows completely and shift the entire tree two character positions to the left. See `:h NERDTreeDirArrowExpandable` for more details.
### Can NERDTree access remote files via scp or ftp?
Short answer: No, and there are no plans to add that functionality. However, Vim ships with a plugin that does just that. It's called netrw, and by adding the following lines to your `.vimrc`, you can use it to open files over the `scp:`, `ftp:`, or other protocols, while still using NERDTree for all local files. The function seamlessly makes the decision to open NERDTree or netrw, and other supported protocols can be added to the regular expression.
```vim
" Function to open the file or NERDTree or netrw.
" Returns: 1 if either file explorer was opened; otherwise, 0.
function! s:OpenFileOrExplorer(...)
if a:0 == 0 || a:1 == ''
NERDTree
elseif filereadable(a:1)
execute 'edit '.a:1
return 0
elseif a:1 =~? '^\(scp\|ftp\)://' " Add other protocols as needed.
execute 'Vexplore '.a:1
elseif isdirectory(a:1)
execute 'NERDTree '.a:1
endif
return 1
endfunction
" Auto commands to handle OS commandline arguments
autocmd StdinReadPre * let s:std_in=1
autocmd VimEnter * if argc()==1 && !exists('s:std_in') | if <SID>OpenFileOrExplorer(argv()[0]) | wincmd p | enew | wincmd p | endif | endif
" Command to call the OpenFileOrExplorer function.
command! -n=? -complete=file -bar Edit :call <SID>OpenFileOrExplorer('<args>')
" Command-mode abbreviation to replace the :edit Vim command.
cnoreabbrev e Edit
```

View File

@ -169,7 +169,7 @@ endfunction
function! NERDTreeAddNode()
let curDirNode = g:NERDTreeDirNode.GetSelected()
let prompt = s:inputPrompt('add')
let newNodeName = input(prompt, curDirNode.path.str() . nerdtree#slash(), 'file')
let newNodeName = trim(input(prompt, curDirNode.path.str() . nerdtree#slash(), 'file'))
if newNodeName ==# ''
call nerdtree#echo('Node Creation Aborted.')
@ -206,7 +206,7 @@ function! NERDTreeMoveNode()
let newNodePath = input(prompt, curNode.path.str(), 'file')
while filereadable(newNodePath)
call nerdtree#echoWarning('This destination already exists. Try again.')
let newNodePath = input(prompt, curNode.path.str(), 'file')
let newNodePath = trim(input(prompt, curNode.path.str(), 'file'))
endwhile
@ -337,7 +337,7 @@ endfunction
function! NERDTreeCopyNode()
let currentNode = g:NERDTreeFileNode.GetSelected()
let prompt = s:inputPrompt('copy')
let newNodePath = input(prompt, currentNode.path.str(), 'file')
let newNodePath = trim(input(prompt, currentNode.path.str(), 'file'))
if newNodePath !=# ''
"strip trailing slash

View File

@ -0,0 +1,9 @@
on: push
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Run tests
run: cd test && ./run-tests
shell: bash

View File

@ -1,7 +0,0 @@
---
sudo: required
services:
- docker
language: generic
script: |
cd test && ./run-tests

View File

@ -157,14 +157,7 @@ function! s:RunRustfmt(command, tmpname, from_writepre)
endif
call s:DeleteLines(len(l:content), line('$'))
if has('nvim') && exists('*nvim_buf_set_lines')
" setline() gets called for every item on the array,
" this results on the neovim buffer callbacks being called n times,
" using nvim_buf_set_lines() makes the change in one call.
call nvim_buf_set_lines(0, 0, -1, v:true, l:content)
else
call setline(1, l:content)
endif
call setline(1, l:content)
" only clear location list if it was previously filled to prevent
" clobbering other additions

View File

@ -67,9 +67,9 @@ def image_exists():
def tests_on_docker():
res = docker_run("bash -lc 'python /home/vimtest/run-tests inside-docker'", ok_fail=True)
if res == 0:
print "Tests OK"
print("Tests OK")
else:
print "Tests Failed"
print("Tests Failed")
sys.exit(1)
def inside_docker():
@ -92,7 +92,7 @@ def main():
return
if not image_exists():
print "Need to take image from remote"
print("Need to take image from remote")
system("docker pull %s" % (IMAGE, ))
if "-i" in sys.argv[1:]:

File diff suppressed because it is too large Load Diff

View File

@ -15,9 +15,12 @@ COMMANDS *fugitive-commands*
These commands are local to the buffers in which they work (generally, buffers
that are part of Git repositories).
*:Git* *fugitive-:G*
*fugitive-:G*
:G [args] Same as :Git, but two characters shorter.
*:Git*
:Git {args} Run an arbitrary git command and display any output.
:G {args} On UNIX this uses a pty and on other platforms it uses
On UNIX this uses a pty and on other platforms it uses
a pipe, which will cause some behavior differences
such as the absence of progress bars. Any file the
command edits (for example, a commit message) will be
@ -25,17 +28,28 @@ that are part of Git repositories).
resume running the command. A few Git subcommands
have different behavior; these are documented below.
*:Git!*
:Git! {args} Run an arbitrary git command in the background and
stream the output to the preview window. Requires a
Vim with |setbufline()|. Press CTRL-D during an
interactive :Git invocation to switch to this mode
retroactively.
*:Git_--paginate* *:Git_-p*
:Git --paginate {args} Run an arbitrary git command, capture output to a temp
:Git -p {args} file, and |:split| that temp file. Use :0Git to
:G --paginate {args} |:edit| the temp file instead. A temp file is always
:G -p {args} used for commands like diff and log that typically
user a pager, and for any command that has the
pager.<cmd> Git configuration option set.
:Git -p {args} file, and |:split| that temp file. Pass ++curwin as
the first argument to |:edit| the temp file instead.
A temp file is always used for commands like diff and
log that typically uses a pager, and for any command
that has the pager.<cmd> Git configuration option set.
:{range}Git! --paginate {args}
:{range}Git! -p {args} Run an arbitrary git command, and insert the output
after {range} in the current buffer.
*fugitive-summary*
:Git With no arguments, bring up a summary window vaguely
:G akin to git-status. Press g? or see |fugitive-maps|
akin to git-status. Press g? or see |fugitive-maps|
for usage.
*:Git_blame*
@ -84,13 +98,17 @@ that are part of Git repositories).
*:Git_mergetool*
:Git mergetool [args] Like |:Git_difftool|, but target merge conflicts.
*:Ggrep* *:Gcgrep* *:Git_grep*
:Ggrep[!] [args] |:grep|[!] with git-grep as 'grepprg'.
:Git[!] grep [args]
*:Ggrep* *:Git_grep*
:Ggrep[!] [args] An approximation of |:grep|[!] with git-grep as
:Git[!] grep -O [args] 'grepprg'.
:Ggrep[!] --quiet [args]
:Ggrep[!] -q [args] Like |:Ggrep|, but instead of displaying output, open
the quickfix list.
*:Glgrep*
:Glgrep[!] [args] |:lgrep|[!] with git-grep as 'grepprg'.
:0Git[!] grep [args]
:Glgrep[!] [args] :Ggrep but for |:lgrep|.
:0Git[!] grep -O [args]
*:Gclog*
:Gclog[!] [args] Use git-log [args] to load the commit history into the
@ -170,10 +188,10 @@ that are part of Git repositories).
:Gdiffsplit [object] Perform a |vimdiff| against the given file, or if a
commit is given, the current file in that commit.
With no argument, the version in the index or work
tree is used. The newer of the two files is placed to
the right or bottom, depending on 'diffopt' and the
width of the window relative to 'textwidth'. Use
Vim's |do| and |dp| to stage and unstage changes.
tree is used, and the work tree version is always
placed to the right or bottom, depending on available
width. Use Vim's |do| and |dp| to stage and unstage
changes.
*:Gdiffsplit!*
:Gdiffsplit! Diff against any and all direct ancestors, retaining
@ -190,7 +208,10 @@ that are part of Git repositories).
:Gvdiffsplit [object] Like |:Gdiffsplit|, but always split vertically.
*:Ghdiffsplit*
:Ghdiffsplit [object] Like |:Gdiffsplit|, but always split horizontally.
:Gdiffsplit ++novertical [object]
:Ghdiffsplit [object] Like |:Gdiffsplit|, but with "vertical" removed from
'diffopt'. The split will still be vertical if
combined with |:vertical|.
*:GMove*
:GMove {destination} Wrapper around git-mv that renames the buffer
@ -606,11 +627,8 @@ AUTOCOMMANDS *fugitive-autocommands*
A handful of |User| |autocommands| are provided to allow extending and
overriding Fugitive behaviors. Example usage:
>
autocmd User FugitiveBlob call s:BlobOverrides()
autocmd User FugitiveBlob,FugitiveStageBlob call s:BlobOverrides()
<
*User_FugitiveIndex*
FugitiveIndex After loading the |fugitive-summary| buffer.
*User_FugitiveTag*
FugitiveTag After loading a tag object.
@ -621,10 +639,26 @@ FugitiveCommit After loading a commit object.
FugitiveTree After loading a tree (directory) object.
*User_FugitiveBlob*
FugitiveBlob After loading a blob (file) object. This includes
both committed blobs which are read only, and staged
blobs which can be edited and written. Check
&modifiable to distinguish between the two.
FugitiveBlob After loading a committed blob (file) object.
*User_FugitiveObject*
FugitiveObject After loading any of the 4 above buffer types.
*User_FugitiveStageBlob*
FugitiveStageBlob After loading a staged blob (file) object. These
buffers are 'modifiable' and oftentimes don't want the
same behavior as the other buffer types.
*User_FugitiveIndex*
FugitiveIndex After loading the |fugitive-summary| buffer.
*User_FugitivePager*
FugitivePager After loading a temp file created by a command like
:Git --paginate or :Git blame.
*User_FugitiveEditor*
FugitiveEditor After a :Git command (e.g., :Git commit) edits a file
(e.g., the commit message).
*User_FugitiveChanged*
FugitiveChanged After any event which can potentially change the
@ -661,7 +695,6 @@ version.
*:Gfetch* Superseded by |:Git| fetch.
*:Glog* Superseded by |:Gclog|.
*:Gstatus* Superseded by |:Git| (with no arguments).
*:Git!* Superseded by |:Git_--paginate|.
*:Gsplit!* Superseded by |:Git_--paginate|.
*:Gvsplit!* Superseded by :vert Git --paginate.
*:Gtabsplit!* Superseded by :tab Git --paginate.

View File

@ -1,6 +1,6 @@
" fugitive.vim - A Git wrapper so awesome, it should be illegal
" Maintainer: Tim Pope <http://tpo.pe/>
" Version: 3.3
" Version: 3.4
" GetLatestVimScripts: 2975 1 :AutoInstall: fugitive.vim
if exists('g:loaded_fugitive')
@ -16,9 +16,9 @@ let s:bad_git_dir = '/$\|^fugitive:'
" Fugitive is active in the current buffer. Do not rely on this for direct
" filesystem access; use FugitiveFind('.git/whatever') instead.
function! FugitiveGitDir(...) abort
if v:version < 704
if v:version < 703
return ''
elseif !a:0 || type(a:1) == type(0) && a:1 < 0
elseif !a:0 || type(a:1) == type(0) && a:1 < 0 || a:1 is# get(v:, 'true', -1)
if exists('g:fugitive_event')
return g:fugitive_event
endif
@ -30,7 +30,7 @@ function! FugitiveGitDir(...) abort
return b:git_dir
endif
return dir =~# s:bad_git_dir ? '' : dir
elseif type(a:1) == type(0)
elseif type(a:1) == type(0) && a:1 isnot# 0
if a:1 == bufnr('') && (!exists('b:git_dir') || b:git_dir =~# s:bad_git_dir) && empty(&buftype)
let b:git_dir = FugitiveExtractGitDir(expand('%:p'))
endif
@ -55,7 +55,11 @@ endfunction
" exists, call FooReal("foo://bar").
function! FugitiveReal(...) abort
let file = a:0 ? a:1 : @%
if file =~# '^\a\a\+:' || a:0 > 1
if type(file) ==# type({})
let dir = FugitiveGitDir(file)
let tree = s:Tree(dir)
return FugitiveVimPath(empty(tree) ? dir : tree)
elseif file =~# '^\a\a\+:' || a:0 > 1
return call('fugitive#Real', [file] + a:000[1:-1])
elseif file =~# '^/\|^\a:\|^$'
return file
@ -72,14 +76,10 @@ endfunction
" An optional second argument provides the Git dir, or the buffer number of a
" buffer with a Git dir. The default is the current buffer.
function! FugitiveFind(...) abort
return fugitive#Find(a:0 ? a:1 : bufnr(''), FugitiveGitDir(a:0 > 1 ? a:2 : -1))
endfunction
function! FugitivePath(...) abort
if a:0 > 1
return fugitive#Path(a:1, a:2, FugitiveGitDir(a:0 > 2 ? a:3 : -1))
if a:0 && (type(a:1) ==# type({}) || type(a:1) ==# type(0))
return call('fugitive#Find', a:000[1:-1] + [FugitiveGitDir(a:1)])
else
return FugitiveReal(a:0 ? a:1 : @%)
return fugitive#Find(a:0 ? a:1 : bufnr(''), FugitiveGitDir(a:0 > 1 ? a:2 : -1))
endif
endfunction
@ -99,6 +99,14 @@ function! FugitiveParse(...) abort
throw v:errmsg
endfunction
" FugitiveGitVersion() queries the version of Git in use. Pass up to 3
" arguments to return a Boolean of whether a certain minimum version is
" available (FugitiveGitVersion(2,3,4) checks for 2.3.4 or higher) or no
" arguments to get a raw string.
function! FugitiveGitVersion(...) abort
return call('fugitive#GitVersion', a:000)
endfunction
" FugitiveResult() returns an object encapsulating the result of the most
" recent :Git command. Will be empty if no result is available. During a
" User FugitiveChanged event, this is guaranteed to correspond to the :Git
@ -108,7 +116,7 @@ endfunction
"
" * "args": List of command arguments, starting with the subcommand. Will be
" empty for usages like :Git --help.
" * "dir": Git dir of the relevant repository.
" * "git_dir": Git dir of the relevant repository.
" * "exit_status": The integer exit code of the process.
" * "flags": Flags passed directly to Git, like -c and --help.
" * "file": Path to file containing command output. Not guaranteed to exist,
@ -117,16 +125,44 @@ function! FugitiveResult(...) abort
return call('fugitive#Result', a:000)
endfunction
" FugitivePrepare() constructs a Git command string which can be executed with
" functions like system() and commands like :!. Integer arguments will be
" treated as buffer numbers, and the appropriate relative path inserted in
" their place.
" FugitiveExecute() runs Git with a list of arguments and returns a dictionary
" with the following keys:
"
" If the first argument is a string that looks like a path or an empty string,
" it will be used as the Git dir. If it's a buffer number, the Git dir for
" that buffer will be used. The default is the current buffer.
" * "exit_status": The integer exit code of the process.
" * "stdout": The stdout produced by the process, as a list of lines.
" * "stderr": The stdout produced by the process, as a list of lines.
"
" An optional second argument provides the Git dir, or the buffer number of a
" buffer with a Git dir. The default is the current buffer.
"
" An optional final argument is a callback Funcref, for asynchronous
" execution.
function! FugitiveExecute(args, ...) abort
return call('fugitive#Execute', [a:args] + a:000)
endfunction
" FugitiveShellCommand() turns an array of arugments into a Git command string
" which can be executed with functions like system() and commands like :!.
" Integer arguments will be treated as buffer numbers, and the appropriate
" relative path inserted in their place.
"
" An optional second argument provides the Git dir, or the buffer number of a
" buffer with a Git dir. The default is the current buffer.
function! FugitiveShellCommand(...) abort
return call('fugitive#ShellCommand', a:000)
endfunction
" FugitivePrepare() is a deprecated alias for FugitiveShellCommand(). If you
" are using this in conjunction with system(), consider using
" FugitiveExecute() instead.
function! FugitivePrepare(...) abort
return call('fugitive#Prepare', a:000)
if !exists('s:did_prepare_warning')
let s:did_prepare_warning = 1
echohl WarningMsg
unsilent echomsg 'FugitivePrepare() has been superseded by FugitiveShellCommand()'
echohl NONE
endif
return call('fugitive#ShellCommand', a:000)
endfunction
" FugitiveConfig() get returns an opaque structure that can be passed to other
@ -171,7 +207,19 @@ endfunction
" An optional second argument provides the Git dir, or the buffer number of a
" buffer with a Git dir. The default is the current buffer.
function! FugitiveRemoteUrl(...) abort
return fugitive#RemoteUrl(a:0 ? a:1 : '', a:0 > 1 ? a:2 : -1, a:0 > 2 ? a:3 : 0)
return call('fugitive#RemoteUrl', a:000)
endfunction
" FugitiveDidChange() triggers a FugitiveChanged event and reloads the summary
" buffer for the current or given buffer number's repository. You can also
" give the result of a FugitiveExecute() and that context will be made
" available inside the FugitiveChanged() event.
"
" Passing the special argument 0 (the number zero) softly expires summary
" buffers for all repositories. This can be used after a call to system()
" with unclear implications.
function! FugitiveDidChange(...) abort
return call('fugitive#DidChange', a:000)
endfunction
" FugitiveHead() retrieves the name of the current branch. If the current HEAD
@ -182,15 +230,36 @@ endfunction
" An optional second argument provides the Git dir, or the buffer number of a
" buffer with a Git dir. The default is the current buffer.
function! FugitiveHead(...) abort
let dir = FugitiveGitDir(a:0 > 1 ? a:2 : -1)
if a:0 && (type(a:1) ==# type({}) || type(a:1) ==# type('') && a:1 !~# '^\d\+$')
let dir = FugitiveGitDir(a:1)
let arg = get(a:, 2, 0)
elseif a:0 > 1
let dir = FugitiveGitDir(a:2)
let arg = a:1
else
let dir = FugitiveGitDir()
let arg = get(a:, 1, 0)
endif
if empty(dir)
return ''
endif
return fugitive#Head(a:0 ? a:1 : 0, dir)
return fugitive#Head(arg, dir)
endfunction
function! FugitivePath(...) abort
if a:0 > 2 && type(a:1) ==# type({})
return fugitive#Path(a:2, a:3, FugitiveGitDir(a:1))
elseif a:0 && type(a:1) ==# type({})
return FugitiveReal(a:0 > 1 ? a:2 : @%)
elseif a:0 > 1
return fugitive#Path(a:1, a:2, FugitiveGitDir(a:0 > 2 ? a:3 : -1))
else
return FugitiveReal(a:0 ? a:1 : @%)
endif
endfunction
function! FugitiveStatusline(...) abort
if empty(get(b:, 'git_dir', ''))
if empty(FugitiveGitDir(bufnr('')))
return ''
endif
return fugitive#Statusline()
@ -213,9 +282,12 @@ function! FugitiveWorkTree(...) abort
endif
endfunction
function! FugitiveIsGitDir(path) abort
let path = substitute(a:path, '[\/]$', '', '') . '/'
return len(a:path) && getfsize(path.'HEAD') > 10 && (
function! FugitiveIsGitDir(...) abort
if !a:0 || type(a:1) !=# type('')
return !empty(call('FugitiveGitDir', a:000))
endif
let path = substitute(a:1, '[\/]$', '', '') . '/'
return len(path) && getfsize(path.'HEAD') > 10 && (
\ isdirectory(path.'objects') && isdirectory(path.'refs') ||
\ getftype(path.'commondir') ==# 'file')
endfunction
@ -279,7 +351,13 @@ function! s:CeilingDirectories() abort
endfunction
function! FugitiveExtractGitDir(path) abort
let path = s:Slash(a:path)
if type(a:path) ==# type({})
return get(a:path, 'git_dir', '')
elseif type(a:path) == type(0)
let path = s:Slash(a:path >= 0 ? bufname(a:path) : bufname(''))
else
let path = s:Slash(a:path)
endif
if path =~# '^fugitive:'
return matchstr(path, '\C^fugitive:\%(//\)\=\zs.\{-\}\ze\%(//\|::\|$\)')
elseif empty(path)
@ -335,15 +413,18 @@ function! FugitiveExtractGitDir(path) abort
return ''
endfunction
function! FugitiveDetect(path) abort
if v:version < 704
function! FugitiveDetect(...) abort
if v:version < 703
return ''
endif
if exists('b:git_dir') && b:git_dir =~# '^$\|' . s:bad_git_dir
unlet b:git_dir
endif
if a:0 > 1 && a:2 && !exists('#User#Fugitive')
return ''
endif
if !exists('b:git_dir')
let b:git_dir = FugitiveExtractGitDir(a:path)
let b:git_dir = FugitiveExtractGitDir(a:0 ? a:1 : bufnr(''))
endif
if empty(b:git_dir) || !exists('#User#Fugitive')
return ''
@ -397,14 +478,14 @@ function! s:ProjectionistDetect() abort
if exists('+shellslash') && !&shellslash
let base = tr(base, '/', '\')
endif
let file = FugitiveCommonDir(dir) . '/info/projections.json'
let file = FugitiveFind('.git/info/projections.json', dir)
if filereadable(file)
call projectionist#append(base, file)
endif
endif
endfunction
let s:addr_other = has('patch-8.1.560') ? '-addr=other' : ''
let s:addr_other = has('patch-8.1.560') || has('nvim-0.5.0') ? '-addr=other' : ''
let s:addr_tabs = has('patch-7.4.542') ? '-addr=tabs' : ''
let s:addr_wins = has('patch-7.4.542') ? '-addr=windows' : ''
@ -413,16 +494,22 @@ if exists(':G') != 2
endif
command! -bang -nargs=? -range=-1 -complete=customlist,fugitive#Complete Git exe fugitive#Command(<line1>, <count>, +"<range>", <bang>0, "<mods>", <q-args>)
if exists(':Gstatus') != 2 && get(g:, 'fugitive_legacy_commands', 1)
if exists(':Gstatus') != 2 && get(g:, 'fugitive_legacy_commands', 0)
exe 'command! -bang -bar -range=-1' s:addr_other 'Gstatus exe fugitive#Command(<line1>, <count>, +"<range>", <bang>0, "<mods>", <q-args>)'
\ '|echohl WarningMSG|echomsg ":Gstatus is deprecated in favor of :Git (with no arguments)"|echohl NONE'
elseif exists(':Gstatus') != 2 && !exists('g:fugitive_legacy_commands')
exe 'command! -bang -bar -range=-1' s:addr_other 'Gstatus'
\ ' echoerr ":Gstatus has been removed in favor of :Git (with no arguments)"'
endif
for s:cmd in ['Commit', 'Revert', 'Merge', 'Rebase', 'Pull', 'Push', 'Fetch', 'Blame']
if exists(':G' . tolower(s:cmd)) != 2 && get(g:, 'fugitive_legacy_commands', 1)
if exists(':G' . tolower(s:cmd)) != 2 && get(g:, 'fugitive_legacy_commands', 0)
exe 'command! -bang -nargs=? -range=-1 -complete=customlist,fugitive#' . s:cmd . 'Complete G' . tolower(s:cmd)
\ 'echohl WarningMSG|echomsg ":G' . tolower(s:cmd) . ' is deprecated in favor of :Git ' . tolower(s:cmd) . '"|echohl NONE|'
\ 'exe fugitive#Command(<line1>, <count>, +"<range>", <bang>0, "<mods>", "' . tolower(s:cmd) . ' " . <q-args>)'
elseif exists(':G' . tolower(s:cmd)) != 2 && !exists('g:fugitive_legacy_commands')
exe 'command! -bang -nargs=? -range=-1 -complete=customlist,fugitive#' . s:cmd . 'Complete G' . tolower(s:cmd)
\ 'echoerr ":G' . tolower(s:cmd) . ' has been removed in favor of :Git ' . tolower(s:cmd) . '"'
endif
endfor
unlet s:cmd
@ -431,66 +518,68 @@ exe "command! -bar -bang -nargs=? -complete=customlist,fugitive#CdComplete Gcd
exe "command! -bar -bang -nargs=? -complete=customlist,fugitive#CdComplete Glcd exe fugitive#Cd(<q-args>, 1)"
exe 'command! -bang -nargs=? -range=-1' s:addr_wins '-complete=customlist,fugitive#GrepComplete Ggrep exe fugitive#GrepCommand(<line1>, <count>, +"<range>", <bang>0, "<mods>", <q-args>)'
exe 'command! -bang -nargs=? -range=-1' s:addr_wins '-complete=customlist,fugitive#GrepComplete Gcgrep exe fugitive#GrepCommand(<line1>, <count>, +"<range>", <bang>0, "<mods>", <q-args>)'
exe 'command! -bang -nargs=? -range=-1' s:addr_wins '-complete=customlist,fugitive#GrepComplete Glgrep exe fugitive#GrepCommand(0, <count> > 0 ? <count> : 0, +"<range>", <bang>0, "<mods>", <q-args>)'
if exists(':Glog') != 2 && get(g:, 'fugitive_legacy_commands', 1)
if exists(':Glog') != 2 && get(g:, 'fugitive_legacy_commands', 0)
exe 'command! -bang -nargs=? -range=-1 -complete=customlist,fugitive#LogComplete Glog :exe fugitive#LogCommand(<line1>,<count>,+"<range>",<bang>0,"<mods>",<q-args>, "")'
\ '|echohl WarningMSG|echomsg ":Glog is deprecated in favor of :Gclog"|echohl NONE'
elseif exists(':Glog') != 2 && !exists('g:fugitive_legacy_commands')
exe 'command! -bang -nargs=? -range=-1 -complete=customlist,fugitive#LogComplete Glog'
\ ' echoerr ":Glog has been removed in favor of :Gclog"'
endif
exe 'command! -bang -nargs=? -range=-1 -complete=customlist,fugitive#LogComplete Gclog :exe fugitive#LogCommand(<line1>,<count>,+"<range>",<bang>0,"<mods>",<q-args>, "c")'
exe 'command! -bang -nargs=? -range=-1 -complete=customlist,fugitive#LogComplete GcLog :exe fugitive#LogCommand(<line1>,<count>,+"<range>",<bang>0,"<mods>",<q-args>, "c")'
exe 'command! -bang -nargs=? -range=-1 -complete=customlist,fugitive#LogComplete Gllog :exe fugitive#LogCommand(<line1>,<count>,+"<range>",<bang>0,"<mods>",<q-args>, "l")'
exe 'command! -bang -nargs=? -range=-1 -complete=customlist,fugitive#LogComplete GlLog :exe fugitive#LogCommand(<line1>,<count>,+"<range>",<bang>0,"<mods>",<q-args>, "l")'
exe 'command! -bar -bang -nargs=* -complete=customlist,fugitive#EditComplete Ge exe fugitive#Open("edit<bang>", 0, "<mods>", <q-args>, [<f-args>])'
exe 'command! -bar -bang -nargs=* -complete=customlist,fugitive#EditComplete Gedit exe fugitive#Open("edit<bang>", 0, "<mods>", <q-args>, [<f-args>])'
exe 'command! -bar -bang -nargs=* -complete=customlist,fugitive#ReadComplete Gpedit exe fugitive#Open("pedit", <bang>0, "<mods>", <q-args>, [<f-args>])'
exe 'command! -bar -bang -nargs=* -range=-1' s:addr_other '-complete=customlist,fugitive#ReadComplete Gsplit exe fugitive#Open((<count> > 0 ? <count> : "").(<count> ? "split" : "edit"), <bang>0, "<mods>", <q-args>, [<f-args>])'
exe 'command! -bar -bang -nargs=* -range=-1' s:addr_other '-complete=customlist,fugitive#ReadComplete Gvsplit exe fugitive#Open((<count> > 0 ? <count> : "").(<count> ? "vsplit" : "edit!"), <bang>0, "<mods>", <q-args>, [<f-args>])'
exe 'command! -bar -bang -nargs=* -range=-1' s:addr_tabs '-complete=customlist,fugitive#ReadComplete Gtabedit exe fugitive#Open((<count> >= 0 ? <count> : "")."tabedit", <bang>0, "<mods>", <q-args>, [<f-args>])'
exe 'command! -bar -bang -nargs=* -complete=customlist,fugitive#EditComplete Ge exe fugitive#Open("edit<bang>", 0, "<mods>", <q-args>)'
exe 'command! -bar -bang -nargs=* -complete=customlist,fugitive#EditComplete Gedit exe fugitive#Open("edit<bang>", 0, "<mods>", <q-args>)'
exe 'command! -bar -bang -nargs=* -complete=customlist,fugitive#ReadComplete Gpedit exe fugitive#Open("pedit", <bang>0, "<mods>", <q-args>)'
exe 'command! -bar -bang -nargs=* -range=-1' s:addr_other '-complete=customlist,fugitive#ReadComplete Gsplit exe fugitive#Open((<count> > 0 ? <count> : "").(<count> ? "split" : "edit"), <bang>0, "<mods>", <q-args>)'
exe 'command! -bar -bang -nargs=* -range=-1' s:addr_other '-complete=customlist,fugitive#ReadComplete Gvsplit exe fugitive#Open((<count> > 0 ? <count> : "").(<count> ? "vsplit" : "edit!"), <bang>0, "<mods>", <q-args>)'
exe 'command! -bar -bang -nargs=* -range=-1' s:addr_tabs '-complete=customlist,fugitive#ReadComplete Gtabedit exe fugitive#Open((<count> >= 0 ? <count> : "")."tabedit", <bang>0, "<mods>", <q-args>)'
if exists(':Gr') != 2
exe 'command! -bar -bang -nargs=* -range=-1 -complete=customlist,fugitive#ReadComplete Gr exe fugitive#ReadCommand(<line1>, <count>, +"<range>", <bang>0, "<mods>", <q-args>, [<f-args>])'
exe 'command! -bar -bang -nargs=* -range=-1 -complete=customlist,fugitive#ReadComplete Gr exe fugitive#ReadCommand(<line1>, <count>, +"<range>", <bang>0, "<mods>", <q-args>)'
endif
exe 'command! -bar -bang -nargs=* -range=-1 -complete=customlist,fugitive#ReadComplete Gread exe fugitive#ReadCommand(<line1>, <count>, +"<range>", <bang>0, "<mods>", <q-args>, [<f-args>])'
exe 'command! -bar -bang -nargs=* -range=-1 -complete=customlist,fugitive#ReadComplete Gread exe fugitive#ReadCommand(<line1>, <count>, +"<range>", <bang>0, "<mods>", <q-args>)'
exe 'command! -bar -bang -nargs=* -complete=customlist,fugitive#EditComplete Gdiffsplit exe fugitive#Diffsplit(1, <bang>0, "<mods>", <q-args>, [<f-args>])'
exe 'command! -bar -bang -nargs=* -complete=customlist,fugitive#EditComplete Ghdiffsplit exe fugitive#Diffsplit(0, <bang>0, "<mods>", <q-args>, [<f-args>])'
exe 'command! -bar -bang -nargs=* -complete=customlist,fugitive#EditComplete Gvdiffsplit exe fugitive#Diffsplit(0, <bang>0, "vertical <mods>", <q-args>, [<f-args>])'
exe 'command! -bar -bang -nargs=* -complete=customlist,fugitive#EditComplete Gdiffsplit exe fugitive#Diffsplit(1, <bang>0, "<mods>", <q-args>)'
exe 'command! -bar -bang -nargs=* -complete=customlist,fugitive#EditComplete Ghdiffsplit exe fugitive#Diffsplit(0, <bang>0, "<mods>", <q-args>)'
exe 'command! -bar -bang -nargs=* -complete=customlist,fugitive#EditComplete Gvdiffsplit exe fugitive#Diffsplit(0, <bang>0, "vertical <mods>", <q-args>)'
exe 'command! -bar -bang -nargs=* -complete=customlist,fugitive#EditComplete Gw exe fugitive#WriteCommand(<line1>, <count>, +"<range>", <bang>0, "<mods>", <q-args>, [<f-args>])'
exe 'command! -bar -bang -nargs=* -complete=customlist,fugitive#EditComplete Gwrite exe fugitive#WriteCommand(<line1>, <count>, +"<range>", <bang>0, "<mods>", <q-args>, [<f-args>])'
exe 'command! -bar -bang -nargs=* -complete=customlist,fugitive#EditComplete Gwq exe fugitive#WqCommand( <line1>, <count>, +"<range>", <bang>0, "<mods>", <q-args>, [<f-args>])'
exe 'command! -bar -bang -nargs=* -complete=customlist,fugitive#EditComplete Gw exe fugitive#WriteCommand(<line1>, <count>, +"<range>", <bang>0, "<mods>", <q-args>)'
exe 'command! -bar -bang -nargs=* -complete=customlist,fugitive#EditComplete Gwrite exe fugitive#WriteCommand(<line1>, <count>, +"<range>", <bang>0, "<mods>", <q-args>)'
exe 'command! -bar -bang -nargs=* -complete=customlist,fugitive#EditComplete Gwq exe fugitive#WqCommand( <line1>, <count>, +"<range>", <bang>0, "<mods>", <q-args>)'
exe 'command! -bar -bang -nargs=0 GRemove exe fugitive#RemoveCommand(<line1>, <count>, +"<range>", <bang>0, "<mods>", <q-args>, [<f-args>])'
exe 'command! -bar -bang -nargs=0 GDelete exe fugitive#DeleteCommand(<line1>, <count>, +"<range>", <bang>0, "<mods>", <q-args>, [<f-args>])'
exe 'command! -bar -bang -nargs=1 -complete=customlist,fugitive#CompleteObject GMove exe fugitive#MoveCommand( <line1>, <count>, +"<range>", <bang>0, "<mods>", <q-args>, [<f-args>])'
exe 'command! -bar -bang -nargs=1 -complete=customlist,fugitive#RenameComplete GRename exe fugitive#RenameCommand(<line1>, <count>, +"<range>", <bang>0, "<mods>", <q-args>, [<f-args>])'
exe 'command! -bar -bang -nargs=0 GRemove exe fugitive#RemoveCommand(<line1>, <count>, +"<range>", <bang>0, "<mods>", <q-args>)'
exe 'command! -bar -bang -nargs=0 GDelete exe fugitive#DeleteCommand(<line1>, <count>, +"<range>", <bang>0, "<mods>", <q-args>)'
exe 'command! -bar -bang -nargs=1 -complete=customlist,fugitive#CompleteObject GMove exe fugitive#MoveCommand( <line1>, <count>, +"<range>", <bang>0, "<mods>", <q-args>)'
exe 'command! -bar -bang -nargs=1 -complete=customlist,fugitive#RenameComplete GRename exe fugitive#RenameCommand(<line1>, <count>, +"<range>", <bang>0, "<mods>", <q-args>)'
if exists(':Gremove') != 2 && get(g:, 'fugitive_legacy_commands', 1)
exe 'command! -bar -bang -nargs=0 Gremove exe fugitive#RemoveCommand(<line1>, <count>, +"<range>", <bang>0, "<mods>", <q-args>, [<f-args>])'
exe 'command! -bar -bang -nargs=0 Gremove exe fugitive#RemoveCommand(<line1>, <count>, +"<range>", <bang>0, "<mods>", <q-args>)'
\ '|echohl WarningMSG|echomsg ":Gremove is deprecated in favor of :GRemove"|echohl NONE'
endif
if exists(':Gdelete') != 2 && get(g:, 'fugitive_legacy_commands', 1)
exe 'command! -bar -bang -nargs=0 Gdelete exe fugitive#DeleteCommand(<line1>, <count>, +"<range>", <bang>0, "<mods>", <q-args>, [<f-args>])'
exe 'command! -bar -bang -nargs=0 Gdelete exe fugitive#DeleteCommand(<line1>, <count>, +"<range>", <bang>0, "<mods>", <q-args>)'
\ '|echohl WarningMSG|echomsg ":Gdelete is deprecated in favor of :GDelete"|echohl NONE'
endif
if exists(':Gmove') != 2 && get(g:, 'fugitive_legacy_commands', 1)
exe 'command! -bar -bang -nargs=1 -complete=customlist,fugitive#CompleteObject Gmove exe fugitive#MoveCommand( <line1>, <count>, +"<range>", <bang>0, "<mods>", <q-args>, [<f-args>])'
exe 'command! -bar -bang -nargs=1 -complete=customlist,fugitive#CompleteObject Gmove exe fugitive#MoveCommand( <line1>, <count>, +"<range>", <bang>0, "<mods>", <q-args>)'
\ '|echohl WarningMSG|echomsg ":Gmove is deprecated in favor of :GMove"|echohl NONE'
endif
if exists(':Grename') != 2 && get(g:, 'fugitive_legacy_commands', 1)
exe 'command! -bar -bang -nargs=1 -complete=customlist,fugitive#RenameComplete Grename exe fugitive#RenameCommand(<line1>, <count>, +"<range>", <bang>0, "<mods>", <q-args>, [<f-args>])'
exe 'command! -bar -bang -nargs=1 -complete=customlist,fugitive#RenameComplete Grename exe fugitive#RenameCommand(<line1>, <count>, +"<range>", <bang>0, "<mods>", <q-args>)'
\ '|echohl WarningMSG|echomsg ":Grename is deprecated in favor of :GRename"|echohl NONE'
endif
exe 'command! -bar -bang -range=-1 -nargs=* -complete=customlist,fugitive#CompleteObject GBrowse exe fugitive#BrowseCommand(<line1>, <count>, +"<range>", <bang>0, "<mods>", <q-args>, [<f-args>])'
exe 'command! -bar -bang -range=-1 -nargs=* -complete=customlist,fugitive#CompleteObject GBrowse exe fugitive#BrowseCommand(<line1>, <count>, +"<range>", <bang>0, "<mods>", <q-args>)'
if exists(':Gbrowse') != 2 && get(g:, 'fugitive_legacy_commands', 1)
exe 'command! -bar -bang -range=-1 -nargs=* -complete=customlist,fugitive#CompleteObject Gbrowse exe fugitive#BrowseCommand(<line1>, <count>, +"<range>", <bang>0, "<mods>", <q-args>, [<f-args>])'
exe 'command! -bar -bang -range=-1 -nargs=* -complete=customlist,fugitive#CompleteObject Gbrowse exe fugitive#BrowseCommand(<line1>, <count>, +"<range>", <bang>0, "<mods>", <q-args>)'
\ '|if <bang>1|redraw!|endif|echohl WarningMSG|echomsg ":Gbrowse is deprecated in favor of :GBrowse"|echohl NONE'
endif
if v:version < 704
if v:version < 703
finish
endif
@ -514,8 +603,9 @@ let g:io_fugitive = {
augroup fugitive
autocmd!
autocmd BufNewFile,BufReadPost * call FugitiveDetect(expand('<amatch>:p'))
autocmd FileType netrw call FugitiveDetect(fnamemodify(get(b:, 'netrw_curdir', expand('<amatch>')), ':p'))
autocmd BufNewFile,BufReadPost *
\ call FugitiveDetect(expand('<amatch>:p'), 1)
autocmd FileType netrw call FugitiveDetect(fnamemodify(get(b:, 'netrw_curdir', expand('<afile>:p')), ':p'), 1)
autocmd FileType git
\ call fugitive#MapCfile()
@ -526,7 +616,7 @@ augroup fugitive
\ setlocal foldtext=fugitive#Foldtext() |
\ endif
autocmd FileType fugitive
\ call fugitive#MapCfile('fugitive#StatusCfile()')
\ call fugitive#MapCfile('fugitive#PorcelainCfile()')
autocmd FileType gitrebase
\ let &l:include = '^\%(pick\|squash\|edit\|reword\|fixup\|drop\|[pserfd]\)\>' |
\ if &l:includeexpr !~# 'Fugitive' |

View File

@ -283,6 +283,9 @@ You can customise:
* How to handle non-gitgutter signs
* The signs' colours and symbols
* Line highlights
* Line number highlights (only in Neovim 0.3.2 or higher)
* The diff syntax colours used in the preview window
* The intra-line diff highlights used in the preview window
* Whether the diff is relative to the index (default) or working tree.
* The base of the diff
* Extra arguments for `git` when running `git diff`
@ -395,6 +398,35 @@ highlight link GitGutterChangeLineNr Underlined
```
#### The diff syntax colours used in the preview window
To change the diff syntax colours used in the preview window, set up the `diff*` highlight groups in your colorscheme or `~/.vimrc`:
```viml
diffAdded " if not set: use GitGutterAdd's foreground colour
diffChanged " if not set: use GitGutterChange's foreground colour
diffRemoved " if not set: use GitGutterDelete's foreground colour
```
Note the `diff*` highlight groups are used in any buffer whose `'syntax'` is `diff`.
#### The intra-line diff highlights used in the preview window
To change the intra-line diff highlights used in the preview window, set up the following highlight groups in your colorscheme or `~/.vimrc`:
```viml
GitGutterAddIntraLine " default: gui=reverse cterm=reverse
GitGutterDeleteIntraLine " default: gui=reverse cterm=reverse
```
For example, to use `DiffAdd` for intra-line added regions:
```viml
highlight link GitGutterAddIntraLine DiffAdd
```
#### Whether the diff is relative to the index or working tree
By default diffs are relative to the index. How you can make them relative to the working tree:

View File

@ -205,6 +205,10 @@ function! gitgutter#quickfix(current_file)
elseif line =~ '^diff --git "'
let [_, fnamel, _, fnamer] = split(line, '"')
let fname = fnamel ==# fnamer ? fnamel : fnamel[2:]
elseif line =~ '^diff --cc [^"]'
let fname = line[10:]
elseif line =~ '^diff --cc "'
let [_, fname] = split(line, '"')
elseif line =~ '^@@'
let lnum = matchlist(line, '+\(\d\+\)')[1]
elseif lnum > 0

View File

@ -109,8 +109,8 @@ function! gitgutter#highlight#define_highlights() abort
highlight default link GitGutterChangeDeleteLineNr CursorLineNr
" Highlights used intra line.
highlight GitGutterAddIntraLine gui=reverse cterm=reverse
highlight GitGutterDeleteIntraLine gui=reverse cterm=reverse
highlight default GitGutterAddIntraLine gui=reverse cterm=reverse
highlight default GitGutterDeleteIntraLine gui=reverse cterm=reverse
" Set diff syntax colours (used in the preview window) - diffAdded,diffChanged,diffRemoved -
" to match the signs, if not set aleady.
for [dtype,type] in [['Added','Add'], ['Changed','Change'], ['Removed','Delete']]

View File

@ -608,6 +608,26 @@ For example, to use |hl-Underlined| instead of |hl-CursorLineNr|:
>
highlight link GitGutterChangeLineNr Underlined
<
To change the diff syntax colours used in the preview window, set up the diff*
highlight groups in your colorscheme or |vimrc|:
>
diffAdded " if not set: use GitGutterAdd's foreground colour
diffChanged " if not set: use GitGutterChange's foreground colour
diffRemoved " if not set: use GitGutterDelete's foreground colour
<
Note the diff* highlight groups are used in any buffer whose 'syntax' is
"diff".
To change the intra-line diff highlights used in the preview window, set up
the following highlight groups in your colorscheme or |vimrc|:
>
GitGutterAddIntraLine " default: gui=reverse cterm=reverse
GitGutterDeleteIntraLine " default: gui=reverse cterm=reverse
<
For example, to use |hl-DiffAdd| for intra-line added regions:
>
highlight link GitGutterAddIntraLine DiffAdd
<
===============================================================================

View File

@ -296,8 +296,8 @@ augroup gitgutter
autocmd ColorScheme * call gitgutter#highlight#define_highlights()
" Disable during :vimgrep
autocmd QuickFixCmdPre *vimgrep* let g:gitgutter_enabled = 0
autocmd QuickFixCmdPost *vimgrep* let g:gitgutter_enabled = 1
autocmd QuickFixCmdPre *vimgrep* let [g:gitgutter_was_enabled, g:gitgutter_enabled] = [g:gitgutter_enabled, 0]
autocmd QuickFixCmdPost *vimgrep* let g:gitgutter_enabled = g:gitgutter_was_enabled | unlet g:gitgutter_was_enabled
augroup END
" }}}

View File

@ -2,7 +2,7 @@ GEM
remote: https://rubygems.org/
specs:
diff-lcs (1.2.5)
rake (12.3.3)
rake (10.4.2)
rspec (3.4.0)
rspec-core (~> 3.4.0)
rspec-expectations (~> 3.4.0)

View File

@ -33,6 +33,9 @@ au BufNewFile,BufRead Podfile,*.podspec call s:setf('ruby')
" Guard
au BufNewFile,BufRead Guardfile,.Guardfile call s:setf('ruby')
" Jb
au BufNewFile,BufRead *.jb call s:setf('ruby')
" Jbuilder
au BufNewFile,BufRead *.jbuilder call s:setf('ruby')

View File

@ -283,7 +283,7 @@ function! GetRubyIndent(...) abort
\ ]
" Most Significant line based on the previous one -- in case it's a
" contination of something above
" continuation of something above
let indent_info.plnum_msl = s:GetMSL(indent_info.plnum)
for callback_name in indent_callback_names

View File

@ -40,6 +40,12 @@ describe "Syntax highlighting" do
EOF
end
specify "magic comments - shareable_constant_value" do
assert_correct_highlighting <<~'EOF', 'shareable_constant_value', 'rubyMagicComment'
# shareable_constant_value: literal
EOF
end
specify "TODO comments" do
assert_correct_highlighting <<~'EOF', 'TODO', 'rubyTodo'
# TODO: turn off the oven

View File

@ -429,9 +429,10 @@ endif
" Comments and Documentation {{{1
syn match rubySharpBang "\%^#!.*" display
syn keyword rubyTodo FIXME NOTE TODO OPTIMIZE HACK REVIEW XXX todo contained
syn match rubyEncoding "[[:alnum:]-]\+" contained display
syn match rubyEncoding "[[:alnum:]-_]\+" contained display
syn match rubyMagicComment "\c\%<3l#\s*\zs\%(coding\|encoding\):" contained nextgroup=rubyEncoding skipwhite
syn match rubyMagicComment "\c\%<10l#\s*\zs\%(frozen_string_literal\|warn_indent\|warn_past_scope\):" contained nextgroup=rubyBoolean skipwhite
syn match rubyMagicComment "\c\%<10l#\s*\zs\%(shareable_constant_value\):" contained nextgroup=rubyEncoding skipwhite
syn match rubyComment "#.*" contains=@rubyCommentSpecial,rubySpaceError,@Spell
syn cluster rubyCommentSpecial contains=rubySharpBang,rubyTodo,rubyMagicComment

View File

@ -112,12 +112,12 @@ snippet img "Image"
endsnippet
snippet ilc "Inline Code" i
\`$1\`$0
\`${1:${VISUAL}}\`$0
endsnippet
snippet cbl "Codeblock" b
\`\`\`
$1
\`\`\`$1
${2:${VISUAL}}
\`\`\`
$0
endsnippet

View File

@ -73,7 +73,23 @@ class Arg(object):
def get_args(arglist):
args = [Arg(arg) for arg in arglist.split(',') if arg]
args = []
n = len(arglist)
i = 0
while i < n:
l_bracket = 0
start = i
while i < n and (l_bracket > 0 or arglist[i] != ','):
if arglist[i] == '[':
l_bracket += 1
elif arglist[i] == ']' and l_bracket > 0:
l_bracket -= 1
i += 1
arg = arglist[start:i]
if arg:
args.append(Arg(arg))
i += 1
args = [arg for arg in args if arg.name != 'self']
return args

View File

@ -334,6 +334,33 @@ snippet getopt
${0}
}
}
## Assertions
snippet asr
assert(${1:condition});
snippet anl
assert(${1:ptr} != NULL);
## Dynamic Allocation
snippet mlc
${1:ptr} = (${2:type}*) malloc(sizeof($2));
snippet clc
${1:ptr} = (${2:type}*) calloc(${3:size}, sizeof($2));
snippet rlc
${1:ptr} = realloc($1, ${2:size} * sizeof(${3:type}));
snippet mlcd
${1:type} ${2:ptr} = ($1*) malloc(sizeof($1));
snippet clcd
${1:type} ${2:ptr} = ($1*) calloc(${3:size}, sizeof($1));
snippet fre
free(${1:ptr});
##
# TODO section
snippet todo

View File

@ -5,7 +5,7 @@ snippet ex
module.exports = ${1};
# require
snippet re
${1:const} ${2} = require('${3:module_name}');
const ${1} = require('${2:module_name}');
# EventEmitter
snippet on
on('${1:event_name}', function(${2:stream}) {

View File

@ -380,11 +380,11 @@ snippet lim limit
# Partial derivative
snippet pdv partial derivation
\\frac{\\partial {$1}}{\partial {$2}} {$0}
\\frac{\\partial {$1}}{\\partial {$2}} {$0}
# Second order partial derivative
snippet ppdv second partial derivation
\\frac{\partial^2 {$1}}{\partial {$2} \partial {$3}} {$0}
\\frac{\\partial^2 {$1}}{\\partial {$2} \\partial {$3}} {$0}
# Ordinary derivative
snippet dv derivative
@ -416,7 +416,7 @@ snippet . dot product
# Integral
snippet int integral
\\int_{{$1}}^{{$2}} {$3} \: d{$4} {$5}
\\int_{{$1}}^{{$2}} {$3} \\: d{$4} {$0}
# Right arrow
snippet ra rightarrow