mirror of
1
0
Fork 0

Updated plugins

This commit is contained in:
Amir 2020-04-25 21:56:16 -04:00
parent d98c510eee
commit fef069af24
114 changed files with 4018 additions and 988 deletions

View File

@ -29,6 +29,6 @@ call ale#linter#Define('clojure', {
\ 'name': 'clj-kondo',
\ 'output_stream': 'stdout',
\ 'executable': 'clj-kondo',
\ 'command': 'clj-kondo --lint %t',
\ 'command': 'clj-kondo --cache --lint %t',
\ 'callback': 'ale_linters#clojure#clj_kondo#HandleCljKondoFormat',
\})

View File

@ -174,6 +174,7 @@ endfunction
call ale#linter#Define('kotlin', {
\ 'name': 'kotlinc',
\ 'executable': 'kotlinc',
\ 'output_stream': 'stderr',
\ 'command': function('ale_linters#kotlin#kotlinc#RunWithImportPaths'),
\ 'callback': 'ale_linters#kotlin#kotlinc#Handle',
\ 'lint_file': 1,

View File

@ -32,6 +32,8 @@ function! ale_linters#scala#metals#GetProjectRoot(buffer) abort
\)
endif
endfor
return ''
endfunction
function! ale_linters#scala#metals#GetCommand(buffer) abort

View File

@ -0,0 +1,25 @@
" Author: OJFord <dev@ojford.com>
" Description: terraform-lsp integration for ALE (cf. https://github.com/juliosueiras/terraform-lsp)
call ale#Set('terraform_langserver_executable', 'terraform-lsp')
call ale#Set('terraform_langserver_options', '')
function! ale_linters#terraform#terraform_lsp#GetCommand(buffer) abort
return '%e'
\ . ale#Pad(ale#Var(a:buffer, 'terraform_langserver_options'))
endfunction
function! ale_linters#terraform#terraform_lsp#GetProjectRoot(buffer) abort
let l:tf_dir = ale#path#FindNearestDirectory(a:buffer, '.terraform')
return !empty(l:tf_dir) ? fnamemodify(l:tf_dir, ':h:h') : ''
endfunction
call ale#linter#Define('terraform', {
\ 'name': 'terraform_lsp',
\ 'lsp': 'stdio',
\ 'executable': {b -> ale#Var(b, 'terraform_langserver_executable')},
\ 'command': function('ale_linters#terraform#terraform_lsp#GetCommand'),
\ 'project_root': function('ale_linters#terraform#terraform_lsp#GetProjectRoot'),
\ 'language': 'terraform',
\})

View File

@ -28,21 +28,30 @@ function! ale_linters#verilog#verilator#Handle(buffer, lines) abort
" %Warning-UNDRIVEN: test.v:3: Signal is not driven: clk
" %Warning-UNUSED: test.v:4: Signal is not used: dout
" %Warning-BLKSEQ: test.v:10: Blocking assignments (=) in sequential (flop or latch) block; suggest delayed assignments (<=).
let l:pattern = '^%\(Warning\|Error\)[^:]*:\([^:]\+\):\(\d\+\): \(.\+\)$'
" Since version 4.032 (04/2020) verilator linter messages also contain the column number,
" and look like:
" %Error: /tmp/test.sv:3:1: syntax error, unexpected endmodule, expecting ';'
"
" to stay compatible with old versions of the tool, the column number is
" optional in the researched pattern
let l:pattern = '^%\(Warning\|Error\)[^:]*:\([^:]\+\):\(\d\+\):\(\d\+\)\?:\? \(.\+\)$'
let l:output = []
for l:match in ale#util#GetMatches(a:lines, l:pattern)
let l:line = l:match[3] + 0
let l:type = l:match[1] is# 'Error' ? 'E' : 'W'
let l:text = l:match[4]
let l:item = {
\ 'lnum': str2nr(l:match[3]),
\ 'text': l:match[5],
\ 'type': l:match[1] is# 'Error' ? 'E' : 'W',
\}
if !empty(l:match[4])
let l:item.col = str2nr(l:match[4])
endif
let l:file = l:match[2]
if l:file =~# '_verilator_linted.v'
call add(l:output, {
\ 'lnum': l:line,
\ 'text': l:text,
\ 'type': l:type,
\})
call add(l:output, l:item)
endif
endfor

View File

@ -0,0 +1,61 @@
" Author: Jeffrey Lau - https://github.com/zoonfafer
" Description: Vim Language Server integration for ALE
call ale#Set('vim_vimls_executable', 'vim-language-server')
call ale#Set('vim_vimls_use_global', get(g:, 'ale_use_global_executables', 0))
call ale#Set('vim_vimls_config', {})
function! ale_linters#vim#vimls#GetProjectRoot(buffer) abort
let l:trigger_file_candidates = [
\ '.vimrc',
\ 'init.vim',
\]
for l:candidate in l:trigger_file_candidates
let l:trigger_file = fnamemodify(bufname(a:buffer), ':t')
if l:trigger_file is# l:candidate
return fnamemodify(
\ bufname(a:buffer),
\ ':h',
\)
endif
endfor
let l:trigger_dir_candidates = [
\ 'autoload',
\ 'plugin',
\ '.git',
\]
let l:path_upwards = ale#path#Upwards(fnamemodify(bufname(a:buffer), ':p:h'))
for l:path in l:path_upwards
for l:candidate in l:trigger_dir_candidates
let l:trigger_dir = ale#path#Simplify(
\ l:path . '/' . l:candidate,
\)
if isdirectory(l:trigger_dir)
return fnamemodify(
\ l:trigger_dir,
\ ':p:h:h',
\)
endif
endfor
endfor
return ''
endfunction
call ale#linter#Define('vim', {
\ 'name': 'vimls',
\ 'lsp': 'stdio',
\ 'lsp_config': {b -> ale#Var(b, 'vim_vimls_config')},
\ 'executable': {b -> ale#node#FindExecutable(b, 'vim_vimls', [
\ 'node_modules/.bin/vim-language-server',
\ ])},
\ 'command': '%e --stdio',
\ 'language': 'vim',
\ 'project_root': function('ale_linters#vim#vimls#GetProjectRoot'),
\})

View File

