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 7860271
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T22:13:15+00:00 2026-06-02T22:13:15+00:00

Is there any way to get a xev -like mode where I can hit

  • 0

Is there any way to get a xev-like mode where I can hit keys and key combos and vim will print out what keys or characters it thinks I’m pressing?

Specific related problem: I have key bindings which work in MacVim and GVim but they don’t work in a terminal-vim, which I use on Linux over SSH inside a screen. I’ve come to the conclusion that the reason is because vim thinks the keys I’m pressing are different from how MacVim interprets them.

In my .vimrc:

map <M-,> :split<CR> " Horizontal split
map <M-.> :vsplit<CR> " Vertical split
map <M-/> :close<CR>

In my vim’s :map (MacVim shows the same):

¯             :close<CR><Space>
®             :vsplit<CR> " Vertical split
¬             :split<CR> " Horizontal split

It works in MacVim and GVim, but doesn’t work in any terminal-based vim. I’ve tried this in multiple terminals (OSX Terminal and Term2, KDE Terminal, Gnome Terminal, etc.). I’ve also witnessed this with other modifiers and key combos. It seems like vim is capturing the keystrokes, but it’s interpreting them as something other than <M-,> for example.

I’d love to have a way to find out what vim thinks I’m pressing so I can write mappings accordingly.

  • 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-06-02T22:13:17+00:00Added an answer on June 2, 2026 at 10:13 pm
    1. i to switch to insert mode.
    2. <C-v>.
    3. <key> or combo.
    4. Vim prints the “raw” value of the key/combo you have pressed.

    Here (Gnome terminal on Ubuntu 11.04), typing i<C-v>, followed by <Alt>, followed by , prints something that looks like ^[, which means “Escape,”. The Alt key (which I believe is what you want to use for <Meta>) is neither recognised as <Meta> nor as <Alt>.

    The immediate conclusion is that CLI Vim doesn’t like <M-> (and many terminal emulators don’t deal very well with it anyway). Some terminal emulators allow you to map the <Alt> key to Meta but it’s not a perfect cross-platform solution (I use <Alt> a lot on Mac OS X to input special characters).

    On this machine,

    nnoremap ^[, :split<CR> " ^[ is <C-v><Esc>
    

    does exactly what I think you want, though.

    If you absolutely want to continue using <M-> shortcuts both in the GUI and in the CLI you’ll need to maintain two separate sets of shortcuts. If you have dozens of custom mappings in your .vimrc, it will quickly become a little hard to manage.

    That’s why I think you should use mappings that work everywhere like:

    :nnoremap <leader>, :split<CR>
    :nnoremap <leader>. :vsplit<CR>
    :nnoremap <leader>/ :close<CR>
    

    The default <leader> key is \ but I have set it to ,.

    Note that you don’t need to use <leader>key, simply mapping ,,, ,. and ,/ works, too.

    See :help <leader>.

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

Sidebar

Related Questions

Is there any way to get all keys from an STL hash_map? Or I
Is there any way to get info like progress from another process? What I'm
Is there any way to get the actual data that will be sent when
Is there any way to get a Google API key for local testing purposes?
Is there any way to get something like the following to work in JavaScript?
Is there any way to get an iPhone's GPS signal strength? I'd like to
Is there any way to get an assembly's version number like we previously used
Is there any way to get NSLog to print out an entire JSON file.
Is There any way to get App info from api key and api secret
Is there any way to get the previous URL in JavaScript? Something like this:

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.