Adding updates and my_configs

This commit is contained in:
André Brandão 2025-03-04 12:23:40 -08:00
parent 46294d589d
commit e8333a46e3
115 changed files with 1908 additions and 1300 deletions

32
my_configs.vim Normal file
View File

@ -0,0 +1,32 @@
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" => VIM user interface
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Show line number
set nu
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" => Text, tab and indent related
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Use spaces instead of tabs
set expandtab
" Be smart when using tabs ;)
set smarttab
" 1 tab == 3 spaces
set shiftwidth=3
set tabstop=3
" Linebreak on 500 characters
set lbr
set tw=500
set ai "Auto indent
set si "Smart indent
set wrap "Wrap lines
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" => Nerd Tree
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
let g:NERDTreeWinPos = "left"
map <F12> :NERDTreeToggle<cr>

View File

@ -0,0 +1,22 @@
" Author: Koni Marti <koni.marti@gmail.com>
" Description: A Language Server implementation for C3
call ale#Set('c3_c3lsp_executable', 'c3lsp')
call ale#Set('c3_c3lsp_options', '')
call ale#Set('c3_c3lsp_init_options', {})
function! ale_linters#c3#c3lsp#GetCommand(buffer) abort
let l:executable = ale#Var(a:buffer, 'c3_c3lsp_executable')
return ale#Escape(l:executable) . ale#Pad(ale#Var(a:buffer, 'c3_c3lsp_options'))
endfunction
call ale#linter#Define('c3', {
\ 'name': 'c3lsp',
\ 'lsp': 'stdio',
\ 'executable': {b -> ale#Var(b, 'c3_c3lsp_executable')},
\ 'command': function('ale_linters#c3#c3lsp#GetCommand'),
\ 'project_root': function('ale#handlers#c3lsp#GetProjectRoot'),
\ 'lsp_config': {b -> ale#handlers#c3lsp#GetInitOpts(b, 'c3_c3lsp_init_options')},
\})

View File

@ -53,4 +53,5 @@ call ale#linter#Define('erlang', {
\ 'command': function('s:GetCommand'), \ 'command': function('s:GetCommand'),
\ 'lsp': 'stdio', \ 'lsp': 'stdio',
\ 'project_root': function('s:FindProjectRoot'), \ 'project_root': function('s:FindProjectRoot'),
\ 'aliases': ['erlang-ls'],
\}) \})

View File

@ -5,7 +5,7 @@ call ale#Set('json_jq_filters', '.')
" Matches patterns like the following: " Matches patterns like the following:
" parse error: Expected another key-value pair at line 4, column 3 " parse error: Expected another key-value pair at line 4, column 3
let s:pattern = '^parse error: \(.\+\) at line \(\d\+\), column \(\d\+\)$' let s:pattern = 'parse error: \(.\+\) at line \(\d\+\), column \(\d\+\)$'
function! ale_linters#json#jq#Handle(buffer, lines) abort function! ale_linters#json#jq#Handle(buffer, lines) abort
return ale#util#MapMatches(a:lines, s:pattern, {match -> { return ale#util#MapMatches(a:lines, s:pattern, {match -> {

View File

@ -22,7 +22,7 @@ function! ale_linters#php#phpstan#GetCommand(buffer, version) abort
let l:memory_limit = ale#Var(a:buffer, 'php_phpstan_memory_limit') let l:memory_limit = ale#Var(a:buffer, 'php_phpstan_memory_limit')
let l:memory_limit_option = !empty(l:memory_limit) let l:memory_limit_option = !empty(l:memory_limit)
\ ? ' --memory-limit ' . ale#Escape(l:memory_limit) \ ? ' --memory-limit=' . ale#Escape(l:memory_limit)
\ : '' \ : ''
let l:level = ale#Var(a:buffer, 'php_phpstan_level') let l:level = ale#Var(a:buffer, 'php_phpstan_level')

View File

@ -45,7 +45,7 @@ function! ale_linters#python#bandit#GetCommand(buffer) abort
endif endif
endif endif
let l:exec_args = l:executable =~? 'pipenv\|poetry\|uv$' let l:exec_args = l:executable =~? '\(pipenv\|poetry\|uv\)$'
\ ? ' run bandit' \ ? ' run bandit'
\ : '' \ : ''

View File

@ -74,7 +74,7 @@ endfunction
function! ale_linters#python#flake8#GetCommand(buffer, version) abort function! ale_linters#python#flake8#GetCommand(buffer, version) abort
let l:executable = ale_linters#python#flake8#GetExecutable(a:buffer) let l:executable = ale_linters#python#flake8#GetExecutable(a:buffer)
let l:exec_args = l:executable =~? 'pipenv\|poetry\|uv$' let l:exec_args = l:executable =~? '\(pipenv\|poetry\|uv\)$'
\ ? ' run flake8' \ ? ' run flake8'
\ : '' \ : ''

View File

@ -74,7 +74,7 @@ endfunction
function! ale_linters#python#flakehell#GetCommand(buffer, version) abort function! ale_linters#python#flakehell#GetCommand(buffer, version) abort
let l:executable = ale_linters#python#flakehell#GetExecutable(a:buffer) let l:executable = ale_linters#python#flakehell#GetExecutable(a:buffer)
if (l:executable =~? 'pipenv\|poetry\|uv$') if (l:executable =~? '\(pipenv\|poetry\|uv\)$')
let l:exec_args = ' run flakehell' let l:exec_args = ' run flakehell'
elseif (l:executable is? 'python') elseif (l:executable is? 'python')
let l:exec_args = ' -m flakehell' let l:exec_args = ' -m flakehell'

View File

@ -28,7 +28,7 @@ endfunction
function! ale_linters#python#jedils#GetCommand(buffer) abort function! ale_linters#python#jedils#GetCommand(buffer) abort
let l:executable = ale_linters#python#jedils#GetExecutable(a:buffer) let l:executable = ale_linters#python#jedils#GetExecutable(a:buffer)
let l:exec_args = l:executable =~? 'pipenv\|poetry\|uv$' let l:exec_args = l:executable =~? '\(pipenv\|poetry\|uv\)$'
\ ? ' run jedi-language-server' \ ? ' run jedi-language-server'
\ : '' \ : ''
let l:env_string = '' let l:env_string = ''

View File

@ -49,7 +49,7 @@ endfunction
function! ale_linters#python#mypy#GetCommand(buffer) abort function! ale_linters#python#mypy#GetCommand(buffer) abort
let l:executable = ale_linters#python#mypy#GetExecutable(a:buffer) let l:executable = ale_linters#python#mypy#GetExecutable(a:buffer)
let l:exec_args = l:executable =~? 'pipenv\|poetry\|uv$' let l:exec_args = l:executable =~? '\(pipenv\|poetry\|uv\)$'
\ ? ' run mypy' \ ? ' run mypy'
\ : '' \ : ''

View File

@ -35,7 +35,7 @@ endfunction
function! ale_linters#python#prospector#GetCommand(buffer) abort function! ale_linters#python#prospector#GetCommand(buffer) abort
let l:executable = ale_linters#python#prospector#GetExecutable(a:buffer) let l:executable = ale_linters#python#prospector#GetExecutable(a:buffer)
let l:exec_args = l:executable =~? 'pipenv\|poetry\|uv$' let l:exec_args = l:executable =~? '\(pipenv\|poetry\|uv\)$'
\ ? ' run prospector' \ ? ' run prospector'
\ : '' \ : ''

View File

@ -42,7 +42,7 @@ endfunction
function! ale_linters#python#pycln#GetCommand(buffer, version) abort function! ale_linters#python#pycln#GetCommand(buffer, version) abort
let l:executable = ale_linters#python#pycln#GetExecutable(a:buffer) let l:executable = ale_linters#python#pycln#GetExecutable(a:buffer)
let l:exec_args = l:executable =~? 'pipenv\|poetry\|uv$' let l:exec_args = l:executable =~? '\(pipenv\|poetry\|uv\)$'
\ ? ' run pycln' \ ? ' run pycln'
\ : '' \ : ''

View File

@ -30,7 +30,7 @@ endfunction
function! ale_linters#python#pycodestyle#GetCommand(buffer) abort function! ale_linters#python#pycodestyle#GetCommand(buffer) abort
let l:executable = ale_linters#python#pycodestyle#GetExecutable(a:buffer) let l:executable = ale_linters#python#pycodestyle#GetExecutable(a:buffer)
let l:exec_args = l:executable =~? 'pipenv\|poetry\|uv$' let l:exec_args = l:executable =~? '\(pipenv\|poetry\|uv\)$'
\ ? ' run pycodestyle' \ ? ' run pycodestyle'
\ : '' \ : ''

View File

@ -29,7 +29,7 @@ endfunction
function! ale_linters#python#pydocstyle#GetCommand(buffer) abort function! ale_linters#python#pydocstyle#GetCommand(buffer) abort
let l:executable = ale_linters#python#pydocstyle#GetExecutable(a:buffer) let l:executable = ale_linters#python#pydocstyle#GetExecutable(a:buffer)
let l:exec_args = l:executable =~? 'pipenv\|poetry\|uv$' let l:exec_args = l:executable =~? '\(pipenv\|poetry\|uv\)$'
\ ? ' run pydocstyle' \ ? ' run pydocstyle'
\ : '' \ : ''

View File

@ -29,7 +29,7 @@ endfunction
function! ale_linters#python#pyflakes#GetCommand(buffer) abort function! ale_linters#python#pyflakes#GetCommand(buffer) abort
let l:executable = ale_linters#python#pyflakes#GetExecutable(a:buffer) let l:executable = ale_linters#python#pyflakes#GetExecutable(a:buffer)
let l:exec_args = l:executable =~? 'pipenv\|poetry\|uv$' let l:exec_args = l:executable =~? '\(pipenv\|poetry\|uv\)$'
\ ? ' run pyflakes' \ ? ' run pyflakes'
\ : '' \ : ''

View File

@ -30,7 +30,7 @@ endfunction
function! ale_linters#python#pylama#RunWithVersionCheck(buffer) abort function! ale_linters#python#pylama#RunWithVersionCheck(buffer) abort
let l:executable = ale_linters#python#pylama#GetExecutable(a:buffer) let l:executable = ale_linters#python#pylama#GetExecutable(a:buffer)
let l:exec_args = l:executable =~? 'pipenv\|poetry\|uv$' let l:exec_args = l:executable =~? '\(pipenv\|poetry\|uv\)$'
\ ? ' run pylama' \ ? ' run pylama'
\ : '' \ : ''
@ -59,7 +59,7 @@ endfunction
function! ale_linters#python#pylama#GetCommand(buffer, version) abort function! ale_linters#python#pylama#GetCommand(buffer, version) abort
let l:executable = ale_linters#python#pylama#GetExecutable(a:buffer) let l:executable = ale_linters#python#pylama#GetExecutable(a:buffer)
let l:exec_args = l:executable =~? 'pipenv\|poetry\|uv$' let l:exec_args = l:executable =~? '\(pipenv\|poetry\|uv\)$'
\ ? ' run pylama' \ ? ' run pylama'
\ : '' \ : ''

View File

@ -44,7 +44,7 @@ endfunction
function! ale_linters#python#pylint#GetCommand(buffer, version) abort function! ale_linters#python#pylint#GetCommand(buffer, version) abort
let l:executable = ale_linters#python#pylint#GetExecutable(a:buffer) let l:executable = ale_linters#python#pylint#GetExecutable(a:buffer)
let l:exec_args = l:executable =~? 'pipenv\|poetry\|uv$' let l:exec_args = l:executable =~? '\(pipenv\|poetry\|uv\)$'
\ ? ' run pylint' \ ? ' run pylint'
\ : '' \ : ''

View File

@ -43,7 +43,7 @@ endfunction
function! ale_linters#python#pylsp#GetCommand(buffer) abort function! ale_linters#python#pylsp#GetCommand(buffer) abort
let l:executable = ale_linters#python#pylsp#GetExecutable(a:buffer) let l:executable = ale_linters#python#pylsp#GetExecutable(a:buffer)
let l:exec_args = l:executable =~? 'pipenv\|poetry\|uv$' let l:exec_args = l:executable =~? '\(pipenv\|poetry\|uv\)$'
\ ? ' run pylsp' \ ? ' run pylsp'
\ : '' \ : ''
let l:env_string = '' let l:env_string = ''

View File

@ -28,7 +28,7 @@ endfunction
function! ale_linters#python#pyre#GetCommand(buffer) abort function! ale_linters#python#pyre#GetCommand(buffer) abort
let l:executable = ale_linters#python#pyre#GetExecutable(a:buffer) let l:executable = ale_linters#python#pyre#GetExecutable(a:buffer)
let l:exec_args = (l:executable =~? 'pipenv\|poetry\|uv$' ? ' run pyre' : '') . ' persistent' let l:exec_args = (l:executable =~? '\(pipenv\|poetry\|uv\)$' ? ' run pyre' : '') . ' persistent'
return ale#Escape(l:executable) . l:exec_args return ale#Escape(l:executable) . l:exec_args
endfunction endfunction

View File

@ -70,7 +70,7 @@ endfunction
function! ale_linters#python#pyright#GetCommand(buffer) abort function! ale_linters#python#pyright#GetCommand(buffer) abort
let l:executable = ale_linters#python#pyright#GetExecutable(a:buffer) let l:executable = ale_linters#python#pyright#GetExecutable(a:buffer)
let l:exec_args = l:executable =~? 'pipenv\|poetry\|uv$' let l:exec_args = l:executable =~? '\(pipenv\|poetry\|uv\)$'
\ ? ' run pyright-langserver' \ ? ' run pyright-langserver'
\ : '' \ : ''
let l:env_string = '' let l:env_string = ''

View File

@ -41,7 +41,7 @@ endfunction
function! ale_linters#python#refurb#GetCommand(buffer) abort function! ale_linters#python#refurb#GetCommand(buffer) abort
let l:executable = ale_linters#python#refurb#GetExecutable(a:buffer) let l:executable = ale_linters#python#refurb#GetExecutable(a:buffer)
let l:exec_args = l:executable =~? 'pipenv\|poetry\|uv$' let l:exec_args = l:executable =~? '\(pipenv\|poetry\|uv\)$'
\ ? ' run refurb' \ ? ' run refurb'
\ : '' \ : ''

View File

@ -47,7 +47,7 @@ endfunction
function! ale_linters#python#ruff#GetCommand(buffer, version) abort function! ale_linters#python#ruff#GetCommand(buffer, version) abort
let l:executable = ale_linters#python#ruff#GetExecutable(a:buffer) let l:executable = ale_linters#python#ruff#GetExecutable(a:buffer)
let l:exec_args = l:executable =~? 'pipenv\|poetry\|uv$' let l:exec_args = l:executable =~? '\(pipenv\|poetry\|uv\)$'
\ ? ' run ruff' \ ? ' run ruff'
\ : '' \ : ''

View File

@ -28,7 +28,7 @@ endfunction
function! ale_linters#python#unimport#GetCommand(buffer) abort function! ale_linters#python#unimport#GetCommand(buffer) abort
let l:executable = ale_linters#python#unimport#GetExecutable(a:buffer) let l:executable = ale_linters#python#unimport#GetExecutable(a:buffer)
let l:exec_args = l:executable =~? 'pipenv\|poetry\|uv$' let l:exec_args = l:executable =~? '\(pipenv\|poetry\|uv\)$'
\ ? ' run unimport' \ ? ' run unimport'
\ : '' \ : ''

View File