@ -258,9 +258,9 @@ function! ale#GetLocItemMessage(item, format_string) abort
" Replace special markers with certain information.
" \=l:variable is used to avoid escaping issues.
let l:msg = substitute(l:msg, '\v\%([^\%]*)code([^\%]*)\%', l:code_repl, 'g')
let l:msg = substitute(l:msg, '\V%severity%', '\=l:severity', 'g')
let l:msg = substitute(l:msg, '\V%linter%', '\=l:linter_name', 'g')
let l:msg = substitute(l:msg, '\v\%([^\%]*)code([^\%]*)\%', l:code_repl, 'g')
" Replace %s with the text.
let l:msg = substitute(l:msg, '\V%s', '\=a:item.text', 'g')

View File

@ -1,4 +1,4 @@
" Author: Andrew Lee <andrewl@mbda.fun>.
" Author: Andrew Lee <andrew.lambda@tuta.io>.
" Inspired by ale/gradle.vim by Michael Pardo <michael@michaelpardo.com>
" Description: Functions for working with Ant projects.

View File

@ -1,7 +1,7 @@
" Author: Jerko Steiner <jerko.steiner@gmail.com>
" Description: Code action support for LSP / tsserver
function! ale#code_action#HandleCodeAction(code_action) abort
function! ale#code_action#HandleCodeAction(code_action, should_save) abort
let l:current_buffer = bufnr('')
let l:changes = a:code_action.changes
@ -17,11 +17,14 @@ function! ale#code_action#HandleCodeAction(code_action) abort
for l:file_code_edit in l:changes
call ale#code_action#ApplyChanges(
\ l:file_code_edit.fileName, l:file_code_edit.textChanges)
\ l:file_code_edit.fileName,
\ l:file_code_edit.textChanges,
\ a:should_save,
\ )
endfor
endfunction
function! ale#code_action#ApplyChanges(filename, changes) abort
function! ale#code_action#ApplyChanges(filename, changes, should_save) abort
let l:current_buffer = bufnr('')
" The buffer is used to determine the fileformat, if available.
let l:buffer = bufnr(a:filename)
@ -106,10 +109,17 @@ function! ale#code_action#ApplyChanges(filename, changes) abort
call remove(l:lines, -1)
endif
call ale#util#Writefile(l:buffer, l:lines, a:filename)
if a:should_save
call ale#util#Writefile(l:buffer, l:lines, a:filename)
else
call ale#util#SetBufferContents(l:buffer, l:lines)
endif
if l:is_current_buffer
call ale#util#Execute(':e!')
if a:should_save
call ale#util#Execute(':e!')
endif
call setpos('.', [0, l:pos[0], l:pos[1], 0])
endif
endfunction

View File

@ -823,7 +823,7 @@ function! ale#completion#HandleUserData(completed_item) abort
endif
for l:code_action in get(l:user_data, 'codeActions', [])
call ale#code_action#HandleCodeAction(l:code_action)
call ale#code_action#HandleCodeAction(l:code_action, v:false)
endfor
endfunction

View File

@ -5,6 +5,7 @@ let s:go_to_definition_map = {}
" Enable automatic updates of the tagstack
let g:ale_update_tagstack = get(g:, 'ale_update_tagstack', 1)
let g:ale_default_navigation = get(g:, 'ale_default_navigation', 'buffer')
" Used to get the definition map in tests.
function! ale#definition#GetMap() abort
@ -134,6 +135,10 @@ function! s:GoToLSPDefinition(linter, options, capability) abort
endfunction
function! ale#definition#GoTo(options) abort
if !get(g:, 'ale_ignore_2_7_warnings') && has_key(a:options, 'deprecated_command')
execute 'echom '':' . a:options.deprecated_command . ' is deprecated. Use `let g:ale_ignore_2_7_warnings = 1` to disable this message.'''
endif
for l:linter in ale#linter#Get(&filetype)
if !empty(l:linter.lsp)
call s:GoToLSPDefinition(l:linter, a:options, 'definition')
@ -142,6 +147,10 @@ function! ale#definition#GoTo(options) abort
endfunction
function! ale#definition#GoToType(options) abort
if !get(g:, 'ale_ignore_2_7_warnings') && has_key(a:options, 'deprecated_command')
execute 'echom '':' . a:options.deprecated_command . ' is deprecated. Use `let g:ale_ignore_2_7_warnings = 1` to disable this message.'''
endif
for l:linter in ale#linter#Get(&filetype)
if !empty(l:linter.lsp)
" TODO: handle typeDefinition for tsserver if supported by the
@ -154,3 +163,33 @@ function! ale#definition#GoToType(options) abort
endif
endfor
endfunction
function! ale#definition#GoToCommandHandler(command, ...) abort
let l:options = {}
if len(a:000) > 0
for l:option in a:000
if l:option is? '-tab'
let l:options.open_in = 'tab'
elseif l:option is? '-split'
let l:options.open_in = 'split'
elseif l:option is? '-vsplit'
let l:options.open_in = 'vsplit'
endif
endfor
endif
if !has_key(l:options, 'open_in')
let l:default_navigation = ale#Var(bufnr(''), 'default_navigation')
if index(['tab', 'split', 'vsplit'], l:default_navigation) >= 0
let l:options.open_in = l:default_navigation
endif
endif
if a:command is# 'type'
call ale#definition#GoToType(l:options)
else
call ale#definition#GoTo(l:options)
endif
endfunction

View File

