Updated plugins
This commit is contained in:
parent
06f872cb2f
commit
8240935caa
34 changed files with 497 additions and 279 deletions
|
@ -1,5 +1,5 @@
|
||||||
" Author: Jon Parise <jon@indelible.org>
|
" Author: Jon Parise <jon@indelible.org>
|
||||||
" Description: ElixirLS integration (https://github.com/JakeBecker/elixir-ls)
|
" Description: ElixirLS integration (https://github.com/elixir-lsp/elixir-ls)
|
||||||
|
|
||||||
call ale#Set('elixir_elixir_ls_release', 'elixir-ls')
|
call ale#Set('elixir_elixir_ls_release', 'elixir-ls')
|
||||||
call ale#Set('elixir_elixir_ls_config', {})
|
call ale#Set('elixir_elixir_ls_config', {})
|
||||||
|
|
|
@ -17,13 +17,15 @@ function! ale_linters#glsl#glslang#Handle(buffer, lines) abort
|
||||||
" Matches patterns like the following:
|
" Matches patterns like the following:
|
||||||
"
|
"
|
||||||
" ERROR: 0:5: 'foo' : undeclared identifier
|
" ERROR: 0:5: 'foo' : undeclared identifier
|
||||||
let l:pattern = '^\(.\+\): \(\d\+\):\(\d\+\): \(.\+\)'
|
" or when using options like -V or -G or --target-env
|
||||||
|
" ERROR: filename:5: 'foo' : undeclared identifier
|
||||||
|
let l:pattern = '^\(.\+\): \(.\+\):\(\d\+\): \(.\+\)'
|
||||||
let l:output = []
|
let l:output = []
|
||||||
|
|
||||||
for l:match in ale#util#GetMatches(a:lines, l:pattern)
|
for l:match in ale#util#GetMatches(a:lines, l:pattern)
|
||||||
call add(l:output, {
|
call add(l:output, {
|
||||||
\ 'lnum': str2nr(l:match[3]),
|
\ 'lnum': str2nr(l:match[3]),
|
||||||
\ 'col': str2nr(l:match[2]),
|
\ 'col' : 0,
|
||||||
\ 'text': l:match[4],
|
\ 'text': l:match[4],
|
||||||
\ 'type': l:match[1] is# 'ERROR' ? 'E' : 'W',
|
\ 'type': l:match[1] is# 'ERROR' ? 'E' : 'W',
|
||||||
\})
|
\})
|
||||||
|
|
|
@ -1,58 +0,0 @@
|
||||||
" Author: Ben Reedy <https://github.com/breed808>, Jeff Willette <jrwillette88@gmail.com>
|
|
||||||
" Description: Adds support for the gometalinter suite for Go files
|
|
||||||
|
|
||||||
call ale#Set('go_gometalinter_options', '')
|
|
||||||
call ale#Set('go_gometalinter_executable', 'gometalinter')
|
|
||||||
call ale#Set('go_gometalinter_lint_package', 0)
|
|
||||||
|
|
||||||
function! ale_linters#go#gometalinter#GetCommand(buffer) abort
|
|
||||||
let l:filename = expand('#' . a:buffer . ':t')
|
|
||||||
let l:options = ale#Var(a:buffer, 'go_gometalinter_options')
|
|
||||||
let l:lint_package = ale#Var(a:buffer, 'go_gometalinter_lint_package')
|
|
||||||
|
|
||||||
" BufferCdString is used so that we can be sure the paths output from gometalinter can
|
|
||||||
" be calculated to absolute paths in the Handler
|
|
||||||
if l:lint_package
|
|
||||||
return ale#go#EnvString(a:buffer)
|
|
||||||
\ . '%e'
|
|
||||||
\ . (!empty(l:options) ? ' ' . l:options : '') . ' .'
|
|
||||||
endif
|
|
||||||
|
|
||||||
return ale#go#EnvString(a:buffer)
|
|
||||||
\ . '%e'
|
|
||||||
\ . ' --include=' . ale#Escape(ale#util#EscapePCRE(l:filename))
|
|
||||||
\ . (!empty(l:options) ? ' ' . l:options : '') . ' .'
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! ale_linters#go#gometalinter#GetMatches(lines) abort
|
|
||||||
let l:pattern = '\v^([a-zA-Z]?:?[^:]+):(\d+):?(\d+)?:?:?(warning|error):?\s\*?(.+)$'
|
|
||||||
|
|
||||||
return ale#util#GetMatches(a:lines, l:pattern)
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! ale_linters#go#gometalinter#Handler(buffer, lines) abort
|
|
||||||
let l:dir = expand('#' . a:buffer . ':p:h')
|
|
||||||
let l:output = []
|
|
||||||
|
|
||||||
for l:match in ale_linters#go#gometalinter#GetMatches(a:lines)
|
|
||||||
" l:match[1] will already be an absolute path, output from gometalinter
|
|
||||||
call add(l:output, {
|
|
||||||
\ 'filename': ale#path#GetAbsPath(l:dir, l:match[1]),
|
|
||||||
\ 'lnum': l:match[2] + 0,
|
|
||||||
\ 'col': l:match[3] + 0,
|
|
||||||
\ 'type': tolower(l:match[4]) is# 'warning' ? 'W' : 'E',
|
|
||||||
\ 'text': l:match[5],
|
|
||||||
\})
|
|
||||||
endfor
|
|
||||||
|
|
||||||
return l:output
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
call ale#linter#Define('go', {
|
|
||||||
\ 'name': 'gometalinter',
|
|
||||||
\ 'executable': {b -> ale#Var(b, 'go_gometalinter_executable')},
|
|
||||||
\ 'cwd': '%s:h',
|
|
||||||
\ 'command': function('ale_linters#go#gometalinter#GetCommand'),
|
|
||||||
\ 'callback': 'ale_linters#go#gometalinter#Handler',
|
|
||||||
\ 'lint_file': 1,
|
|
||||||
\})
|
|
35
sources_non_forked/ale/ale_linters/markdown/marksman.vim
Normal file
35
sources_non_forked/ale/ale_linters/markdown/marksman.vim
Normal file
|
@ -0,0 +1,35 @@
|
||||||
|
" Author: Peter Benjamin <petermbenjamin@gmail.com>
|
||||||
|
" Description: Write Markdown with code assist and intelligence in the comfort of your favourite editor.
|
||||||
|
|
||||||
|
call ale#Set('markdown_marksman_executable', 'marksman')
|
||||||
|
|
||||||
|
function! ale_linters#markdown#marksman#GetCommand(buffer) abort
|
||||||
|
return '%e server'
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! ale_linters#markdown#marksman#GetProjectRoot(buffer) abort
|
||||||
|
" Find nearest .marksman.toml
|
||||||
|
let l:marksman_toml = ale#path#FindNearestFile(a:buffer, '.marksman.toml')
|
||||||
|
|
||||||
|
if !empty(l:marksman_toml)
|
||||||
|
return fnamemodify(l:marksman_toml, ':h')
|
||||||
|
endif
|
||||||
|
|
||||||
|
" Find nearest .git/ directory
|
||||||
|
let l:project_root = finddir('.git/..', expand('#' . a:buffer . '...').';')
|
||||||
|
|
||||||
|
if !empty(l:project_root)
|
||||||
|
return l:project_root
|
||||||
|
endif
|
||||||
|
|
||||||
|
return ''
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
call ale#linter#Define('markdown', {
|
||||||
|
\ 'name': 'marksman',
|
||||||
|
\ 'lsp': 'stdio',
|
||||||
|
\ 'executable': {b -> ale#Var(b, 'markdown_marksman_executable')},
|
||||||
|
\ 'command': function('ale_linters#markdown#marksman#GetCommand'),
|
||||||
|
\ 'project_root': function('ale_linters#markdown#marksman#GetProjectRoot'),
|
||||||
|
\ 'initialization_options': {},
|
||||||
|
\})
|
|
@ -3,50 +3,21 @@
|
||||||
" nvim-lspconfig and volar/packages/shared/src/types.ts
|
" nvim-lspconfig and volar/packages/shared/src/types.ts
|
||||||
|
|
||||||
call ale#Set('vue_volar_executable', 'vue-language-server')
|
call ale#Set('vue_volar_executable', 'vue-language-server')
|
||||||
call ale#Set('vue_volar_use_global', get(g:, 'ale_use_global_executables', 0))
|
call ale#Set('vue_volar_use_global', 1)
|
||||||
call ale#Set('vue_volar_init_options', {
|
call ale#Set('vue_volar_init_options', {
|
||||||
\ 'documentFeatures': {
|
\ 'typescript': { 'tsdk': '' },
|
||||||
\ 'documentColor': v:false,
|
|
||||||
\ 'documentFormatting': {
|
|
||||||
\ 'defaultPrintWidth': 100,
|
|
||||||
\ },
|
|
||||||
\ 'documentSymbol': v:true,
|
|
||||||
\ 'foldingRange': v:true,
|
|
||||||
\ 'linkedEditingRange': v:true,
|
|
||||||
\ 'selectionRange': v:true,
|
|
||||||
\ },
|
|
||||||
\ 'languageFeatures': {
|
|
||||||
\ 'callHierarchy': v:true,
|
|
||||||
\ 'codeAction': v:true,
|
|
||||||
\ 'codeLens': v:true,
|
|
||||||
\ 'completion': {
|
|
||||||
\ 'defaultAttrNameCase': 'kebabCase',
|
|
||||||
\ 'defaultTagNameCase': 'both',
|
|
||||||
\ 'getDocumentNameCaseRequest': v:false,
|
|
||||||
\ 'getDocumentSelectionRequest': v:false,
|
|
||||||
\ },
|
|
||||||
\ 'definition': v:true,
|
|
||||||
\ 'diagnostics': v:true,
|
|
||||||
\ 'documentHighlight': v:true,
|
|
||||||
\ 'documentLink': v:true,
|
|
||||||
\ 'hover': v:true,
|
|
||||||
\ 'references': v:true,
|
|
||||||
\ 'rename': v:true,
|
|
||||||
\ 'renameFileRefactoring': v:true,
|
|
||||||
\ 'schemaRequestService': v:true,
|
|
||||||
\ 'semanticTokens': v:false,
|
|
||||||
\ 'signatureHelp': v:true,
|
|
||||||
\ 'typeDefinition': v:true,
|
|
||||||
\ 'workspaceSymbol': v:false,
|
|
||||||
\ },
|
|
||||||
\ 'typescript': {
|
|
||||||
\ 'serverPath': '',
|
|
||||||
\ 'localizedPath': v:null,
|
|
||||||
\ },
|
|
||||||
\})
|
\})
|
||||||
|
|
||||||
function! ale_linters#vue#volar#GetProjectRoot(buffer) abort
|
function! ale_linters#vue#volar#GetProjectRoot(buffer) abort
|
||||||
let l:project_roots = ['package.json', 'vite.config.js', '.git', bufname(a:buffer)]
|
let l:project_roots = [
|
||||||
|
\ 'package.json',
|
||||||
|
\ 'vite.config.js',
|
||||||
|
\ 'vite.config.mjs',
|
||||||
|
\ 'vite.config.cjs',
|
||||||
|
\ 'vite.config.ts',
|
||||||
|
\ '.git',
|
||||||
|
\ bufname(a:buffer)
|
||||||
|
\]
|
||||||
|
|
||||||
for l:project_root in l:project_roots
|
for l:project_root in l:project_roots
|
||||||
let l:nearest_filepath = ale#path#FindNearestFile(a:buffer, l:project_root)
|
let l:nearest_filepath = ale#path#FindNearestFile(a:buffer, l:project_root)
|
||||||
|
@ -60,11 +31,19 @@ function! ale_linters#vue#volar#GetProjectRoot(buffer) abort
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! ale_linters#vue#volar#GetInitializationOptions(buffer) abort
|
function! ale_linters#vue#volar#GetInitializationOptions(buffer) abort
|
||||||
let l:tsserver_path = ale#path#FindNearestExecutable(a:buffer, [
|
let l:tsserver_path = ale#path#FindNearestDirectory(a:buffer, 'node_modules/typescript/lib')
|
||||||
\ 'node_modules/typescript/lib/tsserverlibrary.js'
|
|
||||||
\ ])
|
if l:tsserver_path is# ''
|
||||||
|
" no-custom-checks
|
||||||
|
echohl WarningMsg
|
||||||
|
" no-custom-checks
|
||||||
|
echom '[volar] Must have typescript installed in project, please install via `npm install -D typescript`.'
|
||||||
|
" no-custom-checks
|
||||||
|
echohl None
|
||||||
|
endif
|
||||||
|
|
||||||
let l:init_options = ale#Var(a:buffer, 'vue_volar_init_options')
|
let l:init_options = ale#Var(a:buffer, 'vue_volar_init_options')
|
||||||
let l:init_options.typescript.serverPath = l:tsserver_path
|
let l:init_options.typescript.tsdk = l:tsserver_path
|
||||||
|
|
||||||
return l:init_options
|
return l:init_options
|
||||||
endfunction
|
endfunction
|
||||||
|
|
|
@ -12,8 +12,10 @@ let s:cursor_timer = -1
|
||||||
|
|
||||||
" A wrapper for echon so we can test messages we echo in Vader tests.
|
" A wrapper for echon so we can test messages we echo in Vader tests.
|
||||||
function! ale#cursor#Echom(message) abort
|
function! ale#cursor#Echom(message) abort
|
||||||
" no-custom-checks
|
if mode() is# 'n'
|
||||||
exec "norm! :echom a:message\n"
|
" no-custom-checks
|
||||||
|
exec "norm! :echom a:message\n"
|
||||||
|
endif
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! ale#cursor#TruncatedEcho(original_message) abort
|
function! ale#cursor#TruncatedEcho(original_message) abort
|
||||||
|
|
|
@ -179,7 +179,12 @@ let s:default_registry = {
|
||||||
\ 'yamlfix': {
|
\ 'yamlfix': {
|
||||||
\ 'function': 'ale#fixers#yamlfix#Fix',
|
\ 'function': 'ale#fixers#yamlfix#Fix',
|
||||||
\ 'suggested_filetypes': ['yaml'],
|
\ 'suggested_filetypes': ['yaml'],
|
||||||
\ 'description': 'Fix yaml files with yamlfix.',
|
\ 'description': 'Fix YAML files with yamlfix.',
|
||||||
|
\ },
|
||||||
|
\ 'yamlfmt': {
|
||||||
|
\ 'function': 'ale#fixers#yamlfmt#Fix',
|
||||||
|
\ 'suggested_filetypes': ['yaml'],
|
||||||
|
\ 'description': 'Format YAML files with yamlfmt.',
|
||||||
\ },
|
\ },
|
||||||
\ 'yapf': {
|
\ 'yapf': {
|
||||||
\ 'function': 'ale#fixers#yapf#Fix',
|
\ 'function': 'ale#fixers#yapf#Fix',
|
||||||
|
@ -615,6 +620,11 @@ let s:default_registry = {
|
||||||
\ 'function': 'ale#fixers#npmgroovylint#Fix',
|
\ 'function': 'ale#fixers#npmgroovylint#Fix',
|
||||||
\ 'suggested_filetypes': ['groovy'],
|
\ 'suggested_filetypes': ['groovy'],
|
||||||
\ 'description': 'Fix Groovy files with npm-groovy-fix.',
|
\ 'description': 'Fix Groovy files with npm-groovy-fix.',
|
||||||
|
\ },
|
||||||
|
\ 'erb-formatter': {
|
||||||
|
\ 'function': 'ale#fixers#erbformatter#Fix',
|
||||||
|
\ 'suggested_filetypes': ['eruby'],
|
||||||
|
\ 'description': 'Apply erb-formatter -w to eruby/erb files.',
|
||||||
\ }
|
\ }
|
||||||
\}
|
\}
|
||||||
|
|
||||||
|
|
13
sources_non_forked/ale/autoload/ale/fixers/erbformatter.vim
Normal file
13
sources_non_forked/ale/autoload/ale/fixers/erbformatter.vim
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
" Author: Arash Mousavi <arash-m>
|
||||||
|
" Description: Support for ERB::Formetter https://github.com/nebulab/erb-formatter
|
||||||
|
|
||||||
|
call ale#Set('eruby_erbformatter_executable', 'erb-formatter')
|
||||||
|
|
||||||
|
function! ale#fixers#erbformatter#Fix(buffer) abort
|
||||||
|
let l:executable = ale#Var(a:buffer, 'eruby_erbformatter_executable')
|
||||||
|
|
||||||
|
return {
|
||||||
|
\ 'command': ale#Escape(l:executable) . ' -w %t',
|
||||||
|
\ 'read_temporary_file': 1,
|
||||||
|
\}
|
||||||
|
endfunction
|
|
@ -1,4 +1,4 @@
|
||||||
" Author: Cyril Roelandt <tipecaml@gmail.com>
|
" Author: Cyril Roelandt <tipecaml@gmail.com>, jiz4oh <me@jiz4oh.com>
|
||||||
" Description: Integration of xmllint with ALE.
|
" Description: Integration of xmllint with ALE.
|
||||||
|
|
||||||
call ale#Set('xml_xmllint_executable', 'xmllint')
|
call ale#Set('xml_xmllint_executable', 'xmllint')
|
||||||
|
@ -7,7 +7,14 @@ call ale#Set('xml_xmllint_indentsize', 2)
|
||||||
|
|
||||||
function! ale#fixers#xmllint#Fix(buffer) abort
|
function! ale#fixers#xmllint#Fix(buffer) abort
|
||||||
let l:executable = ale#Escape(ale#Var(a:buffer, 'xml_xmllint_executable'))
|
let l:executable = ale#Escape(ale#Var(a:buffer, 'xml_xmllint_executable'))
|
||||||
let l:filename = ale#Escape(bufname(a:buffer))
|
let l:filename = bufname(a:buffer)
|
||||||
|
|
||||||
|
if empty(l:filename)
|
||||||
|
let l:filename = '%t'
|
||||||
|
else
|
||||||
|
let l:filename = ale#Escape(l:filename)
|
||||||
|
endif
|
||||||
|
|
||||||
let l:command = l:executable . ' --format ' . l:filename
|
let l:command = l:executable . ' --format ' . l:filename
|
||||||
|
|
||||||
let l:indent = ale#Var(a:buffer, 'xml_xmllint_indentsize')
|
let l:indent = ale#Var(a:buffer, 'xml_xmllint_indentsize')
|
||||||
|
|
20
sources_non_forked/ale/autoload/ale/fixers/yamlfmt.vim
Normal file
20
sources_non_forked/ale/autoload/ale/fixers/yamlfmt.vim
Normal file
|
@ -0,0 +1,20 @@
|
||||||
|
" Author: https://github.com/Spixmaster
|
||||||
|
" Description: Format YAML files with yamlfmt.
|
||||||
|
|
||||||
|
call ale#Set('yaml_yamlfmt_executable', 'yamlfmt')
|
||||||
|
call ale#Set('yaml_yamlfmt_use_global', get(g:, 'ale_use_global_executables', 0))
|
||||||
|
call ale#Set('yaml_yamlfmt_options', '')
|
||||||
|
|
||||||
|
function! ale#fixers#yamlfmt#Fix(buffer) abort
|
||||||
|
let l:executable = ale#python#FindExecutable(
|
||||||
|
\ a:buffer,
|
||||||
|
\ 'yaml_yamlfmt',
|
||||||
|
\ ['yamlfmt']
|
||||||
|
\)
|
||||||
|
|
||||||
|
let l:options = ale#Var(a:buffer, 'yaml_yamlfmt_options')
|
||||||
|
|
||||||
|
return {
|
||||||
|
\ 'command': ale#Escape(l:executable) . ' ' . l:options . ' -in',
|
||||||
|
\}
|
||||||
|
endfunction
|
|
@ -37,15 +37,21 @@ function! s:NvimShow(lines, options) abort
|
||||||
endif
|
endif
|
||||||
|
|
||||||
" Execute commands in window context
|
" Execute commands in window context
|
||||||
let l:parent_window = nvim_get_current_win()
|
if exists('*win_execute')
|
||||||
|
for l:command in get(a:options, 'commands', [])
|
||||||
|
call win_execute(w:preview['id'], l:command)
|
||||||
|
endfor
|
||||||
|
else
|
||||||
|
let l:parent_window = nvim_get_current_win()
|
||||||
|
|
||||||
call nvim_set_current_win(w:preview['id'])
|
call nvim_set_current_win(w:preview['id'])
|
||||||
|
|
||||||
for l:command in get(a:options, 'commands', [])
|
for l:command in get(a:options, 'commands', [])
|
||||||
call execute(l:command)
|
call execute(l:command)
|
||||||
endfor
|
endfor
|
||||||
|
|
||||||
call nvim_set_current_win(l:parent_window)
|
call nvim_set_current_win(l:parent_window)
|
||||||
|
endif
|
||||||
|
|
||||||
" Return to parent context on move
|
" Return to parent context on move
|
||||||
augroup ale_floating_preview_window
|
augroup ale_floating_preview_window
|
||||||
|
|
|
@ -24,14 +24,19 @@ endfunction
|
||||||
function! ale#handlers#cspell#Handle(buffer, lines) abort
|
function! ale#handlers#cspell#Handle(buffer, lines) abort
|
||||||
" Look for lines like the following:
|
" Look for lines like the following:
|
||||||
"
|
"
|
||||||
" /home/user/repos/ale/README.md:723:48 - Unknown word (stylelint)
|
" /home/user/repos/ale/README.md:3:128 - Unknown word (Neovim)
|
||||||
let l:pattern = '\v^.*:(\d+):(\d+) - (.*)$'
|
" match1: 3
|
||||||
|
" match2: 128
|
||||||
|
" match3: Unknown word (Neovim)
|
||||||
|
" match4: Neovim
|
||||||
|
let l:pattern = '\v^.*:(\d+):(\d+) - ([^\(]+\(([^\)]+)\).*)$'
|
||||||
let l:output = []
|
let l:output = []
|
||||||
|
|
||||||
for l:match in ale#util#GetMatches(a:lines, l:pattern)
|
for l:match in ale#util#GetMatches(a:lines, l:pattern)
|
||||||
call add(l:output, {
|
call add(l:output, {
|
||||||
\ 'lnum': l:match[1] + 0,
|
\ 'lnum': l:match[1] + 0,
|
||||||
\ 'col': l:match[2] + 0,
|
\ 'col': l:match[2] + 0,
|
||||||
|
\ 'end_col': l:match[2] + len(l:match[4]) - 1,
|
||||||
\ 'text': l:match[3],
|
\ 'text': l:match[3],
|
||||||
\ 'type': 'W',
|
\ 'type': 'W',
|
||||||
\})
|
\})
|
||||||
|
|
|
@ -70,6 +70,18 @@ function! s:ConvertLanguageName(language) abort
|
||||||
return a:language
|
return a:language
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
" Cache syntax file (non-)existence to avoid calling globpath repeatedly.
|
||||||
|
let s:syntax_file_exists_cache = {}
|
||||||
|
|
||||||
|
function! s:SyntaxFileExists(syntax_file) abort
|
||||||
|
if !has_key(s:syntax_file_exists_cache, a:syntax_file)
|
||||||
|
let s:syntax_file_exists_cache[a:syntax_file] =
|
||||||
|
\ !empty(globpath(&runtimepath, a:syntax_file))
|
||||||
|
endif
|
||||||
|
|
||||||
|
return s:syntax_file_exists_cache[a:syntax_file]
|
||||||
|
endfunction
|
||||||
|
|
||||||
function! ale#hover#ParseLSPResult(contents) abort
|
function! ale#hover#ParseLSPResult(contents) abort
|
||||||
let l:includes = {}
|
let l:includes = {}
|
||||||
let l:highlights = []
|
let l:highlights = []
|
||||||
|
@ -160,10 +172,11 @@ function! ale#hover#ParseLSPResult(contents) abort
|
||||||
let l:language = s:ConvertLanguageName(l:language)
|
let l:language = s:ConvertLanguageName(l:language)
|
||||||
|
|
||||||
if !empty(l:language)
|
if !empty(l:language)
|
||||||
let l:includes[l:language] = printf(
|
let l:syntax_file = printf('syntax/%s.vim', l:language)
|
||||||
\ 'syntax/%s.vim',
|
|
||||||
\ l:language,
|
if s:SyntaxFileExists(l:syntax_file)
|
||||||
\)
|
let l:includes[l:language] = l:syntax_file
|
||||||
|
endif
|
||||||
|
|
||||||
let l:start = len(l:lines) + 1
|
let l:start = len(l:lines) + 1
|
||||||
let l:end = l:start + len(l:marked_lines)
|
let l:end = l:start + len(l:marked_lines)
|
||||||
|
|
|
@ -42,7 +42,7 @@ let s:default_ale_linters = {
|
||||||
\ 'apkbuild': ['apkbuild_lint', 'secfixes_check'],
|
\ 'apkbuild': ['apkbuild_lint', 'secfixes_check'],
|
||||||
\ 'csh': ['shell'],
|
\ 'csh': ['shell'],
|
||||||
\ 'elixir': ['credo', 'dialyxir', 'dogma'],
|
\ 'elixir': ['credo', 'dialyxir', 'dogma'],
|
||||||
\ 'go': ['gofmt', 'gopls', 'govet'],
|
\ 'go': ['gofmt', 'golangci-lint', 'gopls', 'govet'],
|
||||||
\ 'groovy': ['npm-groovy-lint'],
|
\ 'groovy': ['npm-groovy-lint'],
|
||||||
\ 'hack': ['hack'],
|
\ 'hack': ['hack'],
|
||||||
\ 'help': [],
|
\ 'help': [],
|
||||||
|
|
|
@ -424,7 +424,7 @@ function! s:SendInitMessage(conn) abort
|
||||||
\ 'completionItem': {
|
\ 'completionItem': {
|
||||||
\ 'snippetSupport': v:false,
|
\ 'snippetSupport': v:false,
|
||||||
\ 'commitCharactersSupport': v:false,
|
\ 'commitCharactersSupport': v:false,
|
||||||
\ 'documentationFormat': ['plaintext'],
|
\ 'documentationFormat': ['plaintext', 'markdown'],
|
||||||
\ 'deprecatedSupport': v:false,
|
\ 'deprecatedSupport': v:false,
|
||||||
\ 'preselectSupport': v:false,
|
\ 'preselectSupport': v:false,
|
||||||
\ },
|
\ },
|
||||||
|
@ -432,7 +432,7 @@ function! s:SendInitMessage(conn) abort
|
||||||
\ },
|
\ },
|
||||||
\ 'hover': {
|
\ 'hover': {
|
||||||
\ 'dynamicRegistration': v:false,
|
\ 'dynamicRegistration': v:false,
|
||||||
\ 'contentFormat': ['plaintext'],
|
\ 'contentFormat': ['plaintext', 'markdown'],
|
||||||
\ },
|
\ },
|
||||||
\ 'references': {
|
\ 'references': {
|
||||||
\ 'dynamicRegistration': v:false,
|
\ 'dynamicRegistration': v:false,
|
||||||
|
|
|
@ -87,7 +87,7 @@ execute 'sign define ALEInfoSign text=' . s:EscapeSignText(g:ale_sign_info)
|
||||||
\ . ' texthl=ALEInfoSign linehl=ALEInfoLine'
|
\ . ' texthl=ALEInfoSign linehl=ALEInfoLine'
|
||||||
sign define ALEDummySign text=\ texthl=SignColumn
|
sign define ALEDummySign text=\ texthl=SignColumn
|
||||||
|
|
||||||
if g:ale_sign_highlight_linenrs && has('nvim-0.3.2')
|
if g:ale_sign_highlight_linenrs && (has('nvim-0.3.2') || has('patch-8.2.3874'))
|
||||||
if !hlexists('ALEErrorSignLineNr')
|
if !hlexists('ALEErrorSignLineNr')
|
||||||
highlight link ALEErrorSignLineNr CursorLineNr
|
highlight link ALEErrorSignLineNr CursorLineNr
|
||||||
endif
|
endif
|
||||||
|
|
|
@ -14,6 +14,19 @@ default parser in Rails between 3.0 and 5.1. `erubi` is the default in Rails
|
||||||
5.1 and later. `ruumba` can extract Ruby from eruby files and run rubocop on
|
5.1 and later. `ruumba` can extract Ruby from eruby files and run rubocop on
|
||||||
the result. To selectively enable a subset, see |g:ale_linters|.
|
the result. To selectively enable a subset, see |g:ale_linters|.
|
||||||
|
|
||||||
|
|
||||||
|
===============================================================================
|
||||||
|
erb-formatter *ale-eruby-erbformatter*
|
||||||
|
|
||||||
|
g:ale_eruby_erbformatter_executable *g:ale_eruby_erbformatter_executable*
|
||||||
|
*b:ale_eruby_erbformatter_executable*
|
||||||
|
Type: |String|
|
||||||
|
Default: `'erb-formatter'`
|
||||||
|
|
||||||
|
Override the invoked erb-formatter binary. This is useful for running
|
||||||
|
erb-formatter from binstubs or a bundle.
|
||||||
|
|
||||||
|
|
||||||
===============================================================================
|
===============================================================================
|
||||||
erblint *ale-eruby-erblint*
|
erblint *ale-eruby-erblint*
|
||||||
|
|
||||||
|
@ -40,7 +53,7 @@ ruumba *ale-eruby-ruumba*
|
||||||
g:ale_eruby_ruumba_executable *g:ale_eruby_ruumba_executable*
|
g:ale_eruby_ruumba_executable *g:ale_eruby_ruumba_executable*
|
||||||
*b:ale_eruby_ruumba_executable*
|
*b:ale_eruby_ruumba_executable*
|
||||||
Type: |String|
|
Type: |String|
|
||||||
Default: `'ruumba`
|
Default: `'ruumba'`
|
||||||
|
|
||||||
Override the invoked ruumba binary. This is useful for running ruumba
|
Override the invoked ruumba binary. This is useful for running ruumba
|
||||||
from binstubs or a bundle.
|
from binstubs or a bundle.
|
||||||
|
|
|
@ -5,20 +5,15 @@ ALE Go Integration *ale-go-options*
|
||||||
===============================================================================
|
===============================================================================
|
||||||
Integration Information
|
Integration Information
|
||||||
|
|
||||||
The `gometalinter` linter is disabled by default. ALE enables `gofmt`,
|
ALE enables `gofmt`, `gopls` and `go vet` by default. It also supports `staticcheck`,
|
||||||
`gopls`, and `go vet` by default. It also supports `staticcheck, `go
|
`go build, ``gosimple`, `golangserver`, and `golangci-lint.
|
||||||
build`, `gosimple`, `golangserver`, and `golangci-lint`.
|
|
||||||
|
|
||||||
To enable `gometalinter`, update |g:ale_linters| as appropriate:
|
To enable `golangci-lint`, update |g:ale_linters| as appropriate.
|
||||||
|
A possible configuration is to enable golangci-lint and `gofmt:
|
||||||
>
|
>
|
||||||
" Enable all of the linters you want for Go.
|
" Enable all of the linters you want for Go.
|
||||||
let g:ale_linters = {'go': ['gometalinter', 'gofmt']}
|
let g:ale_linters = {'go': ['golangci-lint', 'gofmt']}
|
||||||
<
|
<
|
||||||
A possible configuration is to enable `gometalinter` and `gofmt` but paired
|
|
||||||
with the `--fast` option, set by |g:ale_go_gometalinter_options|. This gets you
|
|
||||||
the benefit of running a number of linters, more than ALE would by default,
|
|
||||||
while ensuring it doesn't run any linters known to be slow or resource
|
|
||||||
intensive.
|
|
||||||
|
|
||||||
g:ale_go_go_executable *g:ale_go_go_executable*
|
g:ale_go_go_executable *g:ale_go_go_executable*
|
||||||
*b:ale_go_go_executable*
|
*b:ale_go_go_executable*
|
||||||
|
@ -175,44 +170,6 @@ g:ale_go_golines_options *g:ale_go_golines_options*
|
||||||
--max-length=100 (lines above 100 characters will be wrapped)
|
--max-length=100 (lines above 100 characters will be wrapped)
|
||||||
|
|
||||||
|
|
||||||
===============================================================================
|
|
||||||
gometalinter *ale-go-gometalinter*
|
|
||||||
|
|
||||||
`gometalinter` is a `lint_file` linter, which only lints files that are
|
|
||||||
written to disk. This differs from the default behavior of linting the buffer.
|
|
||||||
See: |ale-lint-file|
|
|
||||||
|
|
||||||
g:ale_go_gometalinter_executable *g:ale_go_gometalinter_executable*
|
|
||||||
*b:ale_go_gometalinter_executable*
|
|
||||||
Type: |String|
|
|
||||||
Default: `'gometalinter'`
|
|
||||||
|
|
||||||
The executable that will be run for gometalinter.
|
|
||||||
|
|
||||||
|
|
||||||
g:ale_go_gometalinter_options *g:ale_go_gometalinter_options*
|
|
||||||
*b:ale_go_gometalinter_options*
|
|
||||||
Type: |String|
|
|
||||||
Default: `''`
|
|
||||||
|
|
||||||
This variable can be changed to alter the command-line arguments to the
|
|
||||||
gometalinter invocation.
|
|
||||||
|
|
||||||
Since `gometalinter` runs a number of linters that can consume a lot of
|
|
||||||
resources it's recommended to set this option to a value of `--fast` if you
|
|
||||||
use `gometalinter` as one of the linters in |g:ale_linters|. This disables a
|
|
||||||
number of linters known to be slow or consume a lot of resources.
|
|
||||||
|
|
||||||
|
|
||||||
g:ale_go_gometalinter_lint_package *g:ale_go_gometalinter_lint_package*
|
|
||||||
*b:ale_go_gometalinter_lint_package*
|
|
||||||
Type: |Number|
|
|
||||||
Default: `0`
|
|
||||||
|
|
||||||
When set to `1`, the whole Go package will be checked instead of only the
|
|
||||||
current file.
|
|
||||||
|
|
||||||
|
|
||||||
===============================================================================
|
===============================================================================
|
||||||
gopls *ale-go-gopls*
|
gopls *ale-go-gopls*
|
||||||
|
|
||||||
|
|
|
@ -34,6 +34,17 @@ g:ale_markdown_markdownlint_options *g:ale_markdown_markdownlint_options*
|
||||||
This variable can be set to pass additional options to markdownlint.
|
This variable can be set to pass additional options to markdownlint.
|
||||||
|
|
||||||
|
|
||||||
|
===============================================================================
|
||||||
|
marksman *ale-markdown-marksman*
|
||||||
|
|
||||||
|
g:ale_markdown_marksman_executable *g:ale_markdown_marksman_executable*
|
||||||
|
*b:ale_markdown_marksman_executable*
|
||||||
|
Type: |String|
|
||||||
|
Default: `'marksman'`
|
||||||
|
|
||||||
|
Override the invoked `marksman` binary.
|
||||||
|
|
||||||
|
|
||||||
===============================================================================
|
===============================================================================
|
||||||
mdl *ale-markdown-mdl*
|
mdl *ale-markdown-mdl*
|
||||||
|
|
||||||
|
|
|
@ -60,8 +60,20 @@ g:ale_rust_analyzer_config *g:ale_rust_analyzer_config*
|
||||||
Type: |Dictionary|
|
Type: |Dictionary|
|
||||||
Default: `{}`
|
Default: `{}`
|
||||||
|
|
||||||
Dictionary with configuration settings for rust-analyzer.
|
Dictionary with configuration settings for rust-analyzer. Keys of the
|
||||||
|
dictionary are components of configuration keys. For example:
|
||||||
|
>
|
||||||
|
let g:ale_rust_analyzer_config = {
|
||||||
|
\ 'server': {
|
||||||
|
\ 'extraEnv': { 'RUSTUP_TOOLCHAIN': 'stable' },
|
||||||
|
\ }
|
||||||
|
\}
|
||||||
|
<
|
||||||
|
corresponds to `rust-analyzer.server.extraEnv = { 'RUSTUP_TOOLCHAIN': 'stable' }`
|
||||||
|
|
||||||
|
For available configuration parameters, see the `rust-analyzer` manual:
|
||||||
|
|
||||||
|
https://rust-analyzer.github.io/manual.html#configuration
|
||||||
|
|
||||||
===============================================================================
|
===============================================================================
|
||||||
cargo *ale-rust-cargo*
|
cargo *ale-rust-cargo*
|
||||||
|
|
|
@ -175,6 +175,7 @@ Notes:
|
||||||
* `elm-make`
|
* `elm-make`
|
||||||
* Erb
|
* Erb
|
||||||
* `erb`
|
* `erb`
|
||||||
|
* `erb-formatter`
|
||||||
* `erblint`
|
* `erblint`
|
||||||
* `erubi`
|
* `erubi`
|
||||||
* `erubis`
|
* `erubis`
|
||||||
|
@ -213,7 +214,6 @@ Notes:
|
||||||
* `golangci-lint`!!
|
* `golangci-lint`!!
|
||||||
* `golangserver`
|
* `golangserver`
|
||||||
* `golines`
|
* `golines`
|
||||||
* `gometalinter`!!
|
|
||||||
* `gopls`
|
* `gopls`
|
||||||
* `gosimple`!!
|
* `gosimple`!!
|
||||||
* `gotype`!!
|
* `gotype`!!
|
||||||
|
@ -364,6 +364,7 @@ Notes:
|
||||||
* `cspell`
|
* `cspell`
|
||||||
* `languagetool`!!
|
* `languagetool`!!
|
||||||
* `markdownlint`!!
|
* `markdownlint`!!
|
||||||
|
* `marksman`
|
||||||
* `mdl`
|
* `mdl`
|
||||||
* `pandoc`
|
* `pandoc`
|
||||||
* `prettier`
|
* `prettier`
|
||||||
|
@ -698,6 +699,7 @@ Notes:
|
||||||
* `swaglint`
|
* `swaglint`
|
||||||
* `yaml-language-server`
|
* `yaml-language-server`
|
||||||
* `yamlfix`
|
* `yamlfix`
|
||||||
|
* `yamlfmt`
|
||||||
* `yamllint`
|
* `yamllint`
|
||||||
* YANG
|
* YANG
|
||||||
* `yang-lsp`
|
* `yang-lsp`
|
||||||
|
|
|
@ -50,7 +50,7 @@ g:ale_vue_volar_executable *g:ale_vue_volar_executable*
|
||||||
g:ale_vue_volar_use_global *g:ale_vue_volar_use_global*
|
g:ale_vue_volar_use_global *g:ale_vue_volar_use_global*
|
||||||
*b:ale_vue_volar_use_global*
|
*b:ale_vue_volar_use_global*
|
||||||
Type: |Number|
|
Type: |Number|
|
||||||
Default: `get(g:, 'ale_use_global_executables', 0)`
|
Default: `1`
|
||||||
|
|
||||||
See |ale-integrations-local-executables|
|
See |ale-integrations-local-executables|
|
||||||
|
|
||||||
|
@ -58,7 +58,7 @@ g:ale_vue_volar_use_global *g:ale_vue_volar_use_global*
|
||||||
g:vue_volar_init_options *g:ale_vue_volar_init_options*
|
g:vue_volar_init_options *g:ale_vue_volar_init_options*
|
||||||
*b:ale_vue_volar_init_options*
|
*b:ale_vue_volar_init_options*
|
||||||
Type: |Dictionary|
|
Type: |Dictionary|
|
||||||
Default: `{ ... }`
|
Default: `{ 'typescript': 'tsdk': '' }`
|
||||||
|
|
||||||
Default is too long to show here, take a look at it over
|
Default is too long to show here, take a look at it over
|
||||||
`ale_linters/vue/volar.vim`
|
`ale_linters/vue/volar.vim`
|
||||||
|
|
|
@ -47,6 +47,7 @@ g:ale_yaml_actionlint_options *g:ale_yaml_actionlint_options*
|
||||||
<
|
<
|
||||||
Please note that passing `-format` as option is not supported at the moment.
|
Please note that passing `-format` as option is not supported at the moment.
|
||||||
|
|
||||||
|
|
||||||
===============================================================================
|
===============================================================================
|
||||||
circleci *ale-yaml-circleci*
|
circleci *ale-yaml-circleci*
|
||||||
|
|
||||||
|
@ -242,6 +243,44 @@ g:ale_yaml_yamlfix_use_global *g:ale_yaml_yamlfix_use_global*
|
||||||
See |ale-integrations-local-executables|
|
See |ale-integrations-local-executables|
|
||||||
|
|
||||||
|
|
||||||
|
===============================================================================
|
||||||
|
yamlfmt *ale-yaml-yamlfmt*
|
||||||
|
|
||||||
|
Website: https://github.com/google/yamlfmt
|
||||||
|
|
||||||
|
|
||||||
|
Installation
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
Install yamlfmt:
|
||||||
|
|
||||||
|
See the website.
|
||||||
|
|
||||||
|
Options
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
g:ale_yaml_yamlfmt_executable *g:ale_yaml_yamlfmt_executable*
|
||||||
|
*b:ale_yaml_yamlfmt_executable*
|
||||||
|
Type: |String|
|
||||||
|
Default: `'yamlfmt'`
|
||||||
|
|
||||||
|
See |ale-integrations-local-executables|
|
||||||
|
|
||||||
|
|
||||||
|
g:ale_yaml_yamlfmt_options *g:ale_yaml_yamlfmt_options*
|
||||||
|
*b:ale_yaml_yamlfmt_options*
|
||||||
|
Type: |String|
|
||||||
|
Default: `''`
|
||||||
|
|
||||||
|
This variable can be set to pass extra options to yamlfmt.
|
||||||
|
|
||||||
|
g:ale_yaml_yamlfmt_use_global *g:ale_yaml_yamlfmt_use_global*
|
||||||
|
*b:ale_yaml_yamlfmt_use_global*
|
||||||
|
Type: |Number|
|
||||||
|
Default: `get(g:, 'ale_use_global_executables', 0)`
|
||||||
|
|
||||||
|
See |ale-integrations-local-executables|
|
||||||
|
|
||||||
|
|
||||||
===============================================================================
|
===============================================================================
|
||||||
yamllint *ale-yaml-yamllint*
|
yamllint *ale-yaml-yamllint*
|
||||||
|
|
||||||
|
|
|
@ -1641,7 +1641,7 @@ g:ale_linters *g:ale_linters*
|
||||||
\ 'apkbuild': ['apkbuild_lint', 'secfixes_check'],
|
\ 'apkbuild': ['apkbuild_lint', 'secfixes_check'],
|
||||||
\ 'csh': ['shell'],
|
\ 'csh': ['shell'],
|
||||||
\ 'elixir': ['credo', 'dialyxir', 'dogma'],
|
\ 'elixir': ['credo', 'dialyxir', 'dogma'],
|
||||||
\ 'go': ['gofmt', 'gopls', 'govet'],
|
\ 'go': ['gofmt', 'golangci-lint', 'gopls', 'govet'],
|
||||||
\ 'groovy': ['npm-groovy-lint'],
|
\ 'groovy': ['npm-groovy-lint'],
|
||||||
\ 'hack': ['hack'],
|
\ 'hack': ['hack'],
|
||||||
\ 'help': [],
|
\ 'help': [],
|
||||||
|
@ -2409,7 +2409,7 @@ g:ale_virtualenv_dir_names *g:ale_virtualenv_dir_names*
|
||||||
Default: `['.env', '.venv', 'env', 've-py3', 've', 'virtualenv', 'venv']`
|
Default: `['.env', '.venv', 'env', 've-py3', 've', 'virtualenv', 'venv']`
|
||||||
|
|
||||||
A list of directory names to be used when searching upwards from Python
|
A list of directory names to be used when searching upwards from Python
|
||||||
files to discover virtulenv directories with.
|
files to discover virtualenv directories with.
|
||||||
|
|
||||||
For directory named `'foo'`, ALE will search for `'foo/bin/activate'`
|
For directory named `'foo'`, ALE will search for `'foo/bin/activate'`
|
||||||
(`foo\Scripts\activate\` on Windows) in all directories on and above the
|
(`foo\Scripts\activate\` on Windows) in all directories on and above the
|
||||||
|
@ -2963,6 +2963,7 @@ documented in additional help files.
|
||||||
erlfmt................................|ale-erlang-erlfmt|
|
erlfmt................................|ale-erlang-erlfmt|
|
||||||
syntaxerl.............................|ale-erlang-syntaxerl|
|
syntaxerl.............................|ale-erlang-syntaxerl|
|
||||||
eruby...................................|ale-eruby-options|
|
eruby...................................|ale-eruby-options|
|
||||||
|
erb-formatter.........................|ale-eruby-erbformatter|
|
||||||
erblint...............................|ale-eruby-erblint|
|
erblint...............................|ale-eruby-erblint|
|
||||||
ruumba................................|ale-eruby-ruumba|
|
ruumba................................|ale-eruby-ruumba|
|
||||||
fish....................................|ale-fish-options|
|
fish....................................|ale-fish-options|
|
||||||
|
@ -2987,7 +2988,6 @@ documented in additional help files.
|
||||||
golangci-lint.........................|ale-go-golangci-lint|
|
golangci-lint.........................|ale-go-golangci-lint|
|
||||||
golangserver..........................|ale-go-golangserver|
|
golangserver..........................|ale-go-golangserver|
|
||||||
golines...............................|ale-go-golines|
|
golines...............................|ale-go-golines|
|
||||||
gometalinter..........................|ale-go-gometalinter|
|
|
||||||
gopls.................................|ale-go-gopls|
|
gopls.................................|ale-go-gopls|
|
||||||
govet.................................|ale-go-govet|
|
govet.................................|ale-go-govet|
|
||||||
revive................................|ale-go-revive|
|
revive................................|ale-go-revive|
|
||||||
|
@ -3123,6 +3123,7 @@ documented in additional help files.
|
||||||
cspell................................|ale-markdown-cspell|
|
cspell................................|ale-markdown-cspell|
|
||||||
dprint................................|ale-markdown-dprint|
|
dprint................................|ale-markdown-dprint|
|
||||||
markdownlint..........................|ale-markdown-markdownlint|
|
markdownlint..........................|ale-markdown-markdownlint|
|
||||||
|
marksman..............................|ale-markdown-marksman|
|
||||||
mdl...................................|ale-markdown-mdl|
|
mdl...................................|ale-markdown-mdl|
|
||||||
pandoc................................|ale-markdown-pandoc|
|
pandoc................................|ale-markdown-pandoc|
|
||||||
prettier..............................|ale-markdown-prettier|
|
prettier..............................|ale-markdown-prettier|
|
||||||
|
@ -3426,6 +3427,7 @@ documented in additional help files.
|
||||||
swaglint..............................|ale-yaml-swaglint|
|
swaglint..............................|ale-yaml-swaglint|
|
||||||
yaml-language-server..................|ale-yaml-language-server|
|
yaml-language-server..................|ale-yaml-language-server|
|
||||||
yamlfix...............................|ale-yaml-yamlfix|
|
yamlfix...............................|ale-yaml-yamlfix|
|
||||||
|
yamlfmt...............................|ale-yaml-yamlfmt|
|
||||||
yamllint..............................|ale-yaml-yamllint|
|
yamllint..............................|ale-yaml-yamllint|
|
||||||
gitlablint............................|ale-yaml-gitlablint|
|
gitlablint............................|ale-yaml-gitlablint|
|
||||||
yang....................................|ale-yang-options|
|
yang....................................|ale-yang-options|
|
||||||
|
|
|
@ -184,6 +184,7 @@ formatting.
|
||||||
* [elm-make](https://github.com/elm/compiler)
|
* [elm-make](https://github.com/elm/compiler)
|
||||||
* Erb
|
* Erb
|
||||||
* [erb](https://apidock.com/ruby/ERB)
|
* [erb](https://apidock.com/ruby/ERB)
|
||||||
|
* [erb-formatter](https://github.com/nebulab/erb-formatter)
|
||||||
* [erblint](https://github.com/Shopify/erb-lint)
|
* [erblint](https://github.com/Shopify/erb-lint)
|
||||||
* [erubi](https://github.com/jeremyevans/erubi)
|
* [erubi](https://github.com/jeremyevans/erubi)
|
||||||
* [erubis](https://github.com/kwatch/erubis)
|
* [erubis](https://github.com/kwatch/erubis)
|
||||||
|
@ -222,7 +223,6 @@ formatting.
|
||||||
* [golangci-lint](https://github.com/golangci/golangci-lint) :warning: :floppy_disk:
|
* [golangci-lint](https://github.com/golangci/golangci-lint) :warning: :floppy_disk:
|
||||||
* [golangserver](https://github.com/sourcegraph/go-langserver) :warning:
|
* [golangserver](https://github.com/sourcegraph/go-langserver) :warning:
|
||||||
* [golines](https://github.com/segmentio/golines)
|
* [golines](https://github.com/segmentio/golines)
|
||||||
* [gometalinter](https://github.com/alecthomas/gometalinter) :warning: :floppy_disk:
|
|
||||||
* [gopls](https://github.com/golang/go/wiki/gopls)
|
* [gopls](https://github.com/golang/go/wiki/gopls)
|
||||||
* [gosimple](https://github.com/dominikh/go-tools/tree/master/cmd/gosimple) :warning: :floppy_disk:
|
* [gosimple](https://github.com/dominikh/go-tools/tree/master/cmd/gosimple) :warning: :floppy_disk:
|
||||||
* [gotype](https://godoc.org/golang.org/x/tools/cmd/gotype) :warning: :floppy_disk:
|
* [gotype](https://godoc.org/golang.org/x/tools/cmd/gotype) :warning: :floppy_disk:
|
||||||
|
@ -373,6 +373,7 @@ formatting.
|
||||||
* [cspell](https://github.com/streetsidesoftware/cspell/tree/main/packages/cspell)
|
* [cspell](https://github.com/streetsidesoftware/cspell/tree/main/packages/cspell)
|
||||||
* [languagetool](https://languagetool.org/) :floppy_disk:
|
* [languagetool](https://languagetool.org/) :floppy_disk:
|
||||||
* [markdownlint](https://github.com/DavidAnson/markdownlint) :floppy_disk:
|
* [markdownlint](https://github.com/DavidAnson/markdownlint) :floppy_disk:
|
||||||
|
* [marksman](https://github.com/artempyanykh/marksman)
|
||||||
* [mdl](https://github.com/mivok/markdownlint)
|
* [mdl](https://github.com/mivok/markdownlint)
|
||||||
* [pandoc](https://pandoc.org)
|
* [pandoc](https://pandoc.org)
|
||||||
* [prettier](https://github.com/prettier/prettier)
|
* [prettier](https://github.com/prettier/prettier)
|
||||||
|
@ -707,6 +708,7 @@ formatting.
|
||||||
* [swaglint](https://github.com/byCedric/swaglint) :warning:
|
* [swaglint](https://github.com/byCedric/swaglint) :warning:
|
||||||
* [yaml-language-server](https://github.com/redhat-developer/yaml-language-server)
|
* [yaml-language-server](https://github.com/redhat-developer/yaml-language-server)
|
||||||
* [yamlfix](https://lyz-code.github.io/yamlfix)
|
* [yamlfix](https://lyz-code.github.io/yamlfix)
|
||||||
|
* [yamlfmt](https://github.com/google/yamlfmt)
|
||||||
* [yamllint](https://yamllint.readthedocs.io/)
|
* [yamllint](https://yamllint.readthedocs.io/)
|
||||||
* YANG
|
* YANG
|
||||||
* [yang-lsp](https://github.com/theia-ide/yang-lsp)
|
* [yang-lsp](https://github.com/theia-ide/yang-lsp)
|
||||||
|
|
|
@ -116,10 +116,14 @@ fu! ctrlp#tag#accept(mode, str)
|
||||||
if cmd != ''
|
if cmd != ''
|
||||||
exe cmd
|
exe cmd
|
||||||
en
|
en
|
||||||
let save_cst = &cst
|
if exists('&cst')
|
||||||
set cst&
|
let save_cst = &cst
|
||||||
|
set cst&
|
||||||
|
en
|
||||||
cal feedkeys(":".( utg ? fdcnt[2] : "" )."ta ".tg."\r", 'nt')
|
cal feedkeys(":".( utg ? fdcnt[2] : "" )."ta ".tg."\r", 'nt')
|
||||||
let &cst = save_cst
|
if exists('&cst')
|
||||||
|
let &cst = save_cst
|
||||||
|
en
|
||||||
el
|
el
|
||||||
let ext = ""
|
let ext = ""
|
||||||
if fdcnt[1] < 2 && fdcnt[2]
|
if fdcnt[1] < 2 && fdcnt[2]
|
||||||
|
|
|
@ -91,23 +91,24 @@ let s:initialized = 0
|
||||||
" }}}1
|
" }}}1
|
||||||
|
|
||||||
" shellslash handling {{{1
|
" shellslash handling {{{1
|
||||||
function! s:DisableShellSlash() " {{{2
|
function! s:DisableShellSlash(bufnr) " {{{2
|
||||||
" disable shellslash for proper escaping of Windows paths
|
" disable shellslash for proper escaping of Windows paths
|
||||||
|
|
||||||
" In Windows, 'shellslash' also changes the behavior of 'shellescape'.
|
" In Windows, 'shellslash' also changes the behavior of 'shellescape'.
|
||||||
" It makes 'shellescape' behave like in UNIX environment. So ':setl
|
" It makes 'shellescape' behave like in UNIX environment. So ':setl
|
||||||
" noshellslash' before evaluating 'shellescape' and restore the
|
" noshellslash' before evaluating 'shellescape' and restore the
|
||||||
" settings afterwards when 'shell' does not contain 'sh' somewhere.
|
" settings afterwards when 'shell' does not contain 'sh' somewhere.
|
||||||
if has('win32') && empty(matchstr(&shell, 'sh'))
|
let l:shell = getbufvar(a:bufnr, '&shell')
|
||||||
let s:old_shellslash = &l:shellslash
|
if has('win32') && empty(matchstr(l:shell, 'sh'))
|
||||||
setlocal noshellslash
|
let s:old_shellslash = getbufvar(a:bufnr, '&shellslash')
|
||||||
|
setbufvar(a:bufnr, '&shellslash', 0)
|
||||||
endif
|
endif
|
||||||
endfunction " }}}2
|
endfunction " }}}2
|
||||||
|
|
||||||
function! s:ResetShellSlash() " {{{2
|
function! s:ResetShellSlash(bufnr) " {{{2
|
||||||
" reset shellslash to the user-set value, if any
|
" reset shellslash to the user-set value, if any
|
||||||
if exists('s:old_shellslash')
|
if exists('s:old_shellslash')
|
||||||
let &l:shellslash = s:old_shellslash
|
setbufvar(a:bufnr, '&shellslash', s:old_shellslash)
|
||||||
unlet! s:old_shellslash
|
unlet! s:old_shellslash
|
||||||
endif
|
endif
|
||||||
endfunction " }}}2
|
endfunction " }}}2
|
||||||
|
@ -204,9 +205,20 @@ function! s:GetFilenames(path, filename) " {{{1
|
||||||
return l:path_list
|
return l:path_list
|
||||||
endfunction " }}}1
|
endfunction " }}}1
|
||||||
|
|
||||||
function! s:UseConfigFiles() abort " Apply config to the current buffer {{{1
|
function! s:UseConfigFiles(from_autocmd) abort " Apply config to the current buffer {{{1
|
||||||
let b:editorconfig_tried = 1
|
" from_autocmd is truthy if called from an autocmd, falsy otherwise.
|
||||||
let l:buffer_name = expand('%:p')
|
|
||||||
|
" Get the properties of the buffer we are working on
|
||||||
|
if a:from_autocmd
|
||||||
|
let l:bufnr = str2nr(expand('<abuf>'))
|
||||||
|
let l:buffer_name = expand('<afile>:p')
|
||||||
|
let l:buffer_path = expand('<afile>:p:h')
|
||||||
|
else
|
||||||
|
let l:bufnr = bufnr('%')
|
||||||
|
let l:buffer_name = expand('%:p')
|
||||||
|
let l:buffer_path = expand('%:p:h')
|
||||||
|
endif
|
||||||
|
call setbufvar(l:bufnr, 'editorconfig_tried', 1)
|
||||||
|
|
||||||
" Only process normal buffers (do not treat help files as '.txt' files)
|
" Only process normal buffers (do not treat help files as '.txt' files)
|
||||||
" When starting Vim with a directory, the buftype might not yet be set:
|
" When starting Vim with a directory, the buftype might not yet be set:
|
||||||
|
@ -219,19 +231,33 @@ function! s:UseConfigFiles() abort " Apply config to the current buffer {{{1
|
||||||
if g:EditorConfig_enable_for_new_buf
|
if g:EditorConfig_enable_for_new_buf
|
||||||
let l:buffer_name = getcwd() . "/."
|
let l:buffer_name = getcwd() . "/."
|
||||||
else
|
else
|
||||||
|
if g:EditorConfig_verbose
|
||||||
|
echo 'Skipping EditorConfig for unnamed buffer'
|
||||||
|
endif
|
||||||
return
|
return
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if exists("b:EditorConfig_disable") && b:EditorConfig_disable
|
if getbufvar(l:bufnr, 'EditorConfig_disable', 0)
|
||||||
if g:EditorConfig_verbose
|
if g:EditorConfig_verbose
|
||||||
echo 'Skipping EditorConfig for buffer "' . l:buffer_name . '"'
|
echo 'EditorConfig disabled --- skipping buffer "' . l:buffer_name . '"'
|
||||||
endif
|
endif
|
||||||
return
|
return
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
" Ignore specific patterns
|
||||||
|
for pattern in g:EditorConfig_exclude_patterns
|
||||||
|
if l:buffer_name =~ pattern
|
||||||
|
if g:EditorConfig_verbose
|
||||||
|
echo 'Skipping EditorConfig for buffer "' . l:buffer_name .
|
||||||
|
\ '" based on pattern "' . pattern . '"'
|
||||||
|
endif
|
||||||
|
return
|
||||||
|
endif
|
||||||
|
endfor
|
||||||
|
|
||||||
" Check if any .editorconfig does exist
|
" Check if any .editorconfig does exist
|
||||||
let l:conf_files = s:GetFilenames(expand('%:p:h'), '.editorconfig')
|
let l:conf_files = s:GetFilenames(l:buffer_path, '.editorconfig')
|
||||||
let l:conf_found = 0
|
let l:conf_found = 0
|
||||||
for conf_file in conf_files
|
for conf_file in conf_files
|
||||||
if filereadable(conf_file)
|
if filereadable(conf_file)
|
||||||
|
@ -254,20 +280,13 @@ function! s:UseConfigFiles() abort " Apply config to the current buffer {{{1
|
||||||
\ ' on file "' . l:buffer_name . '"'
|
\ ' on file "' . l:buffer_name . '"'
|
||||||
endif
|
endif
|
||||||
|
|
||||||
" Ignore specific patterns
|
|
||||||
for pattern in g:EditorConfig_exclude_patterns
|
|
||||||
if l:buffer_name =~ pattern
|
|
||||||
return
|
|
||||||
endif
|
|
||||||
endfor
|
|
||||||
|
|
||||||
if s:editorconfig_core_mode ==? 'vim_core'
|
if s:editorconfig_core_mode ==? 'vim_core'
|
||||||
if s:UseConfigFiles_VimCore(l:buffer_name) == 0
|
if s:UseConfigFiles_VimCore(l:bufnr, l:buffer_name) == 0
|
||||||
let b:editorconfig_applied = 1
|
call setbufvar(l:bufnr, 'editorconfig_applied', 1)
|
||||||
endif
|
endif
|
||||||
elseif s:editorconfig_core_mode ==? 'external_command'
|
elseif s:editorconfig_core_mode ==? 'external_command'
|
||||||
call s:UseConfigFiles_ExternalCommand(l:buffer_name)
|
call s:UseConfigFiles_ExternalCommand(l:bufnr, l:buffer_name)
|
||||||
let b:editorconfig_applied = 1
|
call setbufvar(l:bufnr, 'editorconfig_applied', 1)
|
||||||
else
|
else
|
||||||
echohl Error |
|
echohl Error |
|
||||||
\ echo "Unknown EditorConfig Core: " .
|
\ echo "Unknown EditorConfig Core: " .
|
||||||
|
@ -283,8 +302,8 @@ function! s:EditorConfigEnable(should_enable)
|
||||||
augroup editorconfig
|
augroup editorconfig
|
||||||
autocmd!
|
autocmd!
|
||||||
if a:should_enable
|
if a:should_enable
|
||||||
autocmd BufNewFile,BufReadPost,BufFilePost * call s:UseConfigFiles()
|
autocmd BufNewFile,BufReadPost,BufFilePost * call s:UseConfigFiles(1)
|
||||||
autocmd VimEnter,BufNew * call s:UseConfigFiles()
|
autocmd VimEnter,BufNew * call s:UseConfigFiles(1)
|
||||||
endif
|
endif
|
||||||
augroup END
|
augroup END
|
||||||
endfunction
|
endfunction
|
||||||
|
@ -295,7 +314,7 @@ endfunction
|
||||||
command! EditorConfigEnable call s:EditorConfigEnable(1)
|
command! EditorConfigEnable call s:EditorConfigEnable(1)
|
||||||
command! EditorConfigDisable call s:EditorConfigEnable(0)
|
command! EditorConfigDisable call s:EditorConfigEnable(0)
|
||||||
|
|
||||||
command! EditorConfigReload call s:UseConfigFiles() " Reload EditorConfig files
|
command! EditorConfigReload call s:UseConfigFiles(0) " Reload EditorConfig files
|
||||||
" }}}2
|
" }}}2
|
||||||
|
|
||||||
" On startup, enable the autocommands
|
" On startup, enable the autocommands
|
||||||
|
@ -305,29 +324,29 @@ call s:EditorConfigEnable(1)
|
||||||
|
|
||||||
" UseConfigFiles function for different modes {{{1
|
" UseConfigFiles function for different modes {{{1
|
||||||
|
|
||||||
function! s:UseConfigFiles_VimCore(target)
|
function! s:UseConfigFiles_VimCore(bufnr, target)
|
||||||
" Use the vimscript EditorConfig core
|
" Use the vimscript EditorConfig core
|
||||||
try
|
try
|
||||||
let l:config = editorconfig_core#handler#get_configurations(
|
let l:config = editorconfig_core#handler#get_configurations(
|
||||||
\ { 'target': a:target } )
|
\ { 'target': a:target } )
|
||||||
call s:ApplyConfig(l:config)
|
call s:ApplyConfig(a:bufnr, l:config)
|
||||||
return 0 " success
|
return 0 " success
|
||||||
catch
|
catch
|
||||||
return 1 " failure
|
return 1 " failure
|
||||||
endtry
|
endtry
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! s:UseConfigFiles_ExternalCommand(target)
|
function! s:UseConfigFiles_ExternalCommand(bufnr, target)
|
||||||
" Use external EditorConfig core (e.g., the C core)
|
" Use external EditorConfig core (e.g., the C core)
|
||||||
|
|
||||||
call s:DisableShellSlash()
|
call s:DisableShellSlash(a:bufnr)
|
||||||
let l:exec_path = shellescape(s:editorconfig_exec_path)
|
let l:exec_path = shellescape(s:editorconfig_exec_path)
|
||||||
call s:ResetShellSlash()
|
call s:ResetShellSlash(a:bufnr)
|
||||||
|
|
||||||
call s:SpawnExternalParser(l:exec_path, a:target)
|
call s:SpawnExternalParser(a:bufnr, l:exec_path, a:target)
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! s:SpawnExternalParser(cmd, target) " {{{2
|
function! s:SpawnExternalParser(bufnr, cmd, target) " {{{2
|
||||||
" Spawn external EditorConfig. Used by s:UseConfigFiles_ExternalCommand()
|
" Spawn external EditorConfig. Used by s:UseConfigFiles_ExternalCommand()
|
||||||
|
|
||||||
let l:cmd = a:cmd
|
let l:cmd = a:cmd
|
||||||
|
@ -338,9 +357,9 @@ function! s:SpawnExternalParser(cmd, target) " {{{2
|
||||||
|
|
||||||
let l:config = {}
|
let l:config = {}
|
||||||
|
|
||||||
call s:DisableShellSlash()
|
call s:DisableShellSlash(a:bufnr)
|
||||||
let l:cmd = l:cmd . ' ' . shellescape(a:target)
|
let l:cmd = l:cmd . ' ' . shellescape(a:target)
|
||||||
call s:ResetShellSlash()
|
call s:ResetShellSlash(a:bufnr)
|
||||||
|
|
||||||
let l:parsing_result = split(system(l:cmd), '\v[\r\n]+')
|
let l:parsing_result = split(system(l:cmd), '\v[\r\n]+')
|
||||||
|
|
||||||
|
@ -379,26 +398,68 @@ function! s:SpawnExternalParser(cmd, target) " {{{2
|
||||||
let l:config[l:eq_left] = l:eq_right
|
let l:config[l:eq_left] = l:eq_right
|
||||||
endfor
|
endfor
|
||||||
|
|
||||||
call s:ApplyConfig(l:config)
|
call s:ApplyConfig(a:bufnr, l:config)
|
||||||
endfunction " }}}2
|
endfunction " }}}2
|
||||||
|
|
||||||
" }}}1
|
" }}}1
|
||||||
|
|
||||||
function! s:ApplyConfig(config) abort " Set the buffer options {{{1
|
" Set the buffer options {{{1
|
||||||
|
function! s:SetCharset(bufnr, charset) abort " apply config['charset']
|
||||||
|
|
||||||
|
" Remember the buffer's state so we can set `nomodifed` at the end
|
||||||
|
" if appropriate.
|
||||||
|
let l:orig_fenc = getbufvar(a:bufnr, "&fileencoding")
|
||||||
|
let l:orig_enc = getbufvar(a:bufnr, "&encoding")
|
||||||
|
let l:orig_modified = getbufvar(a:bufnr, "&modified")
|
||||||
|
|
||||||
|
if a:charset == "utf-8"
|
||||||
|
call setbufvar(a:bufnr, '&fileencoding', 'utf-8')
|
||||||
|
call setbufvar(a:bufnr, '&bomb', 0)
|
||||||
|
elseif a:charset == "utf-8-bom"
|
||||||
|
call setbufvar(a:bufnr, '&fileencoding', 'utf-8')
|
||||||
|
call setbufvar(a:bufnr, '&bomb', 1)
|
||||||
|
elseif a:charset == "latin1"
|
||||||
|
call setbufvar(a:bufnr, '&fileencoding', 'latin1')
|
||||||
|
call setbufvar(a:bufnr, '&bomb', 0)
|
||||||
|
elseif a:charset == "utf-16be"
|
||||||
|
call setbufvar(a:bufnr, '&fileencoding', 'utf-16be')
|
||||||
|
call setbufvar(a:bufnr, '&bomb', 1)
|
||||||
|
elseif a:charset == "utf-16le"
|
||||||
|
call setbufvar(a:bufnr, '&fileencoding', 'utf-16le')
|
||||||
|
call setbufvar(a:bufnr, '&bomb', 1)
|
||||||
|
endif
|
||||||
|
|
||||||
|
let l:new_fenc = getbufvar(a:bufnr, "&fileencoding")
|
||||||
|
|
||||||
|
" If all we did was change the fileencoding from the default to a copy
|
||||||
|
" of the default, we didn't actually modify the file.
|
||||||
|
if !l:orig_modified && (l:orig_fenc ==# '') && (l:new_fenc ==# l:orig_enc)
|
||||||
|
if g:EditorConfig_verbose
|
||||||
|
echo 'Setting nomodified on buffer ' . a:bufnr
|
||||||
|
endif
|
||||||
|
call setbufvar(a:bufnr, '&modified', 0)
|
||||||
|
endif
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! s:ApplyConfig(bufnr, config) abort
|
||||||
if g:EditorConfig_verbose
|
if g:EditorConfig_verbose
|
||||||
echo 'Options: ' . string(a:config)
|
echo 'Options: ' . string(a:config)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if s:IsRuleActive('indent_style', a:config)
|
if s:IsRuleActive('indent_style', a:config)
|
||||||
if a:config["indent_style"] == "tab"
|
if a:config["indent_style"] == "tab"
|
||||||
setl noexpandtab
|
call setbufvar(a:bufnr, '&expandtab', 0)
|
||||||
elseif a:config["indent_style"] == "space"
|
elseif a:config["indent_style"] == "space"
|
||||||
setl expandtab
|
call setbufvar(a:bufnr, '&expandtab', 1)
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if s:IsRuleActive('tab_width', a:config)
|
if s:IsRuleActive('tab_width', a:config)
|
||||||
let &l:tabstop = str2nr(a:config["tab_width"])
|
let l:tabstop = str2nr(a:config["tab_width"])
|
||||||
|
call setbufvar(a:bufnr, '&tabstop', l:tabstop)
|
||||||
|
else
|
||||||
|
" Grab the current ts so we can use it below
|
||||||
|
let l:tabstop = getbufvar(a:bufnr, '&tabstop')
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if s:IsRuleActive('indent_size', a:config)
|
if s:IsRuleActive('indent_size', a:config)
|
||||||
|
@ -406,18 +467,20 @@ function! s:ApplyConfig(config) abort " Set the buffer options {{{1
|
||||||
" if indent_size is a positive integer, set shiftwidth to the integer
|
" if indent_size is a positive integer, set shiftwidth to the integer
|
||||||
" value
|
" value
|
||||||
if a:config["indent_size"] == "tab"
|
if a:config["indent_size"] == "tab"
|
||||||
let &l:shiftwidth = &l:tabstop
|
call setbufvar(a:bufnr, '&shiftwidth', l:tabstop)
|
||||||
if type(g:EditorConfig_softtabstop_tab) != type([])
|
if type(g:EditorConfig_softtabstop_tab) != type([])
|
||||||
let &l:softtabstop = g:EditorConfig_softtabstop_tab > 0 ?
|
call setbufvar(a:bufnr, '&softtabstop',
|
||||||
\ &l:shiftwidth : g:EditorConfig_softtabstop_tab
|
\ g:EditorConfig_softtabstop_tab > 0 ?
|
||||||
|
\ l:tabstop : g:EditorConfig_softtabstop_tab)
|
||||||
endif
|
endif
|
||||||
else
|
else
|
||||||
let l:indent_size = str2nr(a:config["indent_size"])
|
let l:indent_size = str2nr(a:config["indent_size"])
|
||||||
if l:indent_size > 0
|
if l:indent_size > 0
|
||||||
let &l:shiftwidth = l:indent_size
|
call setbufvar(a:bufnr, '&shiftwidth', l:indent_size)
|
||||||
if type(g:EditorConfig_softtabstop_space) != type([])
|
if type(g:EditorConfig_softtabstop_space) != type([])
|
||||||
let &l:softtabstop = g:EditorConfig_softtabstop_space > 0 ?
|
call setbufvar(a:bufnr, '&softtabstop',
|
||||||
\ &l:shiftwidth : g:EditorConfig_softtabstop_space
|
\ g:EditorConfig_softtabstop_space > 0 ?
|
||||||
|
\ l:indent_size : g:EditorConfig_softtabstop_space)
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
@ -425,50 +488,35 @@ function! s:ApplyConfig(config) abort " Set the buffer options {{{1
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if s:IsRuleActive('end_of_line', a:config) &&
|
if s:IsRuleActive('end_of_line', a:config) &&
|
||||||
\ &l:modifiable
|
\ getbufvar(a:bufnr, '&modifiable')
|
||||||
if a:config["end_of_line"] == "lf"
|
if a:config["end_of_line"] == "lf"
|
||||||
setl fileformat=unix
|
call setbufvar(a:bufnr, '&fileformat', 'unix')
|
||||||
elseif a:config["end_of_line"] == "crlf"
|
elseif a:config["end_of_line"] == "crlf"
|
||||||
setl fileformat=dos
|
call setbufvar(a:bufnr, '&fileformat', 'dos')
|
||||||
elseif a:config["end_of_line"] == "cr"
|
elseif a:config["end_of_line"] == "cr"
|
||||||
setl fileformat=mac
|
call setbufvar(a:bufnr, '&fileformat', 'mac')
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if s:IsRuleActive('charset', a:config) &&
|
if s:IsRuleActive('charset', a:config) &&
|
||||||
\ &l:modifiable
|
\ getbufvar(a:bufnr, '&modifiable')
|
||||||
if a:config["charset"] == "utf-8"
|
call s:SetCharset(a:bufnr, a:config["charset"])
|
||||||
setl fileencoding=utf-8
|
|
||||||
setl nobomb
|
|
||||||
elseif a:config["charset"] == "utf-8-bom"
|
|
||||||
setl fileencoding=utf-8
|
|
||||||
setl bomb
|
|
||||||
elseif a:config["charset"] == "latin1"
|
|
||||||
setl fileencoding=latin1
|
|
||||||
setl nobomb
|
|
||||||
elseif a:config["charset"] == "utf-16be"
|
|
||||||
setl fileencoding=utf-16be
|
|
||||||
setl bomb
|
|
||||||
elseif a:config["charset"] == "utf-16le"
|
|
||||||
setl fileencoding=utf-16le
|
|
||||||
setl bomb
|
|
||||||
endif
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
augroup editorconfig_trim_trailing_whitespace
|
augroup editorconfig_trim_trailing_whitespace
|
||||||
autocmd! BufWritePre <buffer>
|
autocmd! BufWritePre <buffer>
|
||||||
if s:IsRuleActive('trim_trailing_whitespace', a:config) &&
|
if s:IsRuleActive('trim_trailing_whitespace', a:config) &&
|
||||||
\ get(a:config, 'trim_trailing_whitespace', 'false') ==# 'true'
|
\ get(a:config, 'trim_trailing_whitespace', 'false') ==# 'true'
|
||||||
autocmd BufWritePre <buffer> call s:TrimTrailingWhitespace()
|
execute 'autocmd BufWritePre <buffer=' . a:bufnr . '> call s:TrimTrailingWhitespace()'
|
||||||
endif
|
endif
|
||||||
augroup END
|
augroup END
|
||||||
|
|
||||||
if s:IsRuleActive('insert_final_newline', a:config)
|
if s:IsRuleActive('insert_final_newline', a:config)
|
||||||
if exists('+fixendofline')
|
if exists('+fixendofline')
|
||||||
if a:config["insert_final_newline"] == "false"
|
if a:config["insert_final_newline"] == "false"
|
||||||
setl nofixendofline
|
call setbufvar(a:bufnr, '&fixendofline', 0)
|
||||||
else
|
else
|
||||||
setl fixendofline
|
call setbufvar(a:bufnr, '&fixendofline', 1)
|
||||||
endif
|
endif
|
||||||
elseif exists(':SetNoEOL') == 2
|
elseif exists(':SetNoEOL') == 2
|
||||||
if a:config["insert_final_newline"] == "false"
|
if a:config["insert_final_newline"] == "false"
|
||||||
|
@ -483,23 +531,39 @@ function! s:ApplyConfig(config) abort " Set the buffer options {{{1
|
||||||
let l:max_line_length = str2nr(a:config['max_line_length'])
|
let l:max_line_length = str2nr(a:config['max_line_length'])
|
||||||
|
|
||||||
if l:max_line_length >= 0
|
if l:max_line_length >= 0
|
||||||
let &l:textwidth = l:max_line_length
|
call setbufvar(a:bufnr, '&textwidth', l:max_line_length)
|
||||||
if g:EditorConfig_preserve_formatoptions == 0
|
if g:EditorConfig_preserve_formatoptions == 0
|
||||||
setlocal formatoptions+=tc
|
" setlocal formatoptions+=tc
|
||||||
|
let l:fo = getbufvar(a:bufnr, '&formatoptions')
|
||||||
|
if l:fo !~# 't'
|
||||||
|
let l:fo .= 't'
|
||||||
|
endif
|
||||||
|
if l:fo !~# 'c'
|
||||||
|
let l:fo .= 'c'
|
||||||
|
endif
|
||||||
|
call setbufvar(a:bufnr, '&formatoptions', l:fo)
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if exists('+colorcolumn')
|
if exists('+colorcolumn')
|
||||||
if l:max_line_length > 0
|
if l:max_line_length > 0
|
||||||
if g:EditorConfig_max_line_indicator == 'line'
|
if g:EditorConfig_max_line_indicator == 'line'
|
||||||
setlocal colorcolumn+=+1
|
" setlocal colorcolumn+=+1
|
||||||
|
let l:cocol = getbufvar(a:bufnr, '&colorcolumn')
|
||||||
|
if !empty(l:cocol)
|
||||||
|
let l:cocol .= ','
|
||||||
|
endif
|
||||||
|
let l:cocol .= '+1'
|
||||||
|
call setbufvar(a:bufnr, '&colorcolumn', l:cocol)
|
||||||
elseif g:EditorConfig_max_line_indicator == 'fill' &&
|
elseif g:EditorConfig_max_line_indicator == 'fill' &&
|
||||||
\ l:max_line_length < &l:columns
|
\ l:max_line_length < getbufvar(a:bufnr, '&columns')
|
||||||
" Fill only if the columns of screen is large enough
|
" Fill only if the columns of screen is large enough
|
||||||
let &l:colorcolumn = join(
|
call setbufvar(a:bufnr, '&colorcolumn',
|
||||||
\ range(l:max_line_length+1,&l:columns),',')
|
\ join(range(l:max_line_length+1,
|
||||||
|
\ getbufvar(a:bufnr, '&columns')),
|
||||||
|
\ ','))
|
||||||
elseif g:EditorConfig_max_line_indicator == 'exceeding'
|
elseif g:EditorConfig_max_line_indicator == 'exceeding'
|
||||||
let &l:colorcolumn = ''
|
call setbufvar(a:bufnr, '&colorcolumn', '')
|
||||||
for l:match in getmatches()
|
for l:match in getmatches()
|
||||||
if get(l:match, 'group', '') == 'ColorColumn'
|
if get(l:match, 'group', '') == 'ColorColumn'
|
||||||
call matchdelete(get(l:match, 'id'))
|
call matchdelete(get(l:match, 'id'))
|
||||||
|
@ -527,7 +591,8 @@ endfunction
|
||||||
" }}}1
|
" }}}1
|
||||||
|
|
||||||
function! s:TrimTrailingWhitespace() " {{{1
|
function! s:TrimTrailingWhitespace() " {{{1
|
||||||
if &l:modifiable
|
" Called from within a buffer-specific autocmd, so we can use '%'
|
||||||
|
if getbufvar('%', '&modifiable')
|
||||||
" don't lose user position when trimming trailing whitespace
|
" don't lose user position when trimming trailing whitespace
|
||||||
let s:view = winsaveview()
|
let s:view = winsaveview()
|
||||||
try
|
try
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
<!--p align="center"><img src="http://svgur.com/i/3Dp.svg"></p-->
|
<p align="center"><img src="https://morhetz.com/gruvbox.svg"></p>
|
||||||
|
|
||||||
gruvbox is heavily inspired by [badwolf][], [jellybeans][] and [solarized][].
|
gruvbox is heavily inspired by [badwolf][], [jellybeans][] and [solarized][].
|
||||||
|
|
||||||
|
|
|
@ -2884,6 +2884,24 @@ function! fugitive#BufReadStatus(...) abort
|
||||||
endfor
|
endfor
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
let sequencing = []
|
||||||
|
if filereadable(fugitive#Find('.git/sequencer/todo'))
|
||||||
|
for line in reverse(readfile(fugitive#Find('.git/sequencer/todo')))
|
||||||
|
let match = matchlist(line, '^\(\l\+\)\s\+\(\x\{4,\}\)\s\+\(.*\)')
|
||||||
|
if len(match) && match[1] !~# 'exec\|merge\|label'
|
||||||
|
call add(sequencing, {'type': 'Rebase', 'status': get(s:rebase_abbrevs, match[1], match[1]), 'commit': match[2], 'subject': match[3]})
|
||||||
|
endif
|
||||||
|
endfor
|
||||||
|
elseif filereadable(fugitive#Find('.git/MERGE_MSG'))
|
||||||
|
if filereadable(fugitive#Find('.git/CHERRY_PICK_HEAD'))
|
||||||
|
let pick_head = fugitive#Execute(['rev-parse', '--short', 'CHERRY_PICK_HEAD', '--']).stdout[0]
|
||||||
|
call add(sequencing, {'type': 'Rebase', 'status': 'pick', 'commit': pick_head, 'subject': get(readfile(fugitive#Find('.git/MERGE_MSG')), 0, '')})
|
||||||
|
elseif filereadable(fugitive#Find('.git/REVERT_HEAD'))
|
||||||
|
let pick_head = fugitive#Execute(['rev-parse', '--short', 'REVERT_HEAD', '--']).stdout[0]
|
||||||
|
call add(sequencing, {'type': 'Rebase', 'status': 'revert', 'commit': pick_head, 'subject': get(readfile(fugitive#Find('.git/MERGE_MSG')), 0, '')})
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
|
||||||
let b:fugitive_diff = diff
|
let b:fugitive_diff = diff
|
||||||
if get(a:, 1, v:cmdbang)
|
if get(a:, 1, v:cmdbang)
|
||||||
unlet! b:fugitive_expanded
|
unlet! b:fugitive_expanded
|
||||||
|
@ -2910,6 +2928,7 @@ function! fugitive#BufReadStatus(...) abort
|
||||||
endif
|
endif
|
||||||
|
|
||||||
call s:AddSection('Rebasing ' . rebasing_head, rebasing)
|
call s:AddSection('Rebasing ' . rebasing_head, rebasing)
|
||||||
|
call s:AddSection(get(get(sequencing, 0, {}), 'status', '') ==# 'revert' ? 'Reverting' : 'Cherry Picking', sequencing)
|
||||||
call s:AddSection('Untracked', untracked)
|
call s:AddSection('Untracked', untracked)
|
||||||
call s:AddSection('Unstaged', unstaged)
|
call s:AddSection('Unstaged', unstaged)
|
||||||
let unstaged_end = len(unstaged) ? line('$') : 0
|
let unstaged_end = len(unstaged) ? line('$') : 0
|
||||||
|
|
|
@ -248,7 +248,9 @@ function! s:hunk_op(op, ...)
|
||||||
|
|
||||||
let hunk_diff = join(hunk_header + hunk_body, "\n")."\n"
|
let hunk_diff = join(hunk_header + hunk_body, "\n")."\n"
|
||||||
|
|
||||||
call s:goto_original_window()
|
if &previewwindow
|
||||||
|
call s:goto_original_window()
|
||||||
|
endif
|
||||||
call gitgutter#hunk#close_hunk_preview_window()
|
call gitgutter#hunk#close_hunk_preview_window()
|
||||||
call s:stage(hunk_diff)
|
call s:stage(hunk_diff)
|
||||||
endif
|
endif
|
||||||
|
@ -460,18 +462,16 @@ function! s:open_hunk_preview_window()
|
||||||
call nvim_buf_set_option(buf, 'swapfile', v:false)
|
call nvim_buf_set_option(buf, 'swapfile', v:false)
|
||||||
call nvim_buf_set_name(buf, 'gitgutter://hunk-preview')
|
call nvim_buf_set_name(buf, 'gitgutter://hunk-preview')
|
||||||
|
|
||||||
|
if g:gitgutter_close_preview_on_escape
|
||||||
|
let winnr = nvim_win_get_number(s:winid)
|
||||||
|
execute winnr.'wincmd w'
|
||||||
|
nnoremap <buffer> <silent> <Esc> :<C-U>call gitgutter#hunk#close_hunk_preview_window()<CR>
|
||||||
|
wincmd w
|
||||||
|
endif
|
||||||
|
|
||||||
" Assumes cursor is in original window.
|
" Assumes cursor is in original window.
|
||||||
autocmd CursorMoved,TabLeave <buffer> ++once call gitgutter#hunk#close_hunk_preview_window()
|
autocmd CursorMoved,TabLeave <buffer> ++once call gitgutter#hunk#close_hunk_preview_window()
|
||||||
|
|
||||||
if g:gitgutter_close_preview_on_escape
|
|
||||||
" Map <Esc> to close the floating preview.
|
|
||||||
nnoremap <buffer> <silent> <Esc> :<C-U>call gitgutter#hunk#close_hunk_preview_window()<CR>
|
|
||||||
" Ensure that when the preview window is closed, the map is removed.
|
|
||||||
autocmd User GitGutterPreviewClosed silent! nunmap <buffer> <Esc>
|
|
||||||
autocmd CursorMoved <buffer> ++once silent! nunmap <buffer> <Esc>
|
|
||||||
execute "autocmd WinClosed <buffer=".winbufnr(s:winid)."> doautocmd" s:nomodeline "User GitGutterPreviewClosed"
|
|
||||||
endif
|
|
||||||
|
|
||||||
return
|
return
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
|
|
@ -19,7 +19,8 @@ function! gitgutter#utility#setbufvar(buffer, varname, val)
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! gitgutter#utility#getbufvar(buffer, varname, ...)
|
function! gitgutter#utility#getbufvar(buffer, varname, ...)
|
||||||
let ggvars = getbufvar(a:buffer, 'gitgutter')
|
let buffer = +a:buffer
|
||||||
|
let ggvars = getbufvar(buffer, 'gitgutter')
|
||||||
if type(ggvars) == type({}) && has_key(ggvars, a:varname)
|
if type(ggvars) == type({}) && has_key(ggvars, a:varname)
|
||||||
return ggvars[a:varname]
|
return ggvars[a:varname]
|
||||||
endif
|
endif
|
||||||
|
|
|
@ -265,6 +265,35 @@ function! s:next_tick(cmd)
|
||||||
call timer_start(1, {-> execute(a:cmd)})
|
call timer_start(1, {-> execute(a:cmd)})
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
function! s:on_buffilepre(bufnr)
|
||||||
|
if !exists('s:renaming')
|
||||||
|
let s:renaming = []
|
||||||
|
let s:gitgutter_was_enabled = gitgutter#utility#getbufvar(a:bufnr, 'enabled')
|
||||||
|
endif
|
||||||
|
|
||||||
|
let s:renaming += [a:bufnr]
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! s:on_buffilepost(bufnr)
|
||||||
|
if len(s:renaming) > 1
|
||||||
|
if s:renaming[0] != a:bufnr
|
||||||
|
throw 'gitgutter rename error' s:renaming[0] a:bufnr
|
||||||
|
endif
|
||||||
|
unlet s:renaming[0]
|
||||||
|
return
|
||||||
|
endif
|
||||||
|
|
||||||
|
" reset cached values
|
||||||
|
GitGutterBufferDisable
|
||||||
|
|
||||||
|
if s:gitgutter_was_enabled
|
||||||
|
GitGutterBufferEnable
|
||||||
|
endif
|
||||||
|
|
||||||
|
unlet s:renaming
|
||||||
|
unlet s:gitgutter_was_enabled
|
||||||
|
endfunction
|
||||||
|
|
||||||
" Autocommands {{{
|
" Autocommands {{{
|
||||||
|
|
||||||
augroup gitgutter
|
augroup gitgutter
|
||||||
|
@ -309,8 +338,8 @@ augroup gitgutter
|
||||||
|
|
||||||
autocmd ColorScheme * call gitgutter#highlight#define_highlights()
|
autocmd ColorScheme * call gitgutter#highlight#define_highlights()
|
||||||
|
|
||||||
autocmd BufFilePre * let b:gitgutter_was_enabled = gitgutter#utility#getbufvar(expand('<abuf>'), 'enabled') | GitGutterBufferDisable
|
autocmd BufFilePre * call s:on_buffilepre(expand('<abuf>'))
|
||||||
autocmd BufFilePost * if b:gitgutter_was_enabled | GitGutterBufferEnable | endif | unlet b:gitgutter_was_enabled
|
autocmd BufFilePost * call s:on_buffilepost(expand('<abuf>'))
|
||||||
|
|
||||||
autocmd QuickFixCmdPre *vimgrep* let b:gitgutter_was_enabled = gitgutter#utility#getbufvar(expand('<abuf>'), 'enabled') | GitGutterBufferDisable
|
autocmd QuickFixCmdPre *vimgrep* let b:gitgutter_was_enabled = gitgutter#utility#getbufvar(expand('<abuf>'), 'enabled') | GitGutterBufferDisable
|
||||||
autocmd QuickFixCmdPost *vimgrep* if b:gitgutter_was_enabled | GitGutterBufferEnable | endif | unlet b:gitgutter_was_enabled
|
autocmd QuickFixCmdPost *vimgrep* if b:gitgutter_was_enabled | GitGutterBufferEnable | endif | unlet b:gitgutter_was_enabled
|
||||||
|
|
|
@ -251,6 +251,35 @@ function Test_filename_umlaut()
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
|
||||||
|
function Test_file_cmd()
|
||||||
|
normal ggo*
|
||||||
|
|
||||||
|
file other.txt
|
||||||
|
|
||||||
|
call s:trigger_gitgutter()
|
||||||
|
call assert_equal(1, b:gitgutter.enabled)
|
||||||
|
call assert_equal('', b:gitgutter.path)
|
||||||
|
call s:assert_signs([], 'other.txt')
|
||||||
|
|
||||||
|
write
|
||||||
|
|
||||||
|
call s:trigger_gitgutter()
|
||||||
|
call assert_equal(-2, b:gitgutter.path)
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
|
||||||
|
function Test_saveas()
|
||||||
|
normal ggo*
|
||||||
|
|
||||||
|
saveas other.txt
|
||||||
|
|
||||||
|
call s:trigger_gitgutter()
|
||||||
|
call assert_equal(1, b:gitgutter.enabled)
|
||||||
|
call assert_equal(-2, b:gitgutter.path)
|
||||||
|
call s:assert_signs([], 'other.txt')
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
|
||||||
" FIXME: this test fails when it is the first (or only) test to be run
|
" FIXME: this test fails when it is the first (or only) test to be run
|
||||||
function Test_follow_symlink()
|
function Test_follow_symlink()
|
||||||
let tmp = 'symlink'
|
let tmp = 'symlink'
|
||||||
|
|
|
@ -63,7 +63,6 @@ vim-indent-guides https://github.com/nathanaelkane/vim-indent-guides
|
||||||
mru.vim https://github.com/vim-scripts/mru.vim
|
mru.vim https://github.com/vim-scripts/mru.vim
|
||||||
editorconfig-vim https://github.com/editorconfig/editorconfig-vim
|
editorconfig-vim https://github.com/editorconfig/editorconfig-vim
|
||||||
dracula https://github.com/dracula/vim
|
dracula https://github.com/dracula/vim
|
||||||
co-pilot.vim https://github.com/github/copilot.vim
|
|
||||||
""".strip()
|
""".strip()
|
||||||
|
|
||||||
GITHUB_ZIP = "%s/archive/master.zip"
|
GITHUB_ZIP = "%s/archive/master.zip"
|
||||||
|
|
Loading…
Reference in a new issue