In vimscript, how can I get the column that the cursor is currently on? I would like to save this value in a variable.
- The first one is to be used most of the time. It doesn't return the actual column number, but the byte index the cursor is on in the current line.
- The second one returns the actual column number
The tricky part is that sometimes a tab (1 byte) expand up to
&ts columns, and a multibyte character have more than 1 byte that expand over only one column.
You'll need to read their documentation to know what you exactly need depending on what you do with that number after.