jmacdonald / amp

A complete text editor for your terminal.
https://amp.rs
Other
3.67k stars 105 forks source link

faster way to navigate lines #263

Open KiaraGrouwstra opened 1 year ago

KiaraGrouwstra commented 1 year ago

Is your feature request related to a problem? Please describe. After opening a file, I tend to move the cursor to the part of the file I'm interested in, which may well be down a bit. I'd expect for e.g. PageDown to move the cursor down by a screen, but instead find it to not move the cursor at all.

Describe the solution you'd like Have PageDown move the cursor, or have some other alternative to move the cursor by more than a line.

Describe alternatives you've considered jjjjjjjjjjjjjjjjjjjjjjjjjjjjj

Additional context n/a

makouchyk commented 1 year ago

You can try f. Don't need the cursor to move, when scrolling, as f will place it at the token anyway.

KiaraGrouwstra commented 1 year ago

i feel like for quickly navigating thru a large file without knowing much about its contents or line numbers, f isn't really much faster than j unfortunately :sweat:

makouchyk commented 1 year ago

I meant, you can use f after you've already found a place to edit by scrolling with m and ,. m and , only move you "camera", the cursor stays at it's original position until you move it with f.

pbgc commented 10 months ago

@KiaraGrouwstra as you can read in #158 this is considered a feature and not a problem. I really like how it works! you can browse up or down ... and comeback to where you were! if you don't want to comeback .. you use the f option to choose where exactly you want to stay. If you want to do the pageup pagedown and move the cursor .. you can define a key binding to do it! https://amp.rs/docs/configuration/#key-bindings

Just define something like:

keymap:
  normal:
    ctrl-f:
            - "cursor::move_down"
            - "cursor::move_down"
            - "cursor::move_down"
            - "cursor::move_down"
            - "cursor::move_down"
            - "cursor::move_down"
            - "cursor::move_down"
            - "cursor::move_down"
            - "cursor::move_down"
            - "cursor::move_down"
            - "cursor::move_down"
            - "cursor::move_down"
            - "cursor::move_down"
            - "cursor::move_down"
            - "cursor::move_down"
            - "cursor::move_down"
            - "cursor::move_down"
            - "cursor::move_down"
            - "cursor::move_down"
            - "cursor::move_down"
            - "cursor::move_down"
            - "cursor::move_down"
            - "cursor::move_down"
            - "cursor::move_down"
            - "cursor::move_down"
            - "cursor::move_down"
            - "cursor::move_down"
            - "cursor::move_down"
            - "cursor::move_down"
            - "cursor::move_down"
            - "cursor::move_down"
            - "cursor::move_down"
            - "cursor::move_down"
            - "cursor::move_down"
            - "cursor::move_down"
            - "cursor::move_down"
            - "cursor::move_down"
            - "cursor::move_down"
            - "cursor::move_down"
            - "cursor::move_down"
KiaraGrouwstra commented 10 months ago

@ppgc thanks. here's a version of ~/.config/amp/config.yml i got to based on rebinding pageup/pagedown, tho the number of lines might depend on how many lines your screen can hold:

keymap:
  normal:
    page_up:
      - "cursor::move_up"
      - "cursor::move_up"
      - "cursor::move_up"
      - "cursor::move_up"
      - "cursor::move_up"
      - "cursor::move_up"
      - "cursor::move_up"
      - "cursor::move_up"
      - "cursor::move_up"
      - "cursor::move_up"
      - "cursor::move_up"
      - "cursor::move_up"
      - "cursor::move_up"
      - "cursor::move_up"
      - "cursor::move_up"
      - "cursor::move_up"
      - "cursor::move_up"
      - "cursor::move_up"
      - "cursor::move_up"
      - "cursor::move_up"
      - "cursor::move_up"
      - "cursor::move_up"
      - "cursor::move_up"
      - "cursor::move_up"
      - "cursor::move_up"
      - "cursor::move_up"
      - "cursor::move_up"
    page_down:
      - "cursor::move_down"
      - "cursor::move_down"
      - "cursor::move_down"
      - "cursor::move_down"
      - "cursor::move_down"
      - "cursor::move_down"
      - "cursor::move_down"
      - "cursor::move_down"
      - "cursor::move_down"
      - "cursor::move_down"
      - "cursor::move_down"
      - "cursor::move_down"
      - "cursor::move_down"
      - "cursor::move_down"
      - "cursor::move_down"
      - "cursor::move_down"
      - "cursor::move_down"
      - "cursor::move_down"
      - "cursor::move_down"
      - "cursor::move_down"
      - "cursor::move_down"
      - "cursor::move_down"
      - "cursor::move_down"
      - "cursor::move_down"
      - "cursor::move_down"
      - "cursor::move_down"
      - "cursor::move_down"