Find the answer to your Linux question:
Results 1 to 4 of 4
I'm trying to alias vi to vim and it works for my one ssh session...but as soon as i close the session and reopen another the alias is lost. Any ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Nov 2005
    Posts
    17

    Alias' being erased


    I'm trying to alias vi to vim and it works for my one ssh session...but as soon as i close the session and reopen another the alias is lost.

    Any ideas how to make the alias permenant?

    Thanks,

    Lewis

  2. #2
    Linux Guru bigtomrodney's Avatar
    Join Date
    Nov 2004
    Location
    Ireland
    Posts
    6,133
    Aliases only last for a login session. To set them permanently for your user you can add the alias line to the .bashrc file in your home directory. To set it for all users you need to modify the /etc/profile script.

  3. #3
    Just Joined!
    Join Date
    Nov 2005
    Posts
    17
    I had a look at the profile on 2 of our machines, one has vi aliased to vim for all users and one doesn't, but the 2 profiles are exactly the same.

    I then tried creating a ".bashrc" file and putting the alias in there, unfortunately this didn't seem to do anything...

    Thanks for the reply, any ideas on these?

    Lewis

  4. #4
    Just Joined!
    Join Date
    May 2006
    Posts
    31
    .bashrc doesn't get read in login shells, you need to source it by hand or in your .bash_profile.
    . bashrc or source .bashrc

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •