10

All

have file with long data lines, which on screen looks like

1    A0    B0    C0    D0    E0    F0
     A1    B1    C1    D1    E1    F1
     A2    B2    C2    D2    E2    F2
2    G0    H0    I0    J0    K0    L0
     G1    H1    I1    J1    K1    L1
     ....

due to wrapping.

Cursor located at A0. I would like to jump to the end of line #1, so cursor shall be at or after F2. If I press End, I'll be at F0, which is nice to have but not what I would expect.

Is there any good way to jump to the EOL?

Severin Pappadeux
  • 18,636
  • 3
  • 38
  • 64

4 Answers4

18

After some looking around, I've got the answer - single End key will move you to logical EOL, while hitting second End key in succession will move cursor to the physical EOL.

Same for Home key - single to logical, twice to physical

Severin Pappadeux
  • 18,636
  • 3
  • 38
  • 64
  • it’s a little sad that your own answer is the only one on topic^^" but it helped me, thx. – x squared Mar 30 '21 at 10:20
  • Any setting to look for to assign a custom key? Because when you don't have an end key that's kind of a bummer lol – LuckyLuke Skywalker Aug 07 '22 at 14:31
  • 2
    If you're annoyed by the default behavior or want to assign custom key head to `File > Preferences > Keyboard shortcuts` lookup `cursorEnd` (for soft EOL) or `cursorLineEnd` (for physical EOL) and assign whatever. – xpuu Sep 06 '22 at 17:25
  • 1
    @LuckyLukeSkywalker You have to change Keyboard shortcuts. Assign key to 'cursorEnd' function for logical EOL and to 'cursorLineEnd' for physical EOL – Severin Pappadeux Sep 16 '22 at 16:31
1

In vim: $ in command mode takes you to the end of the line. The pipe symbol (|) is also handy for getting you to a specific column number; e.g. 30| gets you to column number 30.

Sebastián Palma
  • 32,692
  • 6
  • 40
  • 59
John Ko
  • 27
  • 1
0

Are you asking how to go to the end of a line in the text editor?

Pressing 'End' will take you to the end of the line that the cursor is on (and 'Home' will take you back to the beginning.)

yitzih
  • 3,018
  • 3
  • 27
  • 44
0

For long data lines VSCode enable Word Wrap. With enabled word wrap:

1    A0    B0    C0    D0    E0    F0
     A1    B1    C1    D1    E1    F1
     A2    B2    C2    D2    E2    F2

Without word wrap:

1    A0 B0 C0 D0 E0 F0 A1 B1 C1 D1 E1 F1 A2 B2 C2 D2 E2 F2

You can toggle this option in View > Toggle Word Wrap

So when you disable word wrap, you can use End key as you want (to the end of line).

semanser
  • 2,310
  • 2
  • 15
  • 33
  • Well, i know about that and it is cumbersome and slow - redrawing forth and back etc. It would be nice if there is a function to unwrap a line (single line!) and wrap it back, then I could write small function doing just that (disable redraw->unwrap->go-to-eol->wrap->enable redraw) and assign it to key – Severin Pappadeux Aug 23 '16 at 02:39
  • To be clear - two lines in that file are ~300K numbers per single line. – Severin Pappadeux Aug 23 '16 at 18:35
  • @SeverinPappadeux May be try this plugin: https://marketplace.visualstudio.com/items?itemName=vscodevim.vim It has a lot of original Vim commands, so I think this http://stackoverflow.com/questions/105721/how-do-i-move-to-end-of-line-in-vim commands will perform correct. – semanser Aug 23 '16 at 18:39