cancel
Showing results for 
Search instead for 
Did you mean: 

vi: abbreviations in .exrc?

SOLVED
Go to solution
Doug O'Leary
Honored Contributor

vi: abbreviations in .exrc?

Hey;

This one's got me buggered. I have some serious html editing to do (yes, I do my html writing in vi like All Good Admins Should).

On my linux web server, I have a healthy set of abbreviations to make my editing tasks a little easier. I'm trying to put those same abbreviations into ~/.exrc on hpux and it's not picking them up.

I had originally thought that vi wasn't reading the .exrc file, but that proved not to be the case. All of the non-abbreviation commands are functional.

Can someone tell me what's wrong with these abbreviations and/or how to correct the problem?

ab li

  • ab uol
    ab ola

      ab ol1

        ab ols

          ab olc < ol type=circle>
          ab td
          ab tr
          ab utr

          Thanks.

          Doug O'Leary

  • ------
    Senior UNIX Admin
    O'Leary Computers Inc
    linkedin: http://www.linkedin.com/dkoleary
    Resume: http://www.olearycomputers.com/resume.html
    6 REPLIES
    James R. Ferguson
    Acclaimed Contributor

    Re: vi: abbreviations in .exrc?

    Hi Doug:

    I think that abbreviations in 'vi' are really abbreviations in 'vim'. The HP-uX 'vi' editor is 'vi' and not the GNU 'vim'.

    Regards!

    ...JRF...
    Doug O'Leary
    Honored Contributor

    Re: vi: abbreviations in .exrc?

    Hey;

    I was considering the 'vim' idea as well; however, the man page for ex shows an abbreviation command.

    When I make sure the .exrc file is gone and no EXINIT values, starting from a clean environment in other words, I can create an abbreviation thusly:

    :ab ol1


      then, entering ol1 with return or space will break it out the way it's supposed to.

      The abbreviation li seems to be causing the problem:

      :ab li


    1. results in "no recursive mapping"

      I *just* tried LI and that works. Bit of a pain, but better than the alternative. I haven't mapped li to anything. Anyone know how to find out what it is mapped to?

      Thanks.

      Doug

    ------
    Senior UNIX Admin
    O'Leary Computers Inc
    linkedin: http://www.linkedin.com/dkoleary
    Resume: http://www.olearycomputers.com/resume.html
    OldSchool
    Honored Contributor
    Solution

    Re: vi: abbreviations in .exrc?

    i tried your map file on 3 flavors of AIX w/ vi (not vim) an it ran properly.

    ":ab" will display the current map assignments for a session.

    I suspect the issue may be that "li" appears in the substituted command, causing "recurrsion" error message.

    If thats the case, you should have similar issues with "td" and "tr", as the mapped sequence contain the characters that contain the originally mapped characters as well.

    I suppose you could wipe .exrc, run the :ab to insure no mapping is in effect, and add the new definitions and see what happens.
    OldSchool
    Honored Contributor

    Re: vi: abbreviations in .exrc?

    also see ":map", which should be the "command line" macros fo vi.....
    Doug O'Leary
    Honored Contributor

    Re: vi: abbreviations in .exrc?

    Hey;

    I did have problems with tr and td as well so it looks like your theory is correct. Since I hate caps, I changed the abbreviations to lli, ttr, and ttd respectively. Still a pain, but it works.

    Thanks for the replies. I appreciate the insight.

    Doug

    ------
    Senior UNIX Admin
    O'Leary Computers Inc
    linkedin: http://www.linkedin.com/dkoleary
    Resume: http://www.olearycomputers.com/resume.html
    Doug O'Leary
    Honored Contributor

    Re: vi: abbreviations in .exrc?


    updated the abbrevitions as follows:

    ab lli

  • ab ttr
    ab ttd

    You would think vi, of all things, would be standard across platforms

    Thanks again for the replies.

    Doug

  • ------
    Senior UNIX Admin
    O'Leary Computers Inc
    linkedin: http://www.linkedin.com/dkoleary
    Resume: http://www.olearycomputers.com/resume.html