1
0
Fork 0
mirror of synced 2024-11-22 16:55:34 -05:00
ultimate-vim/sources_non_forked/ale/ftplugin/ale-info.vim

23 lines
756 B
VimL
Raw Normal View History

2024-01-07 10:14:20 -05:00
" Close the ALEInfo preview window with the q key.
noremap <buffer> q :q!<CR>
" Explicitly use the default synmaxcol for ale-info.
setlocal synmaxcol=3000
function! ALEInfoOpenHelp() abort
let l:variable = matchstr(getline('.'), '\v[gb]:ale_[a-z0-9_]+')
if !empty(l:variable)
execute('help ' . l:variable)
endif
endfunction
" Press space to open :help for an ALE Variable
nnoremap <buffer> <silent> <space> :call ALEInfoOpenHelp()<CR>
let b:undo_ftplugin = get(b:, 'undo_ftplugin', 'execute')
let b:undo_ftplugin .= ' | setlocal synmaxcol<'
let b:undo_ftplugin .= ' | execute "silent! unmap <buffer> q"'
let b:undo_ftplugin .= ' | execute "silent! nunmap <buffer> <space>"'
let b:undo_ftplugin .= ' | delfunction! ALEInfoOpenHelp'