0

I have recently got a copy of Ubuntu 12.04.2(LTS), but unfortunately problem occurs while trying VI editor. I have heard that VIM (VI improved) should be installed in order to use vi in this version. If this is the case then is there any way to install it OFFLINE? Is there any alternate editor that can be used to write shell scripts or C source programs.

5
  • The vi command that ships with Ubuntu is the tiny version of Vim. What "problem" do you have with it? Sep 25, 2013 at 13:57
  • 1
    Also, your question is more about your Ubuntu system environment, not about programming, so it's better addressed at SuperUser. Sep 25, 2013 at 13:58
  • I can execute shell commands there. Can also evoke the vi editor using vi [filename]. But I have problem with the modes in the editor which doesn't work for me. @IngoKarkat
    – rosemary
    Sep 25, 2013 at 14:04
  • 1
    Are you uncomfortable with modal editing in general? Type vimtutor to get an introduction. Or try a more straightforward editor like nano. Sep 25, 2013 at 14:06
  • Just a suggestion if you may. Try gedit instead
    – Arnold
    Sep 25, 2013 at 15:41

3 Answers 3

1

The package for the terminal version of Vim is named vim. You can download it and its dependencies here. You need to at least also install the vim-common and vim-runtime packages.

There's also a GUI version of Vim, the package name is vim-gnome.

2
  • thnks, I also want to know whether it can be done just offline,I mean downloading first,because the machine where ubuntu is installed has no internet connection @Ingo Karkat
    – rosemary
    Sep 25, 2013 at 14:10
  • The download links are at the bottom of the linked page; you can choose between 32-/64-bit versions. The will get you a *.deb file which you can then install with dpkg -i *.deb. Sep 25, 2013 at 14:16
0

I think the vi come with Ubuntu12.04 is vim tiny or something like that which is not fully featured one. You can install it offline, get a deb package for vim and copy it to your machine, use dpkg -i your_deb_package.

2
  • thnxx @john smith , I have to try it,where do I get a deb package? You are right,but some of the modes in the editor doesn't work properly..
    – rosemary
    Sep 25, 2013 at 13:58
  • you may found it here. look for vim gnome. launchpad.net/ubuntu/+source/vim
    – John Smith
    Sep 25, 2013 at 13:59
0

The vi command is available by default on every UNIX-y operating system, including Ubuntu 12.04 LTS.

On Debian-based systems like Ubuntu, vi is not the original vi but a lightweight Vim build that usually lacks a few useful features like clipboard or scripting support.

You are not very clear about the "problem" that "occurs". Without more information, we can't do much more than provide generic advices.

  • If you are really unable to install/update your programs your only solution is to customize your Vim config as well as you could. Run the following command in a terminal emulator:

    $ touch ~/.vimrc
    

    You should now be able to use the vim command with saner defaults. After that, you are on your own for the rest of the learning curve.

  • If you are able to update/install programs, use the Synaptic package manager or apt-get to install the vim-gnome or vim-gtk package which are much more complete than the default build.

    Once the installation is complete, create a ~/.vimrc like above and enjoy the ride.

3
  • I mean to say commands pertaining to the modes like :i, :x aren't working properly.For example,in input mode I can't use backspace to delete some characters, the keys behave abnormally. @romainl
    – rosemary
    Sep 25, 2013 at 14:19
  • Not all version of Ubuntu includes vim/vi. The user has to install it normally in 13.04.
    – Braiam
    Sep 25, 2013 at 15:25
  • @rosemary. The backspace behaviour is default vi behavior. You must do quite a lot of configuration if you want it to behave "normally". Your vim works perfectly: no need to reinstall it!
    – romainl
    Sep 25, 2013 at 16:03

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .