I would like to test in an operator-pending mapping whether the cursor is on the last position of the line. I currently have this, but it does not work:
onoremap <expr> i$ col('.') == col('$') ? ':…<CR>' : ':…<CR>'
How can I test whether the cursor is on the last position of the line?
Related to this:
- Where can I find the documentation of these tests?
- How can I quickly test such a condition from the command line?