Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Mac OS X > remapping command and control keys for Terminal?

remapping command and control keys for Terminal?
Thread Tools
Registered User
Join Date: Oct 2003
Status: Offline
Reply With Quote
Jun 21, 2004, 09:10 PM
 
Is there a way to create my own keyboard layout -- that is, those guys in:
Apple Menu --> System Preferences --> International --> Input Menu

?

What I really need is to simply remap my control (ctrl) and command (cmd or clover) keys for just when I'm using the terminal (yes, for vim), but I'm guessing that if I can create my own keyboard layout with just those 2 keys swapped, that would be doable.
     
johnMG  (op)
Registered User
Join Date: Oct 2003
Status: Offline
Reply With Quote
Jun 21, 2004, 09:34 PM
 
Found some tips here:
http://www.macosxhints.com/article.p...10508131542947
but it looks *way* more complicated than I was hoping for.
     
johnMG  (op)
Registered User
Join Date: Oct 2003
Status: Offline
Reply With Quote
Jun 21, 2004, 10:25 PM
 
Well, guess I didn't even need to make the original post after all. I found a solution. Maybe posting this last comment will help someone else who might have the same problem...

I found a solution. :)

I came across this GPL'd program called DoubleCommand
http://www.macupdate.com/info.php/id/12004
http://doublecommand.sourceforge.net/

It works like a charm for me here on OS X 10.3.4. After installing it,
I created these two text files in my ~/bin directory:

Code:
# source this file (named "for_vim") to use vim (no key remapping) echo "0" > /Library/StartupItems/DoubleCommand/DoubleCommand.pref /Library/StartupItems/DoubleCommand/config.command
and
Code:
# source this file (no_vim) to use the Mac as usual (swap cmd & ctrl keys) echo "288" > /Library/StartupItems/DoubleCommand/DoubleCommand.pref /Library/StartupItems/DoubleCommand/config.command
Now, right before using vim, I just do
Code:
. ~/bin/for_vim
and after exiting vim I go
Code:
. ~/bin/no_vim
Mmm... How sweet it is. :)
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 12:57 PM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2