In case I have the following line
// Component: <Component name here> |
where |
is the cursor marker. How can I count, using vimscript, the total number of white spaces before the cursor until the first non space character (>
in this case) ?
The aim is to delete all preceding whitespace before cursor, until non first space character (excluding it).
EDIT: I solved my doubt:
inoremap <silent> <expr> <nowait> <C-Backspace> col('.') == 1 ? "<Backspace>" : getline('.')[col('.') - 2] == ' ' ? "<C-o>diw" : "<C-o>db"