@ -4,40 +4,15 @@ call ale#Set('fix_on_save_ignore', {})
" Vim doesn't let you modify hidden buffers.
function! ale#fix#ApplyQueuedFixes(buffer) abort
let l:data = get(g:ale_fix_buffer_data, a:buffer, {'done': 0})
let l:has_bufline_api = exists('*deletebufline') && exists('*setbufline')
if !l:data.done || (!l:has_bufline_api && a:buffer isnot bufnr(''))
if !l:data.done || (!ale#util#HasBuflineApi() && a:buffer isnot bufnr(''))
return
endif
call remove(g:ale_fix_buffer_data, a:buffer)
if l:data.changes_made
" If the file is in DOS mode, we have to remove carriage returns from
" the ends of lines before calling setline(), or we will see them
" twice.
let l:new_lines = getbufvar(a:buffer, '&fileformat') is# 'dos'
\ ? map(copy(l:data.output), 'substitute(v:val, ''\r\+$'', '''', '''')')
\ : l:data.output
let l:first_line_to_remove = len(l:new_lines) + 1
" Use a Vim API for setting lines in other buffers, if available.
if l:has_bufline_api
call setbufline(a:buffer, 1, l:new_lines)
call deletebufline(a:buffer, l:first_line_to_remove, '$')
" Fall back on setting lines the old way, for the current buffer.
else
let l:old_line_length = len(l:data.lines_before)
if l:old_line_length >= l:first_line_to_remove
let l:save = winsaveview()
silent execute
\ l:first_line_to_remove . ',' . l:old_line_length . 'd_'
call winrestview(l:save)
endif
call setline(1, l:new_lines)
endif
let l:new_lines = ale#util#SetBufferContents(a:buffer, l:data.output)
if l:data.should_save
if a:buffer is bufnr('')

View File

@ -210,6 +210,12 @@ function! ale#highlight#SetHighlights(buffer, loclist) abort
" Set the list in the buffer variable.
call setbufvar(str2nr(a:buffer), 'ale_highlight_items', l:new_list)
let l:exclude_list = ale#Var(a:buffer, 'exclude_highlights')
if !empty(l:exclude_list)
call filter(l:new_list, 'empty(ale#util#GetMatches(v:val.text, l:exclude_list))')
endif
" Update highlights for the current buffer, which may or may not
" be the buffer we just set highlights for.
call ale#highlight#UpdateHighlights()

View File

@ -15,7 +15,7 @@ function! ale#organize_imports#HandleTSServerResponse(conn_id, response) abort
call ale#code_action#HandleCodeAction({
\ 'description': 'Organize Imports',
\ 'changes': l:file_code_edits,
\})
\}, v:false)
endfunction
function! s:OnReady(linter, lsp_details) abort

View File

@ -1,6 +1,14 @@
" Author: w0rp <devw0rp@gmail.com>
" Description: Preview windows for showing whatever information in.
if !has_key(s:, 'last_selection_list')
let s:last_selection_list = []
endif
if !has_key(s:, 'last_selection_open_in')
let s:last_selection_open_in = 'current-buffer'
endif
" Open a preview window and show some lines in it.
" A second argument can be passed as a Dictionary with options. They are...
"
@ -67,9 +75,24 @@ function! ale#preview#ShowSelection(item_list, ...) abort
call ale#preview#Show(l:lines, {'filetype': 'ale-preview-selection'})
let b:ale_preview_item_list = a:item_list
let b:ale_preview_item_open_in = get(l:options, 'open_in', 'current-buffer')
" Remove the last preview
let s:last_selection_list = b:ale_preview_item_list
let s:last_selection_open_in = b:ale_preview_item_open_in
endfunction
function! s:Open(open_in_tab) abort
function! ale#preview#RepeatSelection() abort
if empty(s:last_selection_list)
return
endif
call ale#preview#ShowSelection(s:last_selection_list, {
\ 'open_in': s:last_selection_open_in,
\})
endfunction
function! s:Open(open_in) abort
let l:item_list = get(b:, 'ale_preview_item_list', [])
let l:item = get(l:item_list, getpos('.')[1] - 1, {})
@ -77,22 +100,20 @@ function! s:Open(open_in_tab) abort
return
endif
if !a:open_in_tab
:q!
endif
:q!
call ale#util#Open(
\ l:item.filename,
\ l:item.line,
\ l:item.column,
\ {'open_in_tab': a:open_in_tab},
\ {'open_in': a:open_in},
\)
endfunction
function! ale#preview#OpenSelectionInBuffer() abort
call s:Open(0)
function! ale#preview#OpenSelection() abort
call s:Open(b:ale_preview_item_open_in)
endfunction
function! ale#preview#OpenSelectionInTab() abort
call s:Open(1)
call s:Open('tab')
endfunction

View File

@ -1,3 +1,5 @@
let g:ale_default_navigation = get(g:, 'ale_default_navigation', 'buffer')
let s:references_map = {}
" Used to get the references map in tests.
@ -99,7 +101,8 @@ function! s:OnReady(line, column, options, linter, lsp_details) abort
let l:request_id = ale#lsp#Send(l:id, l:message)
let s:references_map[l:request_id] = {
\ 'use_relative_paths': has_key(a:options, 'use_relative_paths') ? a:options.use_relative_paths : 0
\ 'use_relative_paths': has_key(a:options, 'use_relative_paths') ? a:options.use_relative_paths : 0,
\ 'open_in': get(a:options, 'open_in', 'current-buffer'),
\}
endfunction
@ -110,10 +113,24 @@ function! ale#references#Find(...) abort
for l:option in a:000
if l:option is? '-relative'
let l:options.use_relative_paths = 1
elseif l:option is? '-tab'
let l:options.open_in = 'tab'
elseif l:option is? '-split'
let l:options.open_in = 'split'
elseif l:option is? '-vsplit'
let l:options.open_in = 'vsplit'
endif
endfor
endif
if !has_key(l:options, 'open_in')
let l:default_navigation = ale#Var(bufnr(''), 'default_navigation')
if index(['tab', 'split', 'vsplit'], l:default_navigation) >= 0
let l:options.open_in = l:default_navigation
endif
endif
let l:buffer = bufnr('')
let [l:line, l:column] = getpos('.')[1:2]
let l:column = min([l:column, len(getline(l:line))])

View File

@ -80,7 +80,7 @@ function! ale#rename#HandleTSServerResponse(conn_id, response) abort
call ale#code_action#HandleCodeAction({
\ 'description': 'rename',
\ 'changes': l:changes,
\})
\}, v:true)
endfunction
function! ale#rename#HandleLSPResponse(conn_id, response) abort
@ -134,7 +134,7 @@ function! ale#rename#HandleLSPResponse(conn_id, response) abort
call ale#code_action#HandleCodeAction({
\ 'description': 'rename',
\ 'changes': l:changes,
\})
\}, v:true)
endif
endfunction

View File

@ -23,7 +23,7 @@ let g:ale_sign_offset = get(g:, 'ale_sign_offset', 1000000)
let g:ale_sign_column_always = get(g:, 'ale_sign_column_always', 0)
let g:ale_sign_highlight_linenrs = get(g:, 'ale_sign_highlight_linenrs', 0)
let s:supports_sign_groups = has('nvim-0.4.2') || (v:version >= 801 && has('patch614'))
let s:supports_sign_groups = has('nvim-0.4.2') || has('patch-8.1.614')
if !hlexists('ALEErrorSign')
highlight link ALEErrorSign error

