Review your favorite Linux distribution.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 07-11-2004, 01:30 AM   #1
Registered: Oct 2002
Distribution: Debian 6.0.2 (squeeze)
Posts: 944

Rep: Reputation: 30
Question Vim and escape key

I was wondering if there is any way to map the esc key functionality in vi/vim to the caps lock key. I assume this (or something similar) is what most people do, since it doesn't seem too efficient to keep moving your whole hand up every time you need to change modes.
Old 07-11-2004, 02:23 AM   #2
LQ Addict
Registered: Jul 2002
Location: East Centra Illinois, USA
Distribution: Debian stable
Posts: 5,908

Rep: Reputation: 354Reputation: 354Reputation: 354Reputation: 354
You could try editing the keymaps in /etc/vimrc to map the esc key to capslock.
Of course, capslock may not work anymore, but that's your call.
Old 07-11-2004, 02:31 AM   #3
Registered: Jun 2004
Location: India
Distribution: CLFS
Posts: 515

Rep: Reputation: 36
To remap the Escape key in Vim,add the following to your .vimrc file:

imap <Ctrl-j> <ESC>
cmap <Ctrl-j> <ESC>
nmap <Ctrl-j> <ESC>
Old 07-11-2004, 12:57 PM   #4
Registered: Oct 2002
Distribution: Debian 6.0.2 (squeeze)
Posts: 944

Original Poster
Rep: Reputation: 30
I'm fine with Caps Lock not working (in vim), although that could probably be mapped back to the Escape key, couldn't it? As far as the imap, cmap, nmap, etc., how does Caps Lock get figured in to those lines? Is there documentation somewhere that explains using .vimrc to change keymappings (I wasn't able to find anything)? Thanks.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting 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 Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Remaping Escape Key frankie_DJ Linux - Newbie 13 09-30-2005 02:07 AM
mapping a key to compile a program in vim dvm Linux - Software 1 01-26-2005 08:56 AM
Mapping Esc to windows key in Vim frankie_DJ Linux - Newbie 2 10-14-2004 03:56 PM
Programming the escape key rthak Programming 4 07-22-2004 04:11 AM
backspace key printing ^? in vim clockworks Linux - General 3 01-23-2004 01:07 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 09:17 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration