summaryrefslogtreecommitdiff
path: root/ftplugin
diff options
context:
space:
mode:
authorw0rp <devw0rp@gmail.com>2023-09-06 00:21:58 +0100
committerw0rp <devw0rp@gmail.com>2023-09-06 00:21:58 +0100
commit14350dbb0d265ef87d1c7d420d89fb4165a2b131 (patch)
treeee157f9d69298646b44f3033f6e9ad8745303c74 /ftplugin
parent551fbcfb0905629dcc2afc0db53dcca21994cca3 (diff)
downloadale-14350dbb0d265ef87d1c7d420d89fb4165a2b131.zip
Close #3368 - Supercharge :ALEInfo
Make a series of sweeping changes to make :ALEInfo more useful. 1. Deprecate :ALEInfoToClipboard and support :ALEInfo -clipboard 2. Permit :ALEInfo -clip as a shorthand for :ALEInfo -clipboard 3. Support :ALEInfo -preview to render in the preview window 4. Support :ALEInfo -echo for the classic :ALEInfo mode 5. Change the default mode to 'preview', and make it configurable 6. Add syntax highlighting for ALEInfo in preview mode 7. Add a convenience to look up documentatation that explains itself 8. Don't show an empty 'Linter Variables' section
Diffstat (limited to 'ftplugin')
-rw-r--r--ftplugin/ale-info.vim16
1 files changed, 16 insertions, 0 deletions
diff --git a/ftplugin/ale-info.vim b/ftplugin/ale-info.vim
new file mode 100644
index 00000000..65913a76
--- /dev/null
+++ b/ftplugin/ale-info.vim
@@ -0,0 +1,16 @@
+" 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>