I am getting the character under the cursor in vimscript the following way:
getline('.')[col('.')-1]
It works exactly like it should, however there is something I dislike. consider this []
the cursor. When there is a bracket next to the cursor like so:
}[]
, ][]
, )[]
or {[]
the cursor actually returns the bracket. What do I have to set so it will always return the character exactly under the cursor or atleast ignore if there is a bracket to it's left?
Note: I suspect that it might have to do with the brackets highlight, though I am not sure.
Note2: for the situation to occur there has to be a matching bracket.
vim -N -u NONE
? I guess a plugin changes the cursor position.:scriptnames
and:autocmd
for suspicious things.