Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6738549
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T11:22:56+00:00 2026-05-26T11:22:56+00:00

I can map ‘jj’ to imap jj <Esc> and I can even map letters

  • 0

I can map ‘jj’ to

imap jj <Esc>

and I can even map letters to tab navigation

map tj :tabprevious<CR>
map tk :tabnext<CR>

But I can’t map g to page up (even though spacebar acts as page down)

map <Space> <PageDown>
map g <PageUp> 

According to this “When you try to map multiple key sequences, you won’t be able to start them with lower or upper case letters (“Too dangerous to map that”), but the punctuation and control characters are fair game.” Can anyone confirm this?

If so, how does one assign a function to an unmapped key like ‘g’

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T11:22:56+00:00Added an answer on May 26, 2026 at 11:22 am

    (Edit – original answer suggested native Ctrl-f and Ctrl-b, but answer was updated as the goal here is to avoid using Ctrl and Shift)

    A few points to add

    Leaving the issue of choosing the right character to you, assuming we chose X for now.

    I can think of two reasons why map X <PageUp> isn’t working for you.

    1. Your version of vi may not support PageUp/PageDown. If this is the issue then try instead to map to vi’s page jumping (B for back, accompanied by for forward) eg. map X <C-b>.

    2. Another other option is that it doesn’t work ‘as expected’. In vi PageUp/PageDown act on the ‘viewport’ not the cursor. So if you’r looking at the top of the file, but the cursor is not at the top or won’t do anything. PageDown won’t ‘work’ if your cursor is two lines from the bottom either.

      To address this you could combine the ‘move viewport up’ <C-b> and the ‘move cursor to the top of viewport’ H eg. map X <C-b>H (The opposite being map X <C-f>L). Or specifying the number of lines to jump yourself map X 30k (Op. map X 30j).

    Then the issue of choosing the right character to overwrite. Vi has a lot of native commands, so many in fact that only a handful of characters don’t do something natively.
    So if your goal is to avoid RSI, then of course overwrite something. But make sure to overwrite something that isn’t too useful for you personally.

    Natively:
    f searches for a given symbol on the line you are currnetly on (can be very useful, but not critical I guess)
    g on it’s own does nothing, but gg moves cursor to top of file. Choosing g may cause issus as vim (not the original vi) will interpret two quick keypresses as go to top of file instead of do two PageUp’s.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I don't know what's make wrong, my map can load, but the image on
I have image map that can I move, but this map will be so
I can map 1:1 (one-to-one) tables intuitively, like this: But I cannot understand how
I see that I can map a function over mutable arrays with mapArray, but
How I can map a service running on a specific port number to an
I'm writing a lightweight ORM that can map database columns to instance fields with
Is it expected behavior that two encodings can map to the same decoding? I'm
Can Automapper map values from a NameValueCollection onto an object, where target.Foo receives the
How can I map the value of an object collection using fluent mapping? I
Short version: How can I map two columns from table A and B if

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.