💾 Archived View for bbs.geminispace.org › s › vim › 13150 captured on 2024-05-26 at 15:48:13. Gemini links have been rewritten to link to archived content

View Raw

More Information

⬅️ Previous capture (2024-05-10)

➡️ Next capture (2024-06-16)

🚧 View Differences

-=-=-=-=-=-=-

Q: Abbreviations, but only at beginning of line

I just wasted an hour searching for a way to create an iabbrev that triggers only at beggining of line.

Say I want to convert a '===' to a '/*====================*/, but if and only if the === was typed at the start of its own line.

Is that even possible?

Posted in: s/vim

🚀 stack [mod]

2023-12-28 · 5 months ago

1 Comment

🐐 satch · Dec 29 at 04:22:

how's this:

:iabbrev <expr> === getline('.')[0:2] == '===' ? '/*====================*/' : '==='