How to make vim abbreviations not work in comment areas?

I have a list of abbreviations,

iab uppercase UPPERCASE iab lowercase LOWERCASE 

(specific problems).

I am trying to get them to not work in comment areas (i.e., lines that start with a specific character) because they messed up my plain comment text. Does anyone have any ideas how to do this?

+4
source share
1 answer

You will need to check the context. I already wrote some functions to define such abbreviations:

 inoreab uppercase <cr>=MapNoContext('uppercase', 'UPPERCASE')<cr> 
+6
source

Source: https://habr.com/ru/post/1285714/


All Articles