@ -47,7 +47,7 @@ endfunction
function! ale_linters#python#vulture#GetCommand(buffer) abort function! ale_linters#python#vulture#GetCommand(buffer) abort
let l:executable = ale_linters#python#vulture#GetExecutable(a:buffer) let l:executable = ale_linters#python#vulture#GetExecutable(a:buffer)
let l:exec_args = l:executable =~? 'pipenv\|poetry\|uv$' let l:exec_args = l:executable =~? '\(pipenv\|poetry\|uv\)$'
\ ? ' run vulture' \ ? ' run vulture'
\ : '' \ : ''
let l:lint_dest = ale#Var(a:buffer, 'python_vulture_change_directory') let l:lint_dest = ale#Var(a:buffer, 'python_vulture_change_directory')

View File

@ -1,7 +1,7 @@
" Author: Jeffrey Lau - https://github.com/zoonfafer " Author: Jeffrey Lau - https://github.com/zoonfafer
" Description: Metals Language Server for Scala https://scalameta.org/metals/ " Description: Metals Language Server for Scala https://scalameta.org/metals/
call ale#Set('scala_metals_executable', 'metals-vim') call ale#Set('scala_metals_executable', 'metals')
call ale#Set('scala_metals_project_root', '') call ale#Set('scala_metals_project_root', '')
function! ale_linters#scala#metals#GetProjectRoot(buffer) abort function! ale_linters#scala#metals#GetProjectRoot(buffer) abort

View File

@ -52,16 +52,24 @@ function! ale_linters#sql#sqlfluff#Handle(buffer, version, lines) abort
if ale#semver#GTE(a:version, [3, 0, 0]) if ale#semver#GTE(a:version, [3, 0, 0])
for l:violation in get(l:json, 'violations', []) for l:violation in get(l:json, 'violations', [])
call add(l:output, { let l:err = {
\ 'filename': l:json.filepath, \ 'filename': l:json.filepath,
\ 'lnum': l:violation.start_line_no, \ 'lnum': l:violation.start_line_no,
\ 'end_lnum': l:violation.end_line_no,
\ 'col': l:violation.start_line_pos, \ 'col': l:violation.start_line_pos,
\ 'end_col': l:violation.end_line_pos,
\ 'text': l:violation.description, \ 'text': l:violation.description,
\ 'code': l:violation.code, \ 'code': l:violation.code,
\ 'type': 'W', \ 'type': 'W',
\}) \}
if has_key(l:violation, 'end_line_no')
let l:err.end_lnum = l:violation.end_line_no
endif
if has_key(l:violation, 'end_line_pos')
let l:err.end_col = l:violation.end_line_pos
endif
call add(l:output, l:err)
endfor endfor
else else
for l:violation in get(l:json, 'violations', []) for l:violation in get(l:json, 'violations', [])

View File

@ -5,6 +5,7 @@ call ale#Set('verilog_iverilog_options', '')
function! ale_linters#verilog#iverilog#GetCommand(buffer) abort function! ale_linters#verilog#iverilog#GetCommand(buffer) abort
return 'iverilog -t null -Wall ' return 'iverilog -t null -Wall '
\ . '-y%s:h '
\ . ale#Var(a:buffer, 'verilog_iverilog_options') \ . ale#Var(a:buffer, 'verilog_iverilog_options')
\ . ' %t' \ . ' %t'
endfunction endfunction

View File

@ -20,9 +20,32 @@ function! ale_linters#yaml#actionlint#GetCommand(buffer) abort
let l:options .= ale#Pad('-oneline') let l:options .= ale#Pad('-oneline')
endif endif
let l:configfile = ale_linters#yaml#actionlint#GitRepoHasConfig(a:buffer)
if !empty(l:configfile)
let l:options .= ale#Pad('-config-file ' . l:configfile)
endif
return '%e' . ale#Pad(l:options) . ' - ' return '%e' . ale#Pad(l:options) . ' - '
endfunction endfunction
" If we have a actionlint.yml or actionlint.yaml in our github directory
" use that as our config file.
function! ale_linters#yaml#actionlint#GitRepoHasConfig(buffer) abort
let l:filename = expand('#' . a:buffer . ':p')
let l:configfilebase = substitute(l:filename, '\.github/.*', '.github/actionlint.','')
for l:ext in ['yml', 'yaml']
let l:configfile = l:configfilebase . l:ext
if filereadable(l:configfile)
return l:configfile
endif
endfor
return ''
endfunction
function! ale_linters#yaml#actionlint#Handle(buffer, lines) abort function! ale_linters#yaml#actionlint#Handle(buffer, lines) abort
" Matches patterns line the following: " Matches patterns line the following:
".github/workflows/main.yml:19:0: could not parse as YAML: yaml: line 19: mapping values are not allowed in this context [yaml-syntax] ".github/workflows/main.yml:19:0: could not parse as YAML: yaml: line 19: mapping values are not allowed in this context [yaml-syntax]

View File

@ -0,0 +1,22 @@
" Author: axhav <william@axhav.se>
call ale#Set('yaml_yq_executable', 'yq')
call ale#Set('yaml_yq_options', '')
call ale#Set('yaml_yq_filters', '.')
" Matches patterns like the following:
let s:pattern = '^Error\:.* line \(\d\+\)\: \(.\+\)$'
function! ale_linters#yaml#yq#Handle(buffer, lines) abort
return ale#util#MapMatches(a:lines, s:pattern, {match -> {
\ 'lnum': match[1] + 0,
\ 'text': match[2],
\}})
endfunction
call ale#linter#Define('yaml', {
\ 'name': 'yq',
\ 'executable': {b -> ale#Var(b, 'yaml_yq_executable')},
\ 'output_stream': 'stderr',
\ 'command': '%e',
\ 'callback': 'ale_linters#yaml#yq#Handle',
\})

View File

@ -4,11 +4,12 @@
call ale#Set('zeek_zeek_executable', 'zeek') call ale#Set('zeek_zeek_executable', 'zeek')
function! ale_linters#zeek#zeek#HandleErrors(buffer, lines) abort function! ale_linters#zeek#zeek#HandleErrors(buffer, lines) abort
let l:pattern = 'error in \v.*, line (\d+): (.*)$' let l:pattern = '\(error\|warning\) in \v.*, line (\d+): (.*)$'
return map(ale#util#GetMatches(a:lines, l:pattern), "{ return map(ale#util#GetMatches(a:lines, l:pattern), "{
\ 'lnum': str2nr(v:val[1]), \ 'lnum': str2nr(v:val[2]),
\ 'text': v:val[2], \ 'text': v:val[3],
\ 'type': (v:val[1] is# 'error') ? 'E': 'W',
\}") \}")
endfunction endfunction

View File

