mirror of
https://github.com/amix/vimrc
synced 2024-12-12 21:22:32 +00:00
Updated plugins
This commit is contained in:
parent
e13b2a10a7
commit
b39d6ca807
27 changed files with 348 additions and 120 deletions
|
@ -16,7 +16,7 @@ endfunction
|
|||
function! ale_linters#clojure#clj_kondo#HandleCljKondoFormat(buffer, lines) abort
|
||||
" output format
|
||||
" <filename>:<line>:<column>: <issue type>: <message>
|
||||
let l:pattern = '\v^[a-zA-Z]?:?[^:]+:(\d+):(\d+):? ((Exception|error|warning): ?(.+))$'
|
||||
let l:pattern = '\v^[a-zA-Z]?:?[^:]+:(\d+)?:(\d+)?:? ((Exception|error|warning): ?(.+))$'
|
||||
let l:output = []
|
||||
|
||||
for l:match in ale#util#GetMatches(a:lines, l:pattern)
|
||||
|
|
|
@ -55,13 +55,19 @@ function! ale_linters#dockerfile#hadolint#Handle(buffer, lines) abort
|
|||
let l:detail = 'hadolint could not parse the file because of a syntax error.'
|
||||
endif
|
||||
|
||||
call add(l:output, {
|
||||
let l:line_output = {
|
||||
\ 'lnum': l:lnum,
|
||||
\ 'col': l:colnum,
|
||||
\ 'type': l:type,
|
||||
\ 'text': l:text,
|
||||
\ 'detail': l:detail
|
||||
\})
|
||||
\}
|
||||
|
||||
if l:code isnot# ''
|
||||
let l:line_output['code'] = l:code
|
||||
endif
|
||||
|
||||
call add(l:output, l:line_output)
|
||||
endfor
|
||||
|
||||
return l:output
|
||||
|
|
|
@ -6,7 +6,7 @@ call ale#Set('ruby_ruby_executable', 'ruby')
|
|||
call ale#linter#Define('ruby', {
|
||||
\ 'name': 'ruby',
|
||||
\ 'executable': {b -> ale#Var(b, 'ruby_ruby_executable')},
|
||||
\ 'command': '%e -w -c -T1 %t',
|
||||
\ 'command': '%e -w -c %t',
|
||||
\ 'output_stream': 'stderr',
|
||||
\ 'callback': 'ale#handlers#ruby#HandleSyntaxErrors',
|
||||
\})
|
||||
|
|
22
sources_non_forked/ale/ale_linters/zeek/zeek.vim
Normal file
22
sources_non_forked/ale/ale_linters/zeek/zeek.vim
Normal file
|
@ -0,0 +1,22 @@
|
|||
" Author: Benjamin Bannier <bbannier@gmail.com>
|
||||
" Description: Support for checking Zeek files.
|
||||
"
|
||||
call ale#Set('zeek_zeek_executable', 'zeek')
|
||||
|
||||
function! ale_linters#zeek#zeek#HandleErrors(buffer, lines) abort
|
||||
let l:pattern = 'error in \v.*, line (\d+): (.*)$'
|
||||
|
||||
return map(ale#util#GetMatches(a:lines, l:pattern), "{
|
||||
\ 'lnum': str2nr(v:val[1]),
|
||||
\ 'text': v:val[2],
|
||||
\}")
|
||||
endfunction
|
||||
|
||||
call ale#linter#Define('zeek', {
|
||||
\ 'name': 'zeek',
|
||||
\ 'executable': {b -> ale#Var(b, 'zeek_zeek_executable')},
|
||||
\ 'output_stream': 'stderr',
|
||||
\ 'command': {-> '%e --parse-only %s'},
|
||||
\ 'callback': 'ale_linters#zeek#zeek#HandleErrors',
|
||||
\ 'lint_file': 1,
|
||||
\})
|
|
@ -100,6 +100,11 @@ let s:default_registry = {
|
|||
\ 'suggested_filetypes': ['nim'],
|
||||
\ 'description': 'Apply nimpretty to a file.',
|
||||
\ },
|
||||
\ 'erblint': {
|
||||
\ 'function': 'ale#fixers#erblint#Fix',
|
||||
\ 'suggested_filetypes': ['eruby'],
|
||||
\ 'description': 'Apply erblint --autocorrect to a file.',
|
||||
\ },
|
||||
\ 'eslint': {
|
||||
\ 'function': 'ale#fixers#eslint#Fix',
|
||||
\ 'suggested_filetypes': ['javascript', 'typescript'],
|
||||
|
|
40
sources_non_forked/ale/autoload/ale/fixers/erblint.vim
Normal file
40
sources_non_forked/ale/autoload/ale/fixers/erblint.vim
Normal file
|
@ -0,0 +1,40 @@
|
|||
" Author: Roeland Moors - https://github.com/roelandmoors
|
||||
" Description: ERB Lint, support for https://github.com/Shopify/erb-lint
|
||||
|
||||
call ale#Set('eruby_erblint_executable', 'erblint')
|
||||
call ale#Set('eruby_erblint_options', '')
|
||||
|
||||
|
||||
" Erblint fixer outputs diagnostics first and then the fixed
|
||||
" output. These are delimited by something like this:
|
||||
" ================ /path/to/demo.html.erb ==================
|
||||
" We only need the output after this
|
||||
function! ale#fixers#erblint#PostProcess(buffer, output) abort
|
||||
let l:line = 0
|
||||
|
||||
for l:output in a:output
|
||||
let l:line = l:line + 1
|
||||
|
||||
if l:output =~# "^=\\+.*=\\+$"
|
||||
break
|
||||
endif
|
||||
endfor
|
||||
|
||||
return a:output[l:line :]
|
||||
endfunction
|
||||
|
||||
function! ale#fixers#erblint#GetCommand(buffer) abort
|
||||
let l:executable = ale#Var(a:buffer, 'eruby_erblint_executable')
|
||||
let l:options = ale#Var(a:buffer, 'eruby_erblint_options')
|
||||
|
||||
return ale#ruby#EscapeExecutable(l:executable, 'erblint')
|
||||
\ . (!empty(l:options) ? ' ' . l:options : '')
|
||||
\ . ' --autocorrect --stdin %s'
|
||||
endfunction
|
||||
|
||||
function! ale#fixers#erblint#Fix(buffer) abort
|
||||
return {
|
||||
\ 'command': ale#fixers#erblint#GetCommand(a:buffer),
|
||||
\ 'process_with': 'ale#fixers#erblint#PostProcess'
|
||||
\}
|
||||
endfunction
|
|
@ -21,7 +21,7 @@ function! ale#fixers#isort#GetExecutable(buffer) abort
|
|||
return ale#python#FindExecutable(a:buffer, 'python_isort', ['isort'])
|
||||
endfunction
|
||||
|
||||
function! ale#fixers#isort#Fix(buffer) abort
|
||||
function! ale#fixers#isort#GetCmd(buffer) abort
|
||||
let l:executable = ale#fixers#isort#GetExecutable(a:buffer)
|
||||
let l:cmd = [ale#Escape(l:executable)]
|
||||
|
||||
|
@ -29,7 +29,20 @@ function! ale#fixers#isort#Fix(buffer) abort
|
|||
call extend(l:cmd, ['run', 'isort'])
|
||||
endif
|
||||
|
||||
call add(l:cmd, '--filename %s')
|
||||
return join(l:cmd, ' ')
|
||||
endfunction
|
||||
|
||||
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$'
|
||||
call extend(l:cmd, ['run', 'isort'])
|
||||
endif
|
||||
|
||||
if ale#semver#GTE(a:version, [5, 7, 0])
|
||||
call add(l:cmd, '--filename %s')
|
||||
endif
|
||||
|
||||
let l:options = ale#Var(a:buffer, 'python_isort_options')
|
||||
|
||||
|
@ -41,6 +54,18 @@ function! ale#fixers#isort#Fix(buffer) abort
|
|||
|
||||
return {
|
||||
\ 'cwd': '%s:h',
|
||||
\ 'command': join(l:cmd, ' ')
|
||||
\ 'command': join(l:cmd, ' '),
|
||||
\}
|
||||
endfunction
|
||||
|
||||
function! ale#fixers#isort#Fix(buffer) abort
|
||||
let l:executable = ale#fixers#isort#GetExecutable(a:buffer)
|
||||
let l:command = ale#fixers#isort#GetCmd(a:buffer) . ale#Pad('--version')
|
||||
|
||||
return ale#semver#RunWithVersionCheck(
|
||||
\ a:buffer,
|
||||
\ l:executable,
|
||||
\ l:command,
|
||||
\ function('ale#fixers#isort#FixForVersion'),
|
||||
\)
|
||||
endfunction
|
||||
|
|
|
@ -45,6 +45,7 @@ function! ale#lsp#Register(executable_or_address, project, init_options) abort
|
|||
\ 'typeDefinition': 0,
|
||||
\ 'symbol_search': 0,
|
||||
\ 'code_actions': 0,
|
||||
\ 'did_save': 0,
|
||||
\ 'includeText': 0,
|
||||
\ },
|
||||
\}
|
||||
|
@ -265,15 +266,19 @@ function! s:UpdateCapabilities(conn, capabilities) abort
|
|||
let a:conn.capabilities.symbol_search = 1
|
||||
endif
|
||||
|
||||
if has_key(a:capabilities, 'textDocumentSync')
|
||||
if type(a:capabilities.textDocumentSync) is v:t_dict
|
||||
let l:save = get(a:capabilities.textDocumentSync, 'save', v:false)
|
||||
if type(get(a:capabilities, 'textDocumentSync')) is v:t_dict
|
||||
let l:syncOptions = get(a:capabilities, 'textDocumentSync')
|
||||
|
||||
if type(l:save) is v:true
|
||||
let a:conn.capabilities.includeText = 1
|
||||
endif
|
||||
if get(l:syncOptions, 'save') is v:true
|
||||
let a:conn.capabilities.did_save = 1
|
||||
endif
|
||||
|
||||
if type(l:save) is v:t_dict && get(a:capabilities.textDocumentSync.save, 'includeText', v:false) is v:true
|
||||
if type(get(l:syncOptions, 'save')) is v:t_dict
|
||||
let a:conn.capabilities.did_save = 1
|
||||
|
||||
let l:saveOptions = get(l:syncOptions, 'save')
|
||||
|
||||
if get(l:saveOptions, 'includeText') is v:true
|
||||
let a:conn.capabilities.includeText = 1
|
||||
endif
|
||||
endif
|
||||
|
|
|
@ -466,6 +466,7 @@ function! s:CheckWithLSP(linter, details) abort
|
|||
" If this was a file save event, also notify the server of that.
|
||||
if a:linter.lsp isnot# 'tsserver'
|
||||
\&& getbufvar(l:buffer, 'ale_save_event_fired', 0)
|
||||
\&& ale#lsp#HasCapability(l:buffer, 'did_save')
|
||||
let l:include_text = ale#lsp#HasCapability(l:buffer, 'includeText')
|
||||
let l:save_message = ale#lsp#message#DidSave(l:buffer, l:include_text)
|
||||
let l:notified = ale#lsp#Send(l:id, l:save_message) != 0
|
||||
|
|
|
@ -64,15 +64,16 @@ function! ale#virtualtext#ShowMessage(message, hl_group) abort
|
|||
let l:line = line('.')
|
||||
let l:buffer = bufnr('')
|
||||
let l:prefix = get(g:, 'ale_virtualtext_prefix', '> ')
|
||||
let l:msg = l:prefix.trim(substitute(a:message, '\n', ' ', 'g'))
|
||||
|
||||
if has('nvim')
|
||||
call nvim_buf_set_virtual_text(l:buffer, s:ns_id, l:line-1, [[l:prefix.a:message, a:hl_group]], {})
|
||||
call nvim_buf_set_virtual_text(l:buffer, s:ns_id, l:line-1, [[l:msg, a:hl_group]], {})
|
||||
else
|
||||
let l:left_pad = col('$')
|
||||
call prop_add(l:line, l:left_pad, {
|
||||
\ 'type': 'ale',
|
||||
\})
|
||||
let s:last_popup = popup_create(l:prefix.a:message, {
|
||||
let s:last_popup = popup_create(l:msg, {
|
||||
\ 'line': -1,
|
||||
\ 'padding': [0, 0, 0, 1],
|
||||
\ 'mask': [[1, 1, 1, 1]],
|
||||
|
|
|
@ -601,6 +601,8 @@ Notes:
|
|||
* `yamllint`
|
||||
* YANG
|
||||
* `yang-lsp`
|
||||
* Zeek
|
||||
* `zeek`!!
|
||||
* Zig
|
||||
* `zls`
|
||||
|
||||
|
|
23
sources_non_forked/ale/doc/ale-zeek.txt
Normal file
23
sources_non_forked/ale/doc/ale-zeek.txt
Normal file
|
@ -0,0 +1,23 @@
|
|||
===============================================================================
|
||||
ALE Zeek Integration *ale-zeek-options*
|
||||
*ale-integration-zeek*
|
||||
|
||||
===============================================================================
|
||||
Integration Information
|
||||
|
||||
Currently, the only supported linter for Zeek is zeek.
|
||||
|
||||
===============================================================================
|
||||
zeek *ale-zeek-zeek*
|
||||
|
||||
g:ale_zeek_zeek_executable *g:ale_zeek_zeek_executable*
|
||||
*b:ale_zeek_zeek_executable*
|
||||
Type: |String|
|
||||
Default: `'zeek'`
|
||||
|
||||
This variable can be modified to change the executable path for `zeek`.
|
||||
|
||||
|
||||
===============================================================================
|
||||
vim:tw=78:ts=2:sts=2:sw=2:ft=help:norl:
|
||||
|
|
@ -3114,6 +3114,8 @@ documented in additional help files.
|
|||
yamllint..............................|ale-yaml-yamllint|
|
||||
yang....................................|ale-yang-options|
|
||||
yang-lsp..............................|ale-yang-lsp|
|
||||
zeek....................................|ale-zeek-options|
|
||||
zeek..................................|ale-zeek-zeek|
|
||||
zig.....................................|ale-zig-options|
|
||||
zls...................................|ale-zig-zls|
|
||||
|
||||
|
|
|
@ -610,5 +610,7 @@ formatting.
|
|||
* [yamllint](https://yamllint.readthedocs.io/)
|
||||
* YANG
|
||||
* [yang-lsp](https://github.com/theia-ide/yang-lsp)
|
||||
* Zeek
|
||||
* [zeek](http://zeek.org) :floppy_disk:
|
||||
* Zig
|
||||
* [zls](https://github.com/zigtools/zls)
|
||||
|
|
|
@ -1386,6 +1386,7 @@ fu! s:MarkToOpen()
|
|||
en
|
||||
en
|
||||
sil! cal ctrlp#statusline()
|
||||
redr
|
||||
endf
|
||||
|
||||
fu! s:OpenMulti(...)
|
||||
|
|
|
@ -11,6 +11,17 @@ Full path fuzzy __file__, __buffer__, __mru__, __tag__, __...__ finder for Vim.
|
|||
|
||||
![ctrlp][1]
|
||||
|
||||
## Install
|
||||
|
||||
vim 8+ manages packages all on its own. Installing `ctrlp` is this simple:
|
||||
|
||||
```bash
|
||||
mkdir -p ~/.vim/pack/plugins/start
|
||||
git clone --depth=1 https://github.com/ctrlpvim/ctrlp.vim.git ~/.vim/pack/plugins/start/ctrlp
|
||||
```
|
||||
|
||||
Of course you can use your favorite plugin manager or check the [quick installation guide][3] for a primitive installation method.
|
||||
|
||||
## Basic Usage
|
||||
* Run `:CtrlP` or `:CtrlP [starting-directory]` to invoke CtrlP in find file mode.
|
||||
* Run `:CtrlPBuffer` or `:CtrlPMRU` to invoke CtrlP in find buffer or find MRU file mode.
|
||||
|
@ -97,13 +108,10 @@ Use `:diffthis` when opening multiple files to run `:diffthis` on the first 4 fi
|
|||
|
||||
Check `:help ctrlp-options` for other options.
|
||||
|
||||
## Installation
|
||||
Use your favorite method or check the homepage for a [quick installation guide][3].
|
||||
|
||||
## License
|
||||
CtrlP is distributed under Vim's [license][4].
|
||||
|
||||
[1]: http://i.imgur.com/aOcwHwt.png
|
||||
[1]: https://i.imgur.com/aOcwHwt.png
|
||||
[2]: https://github.com/ctrlpvim/ctrlp.vim/tree/extensions
|
||||
[3]: http://ctrlpvim.github.io/ctrlp.vim#installation
|
||||
[3]: https://ctrlpvim.github.io/ctrlp.vim#installation
|
||||
[4]: http://vimdoc.sourceforge.net/htmldoc/uganda.html
|
||||
|
|
|
@ -85,6 +85,10 @@ if !exists('g:dracula_undercurl')
|
|||
let g:dracula_undercurl = g:dracula_underline
|
||||
endif
|
||||
|
||||
if !exists('g:dracula_full_special_attrs_support')
|
||||
let g:dracula_full_special_attrs_support = has('gui_running')
|
||||
endif
|
||||
|
||||
if !exists('g:dracula_inverse')
|
||||
let g:dracula_inverse = 1
|
||||
endif
|
||||
|
@ -111,10 +115,15 @@ function! s:h(scope, fg, ...) " bg, attr_list, special
|
|||
let l:attr_list = filter(get(a:, 2, ['NONE']), 'type(v:val) == 1')
|
||||
let l:attrs = len(l:attr_list) > 0 ? join(l:attr_list, ',') : 'NONE'
|
||||
|
||||
" Falls back to coloring foreground group on terminals because
|
||||
" nearly all do not support undercurl
|
||||
" If the UI does not have full support for special attributes (like underline and
|
||||
" undercurl) and the highlight does not explicitly set the foreground color,
|
||||
" make the foreground the same as the attribute color to ensure the user will
|
||||
" get some highlight if the attribute is not supported. The default behavior
|
||||
" is to assume that terminals do not have full support, but the user can set
|
||||
" the global variable `g:dracula_full_special_attrs_support` explicitly if the
|
||||
" default behavior is not desirable.
|
||||
let l:special = get(a:, 3, ['NONE', 'NONE'])
|
||||
if l:special[0] !=# 'NONE' && l:fg[0] ==# 'NONE' && !has('gui_running')
|
||||
if l:special[0] !=# 'NONE' && l:fg[0] ==# 'NONE' && !g:dracula_full_special_attrs_support
|
||||
let l:fg[0] = l:special[0]
|
||||
let l:fg[1] = l:special[1]
|
||||
endif
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
*dracula.txt* For Vim version 8 Last change: 2018 May 08
|
||||
*dracula.txt* For Vim version 8 Last change: 2021 Oct 22
|
||||
*dracula* *vim-dracula*
|
||||
|
||||
|\ ,, ~
|
||||
|
@ -86,6 +86,13 @@ Include underline attributes in highlighting >
|
|||
Include undercurl attributes in highlighting (only if underline enabled) >
|
||||
let g:dracula_undercurl = 1
|
||||
|
||||
* *g:dracula_full_special_attrs_support*
|
||||
Explicitly declare full support for special attributes. By default it is 1
|
||||
for graphical applications and 0 for terminals and terminal emulators. On
|
||||
terminal emulators, set to 1 to allow underline/undercurl highlights without
|
||||
changing the foreground color. >
|
||||
let g:dracula_full_special_attrs_support = 1
|
||||
|
||||
* *g:dracula_inverse*
|
||||
Include inverse attributes in highlighting >
|
||||
let g:dracula_inverse = 1
|
||||
|
|
|
@ -228,7 +228,7 @@ function! s:Map(mode, lhs, rhs, ...) abort
|
|||
endwhile
|
||||
if !skip && (flags !~# '<unique>' || empty(mapcheck(head.tail, mode)))
|
||||
call add(maps, mode.'map <buffer>' . s:nowait . substitute(flags, '<unique>', '', '') . ' ' . head.tail . ' ' . a:rhs)
|
||||
if a:0 > 1
|
||||
if a:0 > 1 && a:2
|
||||
let b:undo_ftplugin = get(b:, 'undo_ftplugin', 'exe') .
|
||||
\ '|sil! exe "' . mode . 'unmap <buffer> ' . head.tail . '"'
|
||||
endif
|
||||
|
@ -1253,30 +1253,34 @@ endfunction
|
|||
function! s:UrlParse(url) abort
|
||||
let scp_authority = matchstr(a:url, '^[^:/]\+\ze:\%(//\)\@!')
|
||||
if len(scp_authority) && !(has('win32') && scp_authority =~# '^\a:[\/]')
|
||||
return {'scheme': 'ssh', 'authority': scp_authority,
|
||||
let url = {'scheme': 'ssh', 'authority': scp_authority,
|
||||
\ 'path': strpart(a:url, len(scp_authority) + 1)}
|
||||
elseif empty(a:url)
|
||||
let url = {'scheme': '', 'authority': '', 'path': ''}
|
||||
else
|
||||
let match = matchlist(a:url, '^\([[:alnum:].+-]\+\)://\([^/]*\)\(/.*\)\=\%(#\|$\)')
|
||||
if empty(match)
|
||||
let url = {'scheme': 'file', 'authority': '', 'path': a:url}
|
||||
else
|
||||
let url = {'scheme': match[1], 'authority': match[2]}
|
||||
let url.path = empty(match[3]) ? '/' : match[3]
|
||||
endif
|
||||
endif
|
||||
let match = matchlist(a:url, '^\([[:alnum:].+-]\+\)://\([^/]*\)\(/.*\)\=\%(#\|$\)')
|
||||
if empty(match)
|
||||
return {'scheme': 'file', 'authority': '', 'path': a:url}
|
||||
if (url.scheme ==# 'ssh' || url.scheme ==# 'git') && url.path[0:1] ==# '/~'
|
||||
let url.path = strpart(url.path, 1)
|
||||
endif
|
||||
let remote = {'scheme': match[1], 'authority': match[2]}
|
||||
let remote.path = empty(match[3]) ? '/' : match[3]
|
||||
if (remote.scheme ==# 'ssh' || remote.scheme ==# 'git') && remote.path[0:1] ==# '/~'
|
||||
let remote.path = strpart(remote.path, 1)
|
||||
endif
|
||||
return remote
|
||||
return url
|
||||
endfunction
|
||||
|
||||
function! s:ResolveRemote(url) abort
|
||||
function! s:RemoteResolve(url, flags) abort
|
||||
let remote = s:UrlParse(a:url)
|
||||
if remote.scheme =~# '^https\=$'
|
||||
if remote.scheme =~# '^https\=$' && index(a:flags, ':nohttp') < 0
|
||||
let headers = fugitive#RemoteHttpHeaders(remote.scheme . '://' . remote.authority . remote.path)
|
||||
let loc = matchstr(get(headers, 'location', ''), '^https\=://.\{-\}\ze/info/refs?')
|
||||
if len(loc)
|
||||
let remote = s:UrlParse(loc)
|
||||
else
|
||||
let remote.http_headers = headers
|
||||
let remote.headers = headers
|
||||
endif
|
||||
elseif remote.scheme ==# 'ssh'
|
||||
let remote.authority = fugitive#SshHostAlias(remote.authority)
|
||||
|
@ -1284,23 +1288,66 @@ function! s:ResolveRemote(url) abort
|
|||
return remote
|
||||
endfunction
|
||||
|
||||
function! fugitive#ResolveRemote(url) abort
|
||||
let remote = s:ResolveRemote(a:url)
|
||||
if remote.scheme ==# 'file' || remote.scheme ==# ''
|
||||
return remote.path
|
||||
elseif remote.path =~# '^/'
|
||||
return remote.scheme . '://' . remote.authority . remote.path
|
||||
elseif remote.path =~# '^\~'
|
||||
return remote.scheme . '://' . remote.authority . '/' . remote.path
|
||||
elseif remote.scheme ==# 'ssh' && remote.authority !~# ':'
|
||||
return remote.authority . ':' . remote.path
|
||||
function! s:ConfigLengthSort(i1, i2) abort
|
||||
return len(a:i2[0]) - len(a:i1[0])
|
||||
endfunction
|
||||
|
||||
function! s:RemoteCallback(config, into, flags, cb) abort
|
||||
if a:into.remote_name =~# '^\.\=$'
|
||||
let a:into.remote_name = s:RemoteDefault(a:config)
|
||||
endif
|
||||
let url = a:into.remote_name
|
||||
|
||||
if url ==# '.git'
|
||||
let url = s:GitDir(a:config)
|
||||
elseif url !~# ':\|^/\|^\a:[\/]\|^\.\.\=/'
|
||||
let url = FugitiveConfigGet('remote.' . url . '.url', a:config)
|
||||
endif
|
||||
let instead_of = []
|
||||
for [k, vs] in items(fugitive#ConfigGetRegexp('^url\.\zs.\{-\}\ze\.insteadof$', a:config))
|
||||
for v in vs
|
||||
call add(instead_of, [v, k])
|
||||
endfor
|
||||
endfor
|
||||
call sort(instead_of, 's:ConfigLengthSort')
|
||||
for [orig, replacement] in instead_of
|
||||
if strpart(url, 0, len(orig)) ==# orig
|
||||
let url = replacement . strpart(url, len(orig))
|
||||
break
|
||||
endif
|
||||
endfor
|
||||
if index(a:flags, ':noresolve') < 0
|
||||
call extend(a:into, s:RemoteResolve(url, a:flags))
|
||||
else
|
||||
return a:url
|
||||
call extend(a:into, s:UrlParse(url))
|
||||
endif
|
||||
let a:into.user = matchstr(a:into.authority, '.\{-\}\ze@', '', '')
|
||||
let a:into.host = substitute(a:into.authority, '.\{-\}@', '', '')
|
||||
let a:into.hostname = substitute(a:into.host, ':\d\+$', '', '')
|
||||
let a:into.port = matchstr(a:into.host, ':\zs\d\+$', '', '')
|
||||
if a:into.path =~# '^/'
|
||||
let a:into.url = a:into.scheme . '://' . a:into.authority . a:into.path
|
||||
elseif a:into.path =~# '^\~'
|
||||
let a:into.url = a:into.scheme . '://' . a:into.authority . '/' . a:into.path
|
||||
elseif a:into.scheme ==# 'ssh' && a:into.authority !~# ':'
|
||||
let a:into.url = a:into.authority . ':' . a:into.path
|
||||
else
|
||||
let a:into.url = url
|
||||
endif
|
||||
if len(a:cb)
|
||||
call call(a:cb[0], [a:into] + a:cb[1:-1])
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! s:ConfigLengthSort(i1, i2) abort
|
||||
return len(a:i2[0]) - len(a:i1[0])
|
||||
function! s:Remote(dir, remote, flags, cb) abort
|
||||
let into = {'remote_name': a:remote, 'git_dir': s:GitDir(a:dir)}
|
||||
let config = fugitive#Config(a:dir, function('s:RemoteCallback'), into, a:flags, a:cb)
|
||||
if len(a:cb)
|
||||
return config
|
||||
else
|
||||
call fugitive#Wait(config)
|
||||
return into
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! s:RemoteParseArgs(args) abort
|
||||
|
@ -1340,34 +1387,22 @@ function! s:RemoteParseArgs(args) abort
|
|||
return [dir_or_config, remote, flags, cb]
|
||||
endfunction
|
||||
|
||||
function! fugitive#Remote(...) abort
|
||||
let [dir_or_config, remote, flags, cb] = s:RemoteParseArgs(a:000)
|
||||
return s:Remote(dir_or_config, remote, flags, cb)
|
||||
endfunction
|
||||
|
||||
function! s:RemoteUrlCallback(remote, callback) abort
|
||||
return call(a:callback[0], [a:remote.url] + a:callback[1:-1])
|
||||
endfunction
|
||||
|
||||
function! fugitive#RemoteUrl(...) abort
|
||||
let [dir_or_config, url, flags, cb] = s:RemoteParseArgs(a:000)
|
||||
let config = fugitive#Config(dir_or_config)
|
||||
if url =~# '^\.\=$'
|
||||
let url = s:RemoteDefault(config)
|
||||
let [dir_or_config, remote, flags, cb] = s:RemoteParseArgs(a:000)
|
||||
if len(cb)
|
||||
let cb = [function('s:RemoteUrlCallback'), cb]
|
||||
endif
|
||||
if url ==# '.git'
|
||||
let url = s:GitDir(config)
|
||||
elseif url !~# ':\|^/\|^\.\.\=/'
|
||||
let url = FugitiveConfigGet('remote.' . url . '.url', config)
|
||||
endif
|
||||
let instead_of = []
|
||||
for [k, vs] in items(fugitive#ConfigGetRegexp('^url\.\zs.\{-\}\ze\.insteadof$', config))
|
||||
for v in vs
|
||||
call add(instead_of, [v, k])
|
||||
endfor
|
||||
endfor
|
||||
call sort(instead_of, 's:ConfigLengthSort')
|
||||
for [orig, replacement] in instead_of
|
||||
if strpart(url, 0, len(orig)) ==# orig
|
||||
let url = replacement . strpart(url, len(orig))
|
||||
break
|
||||
endif
|
||||
endfor
|
||||
if index(flags, 1) < 0 && index(flags, get(v:, 'true', 1)) < 0 && index(flags, ':noresolve') < 0
|
||||
let url = fugitive#ResolveRemote(url)
|
||||
endif
|
||||
return url
|
||||
let remote = s:Remote(dir_or_config, remote, flags, cb)
|
||||
return get(remote, 'url', remote)
|
||||
endfunction
|
||||
|
||||
" Section: Quickfix
|
||||
|
@ -2288,9 +2323,8 @@ function! s:FilterEscape(items, ...) abort
|
|||
let items = copy(a:items)
|
||||
call map(items, 's:fnameescape(v:val)')
|
||||
if a:0 && type(a:1) == type('')
|
||||
let match = fnameescape(a:1)
|
||||
let cmp = s:FileIgnoreCase(1) ? '==?' : '==#'
|
||||
call filter(items, 'strpart(v:val, 0, strlen(match)) ' . cmp . ' match')
|
||||
call filter(items, 'strpart(v:val, 0, strlen(a:1)) ' . cmp . ' a:1')
|
||||
endif
|
||||
return items
|
||||
endfunction
|
||||
|
@ -2384,7 +2418,7 @@ function! fugitive#CompleteObject(base, ...) abort
|
|||
let heads += ["stash"]
|
||||
let heads += sort(s:LinesError(["stash","list","--pretty=format:%gd"], dir)[0])
|
||||
endif
|
||||
let results += s:FilterEscape(heads, base)
|
||||
let results += s:FilterEscape(heads, fnameescape(base))
|
||||
endif
|
||||
let results += a:0 == 1 || a:0 >= 3 ? fugitive#CompletePath(base, 0, '', dir, a:0 >= 4 ? a:4 : tree) : fugitive#CompletePath(base)
|
||||
return results
|
||||
|
@ -2406,7 +2440,7 @@ function! fugitive#CompleteObject(base, ...) abort
|
|||
call map(entries,'s:sub(v:val,"^04.*\\zs$","/")')
|
||||
call map(entries,'parent.s:sub(v:val,".*\t","")')
|
||||
endif
|
||||
return s:FilterEscape(entries, base)
|
||||
return s:FilterEscape(entries, fnameescape(base))
|
||||
endfunction
|
||||
|
||||
function! s:CompleteSub(subcommand, A, L, P, ...) abort
|
||||
|
@ -2548,16 +2582,15 @@ let s:rebase_abbrevs = {
|
|||
\ 'b': 'break',
|
||||
\ }
|
||||
|
||||
function! fugitive#BufReadStatus() abort
|
||||
function! fugitive#BufReadStatus(...) abort
|
||||
let amatch = s:Slash(expand('%:p'))
|
||||
let b:fugitive_type = 'index'
|
||||
unlet! b:fugitive_reltime
|
||||
unlet! b:fugitive_reltime b:fugitive_type
|
||||
try
|
||||
silent doautocmd BufReadPre
|
||||
let config = fugitive#Config()
|
||||
|
||||
let cmd = [fnamemodify(amatch, ':h')]
|
||||
setlocal noro ma nomodeline buftype=nowrite
|
||||
setlocal noreadonly modifiable nomodeline buftype=nowrite
|
||||
if s:cpath(fnamemodify($GIT_INDEX_FILE !=# '' ? FugitiveVimPath($GIT_INDEX_FILE) : fugitive#Find('.git/index'), ':p')) !=# s:cpath(amatch)
|
||||
let cmd += [{'env': {'GIT_INDEX_FILE': FugitiveGitPath(amatch)}}]
|
||||
endif
|
||||
|
@ -2757,7 +2790,7 @@ function! fugitive#BufReadStatus() abort
|
|||
endif
|
||||
|
||||
let b:fugitive_diff = diff
|
||||
if v:cmdbang
|
||||
if get(a:, 1, v:cmdbang)
|
||||
unlet! b:fugitive_expanded
|
||||
endif
|
||||
let expanded = get(b:, 'fugitive_expanded', {'Staged': {}, 'Unstaged': {}})
|
||||
|
@ -2875,6 +2908,8 @@ function! fugitive#BufReadStatus() abort
|
|||
return s:DoAutocmd('User FugitiveIndex')
|
||||
catch /^fugitive:/
|
||||
return 'echoerr ' . string(v:exception)
|
||||
finally
|
||||
let b:fugitive_type = 'index'
|
||||
endtry
|
||||
endfunction
|
||||
|
||||
|
@ -3014,7 +3049,7 @@ function! fugitive#BufReadCmd(...) abort
|
|||
if b:fugitive_display_format
|
||||
call s:ReplaceCmd([dir, 'cat-file', b:fugitive_type, rev])
|
||||
else
|
||||
call s:ReplaceCmd([dir, '-c', 'diff.noprefix=false', 'show', '--no-color', '-m', '--first-parent', '--pretty=format:tree%x20%T%nparent%x20%P%nauthor%x20%an%x20<%ae>%x20%ad%ncommitter%x20%cn%x20<%ce>%x20%cd%nencoding%x20%e%n%n%s%n%n%b', rev])
|
||||
call s:ReplaceCmd([dir, '-c', 'diff.noprefix=false', '-c', 'log.showRoot=false', 'show', '--no-color', '-m', '--first-parent', '--pretty=format:tree%x20%T%nparent%x20%P%nauthor%x20%an%x20<%ae>%x20%ad%ncommitter%x20%cn%x20<%ce>%x20%cd%nencoding%x20%e%n%n%s%n%n%b', rev])
|
||||
keepjumps 1
|
||||
keepjumps call search('^parent ')
|
||||
if getline('.') ==# 'parent '
|
||||
|
@ -3159,6 +3194,9 @@ function! s:TempReadPost(file) abort
|
|||
if dict.filetype ==# 'man' && has('nvim')
|
||||
let b:man_sect = matchstr(getline(1), '^\w\+(\zs\d\+\ze)')
|
||||
endif
|
||||
if !get(g:, 'did_load_ftplugin') && dict.filetype ==# 'fugitiveblame'
|
||||
call s:BlameMaps(0)
|
||||
endif
|
||||
let &l:filetype = dict.filetype
|
||||
endif
|
||||
setlocal foldmarker=<<<<<<<<,>>>>>>>>
|
||||
|
@ -4085,7 +4123,7 @@ function! s:DoAutocmdChanged(dir) abort
|
|||
finally
|
||||
unlet! g:fugitive_event g:fugitive_result
|
||||
" Force statusline reload with the buffer's Git dir
|
||||
let &ro = &ro
|
||||
let &l:ro = &l:ro
|
||||
endtry
|
||||
return ''
|
||||
endfunction
|
||||
|
@ -4096,7 +4134,7 @@ function! s:ReloadStatusBuffer(...) abort
|
|||
endif
|
||||
let original_lnum = a:0 ? a:1 : line('.')
|
||||
let info = s:StageInfo(original_lnum)
|
||||
call fugitive#BufReadStatus()
|
||||
call fugitive#BufReadStatus(0)
|
||||
call setpos('.', [0, s:StageSeek(info, original_lnum), 1, 0])
|
||||
return ''
|
||||
endfunction
|
||||
|
@ -4536,8 +4574,8 @@ endfunction
|
|||
|
||||
function! s:PreviousItem(count) abort
|
||||
for i in range(a:count)
|
||||
if !search(s:item_pattern, 'Wbe') && getline('.') !~# s:item_pattern
|
||||
call search('^commit ', 'Wbe')
|
||||
if !search(s:item_pattern, 'Wb') && getline('.') !~# s:item_pattern
|
||||
call search('^commit ', 'Wb')
|
||||
endif
|
||||
endfor
|
||||
call s:StageReveal()
|
||||
|
@ -7059,6 +7097,33 @@ function! s:BlameRehighlight() abort
|
|||
endfor
|
||||
endfunction
|
||||
|
||||
function! s:BlameMaps(is_ftplugin) abort
|
||||
let ft = a:is_ftplugin
|
||||
call s:Map('n', '<F1>', ':help :Git_blame<CR>', '<silent>', ft)
|
||||
call s:Map('n', 'g?', ':help :Git_blame<CR>', '<silent>', ft)
|
||||
if empty(mapcheck('q', 'n'))
|
||||
nnoremap <buffer> <silent> q :<C-U>echoerr "fugitive: q removed in favor of gq (or :q)"<CR>
|
||||
endif
|
||||
call s:Map('n', 'gq', ':exe <SID>BlameQuit()<CR>', '<silent>', ft)
|
||||
call s:Map('n', '<2-LeftMouse>', ':<C-U>exe <SID>BlameCommit("exe <SID>BlameLeave()<Bar>edit")<CR>', '<silent>', ft)
|
||||
call s:Map('n', '<CR>', ':<C-U>exe <SID>BlameCommit("exe <SID>BlameLeave()<Bar>edit")<CR>', '<silent>', ft)
|
||||
call s:Map('n', '-', ':<C-U>exe <SID>BlameJump("")<CR>', '<silent>', ft)
|
||||
call s:Map('n', 's', ':<C-U>exe <SID>BlameJump("")<CR>', '<silent>', ft)
|
||||
call s:Map('n', 'u', ':<C-U>exe <SID>BlameJump("")<CR>', '<silent>', ft)
|
||||
call s:Map('n', 'P', ':<C-U>exe <SID>BlameJump("^".v:count1)<CR>', '<silent>', ft)
|
||||
call s:Map('n', '~', ':<C-U>exe <SID>BlameJump("~".v:count1)<CR>', '<silent>', ft)
|
||||
call s:Map('n', 'i', ':<C-U>exe <SID>BlameCommit("exe <SID>BlameLeave()<Bar>edit")<CR>', '<silent>', ft)
|
||||
call s:Map('n', 'o', ':<C-U>exe <SID>BlameCommit("split")<CR>', '<silent>', ft)
|
||||
call s:Map('n', 'O', ':<C-U>exe <SID>BlameCommit("tabedit")<CR>', '<silent>', ft)
|
||||
call s:Map('n', 'p', ':<C-U>exe <SID>BlameCommit("pedit")<CR>', '<silent>', ft)
|
||||
call s:Map('n', '.', ":<C-U> <C-R>=substitute(<SID>BlameCommitFileLnum()[0],'^$','@','')<CR><Home>", ft)
|
||||
call s:Map('n', '(', "-", ft)
|
||||
call s:Map('n', ')', "+", ft)
|
||||
call s:Map('n', 'A', ":<C-u>exe 'vertical resize '.(<SID>linechars('.\\{-\\}\\ze [0-9:/+-][0-9:/+ -]* \\d\\+)')+1+v:count)<CR>", '<silent>', ft)
|
||||
call s:Map('n', 'C', ":<C-u>exe 'vertical resize '.(<SID>linechars('^\\S\\+')+1+v:count)<CR>", '<silent>', ft)
|
||||
call s:Map('n', 'D', ":<C-u>exe 'vertical resize '.(<SID>linechars('.\\{-\\}\\ze\\d\\ze\\s\\+\\d\\+)')+1-v:count)<CR>", '<silent>', ft)
|
||||
endfunction
|
||||
|
||||
function! fugitive#BlameFileType() abort
|
||||
setlocal nomodeline
|
||||
setlocal foldmethod=manual
|
||||
|
@ -7073,29 +7138,7 @@ function! fugitive#BlameFileType() abort
|
|||
if &modifiable
|
||||
return ''
|
||||
endif
|
||||
call s:Map('n', '<F1>', ':help :Git_blame<CR>', '<silent>')
|
||||
call s:Map('n', 'g?', ':help :Git_blame<CR>', '<silent>')
|
||||
if empty(mapcheck('q', 'n'))
|
||||
nnoremap <buffer> <silent> q :<C-U>echoerr "fugitive: q removed in favor of gq (or :q)"<CR>
|
||||
endif
|
||||
call s:Map('n', 'gq', ':exe <SID>BlameQuit()<CR>', '<silent>')
|
||||
call s:Map('n', '<2-LeftMouse>', ':<C-U>exe <SID>BlameCommit("exe <SID>BlameLeave()<Bar>edit")<CR>', '<silent>')
|
||||
call s:Map('n', '<CR>', ':<C-U>exe <SID>BlameCommit("exe <SID>BlameLeave()<Bar>edit")<CR>', '<silent>')
|
||||
call s:Map('n', '-', ':<C-U>exe <SID>BlameJump("")<CR>', '<silent>')
|
||||
call s:Map('n', 's', ':<C-U>exe <SID>BlameJump("")<CR>', '<silent>')
|
||||
call s:Map('n', 'u', ':<C-U>exe <SID>BlameJump("")<CR>', '<silent>')
|
||||
call s:Map('n', 'P', ':<C-U>exe <SID>BlameJump("^".v:count1)<CR>', '<silent>')
|
||||
call s:Map('n', '~', ':<C-U>exe <SID>BlameJump("~".v:count1)<CR>', '<silent>')
|
||||
call s:Map('n', 'i', ':<C-U>exe <SID>BlameCommit("exe <SID>BlameLeave()<Bar>edit")<CR>', '<silent>')
|
||||
call s:Map('n', 'o', ':<C-U>exe <SID>BlameCommit("split")<CR>', '<silent>')
|
||||
call s:Map('n', 'O', ':<C-U>exe <SID>BlameCommit("tabedit")<CR>', '<silent>')
|
||||
call s:Map('n', 'p', ':<C-U>exe <SID>BlameCommit("pedit")<CR>', '<silent>')
|
||||
call s:Map('n', '.', ":<C-U> <C-R>=substitute(<SID>BlameCommitFileLnum()[0],'^$','@','')<CR><Home>")
|
||||
call s:Map('n', '(', "-")
|
||||
call s:Map('n', ')', "+")
|
||||
call s:Map('n', 'A', ":<C-u>exe 'vertical resize '.(<SID>linechars('.\\{-\\}\\ze [0-9:/+-][0-9:/+ -]* \\d\\+)')+1+v:count)<CR>", '<silent>')
|
||||
call s:Map('n', 'C', ":<C-u>exe 'vertical resize '.(<SID>linechars('^\\S\\+')+1+v:count)<CR>", '<silent>')
|
||||
call s:Map('n', 'D', ":<C-u>exe 'vertical resize '.(<SID>linechars('.\\{-\\}\\ze\\d\\ze\\s\\+\\d\\+)')+1-v:count)<CR>", '<silent>')
|
||||
call s:BlameMaps(1)
|
||||
endfunction
|
||||
|
||||
augroup fugitive_blame
|
||||
|
|
|
@ -318,6 +318,7 @@ dv Perform a |:Gvdiffsplit| on the file under the cursor.
|
|||
*fugitive_ds* *fugitive_dh*
|
||||
ds Perform a |:Ghdiffsplit| on the file under the cursor.
|
||||
dh
|
||||
|
||||
*fugitive_dq*
|
||||
dq Close all but one diff buffer, and |:diffoff|! the
|
||||
last one.
|
||||
|
|
|
@ -628,7 +628,7 @@ augroup fugitive
|
|||
autocmd BufReadCmd index{,.lock}
|
||||
\ if FugitiveIsGitDir(expand('<amatch>:p:h')) |
|
||||
\ let b:git_dir = s:Slash(expand('<amatch>:p:h')) |
|
||||
\ exe fugitive#BufReadStatus() |
|
||||
\ exe fugitive#BufReadStatus(v:cmdbang) |
|
||||
\ elseif filereadable(expand('<amatch>')) |
|
||||
\ silent doautocmd BufReadPre |
|
||||
\ keepalt read <amatch> |
|
||||
|
|
21
sources_non_forked/vim-indent-guides/LICENSE
Normal file
21
sources_non_forked/vim-indent-guides/LICENSE
Normal file
|
@ -0,0 +1,21 @@
|
|||
MIT License
|
||||
|
||||
Copyright (c) 2021 Nathanael Kane
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
|
@ -1,4 +1,4 @@
|
|||
# Indent Guides
|
||||
# Indent Guides (unmaintained)
|
||||
Indent Guides is a plugin for visually displaying indent levels in Vim.
|
||||
|
||||
<img src="http://i.imgur.com/ONgoj.png" width="448" height="448" alt="" />
|
||||
|
|
|
@ -216,6 +216,7 @@ snippet try
|
|||
}catch(${1}) {
|
||||
|
||||
}
|
||||
# auto function
|
||||
snippet af auto function
|
||||
auto ${1:name}(${2}) -> ${3:void}
|
||||
{
|
||||
|
|
|
@ -974,6 +974,7 @@ snippet pi:e
|
|||
snippet pi:c
|
||||
place-items: center;
|
||||
snippet pi:st
|
||||
place-items: stretch;
|
||||
snippet pos
|
||||
position: ${1};${0}
|
||||
snippet pos:a
|
||||
|
|
|
@ -399,7 +399,7 @@ snippet h6#
|
|||
<h6 id="${1}">${0}</h6>
|
||||
snippet head
|
||||
<head>
|
||||
<meta http-equiv="content-type" content="text/html; charset=utf-8">
|
||||
<meta charset="utf-8">
|
||||
|
||||
<title>${1:`substitute(vim_snippets#Filename('', 'Page Title'), '^.', '\u&', '')`}</title>
|
||||
${0}
|
||||
|
@ -609,7 +609,9 @@ snippet meta:d
|
|||
snippet meta:compat
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=${1:7,8,edge}">
|
||||
snippet meta:refresh
|
||||
<meta http-equiv="refresh" content="text/html;charset=UTF-8">
|
||||
<meta http-equiv="refresh" content="3;url=${0}">
|
||||
snippet meta:utf5
|
||||
<meta charset="utf-8">
|
||||
snippet meta:utf
|
||||
<meta http-equiv="content-type" content="text/html;charset=UTF-8">
|
||||
snippet meter
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
" surround.vim - Surroundings
|
||||
" Author: Tim Pope <http://tpo.pe/>
|
||||
" Version: 2.1
|
||||
" Version: 2.2
|
||||
" GetLatestVimScripts: 1697 1 :AutoInstall: surround.vim
|
||||
|
||||
if exists("g:loaded_surround") || &cp || v:version < 700
|
||||
|
|
Loading…
Reference in a new issue