Let's get directly to it.
I was working with some python code and realized I had written a bunch of elif
blocks as else if
after working too much in Javascript.
My natural thought was "cool, I can make an abbreviation to fix those for me so I don't have to think much about it". Then I realized {lhs} of abbreviations can't contain spaces.
I could of course abbrev elif
to else if
and :iunab
it for python, but I was wondering if there's a way to fix it if I ever do happen to write an else if
in python. I dug through the :h ab
files.
:inoreabbreviate <expr> if f
where f steps back one word and checks if it's an else-if block could work, but I'm wondering if there's any other way that I just don't know of?