@ -17,6 +17,11 @@ let s:default_registry = {
\ 'suggested_filetypes': ['help'], \ 'suggested_filetypes': ['help'],
\ 'description': 'Align help tags to the right margin', \ 'description': 'Align help tags to the right margin',
\ }, \ },
\ 'apkbuild-fixer': {
\ 'function': 'ale#fixers#apkbuild_fixer#Fix',
\ 'suggested_filetypes': ['apkbuild'],
\ 'description': 'Fix policy violations found by apkbuild-lint in APKBUILDs',
\ },
\ 'autoimport': { \ 'autoimport': {
\ 'function': 'ale#fixers#autoimport#Fix', \ 'function': 'ale#fixers#autoimport#Fix',
\ 'suggested_filetypes': ['python'], \ 'suggested_filetypes': ['python'],
@ -39,7 +44,7 @@ let s:default_registry = {
\ }, \ },
\ 'biome': { \ 'biome': {
\ 'function': 'ale#fixers#biome#Fix', \ 'function': 'ale#fixers#biome#Fix',
\ 'suggested_filetypes': ['javascript', 'typescript', 'json', 'jsonc'], \ 'suggested_filetypes': ['javascript', 'typescript', 'json', 'jsonc', 'css', 'graphql'],
\ 'description': 'Fix JavaScript and TypeScript using biome.', \ 'description': 'Fix JavaScript and TypeScript using biome.',
\ }, \ },
\ 'black': { \ 'black': {
@ -98,6 +103,17 @@ let s:default_registry = {
\ 'suggested_filetypes': ['dune'], \ 'suggested_filetypes': ['dune'],
\ 'description': 'Fix dune files with dune format', \ 'description': 'Fix dune files with dune format',
\ }, \ },
\ 'erlang_mode': {
\ 'function': 'ale#fixers#erlang_mode#Fix',
\ 'suggested_filetypes': ['erlang'],
\ 'description': 'Indent with the Erlang mode for Emacs',
\ 'aliases': ['erlang-mode'],
\ },
\ 'erlfmt': {
\ 'function': 'ale#fixers#erlfmt#Fix',
\ 'suggested_filetypes': ['erlang'],
\ 'description': 'Format Erlang code with erlfmt',
\ },
\ 'fecs': { \ 'fecs': {
\ 'function': 'ale#fixers#fecs#Fix', \ 'function': 'ale#fixers#fecs#Fix',
\ 'suggested_filetypes': ['javascript', 'css', 'html'], \ 'suggested_filetypes': ['javascript', 'css', 'html'],
@ -201,6 +217,11 @@ let s:default_registry = {
\ 'suggested_filetypes': ['python'], \ 'suggested_filetypes': ['python'],
\ 'description': 'Fix Python files with yapf.', \ 'description': 'Fix Python files with yapf.',
\ }, \ },
\ 'yq': {
\ 'function': 'ale#fixers#yq#Fix',
\ 'suggested_filetypes': ['yaml'],
\ 'description': 'Fix YAML files with yq.',
\ },
\ 'rubocop': { \ 'rubocop': {
\ 'function': 'ale#fixers#rubocop#Fix', \ 'function': 'ale#fixers#rubocop#Fix',
\ 'suggested_filetypes': ['ruby'], \ 'suggested_filetypes': ['ruby'],
@ -321,6 +342,11 @@ let s:default_registry = {
\ 'suggested_filetypes': ['go'], \ 'suggested_filetypes': ['go'],
\ 'description': 'Fix Go files imports with goimports.', \ 'description': 'Fix Go files imports with goimports.',
\ }, \ },
\ 'golangci_lint': {
\ 'function': 'ale#fixers#golangci_lint#Fix',
\ 'suggested_filetypes': ['go'],
\ 'description': 'Fix Go files with golangci-lint.',
\ },
\ 'golines': { \ 'golines': {
\ 'function': 'ale#fixers#golines#Fix', \ 'function': 'ale#fixers#golines#Fix',
\ 'suggested_filetypes': ['go'], \ 'suggested_filetypes': ['go'],
@ -451,6 +477,11 @@ let s:default_registry = {
\ 'suggested_filetypes': ['json'], \ 'suggested_filetypes': ['json'],
\ 'description': 'Fix JSON files with jq.', \ 'description': 'Fix JSON files with jq.',
\ }, \ },
\ 'json_pytool': {
\ 'function': 'ale#fixers#json_pytool#Fix',
\ 'suggested_filetypes': ['json'],
\ 'description': "Fix JSON files with python's built-in json.tool module.",
\ },
\ 'protolint': { \ 'protolint': {
\ 'function': 'ale#fixers#protolint#Fix', \ 'function': 'ale#fixers#protolint#Fix',
\ 'suggested_filetypes': ['proto'], \ 'suggested_filetypes': ['proto'],
@ -666,6 +697,11 @@ let s:default_registry = {
\ 'suggested_filetypes': ['ruby'], \ 'suggested_filetypes': ['ruby'],
\ 'description': 'A formatter for Ruby source code', \ 'description': 'A formatter for Ruby source code',
\ }, \ },
\ 'cljfmt': {
\ 'function': 'ale#fixers#cljfmt#Fix',
\ 'suggested_filetypes': ['clojure'],
\ 'description': 'formatter and linter for clojure files',
\ },
\} \}
" Reset the function registry to the default entries. " Reset the function registry to the default entries.

View File

@ -0,0 +1,19 @@
" Author: Leo <thinkabit.ukim@gmail.com>
" Description: Fix policy violations found by apkbuild-lint
call ale#Set('apkbuild_apkbuild_fixer_executable', 'apkbuild-fixer')
call ale#Set('apkbuild_apkbuild_fixer_lint_executable', get(g:, 'ale_apkbuild_apkbuild_lint_executable'))
call ale#Set('apkbuild_apkbuild_fixer_options', '')
function! ale#fixers#apkbuild_fixer#Fix(buffer) abort
let l:executable = ale#Var(a:buffer, 'apkbuild_apkbuild_fixer_executable')
let l:options = ale#Var(a:buffer, 'apkbuild_apkbuild_fixer_options')
return {
\ 'command': ale#Escape(l:executable)
\ . ' -p ' . ale#Var(a:buffer, 'apkbuild_apkbuild_fixer_lint_executable')
\ . (empty(l:options) ? '' : ' ' . l:options)
\ . ' %t',
\ 'read_temporary_file': 1,
\}
endfunction

View File

@ -30,7 +30,7 @@ endfunction
function! ale#fixers#autoflake#Fix(buffer) abort function! ale#fixers#autoflake#Fix(buffer) abort
let l:executable = ale#fixers#autoflake#GetExecutable(a:buffer) let l:executable = ale#fixers#autoflake#GetExecutable(a:buffer)
let l:exec_args = l:executable =~? 'pipenv\|poetry\|uv$' let l:exec_args = l:executable =~? '\(pipenv\|poetry\|uv\)$'
\ ? ' run autoflake' \ ? ' run autoflake'
\ : '' \ : ''

View File

@ -30,7 +30,7 @@ endfunction
function! ale#fixers#autoimport#Fix(buffer) abort function! ale#fixers#autoimport#Fix(buffer) abort
let l:executable = ale#fixers#autoimport#GetExecutable(a:buffer) let l:executable = ale#fixers#autoimport#GetExecutable(a:buffer)
let l:exec_args = l:executable =~? 'pipenv\|poetry\|uv$' let l:exec_args = l:executable =~? '\(pipenv\|poetry\|uv\)$'
\ ? ' run autoimport' \ ? ' run autoimport'
\ : '' \ : ''

View File

@ -30,7 +30,7 @@ endfunction
function! ale#fixers#autopep8#Fix(buffer) abort function! ale#fixers#autopep8#Fix(buffer) abort
let l:executable = ale#fixers#autopep8#GetExecutable(a:buffer) let l:executable = ale#fixers#autopep8#GetExecutable(a:buffer)
let l:exec_args = l:executable =~? 'pipenv\|poetry\|uv$' let l:exec_args = l:executable =~? '\(pipenv\|poetry\|uv\)$'
\ ? ' run autopep8' \ ? ' run autopep8'
\ : '' \ : ''

View File

@ -32,7 +32,7 @@ function! ale#fixers#black#Fix(buffer) abort
let l:executable = ale#fixers#black#GetExecutable(a:buffer) let l:executable = ale#fixers#black#GetExecutable(a:buffer)
let l:cmd = [ale#Escape(l:executable)] let l:cmd = [ale#Escape(l:executable)]
if l:executable =~? 'pipenv\|poetry\|uv$' if l:executable =~? '\(pipenv\|poetry\|uv\)$'
call extend(l:cmd, ['run', 'black']) call extend(l:cmd, ['run', 'black'])
endif endif
@ -42,6 +42,9 @@ function! ale#fixers#black#Fix(buffer) abort
call add(l:cmd, l:options) call add(l:cmd, l:options)
endif endif
let l:fname = expand('#' . a:buffer . '...')
call add(l:cmd, '--stdin-filename '.ale#Escape(ale#path#Simplify(l:fname)))
if expand('#' . a:buffer . ':e') is? 'pyi' if expand('#' . a:buffer . ':e') is? 'pyi'
call add(l:cmd, '--pyi') call add(l:cmd, '--pyi')
endif endif

View File

@ -0,0 +1,14 @@
" Author: rudolf ordoyne <rudolfordoyne@protonmail.com>
" Description: Support for cljfmt https://github.com/weavejester/cljfmt
call ale#Set('clojure_cljfmt_executable', 'cljfmt')
function! ale#fixers#cljfmt#Fix(buffer) abort
let l:executable = ale#Var(a:buffer, 'clojure_cljfmt_executable')
return {
\ 'command': ale#Escape(l:executable) . ' fix %t',
\ 'read_temporary_file': 1,
\}
endfunction

View File

@ -0,0 +1,49 @@
" Author: Dmitri Vereshchagin <dmitri.vereshchagin@gmail.com>
" Description: Indent with the Erlang mode for Emacs
call ale#Set('erlang_erlang_mode_emacs_executable', 'emacs')
call ale#Set('erlang_erlang_mode_indent_level', 4)
call ale#Set('erlang_erlang_mode_icr_indent', 'nil')
call ale#Set('erlang_erlang_mode_indent_guard', 2)
call ale#Set('erlang_erlang_mode_argument_indent', 2)
call ale#Set('erlang_erlang_mode_indent_tabs_mode', 'nil')
let s:variables = {
\ 'erlang-indent-level': 'erlang_erlang_mode_indent_level',
\ 'erlang-icr-indent': 'erlang_erlang_mode_icr_indent',
\ 'erlang-indent-guard': 'erlang_erlang_mode_indent_guard',
\ 'erlang-argument-indent': 'erlang_erlang_mode_argument_indent',
\ 'indent-tabs-mode': 'erlang_erlang_mode_indent_tabs_mode',
\}
function! ale#fixers#erlang_mode#Fix(buffer) abort
let emacs_executable =
\ ale#Var(a:buffer, 'erlang_erlang_mode_emacs_executable')
let l:exprs = [
\ s:SetqDefault(a:buffer, s:variables),
\ '(erlang-mode)',
\ '(font-lock-fontify-region (point-min) (point-max))',
\ '(indent-region (point-min) (point-max))',
\ '(funcall (if indent-tabs-mode ''tabify ''untabify)'
\ . ' (point-min) (point-max))',
\ '(save-buffer 0)',
\]
let l:command = ale#Escape(l:emacs_executable)
\ . ' --batch'
\ . ' --find-file=%t'
\ . join(map(l:exprs, '" --eval=" . ale#Escape(v:val)'), '')
return {'command': l:command, 'read_temporary_file': 1}
endfunction
function! s:SetqDefault(buffer, variables) abort
let l:args = []
for [l:emacs_name, l:ale_name] in items(a:variables)
let l:args += [l:emacs_name, ale#Var(a:buffer, l:ale_name)]
endfor
return '(setq-default ' . join(l:args) . ')'
endfunction

View File

@ -13,9 +13,7 @@ function! ale#fixers#erlfmt#Fix(buffer) abort
let l:options = ale#Var(a:buffer, 'erlang_erlfmt_options') let l:options = ale#Var(a:buffer, 'erlang_erlfmt_options')
let l:executable = ale#fixers#erlfmt#GetExecutable(a:buffer) let l:executable = ale#fixers#erlfmt#GetExecutable(a:buffer)
let l:command = ale#Escape(l:executable) . (empty(l:options) ? '' : ' ' . l:options) . ' %s' let l:command = ale#Escape(l:executable) . ale#Pad(l:options) . ' -'
return { return {'command': l:command}
\ 'command': l:command
\}
endfunction endfunction

View File

@ -0,0 +1,32 @@
" Author: Ian Stapleton Cordasco <graffatcolmingov@gmail.com>
" Description: Run golangci-lint with the --fix flag to autofix some issues
call ale#Set('go_golangci_lint_options', '')
call ale#Set('go_golangci_lint_executable', 'golangci-lint')
call ale#Set('go_golangci_lint_package', 1)
function! ale#fixers#golangci_lint#GetCommand(buffer) abort
let l:filename = expand('#' . a:buffer . ':t')
let l:executable = ale#Var(a:buffer, 'go_golangci_lint_executable')
let l:options = ale#Var(a:buffer, 'go_golangci_lint_options') . ' --fix'
let l:package_mode = ale#Var(a:buffer, 'go_golangci_lint_package')
let l:env = ale#go#EnvString(a:buffer)
if l:package_mode
return l:env . ale#Escape(l:executable)
\ . ' run '
\ . l:options
endif
return l:env . ale#Escape(l:executable)
\ . ' run '
\ . l:options
\ . ' ' . ale#Escape(l:filename)
endfunction
function! ale#fixers#golangci_lint#Fix(buffer) abort
return {
\ 'command': ale#fixers#golangci_lint#GetCommand(a:buffer),
\}
endfunction

View File

@ -31,7 +31,7 @@ function! ale#fixers#isort#GetCmd(buffer) abort
let l:executable = ale#fixers#isort#GetExecutable(a:buffer) let l:executable = ale#fixers#isort#GetExecutable(a:buffer)
let l:cmd = [ale#Escape(l:executable)] let l:cmd = [ale#Escape(l:executable)]
if l:executable =~? 'pipenv\|poetry\|uv$' if l:executable =~? '\(pipenv\|poetry\|uv\)$'
call extend(l:cmd, ['run', 'isort']) call extend(l:cmd, ['run', 'isort'])
endif endif
@ -42,7 +42,7 @@ function! ale#fixers#isort#FixForVersion(buffer, version) abort
let l:executable = ale#fixers#isort#GetExecutable(a:buffer) let l:executable = ale#fixers#isort#GetExecutable(a:buffer)
let l:cmd = [ale#Escape(l:executable)] let l:cmd = [ale#Escape(l:executable)]
if l:executable =~? 'pipenv\|poetry\|uv$' if l:executable =~? '\(pipenv\|poetry\|uv\)$'
call extend(l:cmd, ['run', 'isort']) call extend(l:cmd, ['run', 'isort'])
endif endif

View File

@ -0,0 +1,20 @@
" Author: idbrii
" Description: json formatter as ALE fixer using python's json.tool
call ale#Set('json_pytool_executable', 'python')
call ale#Set('json_pytool_options', '')
call ale#Set('json_pytool_use_global', get(g:, 'ale_use_global_executables', 0))
function! ale#fixers#json_pytool#GetExecutable(buffer) abort
return ale#path#FindExecutable(a:buffer, 'json_pytool', ['python'])
endfunction
function! ale#fixers#json_pytool#Fix(buffer) abort
let l:executable = ale#Escape(ale#fixers#json_pytool#GetExecutable(a:buffer))
let l:opts = ale#Var(a:buffer, 'json_pytool_options')
let l:command = printf('%s -m json.tool %s -', l:executable, l:opts)
return {
\ 'command': l:command
\ }
endfunction

View File

@ -42,7 +42,7 @@ endfunction
function! ale#fixers#pycln#GetCommand(buffer) abort function! ale#fixers#pycln#GetCommand(buffer) abort
let l:executable = ale#fixers#pycln#GetExecutable(a:buffer) let l:executable = ale#fixers#pycln#GetExecutable(a:buffer)
let l:exec_args = l:executable =~? 'pipenv\|poetry\|uv$' let l:exec_args = l:executable =~? '\(pipenv\|poetry\|uv\)$'
\ ? ' run pycln' \ ? ' run pycln'
\ : '' \ : ''
@ -53,7 +53,7 @@ function! ale#fixers#pycln#FixForVersion(buffer, version) abort
let l:executable = ale#fixers#pycln#GetExecutable(a:buffer) let l:executable = ale#fixers#pycln#GetExecutable(a:buffer)
let l:cmd = [ale#Escape(l:executable)] let l:cmd = [ale#Escape(l:executable)]
if l:executable =~? 'pipenv\|poetry\|uv$' if l:executable =~? '\(pipenv\|poetry\|uv\)$'
call extend(l:cmd, ['run', 'pycln']) call extend(l:cmd, ['run', 'pycln'])
endif endif

View File

@ -33,7 +33,7 @@ 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)] let l:cmd = [ale#Escape(l:executable)]
if l:executable =~? 'pipenv\|poetry\|uv$' if l:executable =~? '\(pipenv\|poetry\|uv\)$'
call extend(l:cmd, ['run', 'tidy-imports']) call extend(l:cmd, ['run', 'tidy-imports'])
endif endif

View File

@ -30,7 +30,7 @@ endfunction
function! ale#fixers#reorder_python_imports#Fix(buffer) abort function! ale#fixers#reorder_python_imports#Fix(buffer) abort
let l:executable = ale#fixers#reorder_python_imports#GetExecutable(a:buffer) let l:executable = ale#fixers#reorder_python_imports#GetExecutable(a:buffer)
let l:exec_args = l:executable =~? 'pipenv\|poetry\|uv$' let l:exec_args = l:executable =~? '\(pipenv\|poetry\|uv\)$'
\ ? ' run reorder-python-imports' \ ? ' run reorder-python-imports'
\ : '' \ : ''

View File

@ -41,7 +41,7 @@ endfunction
function! ale#fixers#ruff#GetCommand(buffer) abort function! ale#fixers#ruff#GetCommand(buffer) abort
let l:executable = ale#fixers#ruff#GetExecutable(a:buffer) let l:executable = ale#fixers#ruff#GetExecutable(a:buffer)
let l:exec_args = l:executable =~? 'pipenv\|poetry\|uv$' let l:exec_args = l:executable =~? '\(pipenv\|poetry\|uv\)$'
\ ? ' run ruff' \ ? ' run ruff'
\ : '' \ : ''
@ -52,7 +52,7 @@ function! ale#fixers#ruff#FixForVersion(buffer, version) abort
let l:executable = ale#fixers#ruff#GetExecutable(a:buffer) let l:executable = ale#fixers#ruff#GetExecutable(a:buffer)
let l:cmd = [ale#Escape(l:executable)] let l:cmd = [ale#Escape(l:executable)]
if l:executable =~? 'pipenv\|poetry\|uv$' if l:executable =~? '\(pipenv\|poetry\|uv\)$'
call extend(l:cmd, ['run', 'ruff']) call extend(l:cmd, ['run', 'ruff'])
endif endif

View File

@ -41,7 +41,7 @@ endfunction
function! ale#fixers#ruff_format#GetCommand(buffer) abort function! ale#fixers#ruff_format#GetCommand(buffer) abort
let l:executable = ale#fixers#ruff_format#GetExecutable(a:buffer) let l:executable = ale#fixers#ruff_format#GetExecutable(a:buffer)
let l:exec_args = l:executable =~? 'pipenv\|poetry\|uv$' let l:exec_args = l:executable =~? '\(pipenv\|poetry\|uv\)$'
\ ? ' run ruff' \ ? ' run ruff'
\ : '' \ : ''
@ -52,7 +52,7 @@ function! ale#fixers#ruff_format#Fix(buffer) abort
let l:executable = ale#fixers#ruff_format#GetExecutable(a:buffer) let l:executable = ale#fixers#ruff_format#GetExecutable(a:buffer)
let l:cmd = [ale#Escape(l:executable)] let l:cmd = [ale#Escape(l:executable)]
if l:executable =~? 'pipenv\|poetry\|uv$' if l:executable =~? '\(pipenv\|poetry\|uv\)$'
call extend(l:cmd, ['run', 'ruff']) call extend(l:cmd, ['run', 'ruff'])
endif endif

View File

@ -4,11 +4,24 @@
call ale#Set('lua_stylua_executable', 'stylua') call ale#Set('lua_stylua_executable', 'stylua')
call ale#Set('lua_stylua_options', '') call ale#Set('lua_stylua_options', '')
function! ale#fixers#stylua#GetCwd(buffer) abort
for l:possible_configfile in ['stylua.toml', '.stylua.toml']
let l:config = ale#path#FindNearestFile(a:buffer, l:possible_configfile)
if !empty(l:config)
return fnamemodify(l:config, ':h')
endif
endfor
return '%s:h'
endfunction
function! ale#fixers#stylua#Fix(buffer) abort function! ale#fixers#stylua#Fix(buffer) abort
let l:executable = ale#Var(a:buffer, 'lua_stylua_executable') let l:executable = ale#Var(a:buffer, 'lua_stylua_executable')
let l:options = ale#Var(a:buffer, 'lua_stylua_options') let l:options = ale#Var(a:buffer, 'lua_stylua_options')
return { return {
\ 'command': ale#Escape(l:executable) . ale#Pad(l:options) . ' -', \ 'cwd': ale#fixers#stylua#GetCwd(a:buffer),
\ 'command': ale#Escape(l:executable) . ale#Pad(l:options) . ' --stdin-filepath %s -',
\} \}
endfunction endfunction

View File

@ -6,7 +6,7 @@ function! ale#fixers#syntax_tree#GetCommand(buffer) abort
let l:options = ale#Var(a:buffer, 'ruby_syntax_tree_options') let l:options = ale#Var(a:buffer, 'ruby_syntax_tree_options')
return ale#ruby#EscapeExecutable(l:executable, 'stree') return ale#ruby#EscapeExecutable(l:executable, 'stree')
\ . ' write' \ . ' format'
\ . (!empty(l:options) ? ' ' . l:options : '') \ . (!empty(l:options) ? ' ' . l:options : '')
\ . ' %t' \ . ' %t'
endfunction endfunction
@ -14,6 +14,5 @@ endfunction
function! ale#fixers#syntax_tree#Fix(buffer) abort function! ale#fixers#syntax_tree#Fix(buffer) abort
return { return {
\ 'command': ale#fixers#syntax_tree#GetCommand(a:buffer), \ 'command': ale#fixers#syntax_tree#GetCommand(a:buffer),
\ 'read_temporary_file': 1,
\} \}
endfunction endfunction

View File

@ -7,15 +7,8 @@ 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 = bufname(a:buffer)
if empty(l:filename) let l:command = l:executable . ' --format'
let l:filename = '%t'
else
let l:filename = ale#Escape(l:filename)
endif
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')
@ -31,6 +24,6 @@ function! ale#fixers#xmllint#Fix(buffer) abort
endif endif
return { return {
\ 'command': l:command \ 'command': l:command . ' -'
\} \}
endfunction endfunction

View File

@ -29,7 +29,7 @@ endfunction
function! ale#fixers#yapf#Fix(buffer) abort function! ale#fixers#yapf#Fix(buffer) abort
let l:executable = ale#fixers#yapf#GetExecutable(a:buffer) let l:executable = ale#fixers#yapf#GetExecutable(a:buffer)
let l:exec_args = l:executable =~? 'pipenv\|poetry\|uv$' let l:exec_args = l:executable =~? '\(pipenv\|poetry\|uv\)$'
\ ? ' run yapf' \ ? ' run yapf'
\ : '' \ : ''

View File

@ -0,0 +1,22 @@
call ale#Set('yaml_yq_executable', 'yq')
call ale#Set('yaml_yq_options', '')
call ale#Set('yaml_yq_filters', '.')
function! ale#fixers#yq#GetExecutable(buffer) abort
return ale#Var(a:buffer, 'yaml_yq_executable')
endfunction
function! ale#fixers#yq#Fix(buffer) abort
let l:options = ale#Var(a:buffer, 'yaml_yq_options')
let l:filters = ale#Var(a:buffer, 'yaml_yq_filters')
if empty(l:filters)
return 0
endif
return {
\ 'command': ale#Escape(ale#fixers#yq#GetExecutable(a:buffer))
\ . ' ' . l:filters . ' '
\ . l:options,
\}
endfunction

View File

@ -21,6 +21,8 @@ function! ale#floating_preview#Show(lines, ...) abort
else else
call s:VimShow(a:lines, l:options) call s:VimShow(a:lines, l:options)
endif endif
return w:preview.id
endfunction endfunction
function! s:NvimShow(lines, options) abort function! s:NvimShow(lines, options) abort

View File

@ -0,0 +1,19 @@
scriptencoding utf-8
" Author: Koni Marti <koni.marti@gmail.com>
" Description: Utilities for c3lsp
function! ale#handlers#c3lsp#GetProjectRoot(buffer) abort
let l:config = ale#path#FindNearestFile(a:buffer, 'project.json')
if !empty(l:config)
return fnamemodify(l:config, ':h')
endif
return expand('#' . a:buffer . ':p:h')
endfunction
function! ale#handlers#c3lsp#GetInitOpts(buffer, init_options_var) abort
let l:init_options = {}
return extend(l:init_options, ale#Var(a:buffer, a:init_options_var))
endfunction

View File

@ -108,12 +108,17 @@ function! ale#python#AutoVirtualenvEnvString(buffer) abort
if !empty(l:venv_dir) if !empty(l:venv_dir)
let l:strs = [ ] let l:strs = [ ]
" venv/bin directory
let l:pathdir = join([l:venv_dir, s:bin_dir], s:sep)
" expand PATH correctly inside of the appropriate shell. " expand PATH correctly inside of the appropriate shell.
" set VIRTUAL_ENV to point to venv
if has('win32') if has('win32')
call add(l:strs, 'set PATH=' . ale#Escape(l:venv_dir) . ';%PATH% && ') call add(l:strs, 'set PATH=' . ale#Escape(l:pathdir) . ';%PATH% && ')
call add(l:strs, 'set VIRTUAL_ENV=' . ale#Escape(l:venv_dir) . ' && ')
else else
call add(l:strs, 'PATH=' . ale#Escape(l:venv_dir) . '":$PATH" ') call add(l:strs, 'PATH=' . ale#Escape(l:pathdir) . '":$PATH" ')
call add(l:strs, 'VIRTUAL_ENV=' . ale#Escape(l:venv_dir) . ' ')
endif endif
return join(l:strs, '') return join(l:strs, '')

View File

@ -17,18 +17,21 @@ function! ale#references#ClearLSPData() abort
endfunction endfunction
function! ale#references#FormatTSResponseItem(response_item, options) abort function! ale#references#FormatTSResponseItem(response_item, options) abort
let l:match = substitute(a:response_item.lineText, '^\s*\(.\{-}\)\s*$', '\1', '')
if get(a:options, 'open_in') is# 'quickfix' if get(a:options, 'open_in') is# 'quickfix'
return { return {
\ 'filename': a:response_item.file, \ 'filename': a:response_item.file,
\ 'lnum': a:response_item.start.line, \ 'lnum': a:response_item.start.line,
\ 'col': a:response_item.start.offset, \ 'col': a:response_item.start.offset,
\ 'text': l:match,
\} \}
else else
return { return {
\ 'filename': a:response_item.file, \ 'filename': a:response_item.file,
\ 'line': a:response_item.start.line, \ 'line': a:response_item.start.line,
\ 'column': a:response_item.start.offset, \ 'column': a:response_item.start.offset,
\ 'match': substitute(a:response_item.lineText, '^\s*\(.\{-}\)\s*$', '\1', ''), \ 'match': l:match,
\} \}
endif endif
endfunction endfunction

View File

@ -2,6 +2,37 @@
ALE APKBUILD Integration *ale-apkbuild-options* ALE APKBUILD Integration *ale-apkbuild-options*
===============================================================================
apkbuild-fixer *ale-apkbuild-apkbuild-fixer*
g:apkbuild_apkbuild_fixer_options *g:apkbuild_apkbuild_fixer_options*
*b:apkbuild_apkbuild_fixer_options*
Type: |String|
Default: `''`
This variable can be set to pass additional options to the apkbuild_fixer
fixer.
g:apkbuild_apkbuild_fixer_executable *g:apkbuild_apkbuild_fixer_executable*
*b:apkbuild_apkbuild_fixer_executable*
Type: |String|
Default: `'apkbuild-fixer'`
This variable can be modified to change the executable path for
`apkbuild-fixer`.
g:apkbuild_apkbuild_fixer_lint_executable
*g:apkbuild_apkbuild_fixer_lint_executable*
*b:apkbuild_apkbuild_fixer_lint_executable*
Type: |String|
Default: `'apkbuild-fixer'`
This variable can be modified to change the executable path for
`apkbuild-lint`, the binary used to find violations.
=============================================================================== ===============================================================================
apkbuild-lint *ale-apkbuild-apkbuild-lint* apkbuild-lint *ale-apkbuild-apkbuild-lint*

View File

@ -0,0 +1,35 @@
===============================================================================
ALE C3 Integration *ale-c3-options*
===============================================================================
c3lsp *ale-c3-c3lsp*
g:ale_c3_c3lsp_executable *g:ale_c3_c3lsp_executable*
*b:ale_c3_c3lsp_executable*
Type: |String|
Default: `c3lsp`
This variable can be changed to set the path to c3lsp executable.
g:ale_c3_c3lsp_options *g:ale_c3_c3lsp_options*
*b:ale_c3_c3lsp_options*
Type: |String|
Default: `''`
Add command line options to the c3lsp executable. This is useful to specify
the path to the C3 standard library with '-stdlib-path=<path>'.
g:ale_c3_c3lsp_init_options *g:ale_c3_c3lsp_init_options*
*b:ale_c3_c3lsp_init_options*
Type: |Dictionary|
Default: `{}`
Dictionary containing configuration settings that will be passed to the
language server.
===============================================================================
vim:tw=78:ts=2:sts=2:sw=2:ft=help:norl:

View File

@ -16,6 +16,18 @@ g:ale_clojure_clj_kondo_options *g:ale_clojure_clj_kondo_options*
This variable can be changed to modify options passed to clj-kondo. This variable can be changed to modify options passed to clj-kondo.
===============================================================================
cljfmt *ale-clojure-cljfmt*
cljfmt is a linter and fixer for Clojure code, with defaults adhering to the
Clojure Style Guide (see https://guide.clojure.style/ )
https://github.com/weavejester/cljfmt
Linting options are not configurable by ale, but instead are controlled by
Leiningen, or a cljfmt file in the current or parent directories.
see https://github.com/weavejester/cljfmt#Configuration for more information.
=============================================================================== ===============================================================================
joker *ale-clojure-joker* joker *ale-clojure-joker*

View File

@ -49,10 +49,10 @@ changes should be preceded by a deprecation phase complete with warnings.
Changes required for security may be an exception. Changes required for security may be an exception.
ALE supports Vim 8 and above, and NeoVim 0.6.0 or newer. These are the ALE supports Vim 8 and above, and NeoVim 0.6.0 or newer. These are the
earliest versions of Vim and NeoVim which support |job|, |timer|, |closure|, earliest versions of Vim and NeoVim which support |+job|, |+timer|,
and |lambda| features. All ALE code should be written so it is compatible with |+closure|, and |+lambda| features. All ALE code should be written so it is
these versions of Vim, or with version checks so particular features can compatible with these versions of Vim, or with version checks so particular
degrade or fail gracefully. features can degrade or fail gracefully.
Just about everything should be documented and covered with tests. Just about everything should be documented and covered with tests.
@ -486,7 +486,7 @@ last minor version.
Generally ALE releases hit a major version only when there are breaking Generally ALE releases hit a major version only when there are breaking
changes to a public ALE setting or function. A "public" setting or function is changes to a public ALE setting or function. A "public" setting or function is
defined as any setting or function documented in the `:help` |ale| text file. defined as any setting or function documented in the `:help` |ale.txt| file.
Major ALE versions ought to be so rare that they only come once a year at Major ALE versions ought to be so rare that they only come once a year at
most. ALE should not typically introduce any breaking changes. most. ALE should not typically introduce any breaking changes.

View File

@ -51,6 +51,57 @@ g:ale_erlang_elvis_executable *g:ale_erlang_elvis_executable*
This variable can be changed to specify the elvis executable. This variable can be changed to specify the elvis executable.
-------------------------------------------------------------------------------
erlang-mode *ale-erlang-erlang-mode*
g:ale_erlang_erlang_mode_emacs_executable
*g:ale_erlang_erlang_mode_emacs_executable*
*b:ale_erlang_erlang_mode_emacs_executable*
Type: |String|
Default: `'emacs'`
This variable can be changed to specify the Emacs executable.
g:ale_erlang_erlang_mode_indent_level *g:ale_erlang_erlang_mode_indent_level*
*b:ale_erlang_erlang_mode_indent_level*
Type: |Number|
Default: `4`
Indentation of Erlang calls/clauses within blocks.
g:ale_erlang_erlang_mode_icr_indent *g:ale_erlang_erlang_mode_icr_indent*
*b:ale_erlang_erlang_mode_icr_indent*
Type: `'nil'` or |Number|
Default: `'nil'`
Indentation of Erlang if/case/receive patterns. `'nil'` means keeping default
behavior. When non-`'nil'`, indent to the column of if/case/receive.
g:ale_erlang_erlang_mode_indent_guard *g:ale_erlang_erlang_mode_indent_guard*
*b:ale_erlang_erlang_mode_indent_guard*
Type: |Number|
Default: `2`
Indentation of Erlang guards.
g:ale_erlang_erlang_mode_argument_indent
*g:ale_erlang_erlang_mode_argument_indent*
*b:ale_erlang_erlang_mode_argument_indent*
Type: `'nil'` or |Number|
Default: `2`
Indentation of the first argument in a function call. When `'nil'`, indent
to the column after the `'('` of the function.
g:ale_erlang_erlang_mode_indent_tabs_mode
*g:ale_erlang_erlang_mode_indent_tabs_mode*
*b:ale_erlang_erlang_mode_indent_tabs_mode*
Type: `'nil'` or `'t'`
Default: `'nil'`
Indentation can insert tabs if this is non-`'nil'`.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
erlang_ls *ale-erlang-erlang_ls* erlang_ls *ale-erlang-erlang_ls*

View File

@ -83,6 +83,40 @@ g:ale_json_fixjson_use_global *g:ale_json_fixjson_use_global*
See |ale-integrations-local-executables| See |ale-integrations-local-executables|
===============================================================================
pytool *ale-json-pytool*
Use python's json.tool module to reformat json.
g:ale_json_pytool_executable *g:ale_json_pytool_executable*
*b:ale_json_pytool_executable*
Type: |String|
Default: `'python'`
The python executable that run to use its json.tool module. This fixer
requires python 3, which includes the json module.
g:ale_json_pytool_options *g:ale_json_pytool_options*
*b:ale_json_pytool_options*
Type: |String|
Default: `''`
These options are passed to the json.tool module. Example: >
let g:ale_json_pytool_options = '--sort-keys --indent 2'
< See docs for all options:
https://docs.python.org/3/library/json.html#module-json.tool
g:ale_json_pytool_use_global *g:ale_json_pytool_use_global*
*b:ale_json_pytool_use_global*
Type: |Number|
Default: `get(g:, 'ale_use_global_executables', 0)`
See |ale-integrations-local-executables|
=============================================================================== ===============================================================================
jsonlint *ale-json-jsonlint* jsonlint *ale-json-jsonlint*

View File

@ -23,6 +23,7 @@ Notes:
* API Blueprint * API Blueprint
* `drafter` * `drafter`
* APKBUILD * APKBUILD
* `apkbuild-fixer`
* `apkbuild-lint` * `apkbuild-lint`
* `secfixes-check` * `secfixes-check`
* AsciiDoc * AsciiDoc
@ -104,6 +105,8 @@ Notes:
* `flawfinder` * `flawfinder`
* `gcc` (`cc`) * `gcc` (`cc`)
* `uncrustify` * `uncrustify`
* C3
* `c3lsp`
* Cairo * Cairo
* `scarb`!! * `scarb`!!
* `starknet` * `starknet`
@ -112,6 +115,7 @@ Notes:
* `foodcritic`!! * `foodcritic`!!
* Clojure * Clojure
* `clj-kondo` * `clj-kondo`
* `cljfmt`
* `joker` * `joker`
* CloudFormation * CloudFormation
* `cfn-python-lint` * `cfn-python-lint`
@ -191,6 +195,7 @@ Notes:
* `SyntaxErl` * `SyntaxErl`
* `dialyzer`!! * `dialyzer`!!
* `elvis`!! * `elvis`!!
* `erlang-mode` (The Erlang mode for Emacs)
* `erlang_ls` * `erlang_ls`
* `erlc` * `erlc`
* `erlfmt` * `erlfmt`
@ -324,6 +329,7 @@ Notes:
* `eslint` * `eslint`
* `fixjson` * `fixjson`
* `jq` * `jq`
* `json.tool`
* `jsonlint` * `jsonlint`
* `prettier` * `prettier`
* `spectral` * `spectral`
@ -727,6 +733,7 @@ Notes:
* `yamlfix` * `yamlfix`
* `yamlfmt` * `yamlfmt`
* `yamllint` * `yamllint`
* `yq`
* YANG * YANG
* `yang-lsp` * `yang-lsp`
* Zeek * Zeek

View File

@ -366,5 +366,43 @@ g:ale_yaml_gitlablint_options *g:ale_yaml_gitlablint_options
This variable can be set to pass additional options to gll. This variable can be set to pass additional options to gll.
===============================================================================
yq *ale-yaml-yq*
Website: https://github.com/mikefarah/yq
Installation
-------------------------------------------------------------------------------
Install yq: >
wget https://github.com/mikefarah/yq/releases/download/${VERSION}/${BINARY}.tar.gz -O - | tar xz && mv ${BINARY} /usr/bin/yq
Options
-------------------------------------------------------------------------------
g:ale_yaml_yq_executable *g:ale_yaml_yq_executable*
*b:ale_yaml_yq_executable*
Type: |String|
Default: `'yq'`
This variable can be set to change the path to yq.
g:ale_yaml_yq_options *g:ale_yaml_yq_options*
*b:ale_yaml_yq_options*
Type: |String|
Default: `''`
This variable can be set to pass additional options to yq.
g:ale_yaml_yq_filters *g:ale_yaml_yq_filters
*b:ale_yaml_yq_filters*
Type: |String|
Default: `'.'`
This option can be changed to pass additional filters to yq
=============================================================================== ===============================================================================
vim:tw=78:ts=2:sts=2:sw=2:ft=help:norl: vim:tw=78:ts=2:sts=2:sw=2:ft=help:norl:

File diff suppressed because it is too large Load Diff

View File

@ -32,6 +32,7 @@ formatting.
* API Blueprint * API Blueprint
* [drafter](https://github.com/apiaryio/drafter) * [drafter](https://github.com/apiaryio/drafter)
* APKBUILD * APKBUILD
* [apkbuild-fixer](https://gitlab.alpinelinux.org/Leo/atools)
* [apkbuild-lint](https://gitlab.alpinelinux.org/Leo/atools) * [apkbuild-lint](https://gitlab.alpinelinux.org/Leo/atools)
* [secfixes-check](https://gitlab.alpinelinux.org/Leo/atools) * [secfixes-check](https://gitlab.alpinelinux.org/Leo/atools)
* AsciiDoc * AsciiDoc
@ -113,6 +114,8 @@ formatting.
* [flawfinder](https://www.dwheeler.com/flawfinder/) * [flawfinder](https://www.dwheeler.com/flawfinder/)
* [gcc](https://gcc.gnu.org/) * [gcc](https://gcc.gnu.org/)
* [uncrustify](https://github.com/uncrustify/uncrustify) * [uncrustify](https://github.com/uncrustify/uncrustify)
* C3
* [c3lsp](https://github.com/pherrymason/c3-lsp)
* Cairo * Cairo
* [scarb](https://docs.swmansion.com/scarb/) :floppy_disk: * [scarb](https://docs.swmansion.com/scarb/) :floppy_disk:
* [starknet](https://starknet.io/docs) * [starknet](https://starknet.io/docs)
@ -121,6 +124,7 @@ formatting.
* [foodcritic](http://www.foodcritic.io/) :floppy_disk: * [foodcritic](http://www.foodcritic.io/) :floppy_disk:
* Clojure * Clojure
* [clj-kondo](https://github.com/borkdude/clj-kondo) * [clj-kondo](https://github.com/borkdude/clj-kondo)
* [cljfmt](https://github.com/weavejester/cljfmt)
* [joker](https://github.com/candid82/joker) * [joker](https://github.com/candid82/joker)
* CloudFormation * CloudFormation
* [cfn-python-lint](https://github.com/awslabs/cfn-python-lint) * [cfn-python-lint](https://github.com/awslabs/cfn-python-lint)
@ -200,6 +204,7 @@ formatting.
* [SyntaxErl](https://github.com/ten0s/syntaxerl) * [SyntaxErl](https://github.com/ten0s/syntaxerl)
* [dialyzer](http://erlang.org/doc/man/dialyzer.html) :floppy_disk: * [dialyzer](http://erlang.org/doc/man/dialyzer.html) :floppy_disk:
* [elvis](https://github.com/inaka/elvis) :floppy_disk: * [elvis](https://github.com/inaka/elvis) :floppy_disk:
* [erlang-mode](https://www.erlang.org/doc/apps/tools/erlang_mode_chapter.html) (The Erlang mode for Emacs)
* [erlang_ls](https://github.com/erlang-ls/erlang_ls) * [erlang_ls](https://github.com/erlang-ls/erlang_ls)
* [erlc](http://erlang.org/doc/man/erlc.html) * [erlc](http://erlang.org/doc/man/erlc.html)
* [erlfmt](https://github.com/WhatsApp/erlfmt) * [erlfmt](https://github.com/WhatsApp/erlfmt)
@ -333,6 +338,7 @@ formatting.
* [eslint](http://eslint.org/) :warning: * [eslint](http://eslint.org/) :warning:
* [fixjson](https://github.com/rhysd/fixjson) * [fixjson](https://github.com/rhysd/fixjson)
* [jq](https://stedolan.github.io/jq/) :warning: * [jq](https://stedolan.github.io/jq/) :warning:
* [json.tool](https://docs.python.org/3/library/json.html#module-json.tool) :warning:
* [jsonlint](https://github.com/zaach/jsonlint) * [jsonlint](https://github.com/zaach/jsonlint)
* [prettier](https://github.com/prettier/prettier) * [prettier](https://github.com/prettier/prettier)
* [spectral](https://github.com/stoplightio/spectral) * [spectral](https://github.com/stoplightio/spectral)
@ -736,6 +742,7 @@ formatting.
* [yamlfix](https://lyz-code.github.io/yamlfix) * [yamlfix](https://lyz-code.github.io/yamlfix)
* [yamlfmt](https://github.com/google/yamlfmt) * [yamlfmt](https://github.com/google/yamlfmt)
* [yamllint](https://yamllint.readthedocs.io/) * [yamllint](https://yamllint.readthedocs.io/)
* [yq](https://github.com/mikefarah/yq)
* YANG * YANG
* [yang-lsp](https://github.com/theia-ide/yang-lsp) * [yang-lsp](https://github.com/theia-ide/yang-lsp)
* Zeek * Zeek

View File

@ -8,3 +8,5 @@ tags
# Github token. # Github token.
github_token github_token
# goreleaser dist directory.
dist/

View File

@ -1,54 +0,0 @@
# This is an example .goreleaser.yml file with some sensible defaults.
# Make sure to check the documentation at https://goreleaser.com
# The lines below are called `modelines`. See `:help modeline`
# Feel free to remove those if you don't want/need to use them.
# yaml-language-server: $schema=https://goreleaser.com/static/schema.json
# vim: set ts=2 sw=2 tw=0 fo=cnqoj
#version: 1
env_files:
# GoReleaser requires an API token with the 'repo' scope selected to deploy
# the artifacts to GitHub. You can create one here
# https://github.com/settings/tokens/new.
github_token: ./github_token
#before:
# hooks:
# # You may remove this if you don't use go modules.
# - go mod tidy
# # you may remove this if you don't need go generate
# - go generate ./...
builds:
- skip: true
archives:
- format: tar.gz
# this name template makes the OS and Arch compatible with the results of `uname`.
name_template: >-
{{ .ProjectName }}_
{{- title .Os }}_
{{- if eq .Arch "amd64" }}x86_64
{{- else if eq .Arch "386" }}i386
{{- else }}{{ .Arch }}{{ end }}
{{- if .Arm }}v{{ .Arm }}{{ end }}
# use zip for windows archives
format_overrides:
- goos: windows
format: zip
checksum:
name_template: 'checksums.txt'
snapshot:
name_template: '{{ .Tag }}-next'
changelog:
use: github-native
sort: asc
release:
draft: false
replace_existing_draft: true

View File

@ -1,5 +1,6 @@
bufexplorer # bufexplorer
===========
---
BufExplorer Plugin for Vim BufExplorer Plugin for Vim
@ -13,28 +14,35 @@ With bufexplorer, you can quickly and easily switch between buffers by using the
`\<Leader\>bv` force vertical split open `\<Leader\>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 `<Enter>` or `<Left-Mouse-Click>` 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 `<Shift-Enter>` 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. Once the bufexplorer window is open you can use the normal movement keys (hjkl) to move around and then use `<Enter>` or `<Left-Mouse-Click>` 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 `<Shift-Enter>` 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: Bufexplorer also offers various options including:
- Display the list of buffers in various sort orders including: - Display the list of buffers in various sort orders including:
- Most Recently Used (MRU) which is the default - Most Recently Used (MRU) which is the default
- Buffer number - Buffer number
- File name - File name
- File extension - File extension
- Full file path name - Full file path name
- Delete buffer from list - Delete buffer from list
For more about options, sort orders, configuration options, etc. please see the supplied VIM help. For more about options, sort orders, configuration options, etc. please see the supplied VIM help.
In this example, the `<Leader>` key is assigned to [Space].
![ScreenToGif](https://github.com/user-attachments/assets/ae5422b9-59ac-4657-aab5-30e6eb8a3243)
## vim.org ## vim.org
This plugin can also be found at http://www.vim.org/scripts/script.php?script_id=42. This plugin can also be found at http://www.vim.org/scripts/script.php?script_id=42.
## Installation ## Installation
### Manually ### Manually
1. If you do not want to use one of the the bundle handlers, you can take the 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 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, directory and the txt file to your vimfiles\doc directory. If you do that,
make sure you generate the help by executing make sure you generate the help by executing
`:helptag <your runtime directory>/doc` `:helptag <your runtime directory>/doc`
@ -43,47 +51,52 @@ This plugin can also be found at http://www.vim.org/scripts/script.php?script_id
`:help bufexplorer`. `:help bufexplorer`.
### Vundle (https://github.com/gmarik/Vundle.vim) ### Vundle (https://github.com/gmarik/Vundle.vim)
1. Add the following configuration to your `.vimrc`.
1. Add the following configuration to your `.vimrc`.
Plugin 'jlanzarotta/bufexplorer' Plugin 'jlanzarotta/bufexplorer'
2. Install with `:BundleInstall`. 2. Install with `:BundleInstall`.
### NeoBundle (https://github.com/Shougo/neobundle.vim) ### NeoBundle (https://github.com/Shougo/neobundle.vim)
1. Add the following configuration to your `.vimrc`.
1. Add the following configuration to your `.vimrc`.
NeoBundle 'jlanzarotta/bufexplorer' NeoBundle 'jlanzarotta/bufexplorer'
2. Install with `:NeoBundleInstall`. 2. Install with `:NeoBundleInstall`.
### Plug (https://github.com/junegunn/vim-plug) ### Plug (https://github.com/junegunn/vim-plug)
1. Add the following configuration to your `.vimrc`.
1. Add the following configuration to your `.vimrc`.
Plug 'jlanzarotta/bufexplorer' Plug 'jlanzarotta/bufexplorer'
2. Install with `:PlugInstall`. 2. Install with `:PlugInstall`.
### Pathogen ### Pathogen
1. Install with the following command.
1. Install with the following command.
git clone https://github.com/jlanzarotta/bufexplorer.git ~/.vim/bundle/bufexplorer.vim git clone https://github.com/jlanzarotta/bufexplorer.git ~/.vim/bundle/bufexplorer.vim
## License ## License
Copyright (c) 2001-2023, Jeff Lanzarotta
Copyright (c) 2001-2025, Jeff Lanzarotta
All rights reserved. All rights reserved.
Redistribution and use in source and binary forms, with or without modification, Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met: are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this - Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer. list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice, this - Redistributions in binary form must reproduce the above copyright notice, this
list of conditions and the following disclaimer in the documentation and/or list of conditions and the following disclaimer in the documentation and/or
other materials provided with the distribution. other materials provided with the distribution.
* Neither the name of the {organization} nor the names of its - Neither the name of the {organization} nor the names of its
contributors may be used to endorse or promote products derived from contributors may be used to endorse or promote products derived from
this software without specific prior written permission. this software without specific prior written permission.

View File

@ -1,7 +1,7 @@
*bufexplorer.txt* Buffer Explorer Last Change: 13 Aug 2024 *bufexplorer.txt* Buffer Explorer Last Change: 17 Feb 2025
Buffer Explorer *buffer-explorer* *bufexplorer* Buffer Explorer *buffer-explorer* *bufexplorer*
Version 7.4.27 Version 7.6.0
Plugin for easily exploring (or browsing) Vim|:buffers|. Plugin for easily exploring (or browsing) Vim|:buffers|.
@ -26,7 +26,7 @@ To install:
- Download the bufexplorer.zip from one of the following places: - Download the bufexplorer.zip from one of the following places:
https://github.com/jlanzarotta/bufexplorer https://github.com/jlanzarotta/bufexplorer
http://www.vim.org/scripts/script.php?script_id=42 http://www.vim.org/scripts/script.php?script_id=42
or use a package manager like Vundle. or use a package manager like vim-plug, Vundle, etc..
- Extract the zip archive into your runtime directory. - Extract the zip archive into your runtime directory.
The archive contains plugin/bufexplorer.vim, and doc/bufexplorer.txt. The archive contains plugin/bufexplorer.vim, and doc/bufexplorer.txt.
- Start Vim or goto an existing instance of Vim. - Start Vim or goto an existing instance of Vim.
@ -254,6 +254,12 @@ To control the size of the new vertical split window, use: >
let g:bufExplorerSplitVertSize=0 " New split windows size set by Vim. let g:bufExplorerSplitVertSize=0 " New split windows size set by Vim.
The default is 0, so that the size is set by Vim. The default is 0, so that the size is set by Vim.
*g:bufExplorerShowTerminal*
To control whether terminal buffers are displayed in BufExplorer, use: >
let g:bufExplorerShowTerminal=1 " Show terminal buffers.
let g:bufExplorerShowTerminal=0 " Don't show terminal buffers.
The default is 1, to show the terminal buffers.
*g:bufExplorerVersionWarn* *g:bufExplorerVersionWarn*
To control whether to warning about Vim version or not, use: > To control whether to warning about Vim version or not, use: >
let g:bufExplorerVersionWarn=1 " Warn if version conflict. let g:bufExplorerVersionWarn=1 " Warn if version conflict.
@ -263,6 +269,59 @@ The default is 1.
=============================================================================== ===============================================================================
CHANGE LOG *bufexplorer-changelog* CHANGE LOG *bufexplorer-changelog*
7.6.0 February 17, 2025
What's Changed
- Another Major patch implemented by Dr. Michael Henry.
https://github.com/jlanzarotta/bufexplorer/pull/119
* Sorting by fullname now depends only on the buffer's absolute path
using a new sorting mechanism. Other sort modes have been converted to
use this mechanism as well.
* Display of directory buffers is now suppressed when
g:bufExplorerShowDirectories == 0 as described in the BufExplorer
documentation.
* Path calculations for the elements in s:types have been normalized.
fullpath now has simplify() applied to normalize paths like
dir/../file. Trailing path separators for directories have been
removed. The shortname <DIRECTORY> for directories has been
eliminated; instead, the directory's basename is used as is done for
files (except for root directories, where the trailing path separator
cannot be removed; a shortname of . is used for this case). A new
element, homepath, has been added to s.types; this is fullpath
shortened for paths in $HOME and without the trailing path separator.
Other displayable paths (path, relativepath, relativename) are
similarly shortened for paths in $HOME.
* Textual substitution of $HOME -> ~ in paths has been eliminated. This
substitution could occur anywhere in the path, not just at the start,
causing undesirable anomalies. Shortening for paths in $HOME is now
done via homename and associated variables from s:types.
* If the devicons plugin is installed, a buffer's buf.isdir status has
been added as a parameter passed to that plugin, allowing the plugin
to supply a directory icon for buffer directories.
* Avoid calculating buffer details until they are needed for display.
Users who don't want to see unlisted buffers shouldn't have to pay
for the expensive work of calculating buffer details for unlisted
buffers, only to have that information ignored. This resolves
bufexplorer is slow to open with many unlisted buffers.
https://github.com/jlanzarotta/bufexplorer/issues/20
7.5.0 February 16, 2025
What's Changed
- Major patch implemented by Dr. Michael Henry.
https://github.com/jlanzarotta/bufexplorer/pull/118
Significant rework and restructuring of the s:SelectBuffer() method to
demonstrate behaviors described in Github issue #117.
https://github.com/jlanzarotta/bufexplorer/issues/117
This patch includes fixes which also resolves:
- Github issue #81. Previous buffer duplicated in split after openning
new buffer in tab.
https://github.com/jlanzarotta/bufexplorer/issues/81
- Github issue #65. bv plus t does weird things.
https://github.com/jlanzarotta/bufexplorer/issues/65
- Github issue #52. Find Active Window not working as expected.
https://github.com/jlanzarotta/bufexplorer/issues/52
7.4.28 November 5, 2024
- Thanks to GitHub user jsvia, for the addition of the new
bufExplorerShowTerminal feature. Please refer to the documentation
for complete information.
7.4.27 May 30, 2024 7.4.27 May 30, 2024
- Thanks to GitHub user NotNormallyAGitUser, for the recommendation to - Thanks to GitHub user NotNormallyAGitUser, for the recommendation to
change the display of the relative path to replace $HOME with "~". change the display of the relative path to replace $HOME with "~".

View File

@ -1,16 +1,17 @@
https://goreleaser.com/quick-start/
To make a release... To make a release...
1. Make changes. 1. Make changes
2. Commit and push changes. 2. Commit and push changes
3. git tag -a v7.4.27 -m "Release v7.4.27." 3. git tag -a 7.4.28 -m "Release 7.4.28"
4. git push origin v7.4.27 4. git push origin 7.4.28
5. goreleaser release --clean 5. set GH_TOKEN environment variable
6. Go to github and make the release. 6. 7z a bufexplorer-7.4.28.zip plugin\bufexplorer.vim doc\bufexplorer.txt
7. gh release create 7.4.28 --notes-from-tag bufexplorer-7.4.28.zip
If something happens and the tag is messed up, you will need to delete the If something happens and the tag is messed up, you will need to delete the
local and remote tag and release again. To delete the tag: local and remote tag and release again. To delete the tag:
1. git tag -d v7.4.27 1. git tag -d 7.4.27
2. git push --delete origin v7.4.27 2. git push --delete origin 7.4.27
3. Remove the release.

View File

@ -1,5 +1,5 @@
"============================================================================ "============================================================================
" Copyright: Copyright (c) 2001-2024, Jeff Lanzarotta " Copyright: Copyright (c) 2001-2025, Jeff Lanzarotta
" All rights reserved. " All rights reserved.
" "
" Redistribution and use in source and binary forms, with or " Redistribution and use in source and binary forms, with or
@ -36,7 +36,7 @@
" Name Of File: bufexplorer.vim " Name Of File: bufexplorer.vim
" Description: Buffer Explorer Vim Plugin " Description: Buffer Explorer Vim Plugin
" Maintainer: Jeff Lanzarotta (my name at gmail dot com) " Maintainer: Jeff Lanzarotta (my name at gmail dot com)
" Last Changed: Tuesday, 13 August 2024 " Last Changed: Monday, 17 February 2025
" Version: See g:bufexplorer_version for version number. " Version: See g:bufexplorer_version for version number.
" Usage: This file should reside in the plugin directory and be " Usage: This file should reside in the plugin directory and be
" automatically sourced. " automatically sourced.
@ -74,7 +74,7 @@ endif
"1}}} "1}}}
" Version number " Version number
let g:bufexplorer_version = "7.4.27" let g:bufexplorer_version = "7.6.0"
" Plugin Code {{{1 " Plugin Code {{{1
" Check for Vim version {{{2 " Check for Vim version {{{2
@ -90,6 +90,7 @@ if v:version < 700
endif endif
finish finish
endif endif
" Check to see if the version of Vim has the correct patch applied, if not, do " Check to see if the version of Vim has the correct patch applied, if not, do
" not used <nowait>. " not used <nowait>.
if v:version > 703 || v:version == 703 && has('patch1261') && has('patch1264') if v:version > 703 || v:version == 703 && has('patch1261') && has('patch1264')
@ -133,7 +134,7 @@ let s:running = 0
let s:sort_by = ["number", "name", "fullpath", "mru", "extension"] let s:sort_by = ["number", "name", "fullpath", "mru", "extension"]
let s:splitMode = "" let s:splitMode = ""
let s:didSplit = 0 let s:didSplit = 0
let s:types = {"fullname": ':p', "path": ':p:h', "relativename": ':~:.', "relativepath": ':~:.:h', "shortname": ':t'} let s:types = ["fullname", "homename", "path", "relativename", "relativepath", "shortname"]
" Setup the autocommands that handle the MRUList and other stuff. {{{2 " Setup the autocommands that handle the MRUList and other stuff. {{{2
autocmd VimEnter * call s:Setup() autocmd VimEnter * call s:Setup()
@ -185,10 +186,9 @@ function! s:CatalogBuffers()
endfunction endfunction
" AssociatedTab {{{2 " AssociatedTab {{{2
" Return the number of the tab associated with the specified buffer. " Return the number of the tab associated with the specified buffer. If the
" If the buffer is associated with more than one tab, the first one " buffer is associated with more than one tab, the first one found is
" found is returned. If the buffer is not associated with any tabs, " returned. If the buffer is not associated with any tabs, -1 is returned.
" -1 is returned.
function! s:AssociatedTab(bufnr) function! s:AssociatedTab(bufnr)
for tab in range(1, tabpagenr('$')) for tab in range(1, tabpagenr('$'))
let list = gettabvar(tab, 'bufexp_buf_list', []) let list = gettabvar(tab, 'bufexp_buf_list', [])
@ -202,8 +202,8 @@ function! s:AssociatedTab(bufnr)
endfunction endfunction
" RemoveBufFromOtherTabs {{{2 " RemoveBufFromOtherTabs {{{2
" Remove the specified buffer from the buffer lists of all tabs " Remove the specified buffer from the buffer lists of all tabs except the
" except the current tab. " current tab.
function! s:RemoveBufFromOtherTabs(bufnr) function! s:RemoveBufFromOtherTabs(bufnr)
for tab in range(1, tabpagenr('$')) for tab in range(1, tabpagenr('$'))
if tab == tabpagenr() if tab == tabpagenr()
@ -222,8 +222,8 @@ function! s:RemoveBufFromOtherTabs(bufnr)
endfunction endfunction
" AddBufToCurrentTab {{{2 " AddBufToCurrentTab {{{2
" Add the specified buffer to the list of buffers associated " Add the specified buffer to the list of buffers associated with the current
" with the current tab " tab.
function! s:AddBufToCurrentTab(bufnr) function! s:AddBufToCurrentTab(bufnr)
if index(t:bufexp_buf_list, a:bufnr) == -1 if index(t:bufexp_buf_list, a:bufnr) == -1
call add(t:bufexp_buf_list, a:bufnr) call add(t:bufexp_buf_list, a:bufnr)
@ -231,12 +231,10 @@ function! s:AddBufToCurrentTab(bufnr)
endfunction endfunction
" IsInCurrentTab {{{2 " IsInCurrentTab {{{2
" Returns whether the specified buffer is associated " Returns whether the specified buffer is associated with the current tab.
" with the current tab
function! s:IsInCurrentTab(bufnr) function! s:IsInCurrentTab(bufnr)
" It shouldn't happen that the list of buffers is " It shouldn't happen that the list of buffers is not defined but if it
" not defined but if it does, play it safe and " does, play it safe and include the buffer.
" include the buffer
if !exists('t:bufexp_buf_list') if !exists('t:bufexp_buf_list')
return 1 return 1
endif endif
@ -245,27 +243,25 @@ function! s:IsInCurrentTab(bufnr)
endfunction endfunction
" UpdateTabBufData {{{2 " UpdateTabBufData {{{2
" Update the tab buffer data for the specified buffer " Update the tab buffer data for the specified buffer.
" "
" The current tab's list is updated. If a buffer is only " The current tab's list is updated. If a buffer is only allowed to be
" allowed to be associated with one tab, it is removed " associated with one tab, it is removed from the lists of any other tabs
" from the lists of any other tabs with which it may have " with which it may have been associated.
" been associated.
" "
" The associations between tabs and buffers are maintained " The associations between tabs and buffers are maintained in separate lists
" in separate lists for each tab, which are stored in tab- " for each tab, which are stored in tab-specific variables
" specific variables 't:bufexp_buf_list'. " 't:bufexp_buf_list'.
function! s:UpdateTabBufData(bufnr) function! s:UpdateTabBufData(bufnr)
" The first time we add a tab, Vim uses the current buffer " The first time we add a tab, Vim uses the current buffer as its starting
" as its starting page even though we are about to edit a " page even though we are about to edit a new page, and another BufEnter
" new page, and another BufEnter for the new page is triggered " for the new page is triggered later. Use this first BufEnter to
" later. Use this first BufEnter to initialize the list of " initialize the list of buffers, but don't add the buffer number to the
" buffers, but don't add the buffer number to the list if " list if it is already associated with another tab.
" it is already associated with another tab
" "
" Unfortunately, this doesn't work right when the first " Unfortunately, this doesn't work right when the first buffer opened in
" buffer opened in the tab should be associated with it, " the tab should be associated with it, such as when 'tab split +buffer N'
" such as when 'tab split +buffer N' is used " is used.
if !exists("t:bufexp_buf_list") if !exists("t:bufexp_buf_list")
let t:bufexp_buf_list = [] let t:bufexp_buf_list = []
@ -537,6 +533,8 @@ function! s:MapKeys()
nnoremap <script> <silent> <nowait> <buffer> u :call <SID>ToggleShowUnlisted()<CR> nnoremap <script> <silent> <nowait> <buffer> u :call <SID>ToggleShowUnlisted()<CR>
nnoremap <script> <silent> <nowait> <buffer> v :call <SID>SelectBuffer("split", "vr")<CR> nnoremap <script> <silent> <nowait> <buffer> v :call <SID>SelectBuffer("split", "vr")<CR>
nnoremap <script> <silent> <nowait> <buffer> V :call <SID>SelectBuffer("split", "vl")<CR> nnoremap <script> <silent> <nowait> <buffer> V :call <SID>SelectBuffer("split", "vl")<CR>
nnoremap <script> <silent> <nowait> <buffer> H :call <SID>ToggleShowTerminal()<CR>
for k in ["G", "n", "N", "L", "M", "H"] for k in ["G", "n", "N", "L", "M", "H"]
execute "nnoremap <buffer> <silent>" k ":keepjumps normal!" k."<CR>" execute "nnoremap <buffer> <silent>" k ":keepjumps normal!" k."<CR>"
@ -623,6 +621,7 @@ function! s:GetHelpStatus()
let ret .= ((g:bufExplorerOnlyOneTab == 0) ? "" : " | One tab/buffer") let ret .= ((g:bufExplorerOnlyOneTab == 0) ? "" : " | One tab/buffer")
let ret .= ' | '.((g:bufExplorerShowRelativePath == 0) ? "Absolute" : "Relative") let ret .= ' | '.((g:bufExplorerShowRelativePath == 0) ? "Absolute" : "Relative")
let ret .= ' '.((g:bufExplorerSplitOutPathName == 0) ? "Full" : "Split")." path" let ret .= ' '.((g:bufExplorerSplitOutPathName == 0) ? "Full" : "Split")." path"
let ret .= ((g:bufExplorerShowTerminal == 0) ? "" : " | Show terminal")
return ret return ret
endfunction endfunction
@ -673,6 +672,49 @@ function! s:CreateHelp()
return header return header
endfunction endfunction
" CalculateBufferDetails {{{2
" Calculate `buf`-related details.
function! s:CalculateBufferDetails(buf)
let buf = a:buf
let name = bufname(buf._bufnr)
let buf["hasNoName"] = empty(name)
if buf.hasNoName
let name = "[No Name]"
endif
let buf.isterminal = getbufvar(buf._bufnr, '&buftype') == 'terminal'
if buf.isterminal
let buf.fullname = name
let buf.isdir = 0
else
let buf.fullname = simplify(fnamemodify(name, ':p'))
let buf.isdir = getftype(buf.fullname) == "dir"
endif
if buf.isdir
" `buf.fullname` ends with a path separator; this will be
" removed via the first `:h` applied to `buf.fullname` (except
" for the root directory, where the path separator will remain).
let parent = fnamemodify(buf.fullname, ':h:h')
let buf.shortname = fnamemodify(buf.fullname, ':h:t')
" Special case for root directory: fnamemodify('/', ':h:t') == ''
if buf.shortname == ''
let buf.shortname = '.'
endif
" Must perform shortening (`:~`, `:.`) before `:h`.
let buf.homename = fnamemodify(buf.fullname, ':~:h')
let buf.relativename = fnamemodify(buf.fullname, ':~:.:h')
else
let parent = fnamemodify(buf.fullname, ':h')
let buf.shortname = fnamemodify(buf.fullname, ':t')
let buf.homename = fnamemodify(buf.fullname, ':~')
let buf.relativename = fnamemodify(buf.fullname, ':~:.')
endif
" `:p` on `parent` adds back the path separator which permits more
" effective shortening (`:~`, `:.`), but `:h` is required afterward
" to trim this separator.
let buf.path = fnamemodify(parent, ':p:~:h')
let buf.relativepath = fnamemodify(parent, ':p:~:.:h')
endfunction
" GetBufferInfo {{{2 " GetBufferInfo {{{2
function! s:GetBufferInfo(bufnr) function! s:GetBufferInfo(bufnr)
redir => bufoutput redir => bufoutput
@ -683,56 +725,22 @@ function! s:GetBufferInfo(bufnr)
redir END redir END
if a:bufnr > 0 if a:bufnr > 0
" Since we are only interested in this specified buffer " Since we are only interested in this specified buffer remove the
" remove the other buffers listed " other buffers listed.
let bufoutput = substitute(bufoutput."\n", '^.*\n\(\s*'.a:bufnr.'\>.\{-}\)\n.*', '\1', '') let bufoutput = substitute(bufoutput."\n", '^.*\n\(\s*'.a:bufnr.'\>.\{-}\)\n.*', '\1', '')
endif endif
let [all, allwidths, listedwidths] = [[], {}, {}] let all = {}
for n in keys(s:types)
let allwidths[n] = []
let listedwidths[n] = []
endfor
" Loop over each line in the buffer. " Loop over each line in the buffer.
for buf in split(bufoutput, '\n') for line in split(bufoutput, '\n')
let bits = split(buf, '"') let bits = split(line, '"')
" Use first and last components after the split on '"', in case a " Use first and last components after the split on '"', in case a
" filename with an embedded '"' is present. " filename with an embedded '"' is present.
let b = {"attributes": bits[0], "line": substitute(bits[-1], '\s*', '', '')} let buf = {"attributes": bits[0], "line": substitute(bits[-1], '\s*', '', '')}
let buf._bufnr = str2nr(buf.attributes)
let name = bufname(str2nr(b.attributes)) let all[buf._bufnr] = buf
let b["hasNoName"] = empty(name)
if b.hasNoName
let name = "[No Name]"
endif
for [key, val] in items(s:types)
let b[key] = fnamemodify(name, val)
endfor
if getftype(b.fullname) == "dir" && g:bufExplorerShowDirectories == 1
let b.shortname = "<DIRECTORY>"
endif
call add(all, b)
for n in keys(s:types)
call add(allwidths[n], s:StringWidth(b[n]))
if b.attributes !~ "u"
call add(listedwidths[n], s:StringWidth(b[n]))
endif
endfor
endfor
let [s:allpads, s:listedpads] = [{}, {}]
for n in keys(s:types)
let s:allpads[n] = repeat(' ', max(allwidths[n]))
let s:listedpads[n] = repeat(' ', max(listedwidths[n]))
endfor endfor
return all return all
@ -740,17 +748,26 @@ endfunction
" BuildBufferList {{{2 " BuildBufferList {{{2
function! s:BuildBufferList() function! s:BuildBufferList()
let lines = [] let table = []
" Loop through every buffer. " Loop through every buffer.
for buf in s:raw_buffer_listing for buf in values(s:raw_buffer_listing)
" `buf.attributes` must exist, but we defer the expensive work of
" calculating other buffer details (e.g., `buf.fullname`) until we know
" the user wants to view this buffer.
" Skip unlisted buffers if we are not to show them. " Skip unlisted buffers if we are not to show them.
if !g:bufExplorerShowUnlisted && buf.attributes =~ "u" if !g:bufExplorerShowUnlisted && buf.attributes =~ "u"
" Skip unlisted buffers if we are not to show them. " Skip unlisted buffers if we are not to show them.
continue continue
endif endif
" Skip "No Name" buffers if we are not to show them. " Ensure buffer details are computed for this buffer.
if !has_key(buf, 'fullname')
call s:CalculateBufferDetails(buf)
endif
" Skip 'No Name' buffers if we are not to show them.
if g:bufExplorerShowNoName == 0 && buf.hasNoName if g:bufExplorerShowNoName == 0 && buf.hasNoName
continue continue
endif endif
@ -760,40 +777,72 @@ function! s:BuildBufferList()
continue continue
endif endif
let line = buf.attributes." " " Skip terminal buffers if we are not to show them.
if !g:bufExplorerShowTerminal && buf.isterminal
continue
endif
" Skip directory buffers if we are not to show them.
if !g:bufExplorerShowDirectories && buf.isdir
continue
endif
let row = [buf.attributes]
if exists("g:loaded_webdevicons") if exists("g:loaded_webdevicons")
let line .= WebDevIconsGetFileTypeSymbol(buf.shortname) let row += [WebDevIconsGetFileTypeSymbol(buf.fullname, buf.isdir)]
let line .= " "
endif endif
" Are we to split the path and file name? " Are we to split the path and file name?
if g:bufExplorerSplitOutPathName if g:bufExplorerSplitOutPathName
let type = (g:bufExplorerShowRelativePath) ? "relativepath" : "path" let type = (g:bufExplorerShowRelativePath) ? "relativepath" : "path"
let path = substitute( buf[type], $HOME."\\>", "~", "" ) let row += [buf.shortname, buf[type]]
let pad = (g:bufExplorerShowUnlisted) ? s:allpads.shortname : s:listedpads.shortname
let line .= buf.shortname." ".strpart(pad.path, s:StringWidth(buf.shortname))
else else
let type = (g:bufExplorerShowRelativePath) ? "relativename" : "fullname" let type = (g:bufExplorerShowRelativePath) ? "relativename" : "homename"
let path = substitute( buf[type], $HOME."\\>", "~", "" ) let row += [buf[type]]
let line .= path
endif endif
let row += [buf.line]
let pads = (g:bufExplorerShowUnlisted) ? s:allpads : s:listedpads call add(table, row)
if !empty(pads[type])
let line .= strpart(pads[type], s:StringWidth(path))." "
endif
let line .= buf.line
call add(lines, line)
endfor endfor
let lines = s:MakeLines(table)
call setline(s:firstBufferLine, lines) call setline(s:firstBufferLine, lines)
call s:SortListing() call s:SortListing()
endfunction endfunction
" MakeLines {{{2
function! s:MakeLines(table)
if len(a:table) == 0
return []
endif
let lines = []
" To avoid trailing whitespace, do not pad the final column.
let numColumnsToPad = len(a:table[0]) - 1
let maxWidths = repeat([0], numColumnsToPad)
for row in a:table
let i = 0
while i < numColumnsToPad
let maxWidths[i] = max([maxWidths[i], s:StringWidth(row[i])])
let i = i + 1
endwhile
endfor
let pads = []
for w in maxWidths
call add(pads, repeat(' ', w))
endfor
for row in a:table
let i = 0
while i < numColumnsToPad
let row[i] .= strpart(pads[i], s:StringWidth(row[i]))
let i = i + 1
endwhile
call add(lines, join(row, ' '))
endfor
return lines
endfunction
" SelectBuffer {{{2 " SelectBuffer {{{2
function! s:SelectBuffer(...) function! s:SelectBuffer(...)
" Sometimes messages are not cleared when we get here so it looks like an " Sometimes messages are not cleared when we get here so it looks like an
@ -841,96 +890,49 @@ function! s:SelectBuffer(...)
endif endif
if bufexists(_bufNbr) if bufexists(_bufNbr)
if bufnr("#") == _bufNbr && !exists("g:bufExplorerChgWin") " Get the tab number where this buffer is located in.
return s:Close()
endif
" Get the tab number where this bufer is located in.
let tabNbr = s:GetTabNbr(_bufNbr) let tabNbr = s:GetTabNbr(_bufNbr)
" Are we supposed to open the selected buffer in a tab? if exists("g:bufExplorerChgWin") && g:bufExplorerChgWin <=winnr("$")
if (a:0 == 1) && (a:1 == "tab") execute g:bufExplorerChgWin."wincmd w"
" Restore [BufExplorer] buffer.
execute "silent buffer!".s:originBuffer
" Was the tab found?
if tabNbr == 0
" _bufNbr is not opened in any tabs. Open a new tab with the
" selected buffer in it.
if v:version > 704 || ( v:version == 704 && has('patch2237') )
" new syntax for last tab as of 7.4.2237
execute "$tab split +buffer" . _bufNbr
else
execute "999tab split +buffer" . _bufNbr
endif
" Workaround for the issue mentioned in UpdateTabBufData.
call s:UpdateTabBufData(_bufNbr)
else
" The _bufNbr is already opened in a tab, go to that tab.
execute tabNbr . "tabnext"
" Focus window.
execute s:GetWinNbr(tabNbr, _bufNbr) . "wincmd w"
endif
" Are we supposed to open the selected buffer in a split?
elseif (a:0 == 2) && (a:1 == "split")
if g:bufExplorerFindActive
call s:Close()
endif
" Was the tab found?
if tabNbr != 0
" Yes, the buffer is located in a tab. Go to that tab instead of
" opening split
execute tabNbr . "tabnext"
else
"Nope, the buffer is not in a tab, open it accordingly
let _bufName = expand("#"._bufNbr.":p")
if (a:2 == "vl")
execute _bufName ?
\ "vert topleft sb ".escape(_bufName, " ") :
\ "vert topleft sb "._bufNbr
elseif (a:2 == "vr")
execute _bufName ?
\ "vert belowright sb ".escape(_bufName, " ") :
\ "vert belowright sb "._bufNbr
elseif (a:2 == "st")
execute _bufName ?
\ "topleft sb ".escape(_bufName, " ") :
\ "topleft sb "._bufNbr
else " = sb
execute _bufName ?
\ "belowright sb ".escape(_bufName, " ") :
\ "belowright sb "._bufNbr
endif
endif
" Switch to selected buffer
execute "keepalt silent b!" _bufNbr
" Default, open in current window
else
" Are we suppose to move to the tab where the active buffer is?
if exists("g:bufExplorerChgWin")
execute g:bufExplorerChgWin."wincmd w"
elseif bufloaded(_bufNbr) && g:bufExplorerFindActive
if g:bufExplorerFindActive
call s:Close()
endif
" Was the tab found?
if tabNbr != 0
" Yes, the buffer is located in a tab. Go to that tab number.
execute tabNbr . "tabnext"
else
"Nope, the buffer is not in a tab. Simply switch to that
"buffer.
let _bufName = expand("#"._bufNbr.":p")
execute _bufName ? "drop ".escape(_bufName, " ") : "buffer "._bufNbr
endif
endif
" Switch to the selected buffer.
execute "keepjumps keepalt silent b!" _bufNbr execute "keepjumps keepalt silent b!" _bufNbr
" Are we supposed to open the selected buffer in a tab?
elseif (a:0 == 1) && (a:1 == "tab")
call s:Close()
" Open a new tab with the selected buffer in it.
if v:version > 704 || ( v:version == 704 && has('patch2237') )
" new syntax for last tab as of 7.4.2237
execute "$tab split +buffer" . _bufNbr
else
execute "999tab split +buffer" . _bufNbr
endif
" Workaround for the issue mentioned in UpdateTabBufData.
call s:UpdateTabBufData(_bufNbr)
" Are we supposed to open the selected buffer in a split?
elseif (a:0 == 2) && (a:1 == "split")
call s:Close()
if (a:2 == "vl")
execute "vert topleft sb "._bufNbr
elseif (a:2 == "vr")
execute "vert belowright sb "._bufNbr
elseif (a:2 == "st")
execute "topleft sb "._bufNbr
else " = sb
execute "belowright sb "._bufNbr
endif
else
" Request to open in current (BufExplorer) window.
if g:bufExplorerFindActive && tabNbr > 0
" Close BufExplorer window and switch to existing tab/window.
call s:Close()
execute tabNbr . "tabnext"
execute bufwinnr(_bufNbr) . "wincmd w"
else
" Use BufExplorer window for the buffer.
execute "keepjumps keepalt silent b!" _bufNbr
endif
endif endif
" Make the buffer 'listed' again. " Make the buffer 'listed' again.
@ -976,7 +978,7 @@ function! s:RemoveBuffer(mode)
let _bufNbr = str2nr(getline('.')) let _bufNbr = str2nr(getline('.'))
if getbufvar(_bufNbr, '&modified') == 1 if getbufvar(_bufNbr, '&modified') == 1
" Calling confirm() requires Vim built with dialog option " Calling confirm() requires Vim built with dialog option.
if !has("dialog_con") && !has("dialog_gui") if !has("dialog_con") && !has("dialog_gui")
call s:Error("Sorry, no write since last change for buffer "._bufNbr.", unable to delete") call s:Error("Sorry, no write since last change for buffer "._bufNbr.", unable to delete")
return return
@ -1025,29 +1027,29 @@ function! s:DeleteBuffer(buf, mode)
setlocal nomodifiable setlocal nomodifiable
" Delete the buffer from the raw buffer list. " Delete the buffer from the raw buffer list.
call filter(s:raw_buffer_listing, 'v:val.attributes !~ " '.a:buf.' "') unlet s:raw_buffer_listing[a:buf]
catch catch
call s:Error(v:exception) call s:Error(v:exception)
endtry endtry
endfunction endfunction
" ListedAndCurrentTab {{{2 " ListedAndCurrentTab {{{2
" Returns whether the specified buffer is both listed and associated " Returns whether the specified buffer is both listed and associated with the
" with the current tab " current tab.
function! s:ListedAndCurrentTab(buf) function! s:ListedAndCurrentTab(buf)
return buflisted(a:buf) && s:IsInCurrentTab(a:buf) return buflisted(a:buf) && s:IsInCurrentTab(a:buf)
endfunction endfunction
" Close {{{2 " Close {{{2
function! s:Close() function! s:Close()
" Get only the listed buffers associated with the current tab " Get only the listed buffers associated with the current tab.
let listed = filter(copy(s:MRUList), "s:ListedAndCurrentTab(v:val)") let listed = filter(copy(s:MRUList), "s:ListedAndCurrentTab(v:val)")
if len(listed) == 0 if len(listed) == 0
let listed = filter(range(1, bufnr('$')), "s:ListedAndCurrentTab(v:val)") let listed = filter(range(1, bufnr('$')), "s:ListedAndCurrentTab(v:val)")
endif endif
" If we needed to split the main window, close the split one. " If we needed to split the main window, close the split one.
if s:didSplit == 1 && bufwinnr(s:originBuffer) != -1 if s:didSplit
execute "wincmd c" execute "wincmd c"
endif endif
@ -1068,6 +1070,13 @@ function! s:Close()
echo echo
endfunction endfunction
" ToggleShowTerminal {{{2
function! s:ToggleShowTerminal()
let g:bufExplorerShowTerminal = !g:bufExplorerShowTerminal
call s:RebuildBufferList()
call s:UpdateHelpStatus()
endfunction
" ToggleSplitOutPathName {{{2 " ToggleSplitOutPathName {{{2
function! s:ToggleSplitOutPathName() function! s:ToggleSplitOutPathName()
let g:bufExplorerSplitOutPathName = !g:bufExplorerSplitOutPathName let g:bufExplorerSplitOutPathName = !g:bufExplorerSplitOutPathName
@ -1139,9 +1148,70 @@ function! s:UpdateHelpStatus()
setlocal nomodifiable setlocal nomodifiable
endfunction endfunction
" MRUCmp {{{2 " Key_number {{{2
function! s:MRUCmp(line1, line2) function! s:Key_number(line)
return index(s:MRUList, str2nr(a:line1)) - index(s:MRUList, str2nr(a:line2)) let _bufnr = str2nr(a:line)
let key = [printf('%9d', _bufnr)]
return key
endfunction
" Key_name {{{2
function! s:Key_name(line)
let _bufnr = str2nr(a:line)
let buf = s:raw_buffer_listing[_bufnr]
let key = [buf.shortname, buf.fullname]
return key
endfunction
" Key_fullpath {{{2
function! s:Key_fullpath(line)
let _bufnr = str2nr(a:line)
let buf = s:raw_buffer_listing[_bufnr]
let key = [buf.fullname]
return key
endfunction
" Key_extension {{{2
function! s:Key_extension(line)
let _bufnr = str2nr(a:line)
let buf = s:raw_buffer_listing[_bufnr]
let extension = fnamemodify(buf.shortname, ':e')
let key = [extension, buf.shortname, buf.fullname]
return key
endfunction
" Key_mru {{{2
function! s:Key_mru(line)
let _bufnr = str2nr(a:line)
let buf = s:raw_buffer_listing[_bufnr]
let pos = index(s:MRUList, _bufnr)
if pos < 0
let pos = 0
endif
return [printf('%9d', pos), buf.fullname]
endfunction
" SortByKeyFunc {{{2
function! s:SortByKeyFunc(keyFunc)
let keyedLines = []
for line in getline(s:firstBufferLine, "$")
let key = eval(a:keyFunc . '(line)')
call add(keyedLines, join(key + [line], "\1"))
endfor
" Ignore case when sorting by passing `1`:
call sort(keyedLines, 1)
if g:bufExplorerReverseSort
call reverse(keyedLines)
endif
let lines = []
for keyedLine in keyedLines
call add(lines, split(keyedLine, "\1")[-1])
endfor
call setline(s:firstBufferLine, lines)
endfunction endfunction
" SortReverse {{{2 " SortReverse {{{2
@ -1178,50 +1248,7 @@ endfunction
" SortListing {{{2 " SortListing {{{2
function! s:SortListing() function! s:SortListing()
let sort = s:firstBufferLine.",$sort".((g:bufExplorerReverseSort == 1) ? "!": "") call s:SortByKeyFunc("<SID>Key_" . g:bufExplorerSortBy)
if g:bufExplorerSortBy == "number"
" Easiest case.
execute sort 'n'
elseif g:bufExplorerSortBy == "name"
" Sort by full path first
execute sort 'ir /\zs\f\+\ze\s\+line/'
if g:bufExplorerSplitOutPathName
execute sort 'ir /\d.\{7}\zs\f\+\ze/'
else
execute sort 'ir /\zs[^\/\\]\+\ze\s*line/'
endif
elseif g:bufExplorerSortBy == "fullpath"
if g:bufExplorerSplitOutPathName
" Sort twice - first on the file name then on the path.
execute sort 'ir /\d.\{7}\zs\f\+\ze/'
endif
execute sort 'ir /\zs\f\+\ze\s\+line/'
elseif g:bufExplorerSortBy == "extension"
" Sort by full path...
execute sort 'ir /\zs\f\+\ze\s\+line/'
" Sort by name...
if g:bufExplorerSplitOutPathName
" Sort twice - first on the file name then on the path.
execute sort 'ir /\d.\{7}\zs\f\+\ze/'
endif
" Sort by extension.
execute sort 'ir /\.\zs\w\+\ze\s/'
elseif g:bufExplorerSortBy == "mru"
let l = getline(s:firstBufferLine, "$")
call sort(l, "<SID>MRUCmp")
if g:bufExplorerReverseSort
call reverse(l)
endif
call setline(s:firstBufferLine, l)
endif
endfunction endfunction
" MRUListShow {{{2 " MRUListShow {{{2
@ -1247,6 +1274,10 @@ endfunction
" GetTabNbr {{{2 " GetTabNbr {{{2
function! s:GetTabNbr(bufNbr) function! s:GetTabNbr(bufNbr)
" Prefer current tab.
if bufwinnr(a:bufNbr) > 0
return tabpagenr()
endif
" Searching buffer bufno, in tabs. " Searching buffer bufno, in tabs.
for i in range(tabpagenr("$")) for i in range(tabpagenr("$"))
if index(tabpagebuflist(i + 1), a:bufNbr) != -1 if index(tabpagebuflist(i + 1), a:bufNbr) != -1
@ -1356,6 +1387,7 @@ call s:Set("g:bufExplorerSplitOutPathName", 1) " Split out path and fil
call s:Set("g:bufExplorerSplitRight", &splitright) " Should vertical splits be on the right or left of current window? call s:Set("g:bufExplorerSplitRight", &splitright) " Should vertical splits be on the right or left of current window?
call s:Set("g:bufExplorerSplitVertSize", 0) " Height for a vertical split. If <=0, default Vim size is used. call s:Set("g:bufExplorerSplitVertSize", 0) " Height for a vertical split. If <=0, default Vim size is used.
call s:Set("g:bufExplorerSplitHorzSize", 0) " Height for a horizontal split. If <=0, default Vim size is used. call s:Set("g:bufExplorerSplitHorzSize", 0) " Height for a horizontal split. If <=0, default Vim size is used.
call s:Set("g:bufExplorerShowTerminal", 1) " Show terminal buffers?
" Default key mapping {{{2 " Default key mapping {{{2
if !hasmapto('BufExplorer') && g:bufExplorerDisableDefaultKeyMapping == 0 if !hasmapto('BufExplorer') && g:bufExplorerDisableDefaultKeyMapping == 0

View File

@ -0,0 +1,23 @@
@echo off
if [%1]==[] goto :help
setlocal enableDelayedExpansion
set /p "GH_TOKEN=" <GITHUB_TOKEN
git tag -a %1 -m "Release %1."
git push origin %1
7z a bufexplorer-%1.zip plugin\bufexplorer.vim doc\bufexplorer.txt
::gh release create %1 --notes-from-tag bufexplorer-%1.zip
gh release create %1 --generate-notes bufexplorer-%1.zip
::gh release create %1 --notes-from-tag
goto :done
:help
echo Usage %0 version_number
goto :done
:done

View File

@ -1,22 +1,20 @@
# GitHub Copilot for Vim and Neovim # GitHub Copilot for Vim and Neovim
GitHub Copilot uses OpenAI Codex to suggest code and entire functions in GitHub Copilot is an AI pair programmer tool that helps you write code faster
real-time right from your editor. Trained on billions of lines of public and smarter. Trained on billions of lines of public code, GitHub Copilot turns
code, GitHub Copilot turns natural language prompts including comments and natural language prompts including comments and method names into coding
method names into coding suggestions across dozens of languages. suggestions across dozens of languages.
Copilot.vim is a Vim/Neovim plugin for GitHub Copilot. Copilot.vim is a Vim/Neovim plugin for GitHub Copilot.
To learn more, visit To learn more, visit
[https://github.com/features/copilot](https://github.com/features/copilot). [https://github.com/features/copilot](https://github.com/features/copilot).
## Subscription ## Getting access to GitHub Copilot
GitHub Copilot requires a subscription. It is free for verified students and To access GitHub Copilot, an active GitHub Copilot subscription is required.
maintainers of popular open source projects on GitHub. Sign up for [GitHub Copilot Free](https://github.com/settings/copilot), or
request access from your enterprise admin.
GitHub Copilot is subject to the [GitHub Additional Product
Terms](https://docs.github.com/en/site-policy/github-terms/github-terms-for-additional-products-and-features).
## Getting started ## Getting started

View File

@ -23,17 +23,6 @@ function! s:Echo(msg) abort
endif endif
endfunction endfunction
function! s:EditorConfiguration() abort
let filetypes = copy(s:filetype_defaults)
if type(get(g:, 'copilot_filetypes')) == v:t_dict
call extend(filetypes, g:copilot_filetypes)
endif
return {
\ 'enableAutoCompletions': empty(get(g:, 'copilot_enabled', 1)) ? v:false : v:true,
\ 'disabledLanguages': map(sort(keys(filter(filetypes, { k, v -> empty(v) }))), { _, v -> {'languageId': v}}),
\ }
endfunction
function! copilot#Init(...) abort function! copilot#Init(...) abort
call copilot#util#Defer({ -> exists('s:client') || s:Start() }) call copilot#util#Defer({ -> exists('s:client') || s:Start() })
endfunction endfunction
@ -46,7 +35,7 @@ function! s:Start() abort
if s:Running() || exists('s:client.startup_error') if s:Running() || exists('s:client.startup_error')
return return
endif endif
let s:client = copilot#client#New({'editorConfiguration' : s:EditorConfiguration()}) let s:client = copilot#client#New()
endfunction endfunction
function! s:Stop() abort function! s:Stop() abort
@ -599,20 +588,8 @@ function! s:VerifySetup() abort
return return
endif endif
let status = copilot#Call('checkStatus', {}) if exists('s:client.status.kind') && s:client.status.kind ==# 'Error'
echo 'Copilot: Error: ' . get(s:client.status, 'message', 'unknown')
if !has_key(status, 'user')
echo 'Copilot: Not authenticated. Invoke :Copilot setup'
return
endif
if status.status ==# 'NoTelemetryConsent'
echo 'Copilot: Telemetry terms not accepted. Invoke :Copilot setup'
return
endif
if status.status ==# 'NotAuthorized'
echo "Copilot: You don't have access to GitHub Copilot. Sign up by visiting https://github.com/settings/copilot"
return return
endif endif
@ -624,11 +601,8 @@ function! s:commands.status(opts) abort
return return
endif endif
if exists('s:client.status.status') && s:client.status.status =~# 'Warning\|Error' if exists('s:client.status.kind') && s:client.status.kind ==# 'Warning'
echo 'Copilot: ' . s:client.status.status echo 'Copilot: Warning: ' . get(s:client.status, 'message', 'unknown')
if !empty(get(s:client.status, 'message', ''))
echon ': ' . s:client.status.message
endif
return return
endif endif
@ -643,12 +617,7 @@ function! s:commands.status(opts) abort
endfunction endfunction
function! s:commands.signout(opts) abort function! s:commands.signout(opts) abort
let status = copilot#Call('checkStatus', {'options': {'localChecksOnly': v:true}}) echo 'Copilot: Signed out'
if has_key(status, 'user')
echo 'Copilot: Signed out as GitHub user ' . status.user
else
echo 'Copilot: Not signed in'
endif
call copilot#Call('signOut', {}) call copilot#Call('signOut', {})
endfunction endfunction
@ -659,14 +628,7 @@ function! s:commands.setup(opts) abort
return return
endif endif
let browser = copilot#Browser() let data = copilot#Call('signIn', {})
let status = copilot#Call('checkStatus', {})
if has_key(status, 'user')
let data = {'status': 'AlreadySignedIn', 'user': status.user}
else
let data = copilot#Call('signInInitiate', {})
endif
if has_key(data, 'verificationUri') if has_key(data, 'verificationUri')
let uri = data.verificationUri let uri = data.verificationUri
@ -688,24 +650,13 @@ function! s:commands.setup(opts) abort
endif endif
if get(a:opts, 'bang') if get(a:opts, 'bang')
call s:Echo(codemsg . "In your browser, visit " . uri) call s:Echo(codemsg . "In your browser, visit " . uri)
elseif len(browser) let request = copilot#Request('signInConfirm', {})
call input(codemsg . "Press ENTER to open GitHub in your browser\n")
let status = {}
call copilot#job#Stream(browser + [uri], v:null, v:null, function('s:BrowserCallback', [status]))
let time = reltime()
while empty(status) && reltimefloat(reltime(time)) < 5
sleep 10m
endwhile
if get(status, 'code', browser[0] !=# 'xdg-open') != 0
call s:Echo("Failed to open browser. Visit " . uri)
else
call s:Echo("Opened " . uri)
endif
else else
call s:Echo(codemsg . "Could not find browser. Visit " . uri) call input(codemsg . "Press ENTER to open GitHub in your browser\n")
let request = copilot#Request('workspace/executeCommand', data.command)
endif endif
call s:Echo("Waiting (could take up to 10 seconds)") call s:Echo("Waiting for " . data.userCode . " at " . uri . " (could take up to 10 seconds)")
let request = copilot#Request('signInConfirm', {'userCode': data.userCode}).Wait() call request.Wait()
finally finally
if exists('mouse') if exists('mouse')
let &mouse = mouse let &mouse = mouse
@ -768,16 +719,6 @@ function! s:commands.version(opts) abort
call s:EditorVersionWarning() call s:EditorVersionWarning()
endfunction endfunction
function! s:UpdateEditorConfiguration() abort
try
if s:Running()
call copilot#Notify('notifyChangeConfiguration', {'settings': s:EditorConfiguration()})
endif
catch
call copilot#logger#Exception()
endtry
endfunction
let s:feedback_url = 'https://github.com/orgs/community/discussions/categories/copilot' let s:feedback_url = 'https://github.com/orgs/community/discussions/categories/copilot'
function! s:commands.feedback(opts) abort function! s:commands.feedback(opts) abort
echo s:feedback_url echo s:feedback_url
@ -795,12 +736,10 @@ endfunction
function! s:commands.disable(opts) abort function! s:commands.disable(opts) abort
let g:copilot_enabled = 0 let g:copilot_enabled = 0
call s:UpdateEditorConfiguration()
endfunction endfunction
function! s:commands.enable(opts) abort function! s:commands.enable(opts) abort
let g:copilot_enabled = 1 let g:copilot_enabled = 1
call s:UpdateEditorConfiguration()
endfunction endfunction
function! s:commands.panel(opts) abort function! s:commands.panel(opts) abort

View File

@ -550,7 +550,10 @@ function! copilot#client#Settings() abort
let settings.http.proxy = 'http://' . settings.http.proxy let settings.http.proxy = 'http://' . settings.http.proxy
endif endif
if type(get(g:, 'copilot_settings')) == v:t_dict if type(get(g:, 'copilot_settings')) == v:t_dict
call extend(settings, g:copilot_settings) let settings.github = {'copilot': g:copilot_settings}
endif
if type(get(g:, 'copilot_lsp_settings')) == v:t_dict
call extend(settings, g:copilot_lsp_settings)
endif endif
return settings return settings
endfunction endfunction
@ -610,7 +613,7 @@ endfunction
let s:notifications = { let s:notifications = {
\ '$/progress': function('s:Progress'), \ '$/progress': function('s:Progress'),
\ 'featureFlagsNotification': function('s:Nop'), \ 'featureFlagsNotification': function('s:Nop'),
\ 'statusNotification': function('s:StatusNotification'), \ 'didChangeStatus': function('s:StatusNotification'),
\ 'window/logMessage': function('copilot#handlers#window_logMessage'), \ 'window/logMessage': function('copilot#handlers#window_logMessage'),
\ } \ }
@ -624,8 +627,8 @@ let s:vim_capabilities = {
\ 'window': {'showDocument': {'support': v:true}}, \ 'window': {'showDocument': {'support': v:true}},
\ } \ }
function! copilot#client#New(...) abort function! copilot#client#New() abort
let opts = a:0 ? a:1 : {} let opts = {}
let instance = {'requests': {}, let instance = {'requests': {},
\ 'progress': {}, \ 'progress': {},
\ 'workspaceFolders': {}, \ 'workspaceFolders': {},
@ -651,13 +654,12 @@ function! copilot#client#New(...) abort
endif endif
let instance.node = node let instance.node = node
let command = node + argv let command = node + argv
let opts = {}
let opts.initializationOptions = { let opts.initializationOptions = {
\ 'editorInfo': copilot#client#EditorInfo(), \ 'editorInfo': copilot#client#EditorInfo(),
\ 'editorPluginInfo': copilot#client#EditorPluginInfo(), \ 'editorPluginInfo': copilot#client#EditorPluginInfo(),
\ } \ }
let opts.workspaceFolders = [] let opts.workspaceFolders = []
let settings = extend(copilot#client#Settings(), get(opts, 'editorConfiguration', {})) let settings = copilot#client#Settings()
if type(get(g:, 'copilot_workspace_folders')) == v:t_list if type(get(g:, 'copilot_workspace_folders')) == v:t_list
for folder in g:copilot_workspace_folders for folder in g:copilot_workspace_folders
if type(folder) == v:t_string && !empty(folder) && folder !~# '\*\*\|^/$' if type(folder) == v:t_string && !empty(folder) && folder !~# '\*\*\|^/$'

View File

@ -108,7 +108,11 @@ function! copilot#panel#Accept(...) abort
endfunction endfunction
function! s:Initialize(state) abort function! s:Initialize(state) abort
let &l:filetype = 'copilot' . (empty(a:state.filetype) ? '' : '.' . a:state.filetype) try
let &l:filetype = 'copilot' . (empty(a:state.filetype) ? '' : '.' . a:state.filetype)
catch
let &l:filetype = 'copilot'
endtry
let &l:tabstop = a:state.tabstop let &l:tabstop = a:state.tabstop
nmap <buffer><script> <CR> <Cmd>exe copilot#panel#Accept()<CR> nmap <buffer><script> <CR> <Cmd>exe copilot#panel#Accept()<CR>
nmap <buffer><script> [[ <Cmd>call search('^─\{9,}\n.', 'bWe')<CR> nmap <buffer><script> [[ <Cmd>call search('^─\{9,}\n.', 'bWe')<CR>

View File

@ -1,3 +1,3 @@
function! copilot#version#String() abort function! copilot#version#String() abort
return '1.40.0' return '1.42.0'
endfunction endfunction

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

Binary file not shown.

Binary file not shown.

View File

@ -641,6 +641,9 @@ fu! ctrlp#buffers(...)
retu ids retu ids
el el
let bufs = [[], []] let bufs = [[], []]
if s:matcher != {} && !s:matchcrfile
call filter(ids, 'v:val != s:crbufnr')
en
for id in ids for id in ids
let bname = bufname(id) let bname = bufname(id)
let ebname = bname == '' let ebname = bname == ''
@ -2179,7 +2182,7 @@ fu! s:isabs(path)
endf endf
fu! s:bufnrfilpath(line) fu! s:bufnrfilpath(line)
if s:isabs(a:line) || a:line =~ '^\~[/\\]' || a:line =~ '^\w\+:\/\/' if s:isabs(a:line) || a:line =~ '^\~[/\\]' || a:line =~ '^\w\+:\/\/'
let filpath = a:line let filpath = a:line
el el
let filpath = s:dyncwd.s:lash().a:line let filpath = s:dyncwd.s:lash().a:line

View File

@ -449,7 +449,8 @@ Includes the current file in the match entries: >
By default, the current file is excluded from the list. By default, the current file is excluded from the list.
Note: does not apply when |g:ctrlp_match_func| is used. Note: With the exception of |:CtrlPMRU|, does not apply when
|g:ctrlp_match_func| is used.
*'g:ctrlp_types'* *'g:ctrlp_types'*
Set this to list of names to customize core types: > Set this to list of names to customize core types: >

View File

@ -71,6 +71,12 @@ The core included the code to parse `.editorconfig` files.
This plugin **includes** the core, so you don't need to download the This plugin **includes** the core, so you don't need to download the
core separately. core separately.
### Version Supported
Vim v9.1.0543 and Neovim v0.10.x or earlier versions: This plugin after version
1.2.1 will not automatically set `.editorconfig` filetype to `dosini`. Please
install version 1.2.1 of this plugin if you would like to retain this behavior.
## Supported properties ## Supported properties
The EditorConfig Vim plugin supports the following EditorConfig [properties][]: The EditorConfig Vim plugin supports the following EditorConfig [properties][]:

View File

@ -1,4 +1,4 @@
" autoload/editorconfig.vim: EditorConfig native Vimscript plugin " autoload/editorconfig.vim: EditorConfig native Vim script plugin
" Copyright (c) 2011-2019 EditorConfig Team " Copyright (c) 2011-2019 EditorConfig Team
" All rights reserved. " All rights reserved.
" "

View File

@ -47,7 +47,7 @@ Specify the mode of EditorConfig core. Generally it is OK to leave this option
empty. Currently, the supported modes are "vim_core" (default) and empty. Currently, the supported modes are "vim_core" (default) and
"external_command". "external_command".
vim_core: Use the included VimScript EditorConfig Core. vim_core: Use the included Vim script EditorConfig Core.
external_command: Run external EditorConfig Core. external_command: Run external EditorConfig Core.
If "g:EditorConfig_core_mode" is not specified, this plugin will automatically If "g:EditorConfig_core_mode" is not specified, this plugin will automatically

View File

@ -1 +0,0 @@
autocmd BufNewFile,BufRead .editorconfig setfiletype dosini

Some files were not shown because too many files have changed in this diff Show More