Adding updates and my_configs
This commit is contained in:
32
my_configs.vim
Normal file
32
my_configs.vim
Normal 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>
|
||||
22
sources_non_forked/ale/ale_linters/c3/c3lsp.vim
Normal file
22
sources_non_forked/ale/ale_linters/c3/c3lsp.vim
Normal 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')},
|
||||
\})
|
||||
@@ -53,4 +53,5 @@ call ale#linter#Define('erlang', {
|
||||
\ 'command': function('s:GetCommand'),
|
||||
\ 'lsp': 'stdio',
|
||||
\ 'project_root': function('s:FindProjectRoot'),
|
||||
\ 'aliases': ['erlang-ls'],
|
||||
\})
|
||||
|
||||
@@ -5,7 +5,7 @@ call ale#Set('json_jq_filters', '.')
|
||||
|
||||
" Matches patterns like the following:
|
||||
" 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
|
||||
return ale#util#MapMatches(a:lines, s:pattern, {match -> {
|
||||
|
||||
@@ -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_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')
|
||||
|
||||
@@ -45,7 +45,7 @@ function! ale_linters#python#bandit#GetCommand(buffer) abort
|
||||
endif
|
||||
endif
|
||||
|
||||
let l:exec_args = l:executable =~? 'pipenv\|poetry\|uv$'
|
||||
let l:exec_args = l:executable =~? '\(pipenv\|poetry\|uv\)$'
|
||||
\ ? ' run bandit'
|
||||
\ : ''
|
||||
|
||||
|
||||
@@ -74,7 +74,7 @@ endfunction
|
||||
function! ale_linters#python#flake8#GetCommand(buffer, version) abort
|
||||
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'
|
||||
\ : ''
|
||||
|
||||
|
||||
@@ -74,7 +74,7 @@ endfunction
|
||||
function! ale_linters#python#flakehell#GetCommand(buffer, version) abort
|
||||
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'
|
||||
elseif (l:executable is? 'python')
|
||||
let l:exec_args = ' -m flakehell'
|
||||
|
||||
@@ -28,7 +28,7 @@ endfunction
|
||||
|
||||
function! ale_linters#python#jedils#GetCommand(buffer) abort
|
||||
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'
|
||||
\ : ''
|
||||
let l:env_string = ''
|
||||
|
||||
@@ -49,7 +49,7 @@ endfunction
|
||||
|
||||
function! ale_linters#python#mypy#GetCommand(buffer) abort
|
||||
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'
|
||||
\ : ''
|
||||
|
||||
|
||||
@@ -35,7 +35,7 @@ endfunction
|
||||
function! ale_linters#python#prospector#GetCommand(buffer) abort
|
||||
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'
|
||||
\ : ''
|
||||
|
||||
|
||||
@@ -42,7 +42,7 @@ endfunction
|
||||
|
||||
function! ale_linters#python#pycln#GetCommand(buffer, version) abort
|
||||
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'
|
||||
\ : ''
|
||||
|
||||
|
||||
@@ -30,7 +30,7 @@ endfunction
|
||||
function! ale_linters#python#pycodestyle#GetCommand(buffer) abort
|
||||
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'
|
||||
\ : ''
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@ endfunction
|
||||
|
||||
function! ale_linters#python#pydocstyle#GetCommand(buffer) abort
|
||||
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'
|
||||
\ : ''
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@ endfunction
|
||||
function! ale_linters#python#pyflakes#GetCommand(buffer) abort
|
||||
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'
|
||||
\ : ''
|
||||
|
||||
|
||||
@@ -30,7 +30,7 @@ endfunction
|
||||
|
||||
function! ale_linters#python#pylama#RunWithVersionCheck(buffer) abort
|
||||
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'
|
||||
\ : ''
|
||||
|
||||
@@ -59,7 +59,7 @@ endfunction
|
||||
|
||||
function! ale_linters#python#pylama#GetCommand(buffer, version) abort
|
||||
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'
|
||||
\ : ''
|
||||
|
||||
|
||||
@@ -44,7 +44,7 @@ endfunction
|
||||
|
||||
function! ale_linters#python#pylint#GetCommand(buffer, version) abort
|
||||
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'
|
||||
\ : ''
|
||||
|
||||
|
||||
@@ -43,7 +43,7 @@ endfunction
|
||||
|
||||
function! ale_linters#python#pylsp#GetCommand(buffer) abort
|
||||
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'
|
||||
\ : ''
|
||||
let l:env_string = ''
|
||||
|
||||
@@ -28,7 +28,7 @@ endfunction
|
||||
|
||||
function! ale_linters#python#pyre#GetCommand(buffer) abort
|
||||
let l:executable = ale_linters#python#pyre#GetExecutable(a:buffer)
|
||||
let l:exec_args = (l:executable =~? 'pipenv\|poetry\|uv$' ? ' run pyre' : '') . ' persistent'
|
||||
let l:exec_args = (l:executable =~? '\(pipenv\|poetry\|uv\)$' ? ' run pyre' : '') . ' persistent'
|
||||
|
||||
return ale#Escape(l:executable) . l:exec_args
|
||||
endfunction
|
||||
|
||||
@@ -70,7 +70,7 @@ endfunction
|
||||
|
||||
function! ale_linters#python#pyright#GetCommand(buffer) abort
|
||||
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'
|
||||
\ : ''
|
||||
let l:env_string = ''
|
||||
|
||||
@@ -41,7 +41,7 @@ endfunction
|
||||
|
||||
function! ale_linters#python#refurb#GetCommand(buffer) abort
|
||||
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'
|
||||
\ : ''
|
||||
|
||||
|
||||
@@ -47,7 +47,7 @@ endfunction
|
||||
|
||||
function! ale_linters#python#ruff#GetCommand(buffer, version) abort
|
||||
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'
|
||||
\ : ''
|
||||
|
||||
|
||||
@@ -28,7 +28,7 @@ endfunction
|
||||
|
||||
function! ale_linters#python#unimport#GetCommand(buffer) abort
|
||||
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'
|
||||
\ : ''
|
||||
|
||||
|
||||
@@ -47,7 +47,7 @@ endfunction
|
||||
|
||||
function! ale_linters#python#vulture#GetCommand(buffer) abort
|
||||
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'
|
||||
\ : ''
|
||||
let l:lint_dest = ale#Var(a:buffer, 'python_vulture_change_directory')
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
" Author: Jeffrey Lau - https://github.com/zoonfafer
|
||||
" 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', '')
|
||||
|
||||
function! ale_linters#scala#metals#GetProjectRoot(buffer) abort
|
||||
|
||||
@@ -52,16 +52,24 @@ function! ale_linters#sql#sqlfluff#Handle(buffer, version, lines) abort
|
||||
|
||||
if ale#semver#GTE(a:version, [3, 0, 0])
|
||||
for l:violation in get(l:json, 'violations', [])
|
||||
call add(l:output, {
|
||||
let l:err = {
|
||||
\ 'filename': l:json.filepath,
|
||||
\ 'lnum': l:violation.start_line_no,
|
||||
\ 'end_lnum': l:violation.end_line_no,
|
||||
\ 'col': l:violation.start_line_pos,
|
||||
\ 'end_col': l:violation.end_line_pos,
|
||||
\ 'text': l:violation.description,
|
||||
\ 'code': l:violation.code,
|
||||
\ '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
|
||||
else
|
||||
for l:violation in get(l:json, 'violations', [])
|
||||
|
||||
@@ -5,6 +5,7 @@ call ale#Set('verilog_iverilog_options', '')
|
||||
|
||||
function! ale_linters#verilog#iverilog#GetCommand(buffer) abort
|
||||
return 'iverilog -t null -Wall '
|
||||
\ . '-y%s:h '
|
||||
\ . ale#Var(a:buffer, 'verilog_iverilog_options')
|
||||
\ . ' %t'
|
||||
endfunction
|
||||
|
||||
@@ -20,9 +20,32 @@ function! ale_linters#yaml#actionlint#GetCommand(buffer) abort
|
||||
let l:options .= ale#Pad('-oneline')
|
||||
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) . ' - '
|
||||
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
|
||||
" 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]
|
||||
|
||||
22
sources_non_forked/ale/ale_linters/yaml/yq.vim
Normal file
22
sources_non_forked/ale/ale_linters/yaml/yq.vim
Normal 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',
|
||||
\})
|
||||
@@ -4,11 +4,12 @@
|
||||
call ale#Set('zeek_zeek_executable', 'zeek')
|
||||
|
||||
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), "{
|
||||
\ 'lnum': str2nr(v:val[1]),
|
||||
\ 'text': v:val[2],
|
||||
\ 'lnum': str2nr(v:val[2]),
|
||||
\ 'text': v:val[3],
|
||||
\ 'type': (v:val[1] is# 'error') ? 'E': 'W',
|
||||
\}")
|
||||
endfunction
|
||||
|
||||
|
||||
@@ -17,6 +17,11 @@ let s:default_registry = {
|
||||
\ 'suggested_filetypes': ['help'],
|
||||
\ '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': {
|
||||
\ 'function': 'ale#fixers#autoimport#Fix',
|
||||
\ 'suggested_filetypes': ['python'],
|
||||
@@ -39,7 +44,7 @@ let s:default_registry = {
|
||||
\ },
|
||||
\ 'biome': {
|
||||
\ '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.',
|
||||
\ },
|
||||
\ 'black': {
|
||||
@@ -98,6 +103,17 @@ let s:default_registry = {
|
||||
\ 'suggested_filetypes': ['dune'],
|
||||
\ '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': {
|
||||
\ 'function': 'ale#fixers#fecs#Fix',
|
||||
\ 'suggested_filetypes': ['javascript', 'css', 'html'],
|
||||
@@ -201,6 +217,11 @@ let s:default_registry = {
|
||||
\ 'suggested_filetypes': ['python'],
|
||||
\ 'description': 'Fix Python files with yapf.',
|
||||
\ },
|
||||
\ 'yq': {
|
||||
\ 'function': 'ale#fixers#yq#Fix',
|
||||
\ 'suggested_filetypes': ['yaml'],
|
||||
\ 'description': 'Fix YAML files with yq.',
|
||||
\ },
|
||||
\ 'rubocop': {
|
||||
\ 'function': 'ale#fixers#rubocop#Fix',
|
||||
\ 'suggested_filetypes': ['ruby'],
|
||||
@@ -321,6 +342,11 @@ let s:default_registry = {
|
||||
\ 'suggested_filetypes': ['go'],
|
||||
\ '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': {
|
||||
\ 'function': 'ale#fixers#golines#Fix',
|
||||
\ 'suggested_filetypes': ['go'],
|
||||
@@ -451,6 +477,11 @@ let s:default_registry = {
|
||||
\ 'suggested_filetypes': ['json'],
|
||||
\ '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': {
|
||||
\ 'function': 'ale#fixers#protolint#Fix',
|
||||
\ 'suggested_filetypes': ['proto'],
|
||||
@@ -666,6 +697,11 @@ let s:default_registry = {
|
||||
\ 'suggested_filetypes': ['ruby'],
|
||||
\ '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.
|
||||
|
||||
@@ -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
|
||||
@@ -30,7 +30,7 @@ endfunction
|
||||
function! ale#fixers#autoflake#Fix(buffer) abort
|
||||
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'
|
||||
\ : ''
|
||||
|
||||
|
||||
@@ -30,7 +30,7 @@ endfunction
|
||||
function! ale#fixers#autoimport#Fix(buffer) abort
|
||||
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'
|
||||
\ : ''
|
||||
|
||||
|
||||
@@ -30,7 +30,7 @@ endfunction
|
||||
function! ale#fixers#autopep8#Fix(buffer) abort
|
||||
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'
|
||||
\ : ''
|
||||
|
||||
|
||||
@@ -32,7 +32,7 @@ function! ale#fixers#black#Fix(buffer) abort
|
||||
let l:executable = ale#fixers#black#GetExecutable(a:buffer)
|
||||
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'])
|
||||
endif
|
||||
|
||||
@@ -42,6 +42,9 @@ function! ale#fixers#black#Fix(buffer) abort
|
||||
call add(l:cmd, l:options)
|
||||
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'
|
||||
call add(l:cmd, '--pyi')
|
||||
endif
|
||||
|
||||
14
sources_non_forked/ale/autoload/ale/fixers/cljfmt.vim
Normal file
14
sources_non_forked/ale/autoload/ale/fixers/cljfmt.vim
Normal 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
|
||||
|
||||
49
sources_non_forked/ale/autoload/ale/fixers/erlang_mode.vim
Normal file
49
sources_non_forked/ale/autoload/ale/fixers/erlang_mode.vim
Normal 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
|
||||
@@ -13,9 +13,7 @@ function! ale#fixers#erlfmt#Fix(buffer) abort
|
||||
let l:options = ale#Var(a:buffer, 'erlang_erlfmt_options')
|
||||
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 {
|
||||
\ 'command': l:command
|
||||
\}
|
||||
return {'command': l:command}
|
||||
endfunction
|
||||
|
||||
32
sources_non_forked/ale/autoload/ale/fixers/golangci_lint.vim
Normal file
32
sources_non_forked/ale/autoload/ale/fixers/golangci_lint.vim
Normal 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
|
||||
@@ -31,7 +31,7 @@ function! ale#fixers#isort#GetCmd(buffer) abort
|
||||
let l:executable = ale#fixers#isort#GetExecutable(a:buffer)
|
||||
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'])
|
||||
endif
|
||||
|
||||
@@ -42,7 +42,7 @@ function! ale#fixers#isort#FixForVersion(buffer, version) abort
|
||||
let l:executable = ale#fixers#isort#GetExecutable(a:buffer)
|
||||
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'])
|
||||
endif
|
||||
|
||||
|
||||
20
sources_non_forked/ale/autoload/ale/fixers/json_pytool.vim
Normal file
20
sources_non_forked/ale/autoload/ale/fixers/json_pytool.vim
Normal 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
|
||||
@@ -42,7 +42,7 @@ endfunction
|
||||
|
||||
function! ale#fixers#pycln#GetCommand(buffer) abort
|
||||
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'
|
||||
\ : ''
|
||||
|
||||
@@ -53,7 +53,7 @@ function! ale#fixers#pycln#FixForVersion(buffer, version) abort
|
||||
let l:executable = ale#fixers#pycln#GetExecutable(a:buffer)
|
||||
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'])
|
||||
endif
|
||||
|
||||
|
||||
@@ -33,7 +33,7 @@ function! ale#fixers#pyflyby#Fix(buffer) abort
|
||||
let l:executable = ale#fixers#pyflyby#GetExecutable(a:buffer)
|
||||
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'])
|
||||
endif
|
||||
|
||||
|
||||
@@ -30,7 +30,7 @@ endfunction
|
||||
function! ale#fixers#reorder_python_imports#Fix(buffer) abort
|
||||
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'
|
||||
\ : ''
|
||||
|
||||
|
||||
@@ -41,7 +41,7 @@ endfunction
|
||||
|
||||
function! ale#fixers#ruff#GetCommand(buffer) abort
|
||||
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'
|
||||
\ : ''
|
||||
|
||||
@@ -52,7 +52,7 @@ function! ale#fixers#ruff#FixForVersion(buffer, version) abort
|
||||
let l:executable = ale#fixers#ruff#GetExecutable(a:buffer)
|
||||
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'])
|
||||
endif
|
||||
|
||||
|
||||
@@ -41,7 +41,7 @@ endfunction
|
||||
|
||||
function! ale#fixers#ruff_format#GetCommand(buffer) abort
|
||||
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'
|
||||
\ : ''
|
||||
|
||||
@@ -52,7 +52,7 @@ function! ale#fixers#ruff_format#Fix(buffer) abort
|
||||
let l:executable = ale#fixers#ruff_format#GetExecutable(a:buffer)
|
||||
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'])
|
||||
endif
|
||||
|
||||
|
||||
@@ -4,11 +4,24 @@
|
||||
call ale#Set('lua_stylua_executable', 'stylua')
|
||||
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
|
||||
let l:executable = ale#Var(a:buffer, 'lua_stylua_executable')
|
||||
let l:options = ale#Var(a:buffer, 'lua_stylua_options')
|
||||
|
||||
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
|
||||
|
||||
@@ -6,7 +6,7 @@ function! ale#fixers#syntax_tree#GetCommand(buffer) abort
|
||||
let l:options = ale#Var(a:buffer, 'ruby_syntax_tree_options')
|
||||
|
||||
return ale#ruby#EscapeExecutable(l:executable, 'stree')
|
||||
\ . ' write'
|
||||
\ . ' format'
|
||||
\ . (!empty(l:options) ? ' ' . l:options : '')
|
||||
\ . ' %t'
|
||||
endfunction
|
||||
@@ -14,6 +14,5 @@ endfunction
|
||||
function! ale#fixers#syntax_tree#Fix(buffer) abort
|
||||
return {
|
||||
\ 'command': ale#fixers#syntax_tree#GetCommand(a:buffer),
|
||||
\ 'read_temporary_file': 1,
|
||||
\}
|
||||
endfunction
|
||||
|
||||
@@ -7,15 +7,8 @@ call ale#Set('xml_xmllint_indentsize', 2)
|
||||
|
||||
function! ale#fixers#xmllint#Fix(buffer) abort
|
||||
let l:executable = ale#Escape(ale#Var(a:buffer, 'xml_xmllint_executable'))
|
||||
let l:filename = bufname(a:buffer)
|
||||
|
||||
if empty(l:filename)
|
||||
let l:filename = '%t'
|
||||
else
|
||||
let l:filename = ale#Escape(l:filename)
|
||||
endif
|
||||
|
||||
let l:command = l:executable . ' --format ' . l:filename
|
||||
let l:command = l:executable . ' --format'
|
||||
|
||||
let l:indent = ale#Var(a:buffer, 'xml_xmllint_indentsize')
|
||||
|
||||
@@ -31,6 +24,6 @@ function! ale#fixers#xmllint#Fix(buffer) abort
|
||||
endif
|
||||
|
||||
return {
|
||||
\ 'command': l:command
|
||||
\ 'command': l:command . ' -'
|
||||
\}
|
||||
endfunction
|
||||
|
||||
@@ -29,7 +29,7 @@ endfunction
|
||||
function! ale#fixers#yapf#Fix(buffer) abort
|
||||
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'
|
||||
\ : ''
|
||||
|
||||
|
||||
22
sources_non_forked/ale/autoload/ale/fixers/yq.vim
Normal file
22
sources_non_forked/ale/autoload/ale/fixers/yq.vim
Normal 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
|
||||
@@ -21,6 +21,8 @@ function! ale#floating_preview#Show(lines, ...) abort
|
||||
else
|
||||
call s:VimShow(a:lines, l:options)
|
||||
endif
|
||||
|
||||
return w:preview.id
|
||||
endfunction
|
||||
|
||||
function! s:NvimShow(lines, options) abort
|
||||
|
||||
19
sources_non_forked/ale/autoload/ale/handlers/c3lsp.vim
Normal file
19
sources_non_forked/ale/autoload/ale/handlers/c3lsp.vim
Normal 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
|
||||
@@ -108,12 +108,17 @@ function! ale#python#AutoVirtualenvEnvString(buffer) abort
|
||||
|
||||
if !empty(l:venv_dir)
|
||||
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.
|
||||
" set VIRTUAL_ENV to point to venv
|
||||
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
|
||||
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
|
||||
|
||||
return join(l:strs, '')
|
||||
|
||||
@@ -17,18 +17,21 @@ function! ale#references#ClearLSPData() abort
|
||||
endfunction
|
||||
|
||||
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'
|
||||
return {
|
||||
\ 'filename': a:response_item.file,
|
||||
\ 'lnum': a:response_item.start.line,
|
||||
\ 'col': a:response_item.start.offset,
|
||||
\ 'text': l:match,
|
||||
\}
|
||||
else
|
||||
return {
|
||||
\ 'filename': a:response_item.file,
|
||||
\ 'line': a:response_item.start.line,
|
||||
\ 'column': a:response_item.start.offset,
|
||||
\ 'match': substitute(a:response_item.lineText, '^\s*\(.\{-}\)\s*$', '\1', ''),
|
||||
\ 'match': l:match,
|
||||
\}
|
||||
endif
|
||||
endfunction
|
||||
|
||||
@@ -2,6 +2,37 @@
|
||||
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*
|
||||
|
||||
|
||||
35
sources_non_forked/ale/doc/ale-c3.txt
Normal file
35
sources_non_forked/ale/doc/ale-c3.txt
Normal 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:
|
||||
@@ -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.
|
||||
|
||||
===============================================================================
|
||||
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*
|
||||
|
||||
@@ -49,10 +49,10 @@ changes should be preceded by a deprecation phase complete with warnings.
|
||||
Changes required for security may be an exception.
|
||||
|
||||
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|,
|
||||
and |lambda| features. All ALE code should be written so it is compatible with
|
||||
these versions of Vim, or with version checks so particular features can
|
||||
degrade or fail gracefully.
|
||||
earliest versions of Vim and NeoVim which support |+job|, |+timer|,
|
||||
|+closure|, and |+lambda| features. All ALE code should be written so it is
|
||||
compatible with these versions of Vim, or with version checks so particular
|
||||
features can degrade or fail gracefully.
|
||||
|
||||
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
|
||||
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
|
||||
most. ALE should not typically introduce any breaking changes.
|
||||
|
||||
|
||||
@@ -51,6 +51,57 @@ g:ale_erlang_elvis_executable *g:ale_erlang_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*
|
||||
|
||||
|
||||
@@ -83,6 +83,40 @@ g:ale_json_fixjson_use_global *g:ale_json_fixjson_use_global*
|
||||
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*
|
||||
|
||||
|
||||
@@ -23,6 +23,7 @@ Notes:
|
||||
* API Blueprint
|
||||
* `drafter`
|
||||
* APKBUILD
|
||||
* `apkbuild-fixer`
|
||||
* `apkbuild-lint`
|
||||
* `secfixes-check`
|
||||
* AsciiDoc
|
||||
@@ -104,6 +105,8 @@ Notes:
|
||||
* `flawfinder`
|
||||
* `gcc` (`cc`)
|
||||
* `uncrustify`
|
||||
* C3
|
||||
* `c3lsp`
|
||||
* Cairo
|
||||
* `scarb`!!
|
||||
* `starknet`
|
||||
@@ -112,6 +115,7 @@ Notes:
|
||||
* `foodcritic`!!
|
||||
* Clojure
|
||||
* `clj-kondo`
|
||||
* `cljfmt`
|
||||
* `joker`
|
||||
* CloudFormation
|
||||
* `cfn-python-lint`
|
||||
@@ -191,6 +195,7 @@ Notes:
|
||||
* `SyntaxErl`
|
||||
* `dialyzer`!!
|
||||
* `elvis`!!
|
||||
* `erlang-mode` (The Erlang mode for Emacs)
|
||||
* `erlang_ls`
|
||||
* `erlc`
|
||||
* `erlfmt`
|
||||
@@ -324,6 +329,7 @@ Notes:
|
||||
* `eslint`
|
||||
* `fixjson`
|
||||
* `jq`
|
||||
* `json.tool`
|
||||
* `jsonlint`
|
||||
* `prettier`
|
||||
* `spectral`
|
||||
@@ -727,6 +733,7 @@ Notes:
|
||||
* `yamlfix`
|
||||
* `yamlfmt`
|
||||
* `yamllint`
|
||||
* `yq`
|
||||
* YANG
|
||||
* `yang-lsp`
|
||||
* Zeek
|
||||
|
||||
@@ -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.
|
||||
|
||||
|
||||
===============================================================================
|
||||
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:
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -32,6 +32,7 @@ formatting.
|
||||
* API Blueprint
|
||||
* [drafter](https://github.com/apiaryio/drafter)
|
||||
* APKBUILD
|
||||
* [apkbuild-fixer](https://gitlab.alpinelinux.org/Leo/atools)
|
||||
* [apkbuild-lint](https://gitlab.alpinelinux.org/Leo/atools)
|
||||
* [secfixes-check](https://gitlab.alpinelinux.org/Leo/atools)
|
||||
* AsciiDoc
|
||||
@@ -113,6 +114,8 @@ formatting.
|
||||
* [flawfinder](https://www.dwheeler.com/flawfinder/)
|
||||
* [gcc](https://gcc.gnu.org/)
|
||||
* [uncrustify](https://github.com/uncrustify/uncrustify)
|
||||
* C3
|
||||
* [c3lsp](https://github.com/pherrymason/c3-lsp)
|
||||
* Cairo
|
||||
* [scarb](https://docs.swmansion.com/scarb/) :floppy_disk:
|
||||
* [starknet](https://starknet.io/docs)
|
||||
@@ -121,6 +124,7 @@ formatting.
|
||||
* [foodcritic](http://www.foodcritic.io/) :floppy_disk:
|
||||
* Clojure
|
||||
* [clj-kondo](https://github.com/borkdude/clj-kondo)
|
||||
* [cljfmt](https://github.com/weavejester/cljfmt)
|
||||
* [joker](https://github.com/candid82/joker)
|
||||
* CloudFormation
|
||||
* [cfn-python-lint](https://github.com/awslabs/cfn-python-lint)
|
||||
@@ -200,6 +204,7 @@ formatting.
|
||||
* [SyntaxErl](https://github.com/ten0s/syntaxerl)
|
||||
* [dialyzer](http://erlang.org/doc/man/dialyzer.html) :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)
|
||||
* [erlc](http://erlang.org/doc/man/erlc.html)
|
||||
* [erlfmt](https://github.com/WhatsApp/erlfmt)
|
||||
@@ -333,6 +338,7 @@ formatting.
|
||||
* [eslint](http://eslint.org/) :warning:
|
||||
* [fixjson](https://github.com/rhysd/fixjson)
|
||||
* [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)
|
||||
* [prettier](https://github.com/prettier/prettier)
|
||||
* [spectral](https://github.com/stoplightio/spectral)
|
||||
@@ -736,6 +742,7 @@ formatting.
|
||||
* [yamlfix](https://lyz-code.github.io/yamlfix)
|
||||
* [yamlfmt](https://github.com/google/yamlfmt)
|
||||
* [yamllint](https://yamllint.readthedocs.io/)
|
||||
* [yq](https://github.com/mikefarah/yq)
|
||||
* YANG
|
||||
* [yang-lsp](https://github.com/theia-ide/yang-lsp)
|
||||
* Zeek
|
||||
|
||||
2
sources_non_forked/bufexplorer/.gitignore
vendored
2
sources_non_forked/bufexplorer/.gitignore
vendored
@@ -8,3 +8,5 @@ tags
|
||||
# Github token.
|
||||
github_token
|
||||
|
||||
# goreleaser dist directory.
|
||||
dist/
|
||||
|
||||
@@ -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
|
||||
@@ -1,5 +1,6 @@
|
||||
bufexplorer
|
||||
===========
|
||||
# bufexplorer
|
||||
|
||||
---
|
||||
|
||||
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
|
||||
|
||||
|
||||
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:
|
||||
|
||||
- Display the list of buffers in various sort orders including:
|
||||
- Most Recently Used (MRU) which is the default
|
||||
- Buffer number
|
||||
- File name
|
||||
- File extension
|
||||
- Full file path name
|
||||
- Most Recently Used (MRU) which is the default
|
||||
- Buffer number
|
||||
- File name
|
||||
- File extension
|
||||
- Full file path name
|
||||
- Delete buffer from list
|
||||
|
||||
For more about options, sort orders, configuration options, etc. please see the supplied VIM help.
|
||||
|
||||
In this example, the `<Leader>` key is assigned to [Space].
|
||||
|
||||

|
||||
|
||||
## vim.org
|
||||
|
||||
This plugin can also be found at http://www.vim.org/scripts/script.php?script_id=42.
|
||||
|
||||
## Installation
|
||||
|
||||
### Manually
|
||||
|
||||
1. If you do not want to use one of the the bundle handlers, you can take the
|
||||
zip file from vim.org and unzip it and copy the plugin to your vimfiles\plugin
|
||||
directory and the txt file to your vimfiles\doc directory. If you do that,
|
||||
directory and the txt file to your vimfiles\doc directory. If you do that,
|
||||
make sure you generate the help by executing
|
||||
|
||||
`: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`.
|
||||
|
||||
### 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'
|
||||
|
||||
2. Install with `:BundleInstall`.
|
||||
2. Install with `:BundleInstall`.
|
||||
|
||||
### 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'
|
||||
|
||||
2. Install with `:NeoBundleInstall`.
|
||||
2. Install with `:NeoBundleInstall`.
|
||||
|
||||
### 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'
|
||||
|
||||
2. Install with `:PlugInstall`.
|
||||
2. Install with `:PlugInstall`.
|
||||
|
||||
### 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
|
||||
|
||||
## License
|
||||
Copyright (c) 2001-2023, Jeff Lanzarotta
|
||||
|
||||
Copyright (c) 2001-2025, Jeff Lanzarotta
|
||||
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without modification,
|
||||
are permitted provided that the following conditions are met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright notice, this
|
||||
- Redistributions of source code must retain the above copyright notice, this
|
||||
list of conditions and the following disclaimer.
|
||||
|
||||
* Redistributions in binary form must reproduce the above copyright notice, this
|
||||
- Redistributions in binary form must reproduce the above copyright notice, this
|
||||
list of conditions and the following disclaimer in the documentation and/or
|
||||
other materials provided with the distribution.
|
||||
|
||||
* Neither the name of the {organization} nor the names of its
|
||||
- Neither the name of the {organization} nor the names of its
|
||||
contributors may be used to endorse or promote products derived from
|
||||
this software without specific prior written permission.
|
||||
|
||||
|
||||
@@ -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*
|
||||
Version 7.4.27
|
||||
Version 7.6.0
|
||||
|
||||
Plugin for easily exploring (or browsing) Vim|:buffers|.
|
||||
|
||||
@@ -26,7 +26,7 @@ To install:
|
||||
- Download the bufexplorer.zip from one of the following places:
|
||||
https://github.com/jlanzarotta/bufexplorer
|
||||
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.
|
||||
The archive contains plugin/bufexplorer.vim, and doc/bufexplorer.txt.
|
||||
- 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.
|
||||
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*
|
||||
To control whether to warning about Vim version or not, use: >
|
||||
let g:bufExplorerVersionWarn=1 " Warn if version conflict.
|
||||
@@ -263,6 +269,59 @@ The default is 1.
|
||||
===============================================================================
|
||||
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
|
||||
- Thanks to GitHub user NotNormallyAGitUser, for the recommendation to
|
||||
change the display of the relative path to replace $HOME with "~".
|
||||
|
||||
@@ -1,16 +1,17 @@
|
||||
https://goreleaser.com/quick-start/
|
||||
|
||||
To make a release...
|
||||
|
||||
1. Make changes.
|
||||
2. Commit and push changes.
|
||||
3. git tag -a v7.4.27 -m "Release v7.4.27."
|
||||
4. git push origin v7.4.27
|
||||
5. goreleaser release --clean
|
||||
6. Go to github and make the release.
|
||||
1. Make changes
|
||||
2. Commit and push changes
|
||||
3. git tag -a 7.4.28 -m "Release 7.4.28"
|
||||
4. git push origin 7.4.28
|
||||
5. set GH_TOKEN environment variable
|
||||
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
|
||||
local and remote tag and release again. To delete the tag:
|
||||
|
||||
1. git tag -d v7.4.27
|
||||
2. git push --delete origin v7.4.27
|
||||
1. git tag -d 7.4.27
|
||||
2. git push --delete origin 7.4.27
|
||||
3. Remove the release.
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
"============================================================================
|
||||
" Copyright: Copyright (c) 2001-2024, Jeff Lanzarotta
|
||||
" Copyright: Copyright (c) 2001-2025, Jeff Lanzarotta
|
||||
" All rights reserved.
|
||||
"
|
||||
" Redistribution and use in source and binary forms, with or
|
||||
@@ -36,7 +36,7 @@
|
||||
" Name Of File: bufexplorer.vim
|
||||
" Description: Buffer Explorer Vim Plugin
|
||||
" 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.
|
||||
" Usage: This file should reside in the plugin directory and be
|
||||
" automatically sourced.
|
||||
@@ -74,7 +74,7 @@ endif
|
||||
"1}}}
|
||||
|
||||
" Version number
|
||||
let g:bufexplorer_version = "7.4.27"
|
||||
let g:bufexplorer_version = "7.6.0"
|
||||
|
||||
" Plugin Code {{{1
|
||||
" Check for Vim version {{{2
|
||||
@@ -90,6 +90,7 @@ if v:version < 700
|
||||
endif
|
||||
finish
|
||||
endif
|
||||
|
||||
" Check to see if the version of Vim has the correct patch applied, if not, do
|
||||
" not used <nowait>.
|
||||
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:splitMode = ""
|
||||
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
|
||||
autocmd VimEnter * call s:Setup()
|
||||
@@ -185,10 +186,9 @@ function! s:CatalogBuffers()
|
||||
endfunction
|
||||
|
||||
" AssociatedTab {{{2
|
||||
" Return the number of the tab associated with the specified buffer.
|
||||
" If the buffer is associated with more than one tab, the first one
|
||||
" found is returned. If the buffer is not associated with any tabs,
|
||||
" -1 is returned.
|
||||
" Return the number of the tab associated with the specified buffer. If the
|
||||
" buffer is associated with more than one tab, the first one found is
|
||||
" returned. If the buffer is not associated with any tabs, -1 is returned.
|
||||
function! s:AssociatedTab(bufnr)
|
||||
for tab in range(1, tabpagenr('$'))
|
||||
let list = gettabvar(tab, 'bufexp_buf_list', [])
|
||||
@@ -202,8 +202,8 @@ function! s:AssociatedTab(bufnr)
|
||||
endfunction
|
||||
|
||||
" RemoveBufFromOtherTabs {{{2
|
||||
" Remove the specified buffer from the buffer lists of all tabs
|
||||
" except the current tab.
|
||||
" Remove the specified buffer from the buffer lists of all tabs except the
|
||||
" current tab.
|
||||
function! s:RemoveBufFromOtherTabs(bufnr)
|
||||
for tab in range(1, tabpagenr('$'))
|
||||
if tab == tabpagenr()
|
||||
@@ -222,8 +222,8 @@ function! s:RemoveBufFromOtherTabs(bufnr)
|
||||
endfunction
|
||||
|
||||
" AddBufToCurrentTab {{{2
|
||||
" Add the specified buffer to the list of buffers associated
|
||||
" with the current tab
|
||||
" Add the specified buffer to the list of buffers associated with the current
|
||||
" tab.
|
||||
function! s:AddBufToCurrentTab(bufnr)
|
||||
if index(t:bufexp_buf_list, a:bufnr) == -1
|
||||
call add(t:bufexp_buf_list, a:bufnr)
|
||||
@@ -231,12 +231,10 @@ function! s:AddBufToCurrentTab(bufnr)
|
||||
endfunction
|
||||
|
||||
" IsInCurrentTab {{{2
|
||||
" Returns whether the specified buffer is associated
|
||||
" with the current tab
|
||||
" Returns whether the specified buffer is associated with the current tab.
|
||||
function! s:IsInCurrentTab(bufnr)
|
||||
" It shouldn't happen that the list of buffers is
|
||||
" not defined but if it does, play it safe and
|
||||
" include the buffer
|
||||
" It shouldn't happen that the list of buffers is not defined but if it
|
||||
" does, play it safe and include the buffer.
|
||||
if !exists('t:bufexp_buf_list')
|
||||
return 1
|
||||
endif
|
||||
@@ -245,27 +243,25 @@ function! s:IsInCurrentTab(bufnr)
|
||||
endfunction
|
||||
|
||||
" 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
|
||||
" allowed to be associated with one tab, it is removed
|
||||
" from the lists of any other tabs with which it may have
|
||||
" been associated.
|
||||
" The current tab's list is updated. If a buffer is only allowed to be
|
||||
" associated with one tab, it is removed from the lists of any other tabs
|
||||
" with which it may have been associated.
|
||||
"
|
||||
" The associations between tabs and buffers are maintained
|
||||
" in separate lists for each tab, which are stored in tab-
|
||||
" specific variables 't:bufexp_buf_list'.
|
||||
" The associations between tabs and buffers are maintained in separate lists
|
||||
" for each tab, which are stored in tab-specific variables
|
||||
" 't:bufexp_buf_list'.
|
||||
function! s:UpdateTabBufData(bufnr)
|
||||
" The first time we add a tab, Vim uses the current buffer
|
||||
" as its starting page even though we are about to edit a
|
||||
" new page, and another BufEnter for the new page is triggered
|
||||
" later. Use this first BufEnter to initialize the list of
|
||||
" buffers, but don't add the buffer number to the list if
|
||||
" it is already associated with another tab
|
||||
" The first time we add a tab, Vim uses the current buffer as its starting
|
||||
" page even though we are about to edit a new page, and another BufEnter
|
||||
" for the new page is triggered later. Use this first BufEnter to
|
||||
" initialize the list of buffers, but don't add the buffer number to the
|
||||
" list if it is already associated with another tab.
|
||||
"
|
||||
" Unfortunately, this doesn't work right when the first
|
||||
" buffer opened in the tab should be associated with it,
|
||||
" such as when 'tab split +buffer N' is used
|
||||
" Unfortunately, this doesn't work right when the first buffer opened in
|
||||
" the tab should be associated with it, such as when 'tab split +buffer N'
|
||||
" is used.
|
||||
if !exists("t:bufexp_buf_list")
|
||||
let t:bufexp_buf_list = []
|
||||
|
||||
@@ -537,6 +533,8 @@ function! s:MapKeys()
|
||||
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", "vl")<CR>
|
||||
nnoremap <script> <silent> <nowait> <buffer> H :call <SID>ToggleShowTerminal()<CR>
|
||||
|
||||
|
||||
for k in ["G", "n", "N", "L", "M", "H"]
|
||||
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:bufExplorerShowRelativePath == 0) ? "Absolute" : "Relative")
|
||||
let ret .= ' '.((g:bufExplorerSplitOutPathName == 0) ? "Full" : "Split")." path"
|
||||
let ret .= ((g:bufExplorerShowTerminal == 0) ? "" : " | Show terminal")
|
||||
|
||||
return ret
|
||||
endfunction
|
||||
@@ -673,6 +672,49 @@ function! s:CreateHelp()
|
||||
return header
|
||||
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
|
||||
function! s:GetBufferInfo(bufnr)
|
||||
redir => bufoutput
|
||||
@@ -683,56 +725,22 @@ function! s:GetBufferInfo(bufnr)
|
||||
redir END
|
||||
|
||||
if a:bufnr > 0
|
||||
" Since we are only interested in this specified buffer
|
||||
" remove the other buffers listed
|
||||
" Since we are only interested in this specified buffer remove the
|
||||
" other buffers listed.
|
||||
let bufoutput = substitute(bufoutput."\n", '^.*\n\(\s*'.a:bufnr.'\>.\{-}\)\n.*', '\1', '')
|
||||
endif
|
||||
|
||||
let [all, allwidths, listedwidths] = [[], {}, {}]
|
||||
|
||||
for n in keys(s:types)
|
||||
let allwidths[n] = []
|
||||
let listedwidths[n] = []
|
||||
endfor
|
||||
let all = {}
|
||||
|
||||
" Loop over each line in the buffer.
|
||||
for buf in split(bufoutput, '\n')
|
||||
let bits = split(buf, '"')
|
||||
for line in split(bufoutput, '\n')
|
||||
let bits = split(line, '"')
|
||||
|
||||
" Use first and last components after the split on '"', in case a
|
||||
" filename with an embedded '"' is present.
|
||||
let b = {"attributes": bits[0], "line": substitute(bits[-1], '\s*', '', '')}
|
||||
|
||||
let name = bufname(str2nr(b.attributes))
|
||||
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]))
|
||||
let buf = {"attributes": bits[0], "line": substitute(bits[-1], '\s*', '', '')}
|
||||
let buf._bufnr = str2nr(buf.attributes)
|
||||
let all[buf._bufnr] = buf
|
||||
endfor
|
||||
|
||||
return all
|
||||
@@ -740,17 +748,26 @@ endfunction
|
||||
|
||||
" BuildBufferList {{{2
|
||||
function! s:BuildBufferList()
|
||||
let lines = []
|
||||
let table = []
|
||||
|
||||
" 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.
|
||||
if !g:bufExplorerShowUnlisted && buf.attributes =~ "u"
|
||||
" Skip unlisted buffers if we are not to show them.
|
||||
continue
|
||||
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
|
||||
continue
|
||||
endif
|
||||
@@ -760,40 +777,72 @@ function! s:BuildBufferList()
|
||||
continue
|
||||
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")
|
||||
let line .= WebDevIconsGetFileTypeSymbol(buf.shortname)
|
||||
let line .= " "
|
||||
let row += [WebDevIconsGetFileTypeSymbol(buf.fullname, buf.isdir)]
|
||||
endif
|
||||
|
||||
" Are we to split the path and file name?
|
||||
if g:bufExplorerSplitOutPathName
|
||||
let type = (g:bufExplorerShowRelativePath) ? "relativepath" : "path"
|
||||
let path = substitute( buf[type], $HOME."\\>", "~", "" )
|
||||
let pad = (g:bufExplorerShowUnlisted) ? s:allpads.shortname : s:listedpads.shortname
|
||||
let line .= buf.shortname." ".strpart(pad.path, s:StringWidth(buf.shortname))
|
||||
let row += [buf.shortname, buf[type]]
|
||||
else
|
||||
let type = (g:bufExplorerShowRelativePath) ? "relativename" : "fullname"
|
||||
let path = substitute( buf[type], $HOME."\\>", "~", "" )
|
||||
let line .= path
|
||||
let type = (g:bufExplorerShowRelativePath) ? "relativename" : "homename"
|
||||
let row += [buf[type]]
|
||||
endif
|
||||
|
||||
let pads = (g:bufExplorerShowUnlisted) ? s:allpads : s:listedpads
|
||||
|
||||
if !empty(pads[type])
|
||||
let line .= strpart(pads[type], s:StringWidth(path))." "
|
||||
endif
|
||||
|
||||
let line .= buf.line
|
||||
|
||||
call add(lines, line)
|
||||
let row += [buf.line]
|
||||
call add(table, row)
|
||||
endfor
|
||||
|
||||
let lines = s:MakeLines(table)
|
||||
call setline(s:firstBufferLine, lines)
|
||||
call s:SortListing()
|
||||
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
|
||||
function! s:SelectBuffer(...)
|
||||
" Sometimes messages are not cleared when we get here so it looks like an
|
||||
@@ -841,96 +890,49 @@ function! s:SelectBuffer(...)
|
||||
endif
|
||||
|
||||
if bufexists(_bufNbr)
|
||||
if bufnr("#") == _bufNbr && !exists("g:bufExplorerChgWin")
|
||||
return s:Close()
|
||||
endif
|
||||
|
||||
" Get the tab number where this bufer is located in.
|
||||
" Get the tab number where this buffer is located in.
|
||||
let tabNbr = s:GetTabNbr(_bufNbr)
|
||||
" Are we supposed to open the selected buffer in a tab?
|
||||
if (a:0 == 1) && (a:1 == "tab")
|
||||
|
||||
" 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.
|
||||
if exists("g:bufExplorerChgWin") && g:bufExplorerChgWin <=winnr("$")
|
||||
execute g:bufExplorerChgWin."wincmd w"
|
||||
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
|
||||
|
||||
" Make the buffer 'listed' again.
|
||||
@@ -976,7 +978,7 @@ function! s:RemoveBuffer(mode)
|
||||
let _bufNbr = str2nr(getline('.'))
|
||||
|
||||
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")
|
||||
call s:Error("Sorry, no write since last change for buffer "._bufNbr.", unable to delete")
|
||||
return
|
||||
@@ -1025,29 +1027,29 @@ function! s:DeleteBuffer(buf, mode)
|
||||
setlocal nomodifiable
|
||||
|
||||
" 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
|
||||
call s:Error(v:exception)
|
||||
endtry
|
||||
endfunction
|
||||
|
||||
" ListedAndCurrentTab {{{2
|
||||
" Returns whether the specified buffer is both listed and associated
|
||||
" with the current tab
|
||||
" Returns whether the specified buffer is both listed and associated with the
|
||||
" current tab.
|
||||
function! s:ListedAndCurrentTab(buf)
|
||||
return buflisted(a:buf) && s:IsInCurrentTab(a:buf)
|
||||
endfunction
|
||||
|
||||
" Close {{{2
|
||||
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)")
|
||||
if len(listed) == 0
|
||||
let listed = filter(range(1, bufnr('$')), "s:ListedAndCurrentTab(v:val)")
|
||||
endif
|
||||
|
||||
" 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"
|
||||
endif
|
||||
|
||||
@@ -1068,6 +1070,13 @@ function! s:Close()
|
||||
echo
|
||||
endfunction
|
||||
|
||||
" ToggleShowTerminal {{{2
|
||||
function! s:ToggleShowTerminal()
|
||||
let g:bufExplorerShowTerminal = !g:bufExplorerShowTerminal
|
||||
call s:RebuildBufferList()
|
||||
call s:UpdateHelpStatus()
|
||||
endfunction
|
||||
|
||||
" ToggleSplitOutPathName {{{2
|
||||
function! s:ToggleSplitOutPathName()
|
||||
let g:bufExplorerSplitOutPathName = !g:bufExplorerSplitOutPathName
|
||||
@@ -1139,9 +1148,70 @@ function! s:UpdateHelpStatus()
|
||||
setlocal nomodifiable
|
||||
endfunction
|
||||
|
||||
" MRUCmp {{{2
|
||||
function! s:MRUCmp(line1, line2)
|
||||
return index(s:MRUList, str2nr(a:line1)) - index(s:MRUList, str2nr(a:line2))
|
||||
" Key_number {{{2
|
||||
function! s:Key_number(line)
|
||||
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
|
||||
|
||||
" SortReverse {{{2
|
||||
@@ -1178,50 +1248,7 @@ endfunction
|
||||
|
||||
" SortListing {{{2
|
||||
function! s:SortListing()
|
||||
let sort = s:firstBufferLine.",$sort".((g:bufExplorerReverseSort == 1) ? "!": "")
|
||||
|
||||
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
|
||||
call s:SortByKeyFunc("<SID>Key_" . g:bufExplorerSortBy)
|
||||
endfunction
|
||||
|
||||
" MRUListShow {{{2
|
||||
@@ -1247,6 +1274,10 @@ endfunction
|
||||
|
||||
" GetTabNbr {{{2
|
||||
function! s:GetTabNbr(bufNbr)
|
||||
" Prefer current tab.
|
||||
if bufwinnr(a:bufNbr) > 0
|
||||
return tabpagenr()
|
||||
endif
|
||||
" Searching buffer bufno, in tabs.
|
||||
for i in range(tabpagenr("$"))
|
||||
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: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:bufExplorerShowTerminal", 1) " Show terminal buffers?
|
||||
|
||||
" Default key mapping {{{2
|
||||
if !hasmapto('BufExplorer') && g:bufExplorerDisableDefaultKeyMapping == 0
|
||||
|
||||
23
sources_non_forked/bufexplorer/release.bat
Normal file
23
sources_non_forked/bufexplorer/release.bat
Normal 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
|
||||
@@ -1,22 +1,20 @@
|
||||
# GitHub Copilot for Vim and Neovim
|
||||
|
||||
GitHub Copilot uses OpenAI Codex to suggest code and entire functions in
|
||||
real-time right from your editor. Trained on billions of lines of public
|
||||
code, GitHub Copilot turns natural language prompts including comments and
|
||||
method names into coding suggestions across dozens of languages.
|
||||
GitHub Copilot is an AI pair programmer tool that helps you write code faster
|
||||
and smarter. Trained on billions of lines of public code, GitHub Copilot turns
|
||||
natural language prompts including comments and method names into coding
|
||||
suggestions across dozens of languages.
|
||||
|
||||
Copilot.vim is a Vim/Neovim plugin for GitHub Copilot.
|
||||
|
||||
To learn more, visit
|
||||
[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
|
||||
maintainers of popular open source projects on GitHub.
|
||||
|
||||
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).
|
||||
To access GitHub Copilot, an active GitHub Copilot subscription is required.
|
||||
Sign up for [GitHub Copilot Free](https://github.com/settings/copilot), or
|
||||
request access from your enterprise admin.
|
||||
|
||||
## Getting started
|
||||
|
||||
|
||||
@@ -23,17 +23,6 @@ function! s:Echo(msg) abort
|
||||
endif
|
||||
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
|
||||
call copilot#util#Defer({ -> exists('s:client') || s:Start() })
|
||||
endfunction
|
||||
@@ -46,7 +35,7 @@ function! s:Start() abort
|
||||
if s:Running() || exists('s:client.startup_error')
|
||||
return
|
||||
endif
|
||||
let s:client = copilot#client#New({'editorConfiguration' : s:EditorConfiguration()})
|
||||
let s:client = copilot#client#New()
|
||||
endfunction
|
||||
|
||||
function! s:Stop() abort
|
||||
@@ -599,20 +588,8 @@ function! s:VerifySetup() abort
|
||||
return
|
||||
endif
|
||||
|
||||
let status = copilot#Call('checkStatus', {})
|
||||
|
||||
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"
|
||||
if exists('s:client.status.kind') && s:client.status.kind ==# 'Error'
|
||||
echo 'Copilot: Error: ' . get(s:client.status, 'message', 'unknown')
|
||||
return
|
||||
endif
|
||||
|
||||
@@ -624,11 +601,8 @@ function! s:commands.status(opts) abort
|
||||
return
|
||||
endif
|
||||
|
||||
if exists('s:client.status.status') && s:client.status.status =~# 'Warning\|Error'
|
||||
echo 'Copilot: ' . s:client.status.status
|
||||
if !empty(get(s:client.status, 'message', ''))
|
||||
echon ': ' . s:client.status.message
|
||||
endif
|
||||
if exists('s:client.status.kind') && s:client.status.kind ==# 'Warning'
|
||||
echo 'Copilot: Warning: ' . get(s:client.status, 'message', 'unknown')
|
||||
return
|
||||
endif
|
||||
|
||||
@@ -643,12 +617,7 @@ function! s:commands.status(opts) abort
|
||||
endfunction
|
||||
|
||||
function! s:commands.signout(opts) abort
|
||||
let status = copilot#Call('checkStatus', {'options': {'localChecksOnly': v:true}})
|
||||
if has_key(status, 'user')
|
||||
echo 'Copilot: Signed out as GitHub user ' . status.user
|
||||
else
|
||||
echo 'Copilot: Not signed in'
|
||||
endif
|
||||
echo 'Copilot: Signed out'
|
||||
call copilot#Call('signOut', {})
|
||||
endfunction
|
||||
|
||||
@@ -659,14 +628,7 @@ function! s:commands.setup(opts) abort
|
||||
return
|
||||
endif
|
||||
|
||||
let browser = copilot#Browser()
|
||||
|
||||
let status = copilot#Call('checkStatus', {})
|
||||
if has_key(status, 'user')
|
||||
let data = {'status': 'AlreadySignedIn', 'user': status.user}
|
||||
else
|
||||
let data = copilot#Call('signInInitiate', {})
|
||||
endif
|
||||
let data = copilot#Call('signIn', {})
|
||||
|
||||
if has_key(data, 'verificationUri')
|
||||
let uri = data.verificationUri
|
||||
@@ -688,24 +650,13 @@ function! s:commands.setup(opts) abort
|
||||
endif
|
||||
if get(a:opts, 'bang')
|
||||
call s:Echo(codemsg . "In your browser, visit " . uri)
|
||||
elseif len(browser)
|
||||
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
|
||||
let request = copilot#Request('signInConfirm', {})
|
||||
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
|
||||
call s:Echo("Waiting (could take up to 10 seconds)")
|
||||
let request = copilot#Request('signInConfirm', {'userCode': data.userCode}).Wait()
|
||||
call s:Echo("Waiting for " . data.userCode . " at " . uri . " (could take up to 10 seconds)")
|
||||
call request.Wait()
|
||||
finally
|
||||
if exists('mouse')
|
||||
let &mouse = mouse
|
||||
@@ -768,16 +719,6 @@ function! s:commands.version(opts) abort
|
||||
call s:EditorVersionWarning()
|
||||
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'
|
||||
function! s:commands.feedback(opts) abort
|
||||
echo s:feedback_url
|
||||
@@ -795,12 +736,10 @@ endfunction
|
||||
|
||||
function! s:commands.disable(opts) abort
|
||||
let g:copilot_enabled = 0
|
||||
call s:UpdateEditorConfiguration()
|
||||
endfunction
|
||||
|
||||
function! s:commands.enable(opts) abort
|
||||
let g:copilot_enabled = 1
|
||||
call s:UpdateEditorConfiguration()
|
||||
endfunction
|
||||
|
||||
function! s:commands.panel(opts) abort
|
||||
|
||||
@@ -550,7 +550,10 @@ function! copilot#client#Settings() abort
|
||||
let settings.http.proxy = 'http://' . settings.http.proxy
|
||||
endif
|
||||
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
|
||||
return settings
|
||||
endfunction
|
||||
@@ -610,7 +613,7 @@ endfunction
|
||||
let s:notifications = {
|
||||
\ '$/progress': function('s:Progress'),
|
||||
\ 'featureFlagsNotification': function('s:Nop'),
|
||||
\ 'statusNotification': function('s:StatusNotification'),
|
||||
\ 'didChangeStatus': function('s:StatusNotification'),
|
||||
\ 'window/logMessage': function('copilot#handlers#window_logMessage'),
|
||||
\ }
|
||||
|
||||
@@ -624,8 +627,8 @@ let s:vim_capabilities = {
|
||||
\ 'window': {'showDocument': {'support': v:true}},
|
||||
\ }
|
||||
|
||||
function! copilot#client#New(...) abort
|
||||
let opts = a:0 ? a:1 : {}
|
||||
function! copilot#client#New() abort
|
||||
let opts = {}
|
||||
let instance = {'requests': {},
|
||||
\ 'progress': {},
|
||||
\ 'workspaceFolders': {},
|
||||
@@ -651,13 +654,12 @@ function! copilot#client#New(...) abort
|
||||
endif
|
||||
let instance.node = node
|
||||
let command = node + argv
|
||||
let opts = {}
|
||||
let opts.initializationOptions = {
|
||||
\ 'editorInfo': copilot#client#EditorInfo(),
|
||||
\ 'editorPluginInfo': copilot#client#EditorPluginInfo(),
|
||||
\ }
|
||||
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
|
||||
for folder in g:copilot_workspace_folders
|
||||
if type(folder) == v:t_string && !empty(folder) && folder !~# '\*\*\|^/$'
|
||||
|
||||
@@ -108,7 +108,11 @@ function! copilot#panel#Accept(...) abort
|
||||
endfunction
|
||||
|
||||
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
|
||||
nmap <buffer><script> <CR> <Cmd>exe copilot#panel#Accept()<CR>
|
||||
nmap <buffer><script> [[ <Cmd>call search('^─\{9,}\n.', 'bWe')<CR>
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
function! copilot#version#String() abort
|
||||
return '1.40.0'
|
||||
return '1.42.0'
|
||||
endfunction
|
||||
|
||||
Binary file not shown.
BIN
sources_non_forked/copilot.vim/dist/compiled/darwin/arm64/node_sqlite3.node
vendored
Normal file
BIN
sources_non_forked/copilot.vim/dist/compiled/darwin/arm64/node_sqlite3.node
vendored
Normal file
Binary file not shown.
Binary file not shown.
BIN
sources_non_forked/copilot.vim/dist/compiled/darwin/x64/node_sqlite3.node
vendored
Normal file
BIN
sources_non_forked/copilot.vim/dist/compiled/darwin/x64/node_sqlite3.node
vendored
Normal file
Binary file not shown.
Binary file not shown.
BIN
sources_non_forked/copilot.vim/dist/compiled/linux/arm64/node_sqlite3.node
vendored
Normal file
BIN
sources_non_forked/copilot.vim/dist/compiled/linux/arm64/node_sqlite3.node
vendored
Normal file
Binary file not shown.
Binary file not shown.
BIN
sources_non_forked/copilot.vim/dist/compiled/linux/x64/node_sqlite3.node
vendored
Normal file
BIN
sources_non_forked/copilot.vim/dist/compiled/linux/x64/node_sqlite3.node
vendored
Normal file
Binary file not shown.
Binary file not shown.
BIN
sources_non_forked/copilot.vim/dist/compiled/win32/x64/node_sqlite3.node
vendored
Normal file
BIN
sources_non_forked/copilot.vim/dist/compiled/win32/x64/node_sqlite3.node
vendored
Normal file
Binary file not shown.
1035
sources_non_forked/copilot.vim/dist/language-server.js
vendored
1035
sources_non_forked/copilot.vim/dist/language-server.js
vendored
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
BIN
sources_non_forked/copilot.vim/dist/tree-sitter-c_sharp.wasm
vendored
Normal file
BIN
sources_non_forked/copilot.vim/dist/tree-sitter-c_sharp.wasm
vendored
Normal file
Binary file not shown.
Binary file not shown.
BIN
sources_non_forked/copilot.vim/dist/tree-sitter-java.wasm
vendored
Normal file
BIN
sources_non_forked/copilot.vim/dist/tree-sitter-java.wasm
vendored
Normal file
Binary file not shown.
@@ -641,6 +641,9 @@ fu! ctrlp#buffers(...)
|
||||
retu ids
|
||||
el
|
||||
let bufs = [[], []]
|
||||
if s:matcher != {} && !s:matchcrfile
|
||||
call filter(ids, 'v:val != s:crbufnr')
|
||||
en
|
||||
for id in ids
|
||||
let bname = bufname(id)
|
||||
let ebname = bname == ''
|
||||
@@ -2179,7 +2182,7 @@ fu! s:isabs(path)
|
||||
endf
|
||||
|
||||
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
|
||||
el
|
||||
let filpath = s:dyncwd.s:lash().a:line
|
||||
|
||||
@@ -449,7 +449,8 @@ Includes the current file in the match entries: >
|
||||
|
||||
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'*
|
||||
Set this to list of names to customize core types: >
|
||||
|
||||
@@ -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
|
||||
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
|
||||
|
||||
The EditorConfig Vim plugin supports the following EditorConfig [properties][]:
|
||||
|
||||
@@ -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
|
||||
" All rights reserved.
|
||||
"
|
||||
|
||||
@@ -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
|
||||
"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.
|
||||
|
||||
If "g:EditorConfig_core_mode" is not specified, this plugin will automatically
|
||||
|
||||
@@ -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
Reference in New Issue
Block a user