LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 08-27-2006, 04:19 PM   #1
sadarax
Member
 
Registered: Sep 2005
Distribution: Ubuntu
Posts: 252

Rep: Reputation: 30
Vim map - to _ and the reverse


I am trying to get vim to switch the - and the _ keys. I have got vim to map the - to the _, which is really handy when I am programming. I used

Code:
imap - _
Now, I cannot get it to the reverse, meaning I want to to print a '-' when I would use the key sequence for an '_' (Shift + -). Whatever I map gives me a recursive mapping (which makes sense I guess). Does anyone know how to make this work?
 
Old 08-27-2006, 10:52 PM   #2
Valdis Grinbergs
Member
 
Registered: Dec 2005
Distribution: Debian
Posts: 30

Rep: Reputation: 25
The following will do it:

As you have already done:
imap - _
imap _ -

Type the following two commands as well:

inoremap - _
inoremap _ -
 
  


Reply

Tags
dash, mapping, vim



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
vim map Caps Lock to Escape sadarax Linux - General 3 01-30-2010 01:16 PM
encryption with Vim (vim -x) mikshaw Linux - Software 2 03-07-2007 09:00 AM
LXer: Vim tips: Using Vim mappings and abbreviations LXer Syndicated Linux News 0 06-18-2006 01:54 PM
LXer: Cream for Vim - Making Vim more user friendly LXer Syndicated Linux News 0 06-17-2006 11:54 PM
SYSERR(root): hash map "generics": missing map file /etc/mail/genericstable.db? singying304 Linux - Networking 4 02-28-2005 06:49 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 10:49 AM.

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