Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- " Super, thanks for asking!
- " Barry Arthur, Jan 8 2012
- function! Superscript()
- let line = matchlist(strpart(getline('.'), 0, col('.')), '.*\[\(\d\+\)$')
- if len(line) != 0
- let num = line[1]
- return "\<c-w>\<c-w>".join(map(split(num, '\zs'), '"\<c-k>".v:val."S"'), '')
- else
- return ']'
- endif
- endfunction
- inoremap <expr> ] Superscript()
Advertisement
Add Comment
Please, Sign In to add comment