David Woodfall wrote:
Presently I'm using :set tw=N and gq to break lines at N position. But is
there a way to break lines at cursor position?

If there is no easy way perhaps it could made into a function/macro?


To break the line at the cursor, hit the <Enter> key in Insert mode, as with any text editor.

To break _all_ lines of the file at the cursor column (actually, between the cursor column and the previous one), use (untested)

        :exe '1,$s/\%' . virtcol(".") . 'v./\r\0/'

which can be mapped to a key:

        :map <F7> :exe '1,$s/\%' . virtcol(".") . 'v./\r\0/'<CR>


Best regards,
Tony.

Reply via email to