View File

@ -91,17 +91,17 @@ endfunction
" options['open_in'] can be:
" current-buffer (default)
" tab
" vertical-split
" horizontal-split
" split
" vsplit
function! ale#util#Open(filename, line, column, options) abort
let l:open_in = get(a:options, 'open_in', 'current-buffer')
let l:args_to_open = '+' . a:line . ' ' . fnameescape(a:filename)
if l:open_in is# 'tab'
call ale#util#Execute('tabedit ' . l:args_to_open)
elseif l:open_in is# 'horizontal-split'
elseif l:open_in is# 'split'
call ale#util#Execute('split ' . l:args_to_open)
elseif l:open_in is# 'vertical-split'
elseif l:open_in is# 'vsplit'
call ale#util#Execute('vsplit ' . l:args_to_open)
elseif bufnr(a:filename) isnot bufnr('')
" Open another file only if we need to.
@ -336,15 +336,11 @@ function! ale#util#GetMatches(lines, patterns) abort
endfunction
function! s:LoadArgCount(function) abort
let l:Function = a:function
redir => l:output
silent! function Function
redir END
if !exists('l:output')
try
let l:output = execute('function a:function')
catch /E123/
return 0
endif
endtry
let l:match = matchstr(split(l:output, "\n")[0], '\v\([^)]+\)')[1:-2]
let l:arg_list = filter(split(l:match, ', '), 'v:val isnot# ''...''')
@ -480,3 +476,44 @@ endfunction
function! ale#util#Input(message, value) abort
return input(a:message, a:value)
endfunction
function! ale#util#HasBuflineApi() abort
return exists('*deletebufline') && exists('*setbufline')
endfunction
" Sets buffer contents to lines
function! ale#util#SetBufferContents(buffer, lines) abort
let l:has_bufline_api = ale#util#HasBuflineApi()
if !l:has_bufline_api && a:buffer isnot bufnr('')
return
endif
" If the file is in DOS mode, we have to remove carriage returns from
" the ends of lines before calling setline(), or we will see them
" twice.
let l:new_lines = getbufvar(a:buffer, '&fileformat') is# 'dos'
\ ? map(copy(a:lines), 'substitute(v:val, ''\r\+$'', '''', '''')')
\ : a:lines
let l:first_line_to_remove = len(l:new_lines) + 1
" Use a Vim API for setting lines in other buffers, if available.
if l:has_bufline_api
call setbufline(a:buffer, 1, l:new_lines)
call deletebufline(a:buffer, l:first_line_to_remove, '$')
" Fall back on setting lines the old way, for the current buffer.
else
let l:old_line_length = line('$')
if l:old_line_length >= l:first_line_to_remove
let l:save = winsaveview()
silent execute
\ l:first_line_to_remove . ',' . l:old_line_length . 'd_'
call winrestview(l:save)
endif
call setline(1, l:new_lines)
endif
return l:new_lines
endfunction

View File

@ -485,6 +485,7 @@ Notes:
* `vcom`
* `xvhdl`
* Vim
* `vimls`
* `vint`
* Vim help^
* `alex`!!

View File

@ -32,6 +32,25 @@ g:ale_terraform_terraform_executable *g:ale_terraform_terraform_executable*
This variable can be changed to use a different executable for terraform.
===============================================================================
terraform-lsp *ale-terraform-terraform-lsp*
g:ale_terraform_langserver_executable *g:ale_terraform_langserver_executable*
*b:ale_terraform_langserver_executable*
Type: |String|
Default: `'terraform-lsp'`
This variable can be changed to use a different executable for terraform-lsp.
g:ale_terraform_langserver_options *g:ale_terraform_langserver_options*
*b:ale_terraform_langserver_options*
Type: |String|
Default: `''`
This variable can be changed to pass custom CLI flags to terraform-lsp.
===============================================================================
tflint *ale-terraform-tflint*

View File

@ -2,6 +2,61 @@
ALE Vim Integration *ale-vim-options*
===============================================================================
vimls *ale-vim-vimls*
The `vim-language-server` is the engine that powers VimL editor support
using the Language Server Protocol. See the installation instructions:
https://github.com/iamcco/vim-language-server#install
g:ale_vim_vimls_executable *g:ale_vim_vimls_executable*
*b:ale_vim_vimls_executable*
Type: |String|
Default: `'vim-language-server'`
This option can be set to change the executable path for vimls.
g:ale_vim_vimls_config *g:ale_vim_vimls_config*
*b:ale_vim_vimls_config*
Type: |Dictionary|
Default: `{}`
Dictionary containing configuration settings that will be passed to the
language server. For example: >
{
\ 'vim': {
\ 'iskeyword': '@,48-57,_,192-255,-#',
\ 'vimruntime': '',
\ 'runtimepath': '',
\ 'diagnostic': {
\ 'enable': v:true
\ },
\ 'indexes': {
\ 'runtimepath': v:true,
\ 'gap': 100,
\ 'count': 3,
\ 'projectRootPatterns' : ['.git', 'autoload', 'plugin']
\ },
\ 'suggest': {
\ 'fromVimruntime': v:true,
\ 'fromRuntimepath': v:false
\ },
\ }
\}
<
Consult the vim-language-server documentation for more information about
settings.
g:ale_vim_vimls_use_global *g:ale_vim_vimls_use_global*
*b:ale_vim_vimls_use_global*
Type: |Number|
Default: `get(g:, 'ale_use_global_executables', 0)`
See |ale-integrations-local-executables|
===============================================================================
vint *ale-vim-vint*

View File

