File: ale-info.vim

package info (click to toggle)
vim-ale 4.0.0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 8,764 kB
  • sloc: sh: 499; python: 311; perl: 31; makefile: 4; xml: 4; javascript: 1
file content (22 lines) | stat: -rw-r--r-- 797 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
" 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 .= ' | if exists(''*ALEInfoOpenHelp'') | delfunction ALEInfoOpenHelp | endif'