vim-syntastic / syntastic

Syntax checking hacks for vim
Do What The F*ck You Want To Public License
11.3k stars 1.14k forks source link

Issue with mappings #2337

Closed Brutus11111 closed 3 years ago

Brutus11111 commented 3 years ago

I use a lot of mappings which can give strange results when I have options loaded, but I don't understand why.

set statusline+=%#warningmsg#
set statusline+=%{SyntasticStatuslineFlag()}
set statusline+=%*

let g:syntastic_always_populate_loc_list = 1
let g:syntastic_auto_loc_list = 1
let g:syntastic_check_on_open = 1
let g:syntastic_check_on_wq = 0
let g:syntastic_tex_checkers = ['lacheck', 'text/language_check']

au BufRead,BufNewFile *.tex,*.sty,*.cls set filetype=tex
au FileType tex syntax on

When that is loaded, everything else works fine, but suddenly mappings like the one below don't work anymore:

map <leader>ll a\begin{lstlisting}[language=bash,breaklines]<ESC>a<CR>\end{lstlisting}<CR><ESC>

For some reason, and I don't know why, when the list above is set, leader ll suddenly tries to compile the document I'm working on, instead of inserting text. I don't see anything that intereferes with this. If I disable the options above, it seems to work fine again.

lcd047 commented 3 years ago

Perhaps see :h autocmd-nested?

Anyway, syntastic doesn't define any mappings nor does it change existing ones, and your problem is highly unlikely to be related to it. Unless you can provide conclusive evidence to the contrary, please consider asking this on a general Vim forum instead.