From 7d4411589e008027292a1af6fdeadeca69074aa4 Mon Sep 17 00:00:00 2001 From: jdhao Date: Thu, 18 Feb 2021 14:54:11 +0800 Subject: [PATCH] Update vim-grammarous settings Only enable its mapping in a Markdown file. --- core/plugins.vim | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/core/plugins.vim b/core/plugins.vim index 64894b4..ddb6cba 100644 --- a/core/plugins.vim +++ b/core/plugins.vim @@ -733,9 +733,6 @@ endif """"""""""""""""""""""""vim-grammarous settings"""""""""""""""""""""""""""""" if g:is_mac let g:grammarous#languagetool_cmd = 'languagetool' - nmap x (grammarous-close-info-window) - nmap (grammarous-move-to-next-error) - nmap (grammarous-move-to-previous-error) let g:grammarous#disabled_rules = { \ '*' : ['WHITESPACE_RULE', 'EN_QUOTES', 'ARROWS', 'SENTENCE_WHITESPACE', \ 'WORD_CONTAINS_UNDERSCORE', 'COMMA_PARENTHESIS_WHITESPACE', @@ -746,6 +743,13 @@ if g:is_mac \ 'CURRENCY', 'POSSESSIVE_APOSTROPHE', 'ENGLISH_WORD_REPEAT_RULE', \ 'NON_STANDARD_WORD', 'AU', 'DATE_NEW_YEAR'], \ } + + augroup grammarous_map + autocmd! + autocmd FileType markdown nmap x (grammarous-close-info-window) + autocmd FileType markdown nmap (grammarous-move-to-next-error) + autocmd FileType markdown nmap (grammarous-move-to-previous-error) + augroup END endif """"""""""""""""""""""""unicode.vim settings""""""""""""""""""""""""""""""