diff --git a/sources_non_forked/ale/ale_linters/cairo/starknet.vim b/sources_non_forked/ale/ale_linters/cairo/starknet.vim new file mode 100644 index 00000000..990bda6d --- /dev/null +++ b/sources_non_forked/ale/ale_linters/cairo/starknet.vim @@ -0,0 +1,37 @@ +" Author: 0xHyoga <0xHyoga@gmx.com> +" Description: Report starknet-compile errors in cairo code + +call ale#Set('cairo_starknet_executable', 'starknet-compile') +call ale#Set('cairo_starknet_options', '') + +function! ale_linters#cairo#starknet#Handle(buffer, lines) abort + " Error always on the first line + " e.g ex01.cairo:20:6: Could not find module 'contracts.utils.ex00_base'. Searched in the following paths: + let l:pattern = '\v\.cairo:(\d+):(\d+):+ (.*)' + let l:output = [] + + for l:match in ale#util#GetMatches(a:lines, l:pattern) + call add(l:output, { + \ 'lnum': str2nr(l:match[1]), + \ 'col': str2nr(l:match[2]), + \ 'type': 'E', + \ 'text': l:match[3], + \}) + endfor + + return l:output +endfunction + +function! ale_linters#cairo#starknet#GetCommand(buffer) abort + let l:executable = ale#Var(a:buffer, 'cairo_starknet_executable') + + return l:executable . ale#Pad(ale#Var(a:buffer, 'cairo_starknet_options')) . ' %s' +endfunction + +call ale#linter#Define('cairo', { +\ 'name': 'starknet', +\ 'executable': {b -> ale#Var(b, 'cairo_starknet_executable')}, +\ 'command': function('ale_linters#cairo#starknet#GetCommand'), +\ 'callback': 'ale_linters#cairo#starknet#Handle', +\ 'output_stream': 'stderr', +\}) diff --git a/sources_non_forked/ale/ale_linters/dart/dart_analyze.vim b/sources_non_forked/ale/ale_linters/dart/dart_analyze.vim index a00162d8..7d67c31c 100644 --- a/sources_non_forked/ale/ale_linters/dart/dart_analyze.vim +++ b/sources_non_forked/ale/ale_linters/dart/dart_analyze.vim @@ -4,15 +4,16 @@ call ale#Set('dart_analyze_executable', 'dart') function! ale_linters#dart#dart_analyze#Handle(buffer, lines) abort - let l:pattern = '\v^ ([a-z]+) - (.+):(\d+):(\d+) - (.+) - (.+)$' + let l:pattern = '\v([a-z]+) - (.+):(\d+):(\d+) - (.+) - (.+)$' let l:output = [] for l:match in ale#util#GetMatches(a:lines, l:pattern) + let [l:type, l:filename, l:lnum, l:col, l:message, l:code] = l:match[1:6] call add(l:output, { - \ 'type': l:match[1] is# 'error' ? 'E' : 'W', - \ 'text': l:match[6] . ': ' . l:match[5], - \ 'lnum': str2nr(l:match[3]), - \ 'col': str2nr(l:match[4]), + \ 'type': l:type is# 'error' ? 'E' : l:type is# 'info' ? 'I' : 'W', + \ 'text': l:code . ': ' . l:message, + \ 'lnum': str2nr(l:lnum), + \ 'col': str2nr(l:col), \}) endfor @@ -22,7 +23,7 @@ endfunction call ale#linter#Define('dart', { \ 'name': 'dart_analyze', \ 'executable': {b -> ale#Var(b, 'dart_analyze_executable')}, -\ 'command': '%e analyze %s', +\ 'command': '%e analyze --fatal-infos %s', \ 'callback': 'ale_linters#dart#dart_analyze#Handle', \ 'lint_file': 1, \}) diff --git a/sources_non_forked/ale/ale_linters/openscad/sca2d.vim b/sources_non_forked/ale/ale_linters/openscad/sca2d.vim new file mode 100644 index 00000000..60804a13 --- /dev/null +++ b/sources_non_forked/ale/ale_linters/openscad/sca2d.vim @@ -0,0 +1,24 @@ +" Description: SCA2D linter for OpenSCAD files + +call ale#Set('openscad_sca2d_executable', 'sca2d') +call ale#Set('openscad_sca2d_options', '') + +function! ale_linters#openscad#sca2d#GetExecutable(buffer) abort + return ale#Var(a:buffer, 'openscad_sca2d_executable') +endfunction + +function! ale_linters#openscad#sca2d#GetCommand(buffer) abort + let l:executable = ale_linters#openscad#sca2d#GetExecutable(a:buffer) + let l:options = ale#Var(a:buffer, 'openscad_sca2d_options') + + return ale#Escape(l:executable) . ale#Pad(l:options) . ' %s' +endfunction + +call ale#linter#Define('openscad', { +\ 'name': 'SCA2D', +\ 'aliases': ['sca2d'], +\ 'executable': function('ale_linters#openscad#sca2d#GetExecutable'), +\ 'command': function('ale_linters#openscad#sca2d#GetCommand'), +\ 'callback': 'ale#handlers#openscad#SCA2D_callback', +\ 'lint_file': 1, +\ }) diff --git a/sources_non_forked/ale/ale_linters/yaml/actionlint.vim b/sources_non_forked/ale/ale_linters/yaml/actionlint.vim index e51cf5f0..1e2fda49 100644 --- a/sources_non_forked/ale/ale_linters/yaml/actionlint.vim +++ b/sources_non_forked/ale/ale_linters/yaml/actionlint.vim @@ -1,6 +1,7 @@ " Author: bretello call ale#Set('yaml_actionlint_executable', 'actionlint') +call ale#Set('yaml_actionlint_options', '') call ale#linter#Define('yaml', { \ 'name': 'actionlint', diff --git a/sources_non_forked/ale/autoload/ale/completion.vim b/sources_non_forked/ale/autoload/ale/completion.vim index bb664e03..3d649732 100644 --- a/sources_non_forked/ale/autoload/ale/completion.vim +++ b/sources_non_forked/ale/autoload/ale/completion.vim @@ -133,11 +133,13 @@ let s:should_complete_map = { \ 'typescript': '\v[a-zA-Z$_][a-zA-Z$_0-9]*$|\.$|''$|"$', \ 'rust': '\v[a-zA-Z$_][a-zA-Z$_0-9]*$|\.$|::$', \ 'cpp': '\v[a-zA-Z$_][a-zA-Z$_0-9]*$|\.$|::$|-\>$', +\ 'c': '\v[a-zA-Z$_][a-zA-Z$_0-9]*$|\.$|-\>$', \} " Regular expressions for finding the start column to replace with completion. let s:omni_start_map = { \ '': '\v[a-zA-Z$_][a-zA-Z$_0-9]*$', +\ 'racket': '\k\+', \} " A map of exact characters for triggering LSP completions. Do not forget to @@ -147,6 +149,7 @@ let s:trigger_character_map = { \ 'typescript': ['.', '''', '"'], \ 'rust': ['.', '::'], \ 'cpp': ['.', '::', '->'], +\ 'c': ['.', '->'], \} function! s:GetFiletypeValue(map, filetype) abort diff --git a/sources_non_forked/ale/autoload/ale/fix/registry.vim b/sources_non_forked/ale/autoload/ale/fix/registry.vim index 2e772419..85fef81d 100644 --- a/sources_non_forked/ale/autoload/ale/fix/registry.vim +++ b/sources_non_forked/ale/autoload/ale/fix/registry.vim @@ -78,6 +78,11 @@ let s:default_registry = { \ 'suggested_filetypes': ['dhall'], \ 'description': 'Standard code formatter for the Dhall language and removing dead code', \ }, +\ 'dune': { +\ 'function': 'ale#fixers#dune#Fix', +\ 'suggested_filetypes': ['dune'], +\ 'description': 'Fix dune files with dune format', +\ }, \ 'fecs': { \ 'function': 'ale#fixers#fecs#Fix', \ 'suggested_filetypes': ['javascript', 'css', 'html'], @@ -136,6 +141,11 @@ let s:default_registry = { \ 'description': 'Apply prettier-eslint to a file.', \ 'aliases': ['prettier-eslint'], \ }, +\ 'pyflyby': { +\ 'function': 'ale#fixers#pyflyby#Fix', +\ 'suggested_filetypes': ['python'], +\ 'description': 'Tidy Python imports with pyflyby.', +\ }, \ 'importjs': { \ 'function': 'ale#fixers#importjs#Fix', \ 'suggested_filetypes': ['javascript'], @@ -226,6 +236,11 @@ let s:default_registry = { \ 'suggested_filetypes': ['php'], \ 'description': 'Fix PHP files with php-cs-fixer.', \ }, +\ 'pint': { +\ 'function': 'ale#fixers#pint#Fix', +\ 'suggested_filetypes': ['php'], +\ 'description': 'Fix PHP files with Laravel Pint.', +\ }, \ 'astyle': { \ 'function': 'ale#fixers#astyle#Fix', \ 'suggested_filetypes': ['c', 'cpp'], diff --git a/sources_non_forked/ale/autoload/ale/fixers/dune.vim b/sources_non_forked/ale/autoload/ale/fixers/dune.vim new file mode 100644 index 00000000..6ef7ec9f --- /dev/null +++ b/sources_non_forked/ale/autoload/ale/fixers/dune.vim @@ -0,0 +1,16 @@ +" Author: Albert Peschar +" Description: Fix files with dune format. + +call ale#Set('ocaml_dune_executable', 'dune') +call ale#Set('ocaml_dune_options', '') + +function! ale#fixers#dune#Fix(buffer) abort + let l:executable = ale#Var(a:buffer, 'ocaml_dune_executable') + let l:options = ale#Var(a:buffer, 'ocaml_dune_options') + + return { + \ 'command': ale#Escape(l:executable) + \ . ' format' + \ . (empty(l:options) ? '' : ' ' . l:options), + \} +endfunction diff --git a/sources_non_forked/ale/autoload/ale/fixers/pint.vim b/sources_non_forked/ale/autoload/ale/fixers/pint.vim new file mode 100644 index 00000000..274ddd9e --- /dev/null +++ b/sources_non_forked/ale/autoload/ale/fixers/pint.vim @@ -0,0 +1,25 @@ +" Author: Michael Dyrynda +" Description: Fixing files with Laravel Pint. + +call ale#Set('php_pint_executable', 'pint') +call ale#Set('php_pint_use_global', get(g:, 'ale_use_global_executables', 0)) +call ale#Set('php_pint_options', '') + +function! ale#fixers#pint#GetExecutable(buffer) abort + return ale#path#FindExecutable(a:buffer, 'php_pint', [ + \ 'vendor/bin/pint', + \ 'pint' + \]) +endfunction + +function! ale#fixers#pint#Fix(buffer) abort + let l:executable = ale#fixers#pint#GetExecutable(a:buffer) + + return { + \ 'command': ale#Escape(l:executable) + \ . ' ' . ale#Var(a:buffer, 'php_pint_options') + \ . ' %t', + \ 'read_temporary_file': 1, + \} +endfunction + diff --git a/sources_non_forked/ale/autoload/ale/fixers/pyflyby.vim b/sources_non_forked/ale/autoload/ale/fixers/pyflyby.vim new file mode 100644 index 00000000..81c0f05e --- /dev/null +++ b/sources_non_forked/ale/autoload/ale/fixers/pyflyby.vim @@ -0,0 +1,41 @@ +" Author: infokiller +" Description: Tidy imports using pyflyby's tidy-import script +" https://github.com/deshaw/pyflyby + +call ale#Set('python_pyflyby_executable', 'tidy-imports') +call ale#Set('python_pyflyby_use_global', get(g:, 'ale_use_global_executables', 0)) +call ale#Set('python_pyflyby_options', '') +call ale#Set('python_pyflyby_auto_pipenv', 0) +call ale#Set('python_pyflyby_auto_poetry', 0) + +function! ale#fixers#pyflyby#GetExecutable(buffer) abort + if (ale#Var(a:buffer, 'python_auto_pipenv') || ale#Var(a:buffer, 'python_pyflyby_auto_pipenv')) + \ && ale#python#PipenvPresent(a:buffer) + return 'pipenv' + endif + + if (ale#Var(a:buffer, 'python_auto_poetry') || ale#Var(a:buffer, 'python_pyflyby_auto_poetry')) + \ && ale#python#PoetryPresent(a:buffer) + return 'poetry' + endif + + return ale#python#FindExecutable(a:buffer, 'python_pyflyby', ['tidy-imports']) +endfunction + +function! ale#fixers#pyflyby#Fix(buffer) abort + " let l:executable = ale#fixers#pyflyby#GetExecutable(a:buffer) + let l:executable = ale#fixers#pyflyby#GetExecutable(a:buffer) + let l:cmd = [ale#Escape(l:executable)] + + if l:executable =~? 'pipenv\|poetry$' + call extend(l:cmd, ['run', 'tidy-imports']) + endif + + let l:options = ale#Var(a:buffer, 'python_pyflyby_options') + + if !empty(l:options) + call add(l:cmd, l:options) + endif + + return {'command': join(l:cmd, ' ')} +endfunction diff --git a/sources_non_forked/ale/autoload/ale/fixers/shfmt.vim b/sources_non_forked/ale/autoload/ale/fixers/shfmt.vim index 06e8da57..0eefc985 100644 --- a/sources_non_forked/ale/autoload/ale/fixers/shfmt.vim +++ b/sources_non_forked/ale/autoload/ale/fixers/shfmt.vim @@ -5,27 +5,13 @@ scriptencoding utf-8 call ale#Set('sh_shfmt_executable', 'shfmt') call ale#Set('sh_shfmt_options', '') -function! s:DefaultOption(buffer) abort - if getbufvar(a:buffer, '&expandtab') == 0 - " Tab is used by default - return '' - endif - - let l:tabsize = getbufvar(a:buffer, '&shiftwidth') - - if l:tabsize == 0 - let l:tabsize = getbufvar(a:buffer, '&tabstop') - endif - - return ' -i ' . l:tabsize -endfunction - function! ale#fixers#shfmt#Fix(buffer) abort let l:executable = ale#Var(a:buffer, 'sh_shfmt_executable') let l:options = ale#Var(a:buffer, 'sh_shfmt_options') return { \ 'command': ale#Escape(l:executable) - \ . (empty(l:options) ? s:DefaultOption(a:buffer) : ' ' . l:options) + \ . ' -filename=%s' + \ . (empty(l:options) ? '' : ' ' . l:options) \} endfunction diff --git a/sources_non_forked/ale/autoload/ale/floating_preview.vim b/sources_non_forked/ale/autoload/ale/floating_preview.vim index e953c363..1063a2db 100644 --- a/sources_non_forked/ale/autoload/ale/floating_preview.vim +++ b/sources_non_forked/ale/autoload/ale/floating_preview.vim @@ -106,18 +106,20 @@ function! s:NvimPrepareWindowContent(lines) abort let l:width += 2 let l:height += 2 - let l:hor = g:ale_floating_window_border[0] - let l:top = g:ale_floating_window_border[1] - let l:top_left = g:ale_floating_window_border[2] - let l:top_right = g:ale_floating_window_border[3] - let l:bottom_right = g:ale_floating_window_border[4] - let l:bottom_left = g:ale_floating_window_border[5] + let l:left = get(g:ale_floating_window_border, 0, '|') + let l:top = get(g:ale_floating_window_border, 1, '-') + let l:top_left = get(g:ale_floating_window_border, 2, '+') + let l:top_right = get(g:ale_floating_window_border, 3, '+') + let l:bottom_right = get(g:ale_floating_window_border, 4, '+') + let l:bottom_left = get(g:ale_floating_window_border, 5, '+') + let l:right = get(g:ale_floating_window_border, 6, l:left) + let l:bottom = get(g:ale_floating_window_border, 7, l:top) let l:lines = [l:top_left . repeat(l:top, l:width - 2) . l:top_right] for l:line in a:lines let l:line_width = strchars(l:line) - let l:lines = add(l:lines, l:hor . l:line . repeat(' ', l:width - l:line_width - 2). l:hor) + let l:lines = add(l:lines, l:left . l:line . repeat(' ', l:width - l:line_width - 2). l:right) endfor " Truncate the lines @@ -125,7 +127,7 @@ function! s:NvimPrepareWindowContent(lines) abort let l:lines = l:lines[0:l:max_height] endif - let l:lines = add(l:lines, l:bottom_left . repeat(l:top, l:width - 2) . l:bottom_right) + let l:lines = add(l:lines, l:bottom_left . repeat(l:bottom, l:width - 2) . l:bottom_right) return [l:lines, l:width, l:height] endfunction @@ -158,14 +160,14 @@ function! s:VimCreate(options) abort \ 'padding': [0, 1, 0, 1], \ 'border': [], \ 'borderchars': empty(g:ale_floating_window_border) ? [' '] : [ - \ g:ale_floating_window_border[1], - \ g:ale_floating_window_border[0], - \ g:ale_floating_window_border[1], - \ g:ale_floating_window_border[0], - \ g:ale_floating_window_border[2], - \ g:ale_floating_window_border[3], - \ g:ale_floating_window_border[4], - \ g:ale_floating_window_border[5], + \ get(g:ale_floating_window_border, 1, '-'), + \ get(g:ale_floating_window_border, 6, '|'), + \ get(g:ale_floating_window_border, 7, '-'), + \ get(g:ale_floating_window_border, 0, '|'), + \ get(g:ale_floating_window_border, 2, '+'), + \ get(g:ale_floating_window_border, 3, '+'), + \ get(g:ale_floating_window_border, 4, '+'), + \ get(g:ale_floating_window_border, 5, '+'), \ ], \ 'moved': 'any', \ }) diff --git a/sources_non_forked/ale/autoload/ale/handlers/actionlint.vim b/sources_non_forked/ale/autoload/ale/handlers/actionlint.vim index 9a6f1909..73843c08 100644 --- a/sources_non_forked/ale/autoload/ale/handlers/actionlint.vim +++ b/sources_non_forked/ale/autoload/ale/handlers/actionlint.vim @@ -1,5 +1,17 @@ function! ale#handlers#actionlint#GetCommand(buffer) abort - return '%e --no-color --oneline %t' + let l:options = ale#Var(a:buffer, 'yaml_actionlint_options') + + " automatically add --no-color option if not defined + if l:options !~# '--no-color' + let l:options .= ' --no-color' + endif + + " automatically add --oneline option if not defined + if l:options !~# '--oneline' + let l:options .= ' --oneline' + endif + + return '%e ' . l:options . ' %t' endfunction function! ale#handlers#actionlint#Handle(buffer, lines) abort diff --git a/sources_non_forked/ale/autoload/ale/handlers/openscad.vim b/sources_non_forked/ale/autoload/ale/handlers/openscad.vim new file mode 100644 index 00000000..33eee31c --- /dev/null +++ b/sources_non_forked/ale/autoload/ale/handlers/openscad.vim @@ -0,0 +1,73 @@ +scriptencoding utf-8LE +" Description: This file defines a handler function for linting OpenSCAD files +" with SCA2D + +function! ale#handlers#openscad#SCA2D_callback(buffer, lines) abort + " Example output:: + " foo.scad:3:1: W2001: Variable `unused` overwritten within scope. + " foo.scad:1:1: F0001: Cannot read file due to syntax error: + " - No terminal matches '}' in the current parser context, at line 1 col 36 + let l:filename_re = '^\([^:]*\):' + let l:linenum_re = '\([0-9]*\):' + let l:colnum_re = '\([0-9]*\):' + let l:err_id = '\([IWEFU][0-9]\+\):' + let l:err_msg = '\(.*\)' + let l:pattern = filename_re . + \ linenum_re . + \ colnum_re . + \ ' ' . + \ err_id . + \ ' ' . + \ err_msg + + let l:result = [] + let l:idx = 0 + + for l:line in a:lines + let l:matches = matchlist(line, pattern) + + if len(matches) > 0 + " option: Info, Warning, Error, Fatal, Unknown + if index(['I', 'W'], matches[4][0]) >= 0 + let l:type = 'W' + else + let l:type = 'E' + endif + + let l:lnum = matches[2] + let l:col = matches[3] + let l:text = matches[5] + + " Better locations for some syntax errors + if matches[4][0] is# 'F' + let l:syntax_error_re = '^\(.*\), at line \([0-9]\+\) col \([0-9]\+\)$' + let l:next_line = a:lines[idx+1] + let l:syn_err_matches = matchlist(l:next_line, l:syntax_error_re) + + if len(syn_err_matches) > 0 + let l:text = l:text . l:syn_err_matches[1] + let l:lnum = l:syn_err_matches[2] + let l:col = l:syn_err_matches[3] + else + let l:text = l:next_line + endif + endif + + let l:element = { + \ 'lnum': str2nr(l:lnum), + \ 'col': str2nr(l:col), + \ 'text': l:text, + \ 'detail': l:matches[4] . ': ' . l:text, + \ 'filename': fnamemodify(matches[1], ':p'), + \ 'type': l:type + \ } + + call add(l:result, l:element) + endif + + let l:idx += 1 + endfor + + return result + +endfun diff --git a/sources_non_forked/ale/autoload/ale/job.vim b/sources_non_forked/ale/autoload/ale/job.vim index b4a7a2e8..0fc43a8c 100644 --- a/sources_non_forked/ale/autoload/ale/job.vim +++ b/sources_non_forked/ale/autoload/ale/job.vim @@ -250,10 +250,16 @@ function! ale#job#Start(command, options) abort if has_key(a:options, 'out_cb') let l:job_options.out_cb = function('s:VimOutputCallback') + else + " prevent buffering of output and excessive polling in case close_cb is set + let l:job_options.out_cb = {->0} endif if has_key(a:options, 'err_cb') let l:job_options.err_cb = function('s:VimErrorCallback') + else + " prevent buffering of output and excessive polling in case close_cb is set + let l:job_options.err_cb = {->0} endif if has_key(a:options, 'exit_cb') diff --git a/sources_non_forked/ale/doc/ale-cairo.txt b/sources_non_forked/ale/doc/ale-cairo.txt new file mode 100644 index 00000000..0a78e68a --- /dev/null +++ b/sources_non_forked/ale/doc/ale-cairo.txt @@ -0,0 +1,15 @@ +=============================================================================== +ALE Cairo Integration *ale-cairo-options* + + +=============================================================================== +starknet *ale-cairo-starknet* + +g:ale_cairo_starknet_executable *g:ale_cairo_starknet_executable* + *b:ale_cairo_starknet_executable* + + Default: `'starknet-compile'` + + Overrides the starknet-compile binary after installing the cairo-language. + + For more information read 'https://starknet.io/docs/quickstart.html' diff --git a/sources_non_forked/ale/doc/ale-development.txt b/sources_non_forked/ale/doc/ale-development.txt index 4b4b4c77..a0bba468 100644 --- a/sources_non_forked/ale/doc/ale-development.txt +++ b/sources_non_forked/ale/doc/ale-development.txt @@ -156,8 +156,7 @@ environments. 1. Vim 8.0.0027 on Linux via GitHub Actions. 2. Vim 8.2.4693 on Linux via GitHub Actions. 3. NeoVim 0.2.0 on Linux via GitHub Actions. -4. NeoVim 0.4.4 on Linux via GitHub Actions. -5. NeoVim 0.6.1 on Linux via GitHub Actions. +4. NeoVim 0.7.0 on Linux via GitHub Actions. 6. Vim 8 (stable builds) on Windows via AppVeyor. If you are developing ALE code on Linux, Mac OSX, or BSD, you can run ALEs diff --git a/sources_non_forked/ale/doc/ale-haskell.txt b/sources_non_forked/ale/doc/ale-haskell.txt index 9e65cc62..10b676d7 100644 --- a/sources_non_forked/ale/doc/ale-haskell.txt +++ b/sources_non_forked/ale/doc/ale-haskell.txt @@ -134,7 +134,7 @@ g:ale_haskell_hlint_options g:ale_haskell_hlint_options hls *ale-haskell-hls* g:ale_haskell_hls_executable *g:ale_haskell_hls_executable* - *b:ale_haskell_his_executable* + *b:ale_haskell_hls_executable* Type: |String| Default: `'haskell-language-server-wrapper'` diff --git a/sources_non_forked/ale/doc/ale-ocaml.txt b/sources_non_forked/ale/doc/ale-ocaml.txt index afbc2386..a361a7b4 100644 --- a/sources_non_forked/ale/doc/ale-ocaml.txt +++ b/sources_non_forked/ale/doc/ale-ocaml.txt @@ -2,6 +2,26 @@ ALE OCaml Integration *ale-ocaml-options* +=============================================================================== +dune *ale-ocaml-dune* + + Dune is a build system for OCaml projects. The `dune format` command is + supported for automatically formatting `dune` and `dune-project` files. + +g:ale_ocaml_dune_executable *g:ale_ocaml_dune_executable* + *b:ale_ocaml_dune_executable* + Type: |String| + Default: `'dune'` + + This variable can be set to pass the path to dune. + +g:ale_ocaml_dune_options *g:ale_ocaml_dune_options* + *b:ale_ocaml_dune_options* + Type: |String| + Default: `''` + + This variable can be set to pass additional options to the dune fixer. + =============================================================================== merlin *ale-ocaml-merlin* diff --git a/sources_non_forked/ale/doc/ale-openscad.txt b/sources_non_forked/ale/doc/ale-openscad.txt new file mode 100644 index 00000000..ac416bc3 --- /dev/null +++ b/sources_non_forked/ale/doc/ale-openscad.txt @@ -0,0 +1,25 @@ +=============================================================================== +ALE OpenSCAD Integration *ale-openscad-options* + + +=============================================================================== +sca2d *ale-openscad-sca2d* + +g:ale_openscad_sca2d_executable *g:ale_openscad_sca2d_executable* + *b:ale_openscad_sca2d_executable* + Type: |String| + Default: `'sca2d'` + + See |ale-integrations-local-executables| + + +g:ale_openscad_sca2d_options *g:ale_openscad_sca2d_options* + *b:ale_openscad_sca2d_options* + Type: |String| + Default: `''` + + This variable can be set to pass options to sca2d. + + +=============================================================================== + vim:tw=78:ts=2:sts=2:sw=2:ft=help:norl: diff --git a/sources_non_forked/ale/doc/ale-php.txt b/sources_non_forked/ale/doc/ale-php.txt index e4da97d3..2750a319 100644 --- a/sources_non_forked/ale/doc/ale-php.txt +++ b/sources_non_forked/ale/doc/ale-php.txt @@ -272,6 +272,33 @@ g:ale_php_php_executable *g:ale_php_php_executable* This variable sets the executable used for php. +=============================================================================== +pint *ale-php-pint* + +g:ale_php_pint_executable *g:ale_php_pint_executable* + *b:ale_php_pint_executable* + Type: |String| + Default: `'pint'` + + This variable sets the executable used for pint. + + +g:ale_php_pint_options *g:ale_php_pint_options* + *b:ale_php_pint_options* + Type: |String| + Default: `''` + + This variable can be set to pass additional options to pint. + + +g:ale_php_pint_use_global *g:ale_php_pint_use_global* + *b:ale_php_pint_use_global* + Type: |Boolean| + Default: `get(g:, 'ale_use_global_executables', 0)` + + See |ale-integrations-local-executables| + + =============================================================================== tlint *ale-php-tlint* diff --git a/sources_non_forked/ale/doc/ale-python.txt b/sources_non_forked/ale/doc/ale-python.txt index 8c380e25..41488a65 100644 --- a/sources_non_forked/ale/doc/ale-python.txt +++ b/sources_non_forked/ale/doc/ale-python.txt @@ -268,8 +268,8 @@ g:ale_python_flake8_change_directory *g:ale_python_flake8_change_directory* Default: `'project'` If set to `project`, ALE will switch to the project root before checking file. - If set to `file`, ALE will switch to directory the Python file being - checked with `flake8` is in before checking it. + If set to `file`, ALE will first switch to the directory containing the + Python file being checked with `flake8` before checking it. You can turn it off with `off` option if you want to control the directory Python is executed from yourself. @@ -708,6 +708,52 @@ g:ale_python_pyflakes_auto_poetry *g:ale_python_pyflakes_auto_poetry* if true. This is overridden by a manually-set executable. +=============================================================================== +pyflyby *ale-python-pyflyby* + +g:ale_python_pyflyby_executable *g:ale_python_pyflyby_executable* + *b:ale_python_pyflyby_executable* + Type: |String| + Default: `'tidy-imports'` + + See |ale-integrations-local-executables| + + +g:ale_python_pyflyby_options *g:ale_python_pyflyby_options* + *b:ale_python_pyflyby_options* + Type: |String| + Default: `''` + + This variable can be changed to add command-line arguments to the pyflyby + tidy-imports invocation. + + +g:ale_python_pyflyby_use_global *g:ale_python_pyflyby_use_global* + *b:ale_python_pyflyby_use_global* + Type: |Number| + Default: `get(g:, 'ale_use_global_executables', 0)` + + See |ale-integrations-local-executables| + + +g:ale_python_pyflyby_auto_pipenv *g:ale_python_pyflyby_auto_pipenv* + *b:ale_python_pyflyby_auto_pipenv* + Type: |Number| + Default: `0` + + Detect whether the file is inside a pipenv, and set the executable to `pipenv` + if true. This is overridden by a manually-set executable. + + +g:ale_python_pyflyby_auto_poetry *g:ale_python_pyflyby_auto_poetry* + *b:ale_python_pyflyby_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. + + =============================================================================== pylama *ale-python-pylama* diff --git a/sources_non_forked/ale/doc/ale-supported-languages-and-tools.txt b/sources_non_forked/ale/doc/ale-supported-languages-and-tools.txt index 218832bc..a0a20c7e 100644 --- a/sources_non_forked/ale/doc/ale-supported-languages-and-tools.txt +++ b/sources_non_forked/ale/doc/ale-supported-languages-and-tools.txt @@ -95,6 +95,8 @@ Notes: * `flawfinder` * `gcc` (`cc`) * `uncrustify` +* Cairo + * `starknet` * Chef * `cookstyle` * `foodcritic`!! @@ -384,6 +386,7 @@ Notes: * `clangd` * `uncrustify` * OCaml + * `dune` * `merlin` (see |ale-ocaml-merlin|) * `ocamlformat` * `ocamllsp` @@ -393,6 +396,8 @@ Notes: * `ibm_validator` * `prettier` * `yamllint` +* OpenSCAD + * `SCA2D` * Packer * `packer-fmt-fixer` * Pascal @@ -417,6 +422,7 @@ Notes: * `phpcs` * `phpmd` * `phpstan` + * `pint` * `psalm`!! * `tlint` * PO @@ -466,6 +472,7 @@ Notes: * `pycodestyle` * `pydocstyle` * `pyflakes` + * `pyflyby` * `pylama`!! * `pylint`!! * `pylsp` diff --git a/sources_non_forked/ale/doc/ale-yaml.txt b/sources_non_forked/ale/doc/ale-yaml.txt index 8d44973d..9733990e 100644 --- a/sources_non_forked/ale/doc/ale-yaml.txt +++ b/sources_non_forked/ale/doc/ale-yaml.txt @@ -32,6 +32,20 @@ g:ale_yaml_actionlint_executable *g:ale_yaml_actionlint_executable* This variable can be set to change the path to actionlint. +g:ale_yaml_actionlint_options *g:ale_yaml_actionlint_options* + *b:ale_yaml_actionlint_options* + + Type: |String| + Default: `''` + + This variable can be set to add extra options to actionlint executable. + + For example, to disable running `shellcheck` and `pyflakes` external commands, + you may want to set: +> + let g:ale_yaml_actionlint_options = '-shellcheck= -pyflakes=' +< + Please note that passing `-format` as option is not supported at the moment. =============================================================================== circleci *ale-yaml-circleci* diff --git a/sources_non_forked/ale/doc/ale.txt b/sources_non_forked/ale/doc/ale.txt index c969cb9e..ff1af720 100644 --- a/sources_non_forked/ale/doc/ale.txt +++ b/sources_non_forked/ale/doc/ale.txt @@ -676,7 +676,8 @@ Hover information can be displayed in the preview window instead by setting When using Neovim or Vim with |popupwin|, if |g:ale_hover_to_floating_preview| or |g:ale_floating_preview| is set to 1, the hover information will show in a -floating window. And |g:ale_floating_window_border| for the border setting. +floating window. The borders of the floating preview window can be customized +by setting |g:ale_floating_window_border|. For Vim 8.1+ terminals, mouse hovering is disabled by default. Enabling |balloonexpr| commands in terminals can cause scrolling issues in terminals, @@ -1236,14 +1237,19 @@ g:ale_floating_preview *g:ale_floating_preview* g:ale_floating_window_border *g:ale_floating_window_border* Type: |List| - Default: `['|', '-', '+', '+', '+', '+']` + Default: `['|', '-', '+', '+', '+', '+', '|', '-']` When set to `[]`, window borders are disabled. The elements in the list set - the horizontal, top, top-left, top-right, bottom-right and bottom-left - border characters, respectively. + the the characters for the left side, top, top-left corner, top-right + corner, bottom-right corner, bottom-left corner, right side, and bottom of + the floating window, respectively. If the terminal supports Unicode, you might try setting the value to - ` ['│', '─', 'â•­', 'â•®', '╯', 'â•°']`, to make it look nicer. + ` ['│', '─', 'â•­', 'â•®', '╯', 'â•°', '│', '─']`, to make it look nicer. + + NOTE: For compatibility with previous versions, if the list does not have + elements for the right side and bottom, the left side and top will be used + instead. g:ale_history_enabled *g:ale_history_enabled* @@ -2769,6 +2775,8 @@ documented in additional help files. cspell................................|ale-c-cspell| flawfinder............................|ale-c-flawfinder| uncrustify............................|ale-c-uncrustify| + cairo...................................|ale-cairo-options| + starknet..............................|ale-cairo-starknet| chef....................................|ale-chef-options| cookstyle.............................|ale-chef-cookstyle| foodcritic............................|ale-chef-foodcritic| @@ -3033,6 +3041,7 @@ documented in additional help files. clangd................................|ale-objcpp-clangd| uncrustify............................|ale-objcpp-uncrustify| ocaml...................................|ale-ocaml-options| + dune..................................|ale-ocaml-dune| merlin................................|ale-ocaml-merlin| ocamllsp..............................|ale-ocaml-ocamllsp| ols...................................|ale-ocaml-ols| @@ -3042,6 +3051,8 @@ documented in additional help files. ibm_validator.........................|ale-openapi-ibm-validator| prettier..............................|ale-openapi-prettier| yamllint..............................|ale-openapi-yamllint| + openscad................................|ale-openscad-options| + sca2d.................................|ale-openscad-sca2d| packer..................................|ale-packer-options| packer-fmt-fixer......................|ale-packer-fmt-fixer| pascal..................................|ale-pascal-options| @@ -3065,6 +3076,7 @@ documented in additional help files. psalm.................................|ale-php-psalm| php-cs-fixer..........................|ale-php-php-cs-fixer| php...................................|ale-php-php| + pint..................................|ale-php-pint| tlint.................................|ale-php-tlint| intelephense..........................|ale-php-intelephense| po......................................|ale-po-options| @@ -3111,6 +3123,7 @@ documented in additional help files. pycodestyle...........................|ale-python-pycodestyle| pydocstyle............................|ale-python-pydocstyle| pyflakes..............................|ale-python-pyflakes| + pyflyby...............................|ale-python-pyflyby| pylama................................|ale-python-pylama| pylint................................|ale-python-pylint| pylsp.................................|ale-python-pylsp| diff --git a/sources_non_forked/ale/plugin/ale.vim b/sources_non_forked/ale/plugin/ale.vim index 8d829ddf..12373e11 100644 --- a/sources_non_forked/ale/plugin/ale.vim +++ b/sources_non_forked/ale/plugin/ale.vim @@ -152,10 +152,11 @@ let g:ale_hover_to_floating_preview = get(g:, 'ale_hover_to_floating_preview', 0 " Detail uses floating windows in Neovim let g:ale_detail_to_floating_preview = get(g:, 'ale_detail_to_floating_preview', 0) -" Border setting for floating preview windows in Neovim -" The element in the list presents - horizontal, top, top-left, top-right, -" bottom-right and bottom-left -let g:ale_floating_window_border = get(g:, 'ale_floating_window_border', ['|', '-', '+', '+', '+', '+']) +" Border setting for floating preview windows +" The elements in the list set the characters for the left, top, top-left, +" top-right, bottom-right, bottom-left, right, and bottom of the border +" respectively +let g:ale_floating_window_border = get(g:, 'ale_floating_window_border', ['|', '-', '+', '+', '+', '+', '|', '-']) " This flag can be set to 0 to disable warnings for trailing whitespace let g:ale_warn_about_trailing_whitespace = get(g:, 'ale_warn_about_trailing_whitespace', 1) diff --git a/sources_non_forked/ale/rplugin/python3/deoplete/sources/ale.py b/sources_non_forked/ale/rplugin/python3/deoplete/sources/ale.py index 82d9bbf2..a692dc31 100644 --- a/sources_non_forked/ale/rplugin/python3/deoplete/sources/ale.py +++ b/sources_non_forked/ale/rplugin/python3/deoplete/sources/ale.py @@ -32,6 +32,7 @@ class Source(Base): 'rust': r'(\.|::)\w*$', 'typescript': r'(\.|\'|")\w*$', 'cpp': r'(\.|::|->)\w*$', + 'c': r'(\.|->)\w*$', } # Returns an integer for the start position, as with omnifunc. diff --git a/sources_non_forked/ale/supported-tools.md b/sources_non_forked/ale/supported-tools.md index 24e8de42..bdad2b3b 100644 --- a/sources_non_forked/ale/supported-tools.md +++ b/sources_non_forked/ale/supported-tools.md @@ -104,6 +104,8 @@ formatting. * [flawfinder](https://www.dwheeler.com/flawfinder/) * [gcc](https://gcc.gnu.org/) * [uncrustify](https://github.com/uncrustify/uncrustify) +* Cairo + * [starknet](https://starknet.io/docs) * Chef * [cookstyle](https://docs.chef.io/cookstyle.html) * [foodcritic](http://www.foodcritic.io/) :floppy_disk: @@ -393,6 +395,7 @@ formatting. * [clangd](https://clang.llvm.org/extra/clangd.html) * [uncrustify](https://github.com/uncrustify/uncrustify) * OCaml + * [dune](https://dune.build/) * [merlin](https://github.com/the-lambda-church/merlin) see `:help ale-ocaml-merlin` for configuration instructions * [ocamlformat](https://github.com/ocaml-ppx/ocamlformat) * [ocamllsp](https://github.com/ocaml/ocaml-lsp) @@ -402,6 +405,8 @@ formatting. * [ibm_validator](https://github.com/IBM/openapi-validator) * [prettier](https://github.com/prettier/prettier) * [yamllint](https://yamllint.readthedocs.io/) +* OpenSCAD + * [SCA2D](https://gitlab.com/bath_open_instrumentation_group/sca2d) :floppy_disk: * Packer (HCL) * [packer-fmt-fixer](https://github.com/hashicorp/packer) * Pascal @@ -420,12 +425,13 @@ formatting. * [langserver](https://github.com/felixfbecker/php-language-server) * [phan](https://github.com/phan/phan) see `:help ale-php-phan` to instructions * [php -l](https://secure.php.net/) - * [php-cs-fixer](http://cs.sensiolabs.org/) + * [php-cs-fixer](https://cs.symfony.com) * [phpactor](https://github.com/phpactor/phpactor) * [phpcbf](https://github.com/squizlabs/PHP_CodeSniffer) * [phpcs](https://github.com/squizlabs/PHP_CodeSniffer) * [phpmd](https://phpmd.org) * [phpstan](https://github.com/phpstan/phpstan) + * [pint](https://github.com/laravel/pint) :beer: * [psalm](https://getpsalm.org) :floppy_disk: * [tlint](https://github.com/tightenco/tlint) * PO @@ -475,6 +481,7 @@ formatting. * [pycodestyle](https://github.com/PyCQA/pycodestyle) :warning: * [pydocstyle](https://www.pydocstyle.org/) :warning: * [pyflakes](https://github.com/PyCQA/pyflakes) + * [pyflyby](https://github.com/deshaw/pyflyby) :warning: * [pylama](https://github.com/klen/pylama) :floppy_disk: * [pylint](https://www.pylint.org/) :floppy_disk: * [pylsp](https://github.com/python-lsp/python-lsp-server) :warning: diff --git a/sources_non_forked/bufexplorer/.gitignore b/sources_non_forked/bufexplorer/.gitignore new file mode 100644 index 00000000..42d5d592 --- /dev/null +++ b/sources_non_forked/bufexplorer/.gitignore @@ -0,0 +1,6 @@ +# Ignore generated tags +/doc/tags +dist.bat +*.zip +tags +*.sw[a-p] diff --git a/sources_non_forked/bufexplorer/LICENSE b/sources_non_forked/bufexplorer/LICENSE new file mode 100644 index 00000000..28d7bc4b --- /dev/null +++ b/sources_non_forked/bufexplorer/LICENSE @@ -0,0 +1,27 @@ +Copyright (c) 2001-2013, Jeff Lanzarotta +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +* Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +* Redistributions in binary form must reproduce the above copyright notice, this + list of conditions and the following disclaimer in the documentation and/or + other materials provided with the distribution. + +* Neither the name of the {organization} nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/sources_non_forked/bufexplorer/README.md b/sources_non_forked/bufexplorer/README.md new file mode 100644 index 00000000..4dbe4f88 --- /dev/null +++ b/sources_non_forked/bufexplorer/README.md @@ -0,0 +1,99 @@ +bufexplorer +=========== + +BufExplorer Plugin for Vim + +With bufexplorer, you can quickly and easily switch between buffers by using the one of the default public interfaces: + +`\be` normal open + +`\bt` toggle open / close + +`\bs` force horizontal split open + +`\bv` force vertical split open + + +Once the bufexplorer window is open you can use the normal movement keys (hjkl) to move around and then use `` or `` to select the buffer you would like to open. If you would like to have the selected buffer opened in a new tab, simply press either `` or `t`. Please note that when opening a buffer in a tab, that if the buffer is already in another tab, bufexplorer can switch to that tab automatically for you if you would like. More about that in the supplied VIM help. + +Bufexplorer also offers various options including: +- Display the list of buffers in various sort orders including: + - Most Recently Used (MRU) which is the default + - Buffer number + - File name + - File extension + - Full file path name +- Delete buffer from list + +For more about options, sort orders, configuration options, etc. please see the supplied VIM help. + +## vim.org +This plugin can also be found at http://www.vim.org/scripts/script.php?script_id=42. + +## Installation +### Manually +1. If you do not want to use one of the the bundle handlers, you can take the + zip file from vim.org and unzip it and copy the plugin to your vimfiles\plugin + directory and the txt file to your vimfiles\doc directory. If you do that, + make sure you generate the help by executing + + `:helptag /doc` + + Once help tags have been generated, you can view the manual with + `:help bufexplorer`. + +### Vundle (https://github.com/gmarik/Vundle.vim) +1. Add the following configuration to your `.vimrc`. + + Plugin 'jlanzarotta/bufexplorer' + +2. Install with `:BundleInstall`. + +### NeoBundle (https://github.com/Shougo/neobundle.vim) +1. Add the following configuration to your `.vimrc`. + + NeoBundle 'jlanzarotta/bufexplorer' + +2. Install with `:NeoBundleInstall`. + +### Plug (https://github.com/junegunn/vim-plug) +1. Add the following configuration to your `.vimrc`. + + Plug 'jlanzarotta/bufexplorer' + +2. Install with `:PlugInstall`. + +### Pathogen +1. Install with the following command. + + git clone https://github.com/jlanzarotta/bufexplorer.git ~/.vim/bundle/bufexplorer.vim + +## License +Copyright (c) 2001-2022, Jeff Lanzarotta + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +* Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +* Redistributions in binary form must reproduce the above copyright notice, this + list of conditions and the following disclaimer in the documentation and/or + other materials provided with the distribution. + +* Neither the name of the {organization} nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/sources_non_forked/bufexplorer/doc/bufexplorer.txt b/sources_non_forked/bufexplorer/doc/bufexplorer.txt index dc610942..b3b46cc7 100644 --- a/sources_non_forked/bufexplorer/doc/bufexplorer.txt +++ b/sources_non_forked/bufexplorer/doc/bufexplorer.txt @@ -1,7 +1,7 @@ -*bufexplorer.txt* Buffer Explorer Last Change: 03 Nov 2014 +*bufexplorer.txt* Buffer Explorer Last Change: 02 May 2022 Buffer Explorer *buffer-explorer* *bufexplorer* - Version 7.4.6 + Version 7.4.24 Plugin for easily exploring (or browsing) Vim|:buffers|. @@ -41,22 +41,24 @@ To install: USAGE *bufexplorer-usage* To start exploring in the current window, use: > - \be or :BufExplorer or Your custom key mapping + be or :BufExplorer or Your custom key mapping +To toggle bufexplorer on or off in the current window, use: > + bt or :ToggleBufExplorer or Your custom key mapping To start exploring in a newly split horizontal window, use: > - \bs or :BufExplorerHorizontalSplit or Your custom key mapping + bs or :BufExplorerHorizontalSplit or Your custom key mapping To start exploring in a newly split vertical window, use: > - \bv or :BufExplorerVerticalSplit or Your custom key mapping + bv or :BufExplorerVerticalSplit or Your custom key mapping -If you would like to use something other than '\', you may simply change the -leader (see |mapleader|). +If you would like to use something other than the default leader key - '\' - +you may simply change the leader (see |mapleader|). -When \bs or \bv is issued, bufexplorer opens in either a horizonally or -vertically split window. By issusing either of these commands, the user is -telling bufexplorer that they want to split the window and have bufexplorer -show the buffer they are about to select (from the bufexplorer windows) in the -newly split window. When \be is issued, bufexplorer opens the bufexplorer -contents in the current window and the buffer the user selects is opened in -the current window. +When bs or bv is issued, bufexplorer opens in either a +horizontally or vertically split window. By issuing either of these commands, +the user is telling bufexplorer that they want to split the window and have +bufexplorer show the buffer they are about to select (from the bufexplorer +windows) in the newly split window. When be is issued, bufexplorer +opens the bufexplorer contents in the current window and the buffer the user +selects is opened in the current window. Note: If the current buffer is modified when bufexplorer started, the current window is always split and the new bufexplorer is displayed in that new @@ -70,18 +72,20 @@ Commands to use once exploring: Opens the buffer that is under the cursor into the current window. Opens the buffer that is under the cursor in another tab. + a Toggles whether you are taken to the active window when + selecting a buffer or not. b Fast buffer switching with b. - B Works in association with the|ShowTabBuffer|option. If - |ShowTabBuffer|is set to 1, this toggles if BufExplorer is to + B Works in association with the |ShowTabBuffer| option. If + |ShowTabBuffer| is set to 1, this toggles if BufExplorer is to only store the most recent tab for this buffer or not. - d |:delete|the buffer under the cursor from the list. The + d |:delete| the buffer under the cursor from the list. The buffer's 'buflisted' is cleared. This allows for the buffer to be displayed again using the 'show unlisted' command. - D |:wipeout|the buffer under the cursor from the list. When a - buffers is wiped, it will not be shown when unlisted buffer are + D |:wipeout| the buffer under the cursor from the list. When a + buffer is wiped, it will not be shown when unlisted buffers are displayed. - f Toggles whether you are taken to the active window when - selecting a buffer or not. + F Open selected buffer in another window above the current. + f Open selected buffer in another window below the current. o Opens the buffer that is under the cursor into the current window. p Toggles the showing of a split filename/pathname. @@ -97,12 +101,14 @@ Commands to use once exploring: t Opens the buffer that is under the cursor in another tab. T Toggles to show only buffers for this tab or not. u Toggles the showing of "unlisted" buffers. + V Open the selected buffer in another window on the left of the current. + v Open the selected buffer in another window on the right of the current. Once invoked, Buffer Explorer displays a sorted list (MRU is the default sort method) of all the buffers that are currently opened. You are then able to move the cursor to the line containing the buffer's name you are wanting to act upon. Once you have selected the buffer you would like, -you can then either open it, close it(delete), resort the list, reverse +you can then either open it, close it (delete), resort the list, reverse the sort, quit exploring and so on... =============================================================================== @@ -119,17 +125,18 @@ WINDOW LAYOUT *bufexplorer-windowlayout* | | | | +-- Current Line #. | | | +-- Relative/Full Path | | +-- Buffer Name. - | +-- Buffer Attributes. See|:buffers|for more information. - +-- Buffer Number. See|:buffers|for more information. + | +-- Buffer Attributes. See |:buffers| for more information. + +-- Buffer Number. See |:buffers| for more information. =============================================================================== CUSTOMIZATION *bufexplorer-customization* -If you do not like the default key mappings of \be, \bs, and \bv, you can -override bufexplorer's default mappings by setting up something like the -following in your vimrc file: +If you do not like the default key mappings of be, bs, and +bv, you can override bufexplorer's default mappings by setting up +something like the following in your vimrc file: nnoremap :BufExplorer + nnoremap :ToggleBufExplorer nnoremap :BufExplorerHorizontalSplit nnoremap :BufExplorerVerticalSplit @@ -193,13 +200,13 @@ directory, use: > The default is to show absolute paths. *g:bufExplorerShowTabBuffer* -To control weither or not to show buffers on for the specific tab or not, use: > +To control whether or not to show buffers on for the specific tab or not, use: > let g:bufExplorerShowTabBuffer=0 " No. let g:bufExplorerShowTabBuffer=1 " Yes. The default is not to show. *g:bufExplorerShowUnlisted* -To control whether to show unlisted buffer or not, use: > +To control whether to show unlisted buffers or not, use: > let g:bufExplorerShowUnlisted=0 " Do not show unlisted buffers. let g:bufExplorerShowUnlisted=1 " Show unlisted buffers. The default is to NOT show unlisted buffers. @@ -242,14 +249,90 @@ current window, use: > The default is to use the global &splitright. *g:bufExplorerSplitVertSize* -To control the size of the new vertical split window. use: > - let g:bufExplorerVertSize=n " New split window is n columns wide. - let g:bufExplorerVertSize=0 " New split windows size set by Vim. +To control the size of the new vertical split window, use: > + let g:bufExplorerSplitVertSize=n " New split window is n columns wide. + let g:bufExplorerSplitVertSize=0 " New split windows size set by Vim. The default is 0, so that the size is set by Vim. + *g:bufExplorerVersionWarn* +To control whether to warning about Vim version or not, use: > + let g:bufExplorerVersionWarn=1 " Warn if version conflict. + let g:bufExplorerVersionWarn=0 " Do not warn if version conflict. +The default is 1. + =============================================================================== CHANGE LOG *bufexplorer-changelog* +7.4.23 January 23, 2022 + - Merged in changes from benoit-pierre that fixes an error thrown when vim + is in read-only mode. + - Merged in changes from tartansandal that implements the use of an + independent variable to track window splitting since s:splitMode != '' + no longer implies that a split was triggered. +7.4.22 January 5,2022 + - Merged in change from nadean that fixed an issue that if you use either + split mode, you could no longer use the regular non-split mode. This was + because the split mode set s:splitMode and that variable was never reset + to "" to allow you run without split mode. +7.4.21 December 8, 2018 + - Merged in changes from adelarsq that introduced ryanoasis/vim-devicons + support. If the global g:loaded_webdevicons has been set, bufexplorer + will now load the associated dev icons for each buffer. +7.4.20 January 18, 2017 + - Thanks to jpflouret for supplying code that can remove the warning + messages if you using this plugin on an older version of Vim. The + global variable is g:bufExplorerVersionWarn. +7.4.19 September 18, 2017 + - Merged all changes from github back into this version and tried to sync + to the correct version number. +7.4.18 - Github. +7.4.17 - Github. +7.4.16 August 14, 2017 + - Thanks to Yubo Su for the patch that adds 'f, F, V, and v' commands. + With this change, the original 'f' command was remapped to 'a'. + + The set of commands that can be used during exploring are: + F - Open selected buffer in another window above the current. + f - Open selected buffer in another window below the current. + V - Open the selected buffer in another window on the left of the + current. + v - Open the selected buffer in another window on the right of the + current. +7.4.15 May 01, 2017 + - Finally applied the patch submitted by justfalter. This patch is a + backward-compatible fix for the "invalid tab range" bug. +7.4.14 April 10, 2017 + - As suggested by adelarsq way back on January 5th, 2016, a filetype has + been added. There is now 'filetype=bufexplorer'. +7.4.13 March 08, 2017 + - Thanks to devakivamsi for pointing out that even though bufexplorer + turns off line numbers by default within its own window, this did not + work correctly when using WinManager. This has now been corrected. +7.4.12 September 30, 2016 + - Thanks again to Martin Vuille for several more fixes related to making + bufexplorer more tab-friendly. +7.4.11 September, 20, 2016 + - Thanks to Martin Vuille for reworking the per-tab buffer listing code. + Fix for g:bufExplorerShowTabBuffer is not working correctly and other + "gliches" when the ShotTabBuffer option is enabled. For example old + code would not correctly handle adding/deleting a tab that wasn't the + highest-numbered tab. +7.4.10 August 26, 2016 + - Thanks to buddylindsey for fixing a misspelling in the docs. +7.4.9 April 01, 2016 + - Thanks to ivegotasthma for supplying a patch to fix a major issue with + plugin performance when lots of buffers are open. + - Thanks to ershov for the patch to fix grouping of files in ambiguous + sort modes. + - Thanks to PhilRunninger for changing documentation to use , in + place of '\'. +7.4.8 January 27, 2015 + - Thanks to Marius Gedminas for fixing up the documentation and correcting + various typos. +7.4.7 January 20, 2015 + - Thanks goes out to Phil Runninger for added the ability to toggle the + bufexplorer list on and off using the :ToggleBufExplorer command, the + map bt, and the function ToggleBufExplorer(). 7.4.6 November 03, 2014 - Not sure how, but the file format was converted to Dos instead of Unix. I converted the file back to Unix. @@ -275,7 +358,7 @@ CHANGE LOG *bufexplorer-changelog* - First update related to Vim 7.4. - Changed license text. - Fixed issue with 'hidden'. If 'hidden' is set, make sure that - g:bufExplorerFindActive is set to 0. Otherwise, when using /bs or /bv, + g:bufExplorerFindActive is set to 0. Otherwise, when using \bs or \bv, and selecting a buffer, the original buffer will be switched to instead of being opened in the newly created windows. - Added new 'b' mapping when the bufExplorer window is opened. When 'b' @@ -332,7 +415,7 @@ CHANGE LOG *bufexplorer-changelog* fixes. Overall, I am hopeful that I not forgotten or lost a feature. - Thanks to Tim Johnson for testing out this new version. - I have hopefully allowed for better mapping of the main public - methods as is explained in the|bufexplorer-customization|section + methods as is explained in the |bufexplorer-customization| section of the documentation. - Add new 'B', 'o', and 'S' key mappings. 7.2.8 November 08, 2010 @@ -503,7 +586,7 @@ CHANGE LOG *bufexplorer-changelog* - Dave Eggum has made some 'significant' updates to this latest version: * Added BufExplorerGetAltBuf() global function to be used in the - user’s rulerformat. + user's rulerformat. * Added g:bufExplorerSplitRight option. * Added g:bufExplorerShowRelativePath option with mapping. * Added current line highlighting. @@ -630,7 +713,7 @@ CHANGE LOG *bufexplorer-changelog* - Thanks to Andre Pang for the original patch/idea to get bufexplorer to work in insertmode/modeless mode (evim). - Added Initialize and Cleanup autocommands to handle commands that - need to be performed when starting or leaving bufexplorer. + need to be performed when starting or leaving bufexplorer. 6.0.15 February 20, 2002 - Srinath Avadhanulax added a patch for winmanager.vim. 6.0.14 February 19, 2002 @@ -692,7 +775,7 @@ TODO *bufexplorer-todo* =============================================================================== CREDITS *bufexplorer-credits* -Author: Jeff Lanzarotta +Author: Jeff Lanzarotta Credit must go out to Bram Moolenaar and all the Vim developers for making the world's best editor (IMHO). I also want to thank everyone who @@ -702,7 +785,7 @@ won't list names. =============================================================================== COPYRIGHT *bufexplorer-copyright* -Copyright (c) 2001-2014, Jeff Lanzarotta +Copyright (c) 2001-2022, Jeff Lanzarotta All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/sources_non_forked/bufexplorer/plugin/bufexplorer.vim b/sources_non_forked/bufexplorer/plugin/bufexplorer.vim index f3d9b9ca..87544160 100644 --- a/sources_non_forked/bufexplorer/plugin/bufexplorer.vim +++ b/sources_non_forked/bufexplorer/plugin/bufexplorer.vim @@ -1,5 +1,5 @@ -"============================================================================= -" Copyright: Copyright (c) 2001-2014, Jeff Lanzarotta +"============================================================================ +" Copyright: Copyright (c) 2001-2022, Jeff Lanzarotta " All rights reserved. " " Redistribution and use in source and binary forms, with or @@ -35,8 +35,8 @@ " EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. " Name Of File: bufexplorer.vim " Description: Buffer Explorer Vim Plugin -" Maintainer: Jeff Lanzarotta (delux256-vim at yahoo dot com) -" Last Changed: Monday, 03 November 2014 +" Maintainer: Jeff Lanzarotta (my name at gmail dot com) +" Last Changed: Thursday, 02 May 2022 " Version: See g:bufexplorer_version for version number. " Usage: This file should reside in the plugin directory and be " automatically sourced. @@ -44,6 +44,7 @@ " You may use the default keymappings of " " be - Opens BufExplorer +" bt - Toggles BufExplorer open or closed " bs - Opens horizontally split window BufExplorer " bv - Opens vertically split window BufExplorer " @@ -51,12 +52,14 @@ " in your vimrc file, for example: " " nnoremap :BufExplorer +" nnoremap :ToggleBufExplorer " nnoremap :BufExplorerHorizontalSplit " nnoremap :BufExplorerVerticalSplit " " Or you can use " " ":BufExplorer" - Opens BufExplorer +" ":ToggleBufExplorer" - Opens/Closes BufExplorer " ":BufExplorerHorizontalSplit" - Opens horizontally window BufExplorer " ":BufExplorerVerticalSplit" - Opens vertically split window BufExplorer " @@ -64,26 +67,45 @@ " History: See supplied documentation. "============================================================================= -" Plugin Code {{{1 -" Exit quickly if already running or when 'compatible' is set. {{{2 +" Exit quickly if already running or when 'compatible' is set. {{{1 if exists("g:bufexplorer_version") || &cp finish endif -"2}}} +"1}}} " Version number -let g:bufexplorer_version = "7.4.6" +let g:bufexplorer_version = "7.4.24" +" Plugin Code {{{1 " Check for Vim version {{{2 +if !exists("g:bufExplorerVersionWarn") + let g:bufExplorerVersionWarn = 1 +endif + if v:version < 700 - echohl WarningMsg - echo "Sorry, bufexplorer ".g:bufexplorer_version." required Vim 7.0 and greater." - echohl None + if g:bufExplorerVersionWarn + echohl WarningMsg + echo "Sorry, bufexplorer ".g:bufexplorer_version." required Vim 7.0 or greater." + echohl None + endif + finish +endif +" Check to see if the version of Vim has the correct patch applied, if not, do +" not used . +if v:version > 703 || v:version == 703 && has('patch1261') && has('patch1264') + " We are good to go. +else + if g:bufExplorerVersionWarn + echohl WarningMsg + echo "Sorry, bufexplorer ".g:bufexplorer_version." required Vim 7.3 or greater with patch1261 and patch1264." + echohl None + endif finish endif " Create commands {{{2 command! BufExplorer :call BufExplorer() +command! ToggleBufExplorer :call ToggleBufExplorer() command! BufExplorerHorizontalSplit :call BufExplorerHorizontalSplit() command! BufExplorerVerticalSplit :call BufExplorerVerticalSplit() @@ -103,14 +125,14 @@ function! s:Set(var, default) endfunction " Script variables {{{2 -let s:MRU_Exclude_List = ["[BufExplorer]","__MRU_Files__"] +let s:MRU_Exclude_List = ["[BufExplorer]","__MRU_Files__","[Buf\ List]"] let s:MRUList = [] let s:name = '[BufExplorer]' let s:originBuffer = 0 let s:running = 0 let s:sort_by = ["number", "name", "fullpath", "mru", "extension"] let s:splitMode = "" -let s:tabSpace = [] +let s:didSplit = 0 let s:types = {"fullname": ':p', "path": ':p:h', "relativename": ':~:.', "relativepath": ':~:.:h', "shortname": ':t'} " Setup the autocommands that handle the MRUList and other stuff. {{{2 @@ -128,8 +150,6 @@ function! s:Setup() autocmd BufDelete * call s:DeactivateBuffer(0) autocmd BufWinEnter \[BufExplorer\] call s:Initialize() autocmd BufWinLeave \[BufExplorer\] call s:Cleanup() - autocmd TabEnter * call s:TabEnter() - autocmd SessionLoadPost * call s:Reset() augroup END endfunction @@ -139,82 +159,128 @@ function! s:Reset() " command line are picked up correctly. let s:MRUList = range(1, bufnr('$')) - " Initialize one tab space array, ignore zero-based tabpagenr since all - " tabpagenr's start at 1. -1 signifies this is the first time we are - " referencing this tabpagenr. - " - " If Vim has been loaded with mksession, then it is possible for more tabs - " to exist. So use tabpagenr() to determine how large to make the array. If - " there are 4 tabs, there should be 5 elements in this array. - " - " Each element will hold a CSV list of buffers viewed in that tab. So on - " the 3rd tab, if there user has viewed 4 different buffers in that tab, the - " value would be: - " echo s:tabSpace[3] - " [4, 9, 1, 10] - " echo s:tabSpace - " [[-1], [-1], [-1], [4, 9, 1, 10], [-1]] - let s:tabSpace = [] - let i = 0 + " Initialize the association of buffers to tabs for any buffers + " that have been created prior to now, e.g., files specified as + " vim command line arguments + call s:CatalogBuffers() +endfunction - while(tabpagenr('$') > 0 && i <= tabpagenr('$')) - call add(s:tabSpace, [-1]) - let i = i + 1 - endwhile +" CatalogBuffers {{{2 +" Create tab associations for any existing buffers +function! s:CatalogBuffers() + let ct = tabpagenr() + + for tab in range(1, tabpagenr('$')) + silent execute 'normal! ' . tab . 'gt' + for buf in tabpagebuflist() + call s:UpdateTabBufData(buf) + endfor + endfor + + silent execute 'normal! ' . ct . 'gt' +endfunction + +" AssociatedTab {{{2 +" Return the number of the tab associated with the specified buffer. +" If the buffer is associated with more than one tab, the first one +" found is returned. If the buffer is not associated with any tabs, +" -1 is returned. +function! s:AssociatedTab(bufnr) + for tab in range(1, tabpagenr('$')) + let list = gettabvar(tab, 'bufexp_buf_list', []) + let idx = index(list, a:bufnr) + if idx != -1 + return tab + endif + endfor + + return -1 +endfunction + +" RemoveBufFromOtherTabs {{{2 +" Remove the specified buffer from the buffer lists of all tabs +" except the current tab. +function! s:RemoveBufFromOtherTabs(bufnr) + for tab in range(1, tabpagenr('$')) + if tab == tabpagenr() + continue + endif + + let list = gettabvar(tab, 'bufexp_buf_list', []) + let idx = index(list, a:bufnr) + if idx == -1 + continue + endif + + call remove(list, idx) + call settabvar(tab, 'bufexp_buf_list', list) + endfor +endfunction + +" AddBufToCurrentTab {{{2 +" Add the specified buffer to the list of buffers associated +" with the current tab +function! s:AddBufToCurrentTab(bufnr) + if index(t:bufexp_buf_list, a:bufnr) == -1 + call add(t:bufexp_buf_list, a:bufnr) + endif +endfunction + +" IsInCurrentTab {{{2 +" Returns whether the specified buffer is associated +" with the current tab +function! s:IsInCurrentTab(bufnr) + " It shouldn't happen that the list of buffers is + " not defined but if it does, play it safe and + " include the buffer + if !exists('t:bufexp_buf_list') + return 1 + endif + + return (index(t:bufexp_buf_list, a:bufnr) != -1) +endfunction + +" UpdateTabBufData {{{2 +" Update the tab buffer data for the specified buffer +" +" The current tab's list is updated. If a buffer is only +" allowed to be associated with one tab, it is removed +" from the lists of any other tabs with which it may have +" been associated. +" +" The associations between tabs and buffers are maintained +" in separate lists for each tab, which are stored in tab- +" specific variables 't:bufexp_buf_list'. +function! s:UpdateTabBufData(bufnr) + " The first time we add a tab, Vim uses the current buffer + " as its starting page even though we are about to edit a + " new page, and another BufEnter for the new page is triggered + " later. Use this first BufEnter to initialize the list of + " buffers, but don't add the buffer number to the list if + " it is already associated with another tab + " + " Unfortunately, this doesn't work right when the first + " buffer opened in the tab should be associated with it, + " such as when 'tab split +buffer N' is used + if !exists("t:bufexp_buf_list") + let t:bufexp_buf_list = [] + + if s:AssociatedTab(a:bufnr) != -1 + return + endif + endif + + call s:AddBufToCurrentTab(a:bufnr) + + if g:bufExplorerOnlyOneTab + call s:RemoveBufFromOtherTabs(a:bufnr) + endif endfunction " ActivateBuffer {{{2 function! s:ActivateBuffer() - " Verify the current tabpage exists in the - " current s:tabSpace array. This can be missing - " entries when restoring sessions. - let i = 0 - while( tabpagenr('$') > 0 && i <= tabpagenr() ) - " Number: 0 - " String: 1 - " Funcref: 2 - " List: 3 - " Dictionary: 4 - " Float: 5 - if type(get(s:tabSpace, i)) == 0 - call add(s:tabSpace, [-1]) - endif - - let i = i + 1 - endwhile - let _bufnr = bufnr("%") - let list = get(s:tabSpace, tabpagenr(), [-1]) - - if !empty(list) && list[0] == '-1' - " The first time we add a tab, Vim uses the current buffer - " as it's starting page. Even though we are about to - " edit a new page (BufEnter is triggered after), so - " remove the -1 entry indicating we have covered this case. - let list = [] - call add(list, _bufnr) - let s:tabSpace[tabpagenr()] = list - elseif empty(list) || index(list, _bufnr) == -1 - " Add new buffer to this tab's buffer list. - call add(list, _bufnr) - let s:tabSpace[tabpagenr()] = list - - if g:bufExplorerOnlyOneTab == 1 - " If a buffer can only be available in 1 tab page ensure this - " buffer is not present in any other tabs - let tabidx = 1 - while tabidx < len(s:tabSpace) - if tabidx != tabpagenr() - let bufidx = index(s:tabSpace[tabidx], _bufnr) - if bufidx != -1 - call remove(s:tabSpace[tabidx], bufidx) - endif - endif - let tabidx = tabidx + 1 - endwhile - endif - endif - + call s:UpdateTabBufData(_bufnr) call s:MRUPush(_bufnr) endfunction @@ -224,14 +290,6 @@ function! s:DeactivateBuffer(remove) call s:MRUPop(_bufnr) endfunction -" TabEnter {{{2 -function! s:TabEnter() - " Make s:tabSpace 1-based - if empty(s:tabSpace) || len(s:tabSpace) < (tabpagenr() + 1) - call add(s:tabSpace, [-1]) - endif -endfunction - " MRUPop {{{2 function! s:MRUPop(bufnr) call filter(s:MRUList, 'v:val != '.a:bufnr) @@ -255,7 +313,7 @@ endfunction " ShouldIgnore {{{2 function! s:ShouldIgnore(buf) " Ignore temporary buffers with buftype set. - if empty(getbufvar(a:buf, "&buftype") == 0) + if empty(getbufvar(a:buf, "&buftype")) == 0 return 1 endif @@ -280,26 +338,7 @@ endfunction " Initialize {{{2 function! s:Initialize() - let s:_insertmode = &insertmode - set noinsertmode - - let s:_showcmd = &showcmd - set noshowcmd - - let s:_cpo = &cpo - set cpo&vim - - let s:_report = &report - let &report = 10000 - - setlocal nonumber - setlocal foldcolumn=0 - setlocal nofoldenable - setlocal cursorline - setlocal nospell - - setlocal nobuflisted - + call s:SetLocalSettings() let s:running = 1 endfunction @@ -323,20 +362,55 @@ function! s:Cleanup() let s:running = 0 let s:splitMode = "" + let s:didSplit = 0 delmarks! endfunction +" SetLocalSettings {{{2 +function! s:SetLocalSettings() + let s:_insertmode = &insertmode + set noinsertmode + + let s:_showcmd = &showcmd + set noshowcmd + + let s:_cpo = &cpo + set cpo&vim + + let s:_report = &report + let &report = 10000 + + setlocal nonumber + setlocal foldcolumn=0 + setlocal nofoldenable + setlocal cursorline + setlocal nospell + setlocal nobuflisted + setlocal filetype=bufexplorer +endfunction + " BufExplorerHorizontalSplit {{{2 function! BufExplorerHorizontalSplit() let s:splitMode = "sp" execute "BufExplorer" + let s:splitMode = "" endfunction " BufExplorerVerticalSplit {{{2 function! BufExplorerVerticalSplit() let s:splitMode = "vsp" execute "BufExplorer" + let s:splitMode = "" +endfunction + +" ToggleBufExplorer {{{2 +function! ToggleBufExplorer() + if exists("s:running") && s:running == 1 && bufname(winbufnr(0)) == s:name + call s:Close() + else + call BufExplorer() + endif endfunction " BufExplorer {{{2 @@ -381,6 +455,9 @@ function! BufExplorer() " Restore the original settings. let [&splitbelow, &splitright] = [_splitbelow, _splitright] + + " Remember that a split was triggered + let s:didSplit = 1 endif if !exists("b:displayMode") || b:displayMode != "winmanager" @@ -403,6 +480,7 @@ function! s:DisplayBufferList() " the buffer using CTRL-^. setlocal buftype=nofile setlocal modifiable + setlocal noreadonly setlocal noswapfile setlocal nowrap @@ -431,28 +509,31 @@ function! s:MapKeys() nnoremap :call SelectBuffer() endif - nnoremap