Posts

Showing posts with the label vim

How to Write, Compile and Run a C/C++ Program in Fedora Terminal

Image
In this tutorial we will see how to how to write, compile and run a C or C++ program in fedora terminal itself i.e writing, compiling and execution of the program will be done within the terminal itself. For writing any program we need a console (terminal) based text editor. I 'll be using vim editor, there are many more like nano, jed, emacs... Read more »

How to Comment and Uncomment Multiple Lines in Vim

Image
There are several ways you can comment and uncomment a range of lines in vim editor. Commenting  Method I (easiest) Step 1:  Make sure your are in command mode by pressing Esc key Step2: Move your cusor to the start of the starting line of the block that you want to comment out press Ctrl + v for visual mode and now press the down arrow key to select till the last line you wanna comment. Step 3: Press upper case I (shift + i) and type # or // for commenting depending on the programming language. and finally press Esc key wait a sec and it's done! Read more »

How to Auto Indent a Program: Vim Tips & Tricks

In this tutorial we will see automatic vim editor indentation tips and more. Indentation makes a program readable as well as neat and organised. In python programming language indentation is used instead of curly braces or keywords which make code neat and concise. follow this tutorial and your coding life will become a little easier :) Note : If you haven't used vim before then see some vim basics HERE Automatically Indent a whole program! Let's say you made a 100 line code but didn't care to indent it. Here is how to do it in a very simple way. Read more »

Basic Vim editing for beginners

Image
Vim is a Powerful console-based text editor. It is full of features. But in this tutorial we will only see the basic editing with the vi/vim editor. After going through this you will be able to do most of the essential tasks with vim without spending a lot of time for learning all of vim. Read more »

Vim Commands Cheat Sheet

Image
Vim has been a Unix/Linux programmer's friend since decades, once you get a strong grip on its commands you can do things much faster in a few keystrokes, for example : you need not even use arrow keys to move the cursor instead use ' position by character ' commands which is given in 1st table Here is a list of useful vim commands arranged in groups, helpful for quick reference. Read more »

Writing a C/C++ program on ubuntu terminal

Image
Here is a simple 5 step instruction to compile and execute C/C++ program on the linux terminal. I have also included a sample C/C++ example to demonstrate. In order to write the program in the terminal itself, we need a console  (terminal)  based  text editor so,  I am using Vim in this tutorial since vim is the most popular console text editor, but  you are free to write your program in any editor like nano,  pico, jed  or  vim etc. Now, lets follow the instructions but it would be really helpful if you learn some vim basics here  (won't take much time)  before proceeding to the instructions or its perfectly okay if you are in a hurry :) Read more »