Master Vim Editing: Get Help & Tips for Beginners | Ubuntu Download

  • Thread starter Thread starter mesa
  • Start date Start date
Join the discussion
Ask a follow-up here, or get your own question answered by working scientists, mathematicians and engineers — people, not an autocomplete.
Real named experts · corrections over time · the nuance an AI answer skips
5 replies · 1K views
mesa
Gold Member
Messages
694
Reaction score
36
Okay, so I am trying to use C again, but this time it was recommended I try Vim since I was having a lot of trouble with vi (have terrible typing habits that are not conducive to this type of editing software).

I downloaded ubuntu and vim but when I go to the shell and type in vimtutor it comes up with a bunch of errors in the text. For example, "[5,6HVim is a powerful...".

The tutor is full of extra brackets and numbers, plus it wants me to run through the hjkl, which is exactly what I am trying to avoid by switching to vim.

I have tried just jumping into the editor (which has been great!) but can't for the life of me figure out how to compile the code. At this point I am fine with skipping the tutor if someone can tell me how to compile.
 
Physics news on Phys.org
From inside the vi(m) window where you write your c file, hit ESC, then enter :! cc %
! performs a command in the shell, while % is all the text you have been typing (i.e. your whole program).
 
  • Like
Likes   Reactions: jedishrfu
Well, it compiles but code that had no errors with vi is now full of them? Do things compile differently with vim? I thought they were the same.
 
jedishrfu said:
If you're just looking for an editor to use for development then checkout atom at atom.io. Its easily gotten on ubuntu via the apt get command.

(misread OP question and thought he wanted to compile the vim code to get the vimtutor to work, oh well...)

https://github.com/Valloric/YouCompleteMe/wiki/Building-Vim-from-source
How do you install these, "libraries". Assume I no nothing ;)
 
Never mind, got it guys.

Apparently it was a simple matter of using the search and inputting 'ter' followed by clicking on the 'terminal' icon. I had downloaded the vim editor and that just was not necessary with ubuntu which was causing all the issues.

Thank you both for the input. Perhaps things will go smoother in the future, although with most instructions online speaking in 'code' I get the feeling this software will ultimately find its way to the recycling bin ;)