Find the answer to your Linux question:
Results 1 to 6 of 6
Dear All, I have installed Vmware on Windows Xp. On Vmware i have installed RHEL 5 update 3. Now when i use vi editor and try to split it into ...
  1. #1
    Just Joined!
    Join Date
    Oct 2008
    Posts
    9

    :sp command is not working in Vi editor

    Dear All,

    I have installed Vmware on Windows Xp. On Vmware i have installed RHEL 5 update 3. Now when i use vi editor and try to split it into multiple windows using :sp or :vsp command then it does not work. Whereas i have the same RHEL 5 update 3 in one of the application server, and there :sp works fine. I tried searching online with no success. please help finding out why its not working on vmware and how can we make it work.

    Please help.

    Regards,
    Raghuvendra Kumar

  2. #2
    Just Joined! binMonkey's Avatar
    Join Date
    Aug 2007
    Posts
    1
    i'm still kind of new, so someone correct me if i'm wrong, please.

    i think :sp and :vsp don't work in vi. they do work in vim. maybe the vi on your application server is soft linked to vim and that's why they work there.

    try soft linking your vi to vim in vmware, or just use vim.

    i hope this helps.

  3. #3
    Just Joined!
    Join Date
    Oct 2008
    Posts
    9
    Yup.

    I have figured out. vi is the minimal version. The advanced version is vim.
    We can see by typing :-
    type vi
    type vim.

    Just removed vi and created a soft-link for vim as vi.

    Thanks for your Help.

    Raghuvendra Kumar

  4. #4
    Trusted Penguin Cabhan's Avatar
    Join Date
    Jan 2005
    Location
    Seattle, WA, USA
    Posts
    3,230
    On many systems, "vi" and "vim" both refer to the same vim program. However, when vim is started as "vi", a script is run to run vim in compatibility mode, which disables many of the more advanced vim features in order to provide as vi-like an experience as possible.

    For that reason, on many systems, using an alias to set the "vi" command to "vim" may be better. That way, vim doesn't think it's running as vi, even on systems where you can't control the "vi" link.
    DISTRO=Arch
    Registered Linux User #388732

  5. #5
    Super Moderator MikeTbob's Avatar
    Join Date
    Apr 2006
    Location
    Texas
    Posts
    7,144
    Quote Originally Posted by Cabhan View Post
    On many systems, "vi" and "vim" both refer to the same vim program. However, when vim is started as "vi", a script is run to run vim in compatibility mode, which disables many of the more advanced vim features in order to provide as vi-like an experience as possible.

    For that reason, on many systems, using an alias to set the "vi" command to "vim" may be better. That way, vim doesn't think it's running as vi, even on systems where you can't control the "vi" link.
    I no longer wonder why a lot of people, including myself, do not use vi or vim.....that's just confusing but thanks for the insight.
    Why would vim want to run in compatibility mode, what's the purpose? isn't it just another editor?
    I do not respond to private messages asking for Linux help, Please keep it on the forums only.
    All new users please read this.** Forum FAQS. ** Adopt an unanswered post.

  6. #6
    Trusted Penguin Cabhan's Avatar
    Join Date
    Jan 2005
    Location
    Seattle, WA, USA
    Posts
    3,230
    The main purpose is that if you have old scripts that ran with vi, they will continue running exactly as expected, and won't be interfered with by new vim options and such.

    However, doing a bit more research into it now, I see that it's actually pretty tough to get compatibility mode . In particular, if you have set any custom vi settings (that is, you have a .vimrc file) and have not explicitly set compatibility mode, you won't get it.

    Also, looking at my system in particular (which is Ubuntu 9.10):
    Code:
    alex@danu:~$ readlink -e /usr/bin/vi
    /usr/bin/vim.basic
    alex@danu:~$ readlink -e /usr/bin/vim
    /usr/bin/vim.basic
    So what I said before may just apply to older systems, and not more modern ones. I apologize.
    DISTRO=Arch
    Registered Linux User #388732

Posting Permissions

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