Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to bring up the "Information Window" consistently? #84

Open
llinfeng opened this issue Jan 28, 2020 · 5 comments
Open

How to bring up the "Information Window" consistently? #84

llinfeng opened this issue Jan 28, 2020 · 5 comments

Comments

@llinfeng
Copy link

I have copied the following mappings from ReadMe, but they do not perform consistently

let g:grammarous#hooks = {}
function! g:grammarous#hooks.on_check(errs) abort
    nmap <buffer><C-n> <Plug>(grammarous-move-to-next-error)
    nmap <buffer><C-p> <Plug>(grammarous-move-to-previous-error)
endfunction

function! g:grammarous#hooks.on_reset(errs) abort
    nunmap <buffer><C-n>
    nunmap <buffer><C-p>
endfunction

At times, when I dismiss the following buffer/QuickFix-Window for Grammarmous, it will never come back however I press <C-n> and <C-p>. In the meantime, the cursor does jump accurately, jumping across the reported errors.
image

Namely, I would like to summon the following view "on-demand". I guess this is called the "Information Window"?
image


In an effort to do so, I tried to map out all the known <Plug>(xxx) mappings as the following:

nnoremap <leader>1 <Plug>(grammarous-move-to-info-window)
nnoremap <leader>2 <Plug>(grammarous-open-info-window)
nnoremap <leader>3 <Plug>(grammarous-reset)
nnoremap <leader>4 <Plug>(grammarous-fixit)
nnoremap <leader>5 <Plug>(grammarous-fixall)
nnoremap <leader>6 <Plug>(grammarous-close-info-window)
nnoremap <leader>7 <Plug>(grammarous-remove-error
nnoremap <leader>8 <Plug>(grammarous-disable-rule)

However, none of these leader mappings did anything. Through :Listmaps, I do see all these <leader># mappings have been registered.


Please advise how to map things properly, at least to summon the "Information Window".

@llinfeng
Copy link
Author

Given the <c-n> and <c-p> mappings to navigate the set of suggested typos, I find that entering Insert-mode when the cursor is within the range of the typo will summon the Information Window.

@francozappa
Copy link

I had a similar issue and I guess that for the leader mappings you have to use nmap and not nnoremap

@matze-dd
Copy link
Contributor

Off-topic:
If you use vim-grammarous with LaTeX as in your example, then YaLafi might be of interest. See especially here.

@llinfeng
Copy link
Author

@matze-dd Thanks a lot for pointing to your repo! I have been looking for a parser/filter for LaTeX for a while :) One alternative workflow of spell/grammar checking is to pipe the parsed texts to the clipboard, and feed to the webpages of the other paid services. Shame on all those companies who do not provide an API portal for their paid customers.

Will definitely give YaLafi a try :)

@matze-dd
Copy link
Contributor

@llinfeng Thanks for the emojis! Hopefully, the filter is useful for you.
If all works right, it performs quite reasonable position mapping between LaTeX and plain text.
Unfortunately, its adaptation still requires some command-line usage and Bash scripts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants