mirror of
https://github.com/amix/vimrc
synced 2025-06-16 01:25:00 +08:00
Updated plugins
This commit is contained in:
@ -32,21 +32,12 @@ if !s:has_features
|
||||
finish
|
||||
endif
|
||||
|
||||
" remove in 2.0
|
||||
if has('nvim') && !has('nvim-0.2.0') && !get(g:, 'ale_use_deprecated_neovim')
|
||||
execute 'echom ''ALE support for NeoVim versions below 0.2.0 is deprecated.'''
|
||||
execute 'echom ''Use `let g:ale_use_deprecated_neovim = 1` to silence this warning for now.'''
|
||||
endif
|
||||
|
||||
" This flag can be set to 0 to disable emitting conflict warnings.
|
||||
let g:ale_emit_conflict_warnings = get(g:, 'ale_emit_conflict_warnings', 1)
|
||||
|
||||
if g:ale_emit_conflict_warnings
|
||||
\&& match(&runtimepath, '[/\\]ale[/\\]after') < 0
|
||||
" Add the after directory to the runtimepath
|
||||
" This is only done if the after directory isn't already in runtimepath
|
||||
let &runtimepath .= ',' . expand('<sfile>:p:h:h') . '/after'
|
||||
endif
|
||||
|
||||
" Set this flag so that other plugins can use it, like airline.
|
||||
let g:loaded_ale = 1
|
||||
|
||||
@ -73,9 +64,9 @@ let g:ale_filetype_blacklist = [
|
||||
\]
|
||||
|
||||
" This Dictionary configures which linters are enabled for which languages.
|
||||
call ale#Set('linters', {})
|
||||
let g:ale_linters = get(g:, 'ale_linters', {})
|
||||
" This option can be changed to only enable explicitly selected linters.
|
||||
call ale#Set('linters_explicit', 0)
|
||||
let g:ale_linters_explicit = get(g:, 'ale_linters_explicit', 0)
|
||||
|
||||
" This Dictionary configures which functions will be used for fixing problems.
|
||||
let g:ale_fixers = get(g:, 'ale_fixers', {})
|
||||
@ -106,7 +97,8 @@ let g:ale_lint_on_save = get(g:, 'ale_lint_on_save', 1)
|
||||
" This flag can be set to 1 to enable linting when the filetype is changed.
|
||||
let g:ale_lint_on_filetype_changed = get(g:, 'ale_lint_on_filetype_changed', 1)
|
||||
|
||||
call ale#Set('fix_on_save', 0)
|
||||
" This flag can be set to 1 to enable automatically fixing files on save.
|
||||
let g:ale_fix_on_save = get(g:, 'ale_fix_on_save', 0)
|
||||
|
||||
" This flag may be set to 0 to disable ale. After ale is loaded, :ALEToggle
|
||||
" should be used instead.
|
||||
@ -117,78 +109,26 @@ let g:ale_enabled = get(g:, 'ale_enabled', 1)
|
||||
let g:ale_set_loclist = get(g:, 'ale_set_loclist', 1)
|
||||
let g:ale_set_quickfix = get(g:, 'ale_set_quickfix', 0)
|
||||
|
||||
" This flag dictates if ale open the configured loclist
|
||||
let g:ale_open_list = get(g:, 'ale_open_list', 0)
|
||||
|
||||
" This flag dictates if ale keeps open loclist even if there is no error in loclist
|
||||
let g:ale_keep_list_window_open = get(g:, 'ale_keep_list_window_open', 0)
|
||||
|
||||
" This flag dictates that quickfix windows should be opened vertically
|
||||
let g:ale_list_vertical = get(g:, 'ale_list_vertical', 0)
|
||||
|
||||
" The window size to set for the quickfix and loclist windows
|
||||
call ale#Set('list_window_size', 10)
|
||||
|
||||
" This flag can be set to 0 to disable setting signs.
|
||||
" This is enabled by default only if the 'signs' feature exists.
|
||||
let g:ale_set_signs = get(g:, 'ale_set_signs', has('signs'))
|
||||
" This flag can be set to some integer to control the maximum number of signs
|
||||
" that ALE will set.
|
||||
let g:ale_max_signs = get(g:, 'ale_max_signs', -1)
|
||||
|
||||
" This flag can be set to 1 to enable changing the sign column colors when
|
||||
" there are errors.
|
||||
call ale#Set('change_sign_column_color', 0)
|
||||
|
||||
" This flag can be set to 0 to disable setting error highlights.
|
||||
let g:ale_set_highlights = get(g:, 'ale_set_highlights', has('syntax'))
|
||||
|
||||
" These variables dictate what sign is used to indicate errors and warnings.
|
||||
call ale#Set('sign_error', '>>')
|
||||
call ale#Set('sign_style_error', g:ale_sign_error)
|
||||
call ale#Set('sign_warning', '--')
|
||||
call ale#Set('sign_style_warning', g:ale_sign_warning)
|
||||
call ale#Set('sign_info', g:ale_sign_warning)
|
||||
|
||||
" This variable sets an offset which can be set for sign IDs.
|
||||
" This ID can be changed depending on what IDs are set for other plugins.
|
||||
" The dummy sign will use the ID exactly equal to the offset.
|
||||
let g:ale_sign_offset = get(g:, 'ale_sign_offset', 1000000)
|
||||
|
||||
" This flag can be set to 1 to keep sign gutter always open
|
||||
let g:ale_sign_column_always = get(g:, 'ale_sign_column_always', 0)
|
||||
|
||||
" A string format for the echoed message
|
||||
call ale#Set('echo_msg_format', '%code: %%s')
|
||||
" The same for the loclist.
|
||||
call ale#Set('loclist_msg_format', g:ale_echo_msg_format)
|
||||
|
||||
" Strings used for severity in the echoed message
|
||||
let g:ale_echo_msg_error_str = get(g:, 'ale_echo_msg_error_str', 'Error')
|
||||
let g:ale_echo_msg_info_str = get(g:, 'ale_echo_msg_info_str', 'Info')
|
||||
let g:ale_echo_msg_warning_str = get(g:, 'ale_echo_msg_warning_str', 'Warning')
|
||||
|
||||
" 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)
|
||||
" Controls the milliseconds delay before echoing a message.
|
||||
let g:ale_echo_delay = get(g:, 'ale_echo_delay', 10)
|
||||
|
||||
" This flag can be set to 0 to disable balloon support.
|
||||
call ale#Set('set_balloons', has('balloon_eval'))
|
||||
|
||||
" A deprecated setting for ale#statusline#Status()
|
||||
" See :help ale#statusline#Count() for getting status reports.
|
||||
let g:ale_statusline_format = get(g:, 'ale_statusline_format',
|
||||
\ ['%d error(s)', '%d warning(s)', 'OK']
|
||||
let g:ale_set_balloons = get(g:, 'ale_set_balloons',
|
||||
\ (has('balloon_eval') && has('gui_running'))
|
||||
\ || (has('balloon_eval_term') && !has('gui_running'))
|
||||
\)
|
||||
|
||||
" This flag can be set to 0 to disable warnings for trailing whitespace
|
||||
call ale#Set('warn_about_trailing_whitespace', 1)
|
||||
let g:ale_warn_about_trailing_whitespace = get(g:, 'ale_warn_about_trailing_whitespace', 1)
|
||||
" This flag can be set to 0 to disable warnings for trailing blank lines
|
||||
call ale#Set('warn_about_trailing_blank_lines', 1)
|
||||
|
||||
" A flag for controlling the maximum size of the command history to store.
|
||||
let g:ale_max_buffer_history_size = get(g:, 'ale_max_buffer_history_size', 20)
|
||||
let g:ale_warn_about_trailing_blank_lines = get(g:, 'ale_warn_about_trailing_blank_lines', 1)
|
||||
|
||||
" A flag for enabling or disabling the command history.
|
||||
let g:ale_history_enabled = get(g:, 'ale_history_enabled', 1)
|
||||
@ -196,29 +136,8 @@ let g:ale_history_enabled = get(g:, 'ale_history_enabled', 1)
|
||||
" A flag for storing the full output of commands in the history.
|
||||
let g:ale_history_log_output = get(g:, 'ale_history_log_output', 1)
|
||||
|
||||
" A flag for caching failed executable checks.
|
||||
" This is off by default, because it will cause problems.
|
||||
call ale#Set('cache_executable_check_failures', 0)
|
||||
|
||||
" A dictionary mapping regular expression patterns to arbitrary buffer
|
||||
" variables to be set. Useful for configuration ALE based on filename
|
||||
" patterns.
|
||||
call ale#Set('pattern_options', {})
|
||||
call ale#Set('pattern_options_enabled', !empty(g:ale_pattern_options))
|
||||
|
||||
" A maximum file size for checking for errors.
|
||||
call ale#Set('maximum_file_size', 0)
|
||||
|
||||
" Remapping of linter problems.
|
||||
call ale#Set('type_map', {})
|
||||
|
||||
" Enable automatic completion with LSP servers and tsserver
|
||||
call ale#Set('completion_enabled', 0)
|
||||
call ale#Set('completion_delay', 100)
|
||||
call ale#Set('completion_max_suggestions', 50)
|
||||
|
||||
" A setting for wrapping commands.
|
||||
call ale#Set('command_wrapper', '')
|
||||
let g:ale_completion_enabled = get(g:, 'ale_completion_enabled', 0)
|
||||
|
||||
if g:ale_set_balloons
|
||||
call ale#balloon#Enable()
|
||||
@ -259,9 +178,11 @@ command! -bar ALELint :call ale#Queue(0, 'lint_file')
|
||||
command! -bar ALEInfo :call ale#debugging#Info()
|
||||
" The same, but copy output to your clipboard.
|
||||
command! -bar ALEInfoToClipboard :call ale#debugging#InfoToClipboard()
|
||||
" Copy ALE information to a file.
|
||||
command! -bar -nargs=1 ALEInfoToFile :call ale#debugging#InfoToFile(<f-args>)
|
||||
|
||||
" Fix problems in files.
|
||||
command! -bar ALEFix :call ale#fix#Fix()
|
||||
command! -bar -nargs=* -complete=customlist,ale#fix#registry#CompleteFixers ALEFix :call ale#fix#Fix(bufnr(''), '', <f-args>)
|
||||
" Suggest registered functions to use for fixing problems.
|
||||
command! -bar ALEFixSuggest :call ale#fix#registry#Suggest(&filetype)
|
||||
|
||||
@ -269,6 +190,13 @@ command! -bar ALEFixSuggest :call ale#fix#registry#Suggest(&filetype)
|
||||
command! -bar ALEGoToDefinition :call ale#definition#GoTo({})
|
||||
command! -bar ALEGoToDefinitionInTab :call ale#definition#GoTo({'open_in_tab': 1})
|
||||
|
||||
" Find references for tsserver and LSP
|
||||
command! -bar ALEFindReferences :call ale#references#Find()
|
||||
|
||||
" Get information for the cursor.
|
||||
command! -bar ALEHover :call ale#hover#Show(bufnr(''), getcurpos()[1],
|
||||
\ getcurpos()[2], {})
|
||||
|
||||
" <Plug> mappings for commands
|
||||
nnoremap <silent> <Plug>(ale_previous) :ALEPrevious<Return>
|
||||
nnoremap <silent> <Plug>(ale_previous_wrap) :ALEPreviousWrap<Return>
|
||||
@ -289,9 +217,11 @@ 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_find_references) :ALEFindReferences<Return>
|
||||
nnoremap <silent> <Plug>(ale_hover) :ALEHover<Return>
|
||||
|
||||
" Set up autocmd groups now.
|
||||
call ale#toggle#InitAuGroups()
|
||||
call ale#autocmd#InitAuGroups()
|
||||
|
||||
" Housekeeping
|
||||
|
||||
@ -304,6 +234,7 @@ augroup END
|
||||
|
||||
" Backwards Compatibility
|
||||
|
||||
" remove in 2.0
|
||||
function! ALELint(delay) abort
|
||||
if !get(g:, 'ale_deprecation_ale_lint', 0)
|
||||
execute 'echom ''ALELint() is deprecated, use ale#Queue() instead.'''
|
||||
@ -313,6 +244,7 @@ function! ALELint(delay) abort
|
||||
call ale#Queue(a:delay)
|
||||
endfunction
|
||||
|
||||
" remove in 2.0
|
||||
function! ALEGetStatusLine() abort
|
||||
if !get(g:, 'ale_deprecation_ale_get_status_line', 0)
|
||||
execute 'echom ''ALEGetStatusLine() is deprecated.'''
|
||||
|
Reference in New Issue
Block a user