In Vim, I want to bind a key which will insert a newline and indent that newline up to the column where the cursor used to be. It's a little strange, so let me illustrate:
Example: before and after, with the cursor at |
Before:
a = str "Hello |World"
After:
a = str "Hello
|World"
This concept is not related to vim's 'copyindent' nor 'preserveindent' settings (these settings concern themsevles with the leading indentation of the previous line, not the column of the cursor).