1

Due to my muscle memory(aquired from vim-latex and other code compilation, so <F10> is universal compiler for me), I prefer singleshot calculation. I do have given a shot to \ll and then just save to compile, but unfortunate my muscle memory rejects that. So, I have created this map:

autocmd Filetype tex imap <buffer> <f10> <Esc>:w<CR> <plug>(vimtex-compile-ss)<CR><Esc>

Unfortunately, this doesnot open quickfix as \ll does.

Is it possible to open quickfix when there is some error using this map?

I have also tried

autocmd Filetype tex imap <buffer> <f10> <Esc>:w<CR> :VimtexCompileSS<CR><Esc>

with no change.

Disclaimer: VimtexCompileSs or vimtex-compile-ss is a command from vimtex plugin, popular for latex use

2
  • Can't you chain your mapping with :cw? Something like inoremap <buffer> <f10> <Esc>:w<CR> <plug>(vimtex-compile-ss)<CR>:cw<CR>? See :h :cw Open the quickfix window when there are recognized errors. If the window is already open and there are no recognized errors, close the window. Also you should not use an autocomand but a custom ftplugin to create your mapping and your mapping should be not recursive (inoremap instead of imap) but that's not the point of your question :)
    – statox
    Commented Feb 16, 2021 at 15:51
  • 1
    Usually you have to normal <Plug>... or use feedkeys(). You might want inoremap <buffer> <f10> <C-o>:write | VimtexCompileSS | cwindow<CR>. cf. How to debug a mapping
    – D. Ben Knoble
    Commented Feb 16, 2021 at 17:32

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.