[SOLVED] New Ubuntu user, no string under cursor error in cpp file and arrow keys type ABCD instead of moving cursor
Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
New Ubuntu user, no string under cursor error in cpp file and arrow keys type ABCD instead of moving cursor
Hi, I'm brand new first day using Linux through Virtual Box and trying to follow a Youtube tutorial to make a C++ Hello World file. I opened the cpp file in a terminal using "ls" then the "vi first.cpp" commands and now I'm stuck with an error E348: No string under cursor when I try to start the header file with a #. The # won't type. Also I'm finding it frustrating that the arrows will type letters and not move the cursor, so is there a way to fix that?
I'm using Ubuntu.
Just in case you didn't know. vi is a dual mode editor. To actully type code into the file, you need to be in Insert "I" or Append mode "A". For coding I like Bluefish which is a GUI editor. vi is a little bit of a monster and not for novices. People are going to shoot me, but I recommend Free Pascal, especially for novices. It performs almost as well as c and it is easier to grasp the big picture.
Agree with dmchess - this isn't a 'linux' or 'ubuntu' issue, welcome to vi. Personally I like nano instead (and have no interest in the holy war (https://en.wikipedia.org/wiki/Editor_war)), if working from terminal, so instead of 'vi first.cpp' (which is asking the system to open the file 'first.cpp' in vi) you would run 'nano first.cpp.' Graphical IDEs, as dmchess points out, can be a nicer way to do things as well, and probably offer other functionality too.
What can I say about c descended languages. Oh the pointers, the pointers are EVERYWHERE. Arrays you need pointers, passing variables by address you need pointers and eventually a beginning programmer gets lost. Pascal has pointers too, but there they are used only for linked lists and trees and such, you really can't do those without pointers. For most business type apps in Pascal don't require the use of pointers.
Oh I kinda like vi. I forced myself to learn it while coding some awk on a hp tandem unit. Oh My what a beast. It doesn't have vim, but the old vi. I then forced myself to code some basic Pascal programs using vim. Vim is a lot nicer and now I can use it, but I am no vim expert, I just get by.
It's (vi / vim) pretty much guaranteed to be installed as default on almost any variety of *nix, so it's well worth learning the basics just in case.
Personally I always use vi/vim, otoh you don't need to know much to be able to work well with it.
Once you get used to it having 2 modes (command or insert/append) you're good to go.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.