01. How to insert and append in Vim i, a, I, A

Remember that Vim is known as a modal editor, meaning its state depends on what "mode" it's in. When vim starts up, it's in command mode. Command mode is how you navigate, like we are now! Now let's say we want to insert some text. We can change into insert mode using several keys, depending on where we want to insert our cursor: i - before the cursor a - after the cursor I - at the beginning of the line (first non-white space) A - at the end of the line Now we can start inserting things! Let's say this is some cool text block, and you want to insert at the beginning of the line. Simply go to the line, and press "I"! *** Remember to hit the ESC key to return to COMMAND mode! *** // Find the two error in this Java code and fix it x = 0; if (x = 0) System.out.println("I love Vim.") # Or python if you want L = ["vim", "is", "so", "!"] for n in L rint(n) BTW or LOLCODE... HAI 1.2 CAN HAS STDIO? VISIBLE "CAN I LUVS VIM!!!1!" KTHXBYE Solutions: Java: Make the "=" in the parenthesis to make "==" and insert a semicolon at the end using "A;" Python: add a ":" at the end of the for statement, and a "p" in front of "rint" LOLCODE: nothing's wrong with this one -- just wanted to use it as a fun example!

Aching back from coding all day?

Prism Glasses

Aching back from coding all day? Try Back Problems

Ever feel achy from sitting crunched up on your computer table? Try lying down with these optical glasses that allow you to work on your laptop while lying flat on your back. This is the perfect solution with those with limited mobility or those who wish to prevent neck cramps and back strains.

$ Check price
4.454.45Amazon 4 logo(128+ reviews)

More Back Problems resources

Take your Linux skills to the next level!

Linux for Beginners

Take your Linux skills to the next level! Try Linux & UNIX

Linux for Beginners doesn't make any assumptions about your background or knowledge of Linux. You need no prior knowledge to benefit from this book. You will be guided step by step using a logical and systematic approach. As new concepts, commands, or jargon are encountered they are explained in plain language, making it easy for anyone to understand.

$ Check price
24.9924.99Amazon 4.5 logo(101+ reviews)

More Linux & UNIX resources

Ad