Skip to main content
1 of 4
simzz
  • 510
  • 3
  • 12

Count whitespaces between cursor and preceding non space character

In case I have the following line

// Component: <Component name here>                          $

where $ is the end of line marker (just for explanation purpose), how can I count, using vimscript, the total number of white spaces before the cursor until the first non space character (> in this case) ?

simzz
  • 510
  • 3
  • 12