@ -478,12 +478,9 @@ would like to use. An example here shows the available options for symbols >
ALE supports jumping to the files and locations where symbols are defined
through any enabled LSP linters. The locations ALE will jump to depend on the
information returned by LSP servers. The following commands are supported:
|ALEGoToDefinition| - Open the definition of the symbol under the cursor.
|ALEGoToDefinitionInTab| - The same, but for opening the file in a new tab.
|ALEGoToDefinitionInSplit| - The same, but in a new split.
|ALEGoToDefinitionInVSplit| - The same, but in a new vertical split.
information returned by LSP servers. The |ALEGoToDefinition| command will jump
to the definition of symbols under the cursor. See the documentation for the
command for configuring how the location will be displayed.
ALE will update Vim's |tagstack| automatically unless |g:ale_update_tagstack| is
set to `0`.
@ -493,15 +490,10 @@ set to `0`.
ALE supports jumping to the files and locations where symbols' types are
defined through any enabled LSP linters. The locations ALE will jump to depend
on the information returned by LSP servers. The following commands are
supported:
|ALEGoToTypeDefinition| - Open the definition of the symbol's type under
the cursor.
|ALEGoToTypeDefinitionInTab| - The same, but for opening the file in a new tab.
|ALEGoToTypeDefinitionInSplit| - The same, but in a new split.
|ALEGoToTypeDefinitionInVSplit| - The same, but in a new vertical split.
on the information returned by LSP servers. The |ALEGoToTypeDefinition|
command will jump to the definition of symbols under the cursor. See the
documentation for the command for configuring how the location will be
displayed.
-------------------------------------------------------------------------------
5.4 Find References *ale-find-references*
@ -666,7 +658,7 @@ g:ale_completion_delay *g:ale_completion_delay*
g:ale_completion_enabled *g:ale_completion_enabled*
b:ale_completion_enabled *b:ale_completion_enabled*
*b:ale_completion_enabled*
Type: |Number|
Default: `0`
@ -793,6 +785,16 @@ g:ale_cursor_detail *g:ale_cursor_detail*
loaded for messages to be displayed. See |ale-lint-settings-on-startup|.
g:ale_default_navigation *g:ale_default_navigation*
*b:ale_default_navigation*
Type: |String|
Default: `'buffer'`
The default method for navigating away from the current buffer to another
buffer, such as for |ALEFindReferences:|, or |ALEGoToDefinition|.
g:ale_disable_lsp *g:ale_disable_lsp*
*b:ale_disable_lsp*
@ -845,7 +847,7 @@ g:ale_echo_msg_error_str *g:ale_echo_msg_error_str*
g:ale_echo_msg_format *g:ale_echo_msg_format*
b:ale_echo_msg_format *b:ale_echo_msg_format*
*b:ale_echo_msg_format*
Type: |String|
Default: `'%code: %%s'`
@ -923,6 +925,21 @@ g:ale_enabled *g:ale_enabled*
See |g:ale_pattern_options| for more information on that option.
g:ale_exclude_highlights *g:ale_exclude_highlights*
*b:ale_exclude_highlights*
Type: |List|
Default: `[]`
A list of regular expressions for matching against highlight messages to
remove. For example: >
" Do not highlight messages matching strings like these.
let b:ale_exclude_highlights = ['line too long', 'foo.*bar']
<
See also: |g:ale_set_highlights|
g:ale_fixers *g:ale_fixers*
*b:ale_fixers*
@ -946,7 +963,7 @@ g:ale_fixers *g:ale_fixers*
<
g:ale_fix_on_save *g:ale_fix_on_save*
b:ale_fix_on_save *b:ale_fix_on_save*
*b:ale_fix_on_save*
Type: |Number|
Default: `0`
@ -968,7 +985,7 @@ b:ale_fix_on_save *b:ale_fix_on_save*
g:ale_fix_on_save_ignore *g:ale_fix_on_save_ignore*
b:ale_fix_on_save_ignore *b:ale_fix_on_save_ignore*
*b:ale_fix_on_save_ignore*
Type: |Dictionary| or |List|
Default: `{}`
@ -1344,7 +1361,7 @@ g:ale_list_vertical *g:ale_list_vertical*
g:ale_loclist_msg_format *g:ale_loclist_msg_format*
b:ale_loclist_msg_format *b:ale_loclist_msg_format*
*b:ale_loclist_msg_format*
Type: |String|
Default: `g:ale_echo_msg_format`
@ -1396,7 +1413,7 @@ g:ale_lsp_show_message_severity *g:ale_lsp_show_message_severity*
g:ale_lsp_root *g:ale_lsp_root*
b:ale_lsp_root *b:ale_lsp_root*
*b:ale_lsp_root*
Type: |Dictionary| or |String|
Default: {}
@ -1609,6 +1626,8 @@ g:ale_set_highlights *g:ale_set_highlights*
match highlights, whereas the line highlights when signs are enabled will
run to the edge of the screen.
Highlights can be excluded with the |g:ale_exclude_highlights| option.
g:ale_set_loclist *g:ale_set_loclist*
@ -1875,7 +1894,8 @@ g:ale_virtualtext_cursor *g:ale_virtualtext_cursor*
g:ale_virtualtext_delay *g:ale_virtualtext_delay*
b:ale_virtualtext_delay *b:ale_virtualtext_delay*
*b:ale_virtualtext_delay*
Type: |Number|
Default: `10`
@ -1894,7 +1914,7 @@ g:ale_virtualtext_prefix *g:ale_virtualtext_prefix*
Prefix to be used with |g:ale_virtualtext_cursor|.
g:ale_virtualenv_dir_names *g:ale_virtualenv_dir_names*
b:ale_virtualenv_dir_names *b:ale_virtualenv_dir_names*
*b:ale_virtualenv_dir_names*
Type: |List|
Default: `['.env', '.venv', 'env', 've-py3', 've', 'virtualenv', 'venv']`
@ -1908,7 +1928,7 @@ b:ale_virtualenv_dir_names *b:ale_virtualenv_dir_names*
g:ale_warn_about_trailing_blank_lines *g:ale_warn_about_trailing_blank_lines*
b:ale_warn_about_trailing_blank_lines *b:ale_warn_about_trailing_blank_lines*
*b:ale_warn_about_trailing_blank_lines*
Type: |Number|
Default: `1`
@ -1920,7 +1940,7 @@ b:ale_warn_about_trailing_blank_lines *b:ale_warn_about_trailing_blank_lines*
g:ale_warn_about_trailing_whitespace *g:ale_warn_about_trailing_whitespace*
b:ale_warn_about_trailing_whitespace *b:ale_warn_about_trailing_whitespace*
*b:ale_warn_about_trailing_whitespace*
Type: |Number|
Default: `1`
@ -2603,6 +2623,7 @@ documented in additional help files.
terraform...............................|ale-terraform-options|
terraform-fmt-fixer...................|ale-terraform-fmt-fixer|
terraform.............................|ale-terraform-terraform|
terraform-lsp.........................|ale-terraform-terraform-lsp|
tflint................................|ale-terraform-tflint|
tex.....................................|ale-tex-options|
chktex................................|ale-tex-chktex|
@ -2634,6 +2655,7 @@ documented in additional help files.
vcom..................................|ale-vhdl-vcom|
xvhdl.................................|ale-vhdl-xvhdl|
vim.....................................|ale-vim-options|
vimls.................................|ale-vim-vimls|
vint..................................|ale-vim-vint|
vim help................................|ale-vim-help-options|
write-good............................|ale-vim-help-write-good|
@ -2687,11 +2709,23 @@ ALEFindReferences *ALEFindReferences*
Enter key (`<CR>`) can be used to jump to a referencing location, or the `t`
key can be used to jump to the location in a new tab.
The locations opened in different ways using the following variations.
`:ALEFindReferences -tab` - Open the location in a new tab.
`:ALEFindReferences -split` - Open the location in a horizontal split.
`:ALEFindReferences -vsplit` - Open the location in a vertical split.
The default method used for navigating to a new location can be changed
by modifying |g:ale_default_navigation|.
The selection can be opened again with the |ALERepeatSelection| command.
You can jump back to the position you were at before going to a reference of
something with jump motions like CTRL-O. See |jump-motions|.
A plug mapping `<Plug>(ale_find_references)` is defined for this command.
ALEFix *ALEFix*
Fix problems with the current buffer. See |ale-fix| for more information.
@ -2706,42 +2740,31 @@ ALEFixSuggest *ALEFixSuggest*
See |ale-fix| for more information.
ALEGoToDefinition *ALEGoToDefinition*
ALEGoToDefinition `<options>` *ALEGoToDefinition*
Jump to the definition of a symbol under the cursor using the enabled LSP
linters for the buffer. ALE will jump to a definition if an LSP server
provides a location to jump to. Otherwise, ALE will do nothing.
The locations opened in different ways using the following variations.
`:ALEGoToDefinition -tab` - Open the location in a new tab.
`:ALEGoToDefinition -split` - Open the location in a horizontal split.
`:ALEGoToDefinition -vsplit` - Open the location in a vertical split.
The default method used for navigating to a new location can be changed
by modifying |g:ale_default_navigation|.
You can jump back to the position you were at before going to the definition
of something with jump motions like CTRL-O. See |jump-motions|.
You should consider using the 'hidden' option in combination with this
command. Otherwise, Vim will refuse to leave the buffer you're jumping from
unless you have saved your edits.
A plug mapping `<Plug>(ale_go_to_definition)` is defined for this command.
ALEGoToDefinitionInTab *ALEGoToDefinitionInTab*
The same as |ALEGoToDefinition|, but opens results in a new tab.
A plug mapping `<Plug>(ale_go_to_definition_in_tab)` is defined for this
command.
ALEGoToDefinitionInSplit *ALEGoToDefinitionInSplit*
The same as |ALEGoToDefinition|, but opens results in a new split.
A plug mapping `<Plug>(ale_go_to_definition_in_split)` is defined for this
command.
ALEGoToDefinitionInVSplit *ALEGoToDefinitionInVSplit*
The same as |ALEGoToDefinition|, but opens results in a new vertical split.
A plug mapping `<Plug>(ale_go_to_definition_in_vsplit)` is defined for this
command.
ALEGoToTypeDefinition *ALEGoToTypeDefinition*
This works similar to |ALEGoToDefinition| but instead jumps to the
@ -2749,6 +2772,15 @@ ALEGoToTypeDefinition *ALEGoToTypeDefinition*
definition if an LSP server provides a location to jump to. Otherwise, ALE
will do nothing.
The locations opened in different ways using the following variations.
`:ALEGoToTypeDefinition -tab` - Open the location in a new tab.
`:ALEGoToTypeDefinition -split` - Open the location in a horizontal split.
`:ALEGoToTypeDefinition -vsplit` - Open the location in a vertical split.
The default method used for navigating to a new location can be changed
by modifying |g:ale_default_navigation|.
You can jump back to the position you were at before going to the definition
of something with jump motions like CTRL-O. See |jump-motions|.
@ -2756,31 +2788,6 @@ ALEGoToTypeDefinition *ALEGoToTypeDefinition*
command.
ALEGoToTypeDefinitionInTab *ALEGoToTypeDefinitionInTab*
The same as |ALEGoToTypeDefinition|, but opens results in a new tab.
A plug mapping `<Plug>(ale_go_to_type_definition_in_tab)` is defined for
this command.
ALEGoToTypeDefinitionInSplit *ALEGoToTypeDefinitionInSplit*
The same as |ALEGoToTypeDefinition|, but opens results in a new split.
A plug mapping `<Plug>(ale_go_to_type_definition_in_split)` is defined for
this command.
ALEGoToTypeDefinitionInVSplit *ALEGoToTypeDefinitionInVSplit*
The same as |ALEGoToTypeDefinition|, but opens results in a new vertical
split.
A plug mapping `<Plug>(ale_go_to_type_definition_in_vsplit)` is defined for
this command.
ALEHover *ALEHover*
Print brief information about the symbol under the cursor, taken from any
@ -2806,6 +2813,11 @@ ALERename *ALERename*
The user will be prompted for a new name.
ALERepeatSelection *ALERepeatSelection*
Repeat the last selection displayed in the preview window.
ALESymbolSearch `<query>` *ALESymbolSearch*
Search for symbols in the workspace, taken from any available LSP linters.
@ -3114,7 +3126,6 @@ ale#command#Run(buffer, command, callback, [options]) *ale#command#Run()*
'command': {b -> ale#command#Run(b, 'foo', function('s:GetCommand'))}
<
The following `options` can be provided.
`output_stream` - Either `'stdout'`, `'stderr'`, `'both'`, or `'none`' for

View File

@ -12,5 +12,5 @@ noremap <buffer> A <NOP>
noremap <buffer> o <NOP>
noremap <buffer> O <NOP>
" Keybinds for opening selection items.
noremap <buffer> <CR> :call ale#preview#OpenSelectionInBuffer()<CR>
noremap <buffer> <CR> :call ale#preview#OpenSelection()<CR>
noremap <buffer> t :call ale#preview#OpenSelectionInTab()<CR>

View File

@ -109,6 +109,9 @@ let g:ale_set_signs = get(g:, 'ale_set_signs', has('signs'))
" This flag can be set to 0 to disable setting error highlights.
let g:ale_set_highlights = get(g:, 'ale_set_highlights', has('syntax'))
" This List can be configured to exclude particular highlights.
let g:ale_exclude_highlights = get(g:, 'ale_exclude_highlights', [])
" This flag can be set to 0 to disable echoing when the cursor moves.
let g:ale_echo_cursor = get(g:, 'ale_echo_cursor', 1)
@ -199,16 +202,23 @@ command! -bar -nargs=* -complete=customlist,ale#fix#registry#CompleteFixers ALEF
command! -bar ALEFixSuggest :call ale#fix#registry#Suggest(&filetype)
" Go to definition for tsserver and LSP
command! -bar ALEGoToDefinition :call ale#definition#GoTo({})
command! -bar ALEGoToDefinitionInTab :call ale#definition#GoTo({'open_in': 'tab'})
command! -bar ALEGoToDefinitionInSplit :call ale#definition#GoTo({'open_in': 'horizontal-split'})
command! -bar ALEGoToDefinitionInVSplit :call ale#definition#GoTo({'open_in': 'vertical-split'})
command! -bar -nargs=* ALEGoToDefinition :call ale#definition#GoToCommandHandler('', <f-args>)
" Deprecated commands we have to keep for now.
command! -bar ALEGoToDefinitionInTab :call ale#definition#GoTo({'open_in': 'tab', 'deprecated_command': 'ALEGoToDefinitionInTab'})
command! -bar ALEGoToDefinitionInSplit :call ale#definition#GoTo({'open_in': 'split', 'deprecated_command': 'ALEGoToDefinitionInSplit'})
command! -bar ALEGoToDefinitionInVSplit :call ale#definition#GoTo({'open_in': 'vsplit', 'deprecated_command': 'ALEGoToDefinitionInVSplit'})
" Go to type definition for tsserver and LSP
command! -bar ALEGoToTypeDefinition :call ale#definition#GoToType({})
command! -bar ALEGoToTypeDefinitionInTab :call ale#definition#GoToType({'open_in': 'tab'})
command! -bar ALEGoToTypeDefinitionInSplit :call ale#definition#GoToType({'open_in': 'horizontal-split'})
command! -bar ALEGoToTypeDefinitionInVSplit :call ale#definition#GoToType({'open_in': 'vertical-split'})
command! -bar -nargs=* ALEGoToTypeDefinition :call ale#definition#GoToCommandHandler('type', <f-args>)
" Deprecated commands we have to keep for now.
command! -bar ALEGoToTypeDefinitionInTab :call ale#definition#GoToType({'open_in': 'tab', 'deprecated_command': 'ALEGoToTypeDefinitionInTab'})
command! -bar ALEGoToTypeDefinitionInSplit :call ale#definition#GoToType({'open_in': 'split', 'deprecated_command': 'ALEGoToTypeDefinitionInSplit'})
command! -bar ALEGoToTypeDefinitionInVSplit :call ale#definition#GoToType({'open_in': 'vsplit', 'deprecated_command': 'ALEGoToTypeDefinitionInVSplit'})
" Repeat a previous selection in the preview window
command! -bar ALERepeatSelection :call ale#preview#RepeatSelection()
" Find references for tsserver and LSP
command! -bar -nargs=* ALEFindReferences :call ale#references#Find(<f-args>)
@ -257,18 +267,21 @@ nnoremap <silent> <Plug>(ale_lint) :ALELint<Return>
nnoremap <silent> <Plug>(ale_detail) :ALEDetail<Return>
nnoremap <silent> <Plug>(ale_fix) :ALEFix<Return>
nnoremap <silent> <Plug>(ale_go_to_definition) :ALEGoToDefinition<Return>
nnoremap <silent> <Plug>(ale_go_to_definition_in_tab) :ALEGoToDefinitionInTab<Return>
nnoremap <silent> <Plug>(ale_go_to_definition_in_split) :ALEGoToDefinitionInSplit<Return>
nnoremap <silent> <Plug>(ale_go_to_definition_in_vsplit) :ALEGoToDefinitionInVSplit<Return>
nnoremap <silent> <Plug>(ale_go_to_type_definition) :ALEGoToTypeDefinition<Return>
nnoremap <silent> <Plug>(ale_go_to_type_definition_in_tab) :ALEGoToTypeDefinitionInTab<Return>
nnoremap <silent> <Plug>(ale_go_to_type_definition_in_split) :ALEGoToTypeDefinitionInSplit<Return>
nnoremap <silent> <Plug>(ale_go_to_type_definition_in_vsplit) :ALEGoToTypeDefinitionInVSplit<Return>
nnoremap <silent> <Plug>(ale_find_references) :ALEFindReferences<Return>
nnoremap <silent> <Plug>(ale_hover) :ALEHover<Return>
nnoremap <silent> <Plug>(ale_documentation) :ALEDocumentation<Return>
inoremap <silent> <Plug>(ale_complete) <C-\><C-O>:ALEComplete<Return>
nnoremap <silent> <Plug>(ale_rename) :ALERename<Return>
nnoremap <silent> <Plug>(ale_repeat_selection) :ALERepeatSelection<Return>
" Deprecated <Plug> mappings
nnoremap <silent> <Plug>(ale_go_to_definition_in_tab) :ALEGoToDefinitionInTab<Return>
nnoremap <silent> <Plug>(ale_go_to_definition_in_split) :ALEGoToDefinitionInSplit<Return>
nnoremap <silent> <Plug>(ale_go_to_definition_in_vsplit) :ALEGoToDefinitionInVSplit<Return>
nnoremap <silent> <Plug>(ale_go_to_type_definition_in_tab) :ALEGoToTypeDefinitionInTab<Return>
nnoremap <silent> <Plug>(ale_go_to_type_definition_in_split) :ALEGoToTypeDefinitionInSplit<Return>
nnoremap <silent> <Plug>(ale_go_to_type_definition_in_vsplit) :ALEGoToTypeDefinitionInVSplit<Return>
" Set up autocmd groups now.
call ale#events#Init()

View File

@ -494,6 +494,7 @@ formatting.
* [vcom](https://www.mentor.com/products/fv/questa/)
* [xvhdl](https://www.xilinx.com/products/design-tools/vivado.html)
* Vim
* [vimls](https://github.com/iamcco/vim-language-server)
* [vint](https://github.com/Kuniwak/vint)
* Vim help
* [alex](https://github.com/wooorm/alex) :warning: :floppy_disk:

View File

@ -5,10 +5,14 @@ BufExplorer Plugin for Vim
With bufexplorer, you can quickly and easily switch between buffers by using the one of the default public interfaces:
'\<Leader\>be' (normal open) or
'\<Leader\>bt' (toggle open / close) or
'\<Leader\>bs' (force horizontal split open) or
'\<Leader\>bv' (force vertical split open)
`\<Leader\>be` normal open
`\<Leader\>bt` toggle open / close
`\<Leader\>bs` force horizontal split open
`\<Leader\>bv` force vertical split open
Once the bufexplorer window is open you can use the normal movement keys (hjkl) to move around and then use <Enter> or <Left-Mouse-Click> to select the buffer you would like to open. If you would like to have the selected buffer opened in a new tab, simply press either <Shift-Enter> or 't'. Please note that when opening a buffer in a tab, that if the buffer is already in another tab, bufexplorer can switch to that tab automatically for you if you would like. More about that in the supplied VIM help.

View File

@ -1107,13 +1107,13 @@ c) End the string with a colon ':' followed by a Vim command to execute that
See also: Vim's |++opt| and |+cmd|.
d) Submit two dots '..' to go upward the directory tree by 1 level. To go up
d) Input two dots '..' and then hit the <Enter> key to go upward the directory tree by 1 level. To go up
multiple levels, use one extra dot for each extra level:
>
Raw input Interpreted as
.. ../
... ../../
.... ../../../
..<Cr> ../
...<Cr> ../../
....<Cr> ../../../
<
Note: if the parent directories are large and uncached, this can be slow.

View File

@ -13,7 +13,7 @@ Attention
1. [Read this first](https://github.com/morhetz/gruvbox/wiki/Terminal-specific)
2. Typeface from gallery is [Fantasque Sans Mono](https://github.com/belluzj/fantasque-sans)
3. Typeface from screenshots below is [Fira Mono](http://www.carrois.com/fira-4-1/)
3. Typeface from screenshots below is [Fira Mono](https://mozilla.github.io/Fira/)
Screenshots
-----------

View File

@ -454,6 +454,7 @@ call s:HL('GruvboxYellowSign', s:yellow, s:sign_column, s:invert_signs)
call s:HL('GruvboxBlueSign', s:blue, s:sign_column, s:invert_signs)
call s:HL('GruvboxPurpleSign', s:purple, s:sign_column, s:invert_signs)
call s:HL('GruvboxAquaSign', s:aqua, s:sign_column, s:invert_signs)
call s:HL('GruvboxOrangeSign', s:orange, s:sign_column, s:invert_signs)
" }}}
@ -888,6 +889,30 @@ hi! link NERDTreeToggleOff GruvboxRed
call s:HL('multiple_cursors_cursor', s:none, s:none, s:inverse)
call s:HL('multiple_cursors_visual', s:none, s:bg2)
" }}}
" coc.nvim: {{{
hi! link CocErrorSign GruvboxRedSign
hi! link CocWarningSign GruvboxOrangeSign
hi! link CocInfoSign GruvboxYellowSign
hi! link CocHintSign GruvboxBlueSign
hi! link CocErrorFloat GruvboxRed
hi! link CocWarningFloat GruvboxOrange
hi! link CocInfoFloat GruvboxYellow
hi! link CocHintFloat GruvboxBlue
hi! link CocDiagnosticsError GruvboxRed
hi! link CocDiagnosticsWarning GruvboxOrange
hi! link CocDiagnosticsInfo GruvboxYellow
hi! link CocDiagnosticsHint GruvboxBlue
hi! link CocSelectedText GruvboxRed
hi! link CocCodeLens GruvboxGray
call s:HL('CocErrorHighlight', s:none, s:none, s:undercurl, s:red)
call s:HL('CocWarningHighlight', s:none, s:none, s:undercurl, s:orange)
call s:HL('CocInfoHighlight', s:none, s:none, s:undercurl, s:yellow)
call s:HL('CocHintHighlight', s:none, s:none, s:undercurl, s:blue)
" }}}
" Filetype specific -----------------------------------------------------------

View File

@ -0,0 +1,33 @@
name: CI
on: [push, pull_request]
jobs:
test:
name: Test
runs-on: ubuntu-latest
strategy:
matrix:
vim:
- v8.2.0000
- v8.1.0000
- v8.0.0000
- v7.4
- v7.3
steps:
- name: Checkout code
uses: actions/checkout@master
- name: Checkout vim-themis
uses: actions/checkout@master
with:
repository: thinca/vim-themis
path: vim-themis
- name: Setup Vim
uses: rhysd/action-setup-vim@v1
id: vim
with:
version: ${{ matrix.vim }}
- name: Test
env:
THEMIS_VIM: ${{ steps.vim.outputs.executable }}
run: ./vim-themis/bin/themis --reporter spec

View File

<
@ -1,28 +0,0 @@
language: generic
install:
- git clone --depth=1 https://github.com/thinca/vim-themis /tmp/themis
- (if ! test -d $HOME/vim-$VIM_VERSION/bin; then
git clone https://github.com/vim/vim $HOME/vim &&
cd $HOME/vim &&
git checkout v$VIM_VERSION &&
./configure --prefix=$HOME/vim-$VIM_VERSION &&
make &&
make install;
fi)
cache:
directories:
- $HOME/vim-$VIM_VERSION
env:
- VIM_VERSION=8.2.0000
- VIM_VERSION=8.1.0000
- VIM_VERSION=8.0.0000
- VIM_VERSION=7.4
- VIM_VERSION=7.3
script:
- export PATH=$HOME/vim-$VIM_VERSION/bin:$PATH
- vim --version