Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

append to end of visible line with wrapped vim

Tags:

vim

I've got a file with some rather long lines, which is a pain.

I'm using :set wrap and :set linebreak, which is nice, and I've rebound a few keys from this page so that I can move up and down a visible line (rather than a physical line which has now been wrapped over 10-12 visible lines).

I use A quite a bit (append at the end of the line), but this appends at the end of the physical line, not the visible - is there a keymapping (or alternative keystroke) I can use to append to the end of the visibly wrapped line?

like image 498
simont Avatar asked Feb 20 '23 12:02

simont


1 Answers

You could try with g$a. g$puts you on the end of the current 'screen line' and a will leave you on insert mode.

Maybe a mapping:

nnoremap <leader>a g$a
like image 80
Raimondi Avatar answered Mar 05 '23 04:03

Raimondi