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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T08:49:06+00:00 2026-05-21T08:49:06+00:00

Emacs seems to have all the possible keyboard combinations already randomly distributed among it’s

  • 0

Emacs seems to have all the possible keyboard combinations already randomly distributed among it’s commands. :p

If I am to define new keyboard shortcuts, where should I put them? Which prefixes should I use?

For instance: I want to define shortcuts for the following functions:

  • indent-buffer (C-c i, after I got the answer)
  • comment-or-uncomment-region (C-c C)
  • rdebug (ruby debugger) (C-c R)
  • rsense-complete (ruby autocomplete) (C-c e)

Where would you put these? Why?

  • 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-21T08:49:07+00:00Added an answer on May 21, 2026 at 8:49 am

    Emacs actually has a very definite pattern to its bindings, this answer shows some.

    As far as where you should define keys, if you take a look at the documentation for conventions, you’ll see that C-c a (where a is any lower or upper case character) is reserved for users.

    Plus, if you’re defining a key that really only makes sense in a particular mode, then you should define it in that keymap.

    For example, M-/ is bound to dabbrev-expand, which is a handy way of autocompleting the word you’re typing. It might very well make sense to use rsense-complete instead, but only when you’re in ruby. In which case, you can do this:

    (add-hook 'ruby-mode-hook
         (lambda () (define-key ruby-mode-map (kbd "M-/") 'rsense-complete)))
    

    That will override the binding for M-/ only when you’re in ruby-mode, and leave it unchanged (or available) for the rest of the modes.

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

Sidebar

Related Questions

I have written a function init-set-key-mappings that sets all the global keys in .emacs
I'm relatively new to Emacs, but have been experimenting with it to see if
Emacs seems to save synchronously, i.e. the interface locks up during a save. This
In emacs 24, the order that color themes are applied seems to matter. This
Whenever I edit files on emacs, it seems a temporary file is created with
I've tried putting (setq term-setup-hook 'vip-mode) in my .emacs file but this only seems
Does emacs have support for big numbers that don't fit in integers? If it
I have a .emacs.d directory shared (via git) with branches for various projects and
I have been searching everywhere in the emacs lisp documentation for how to regular
I've been using emacs for all of my text editing needs for the past

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.