Vim tips and tricks

Tags
beginners

Login to Reply

 
Thread Tools Search this Thread
# 15  
Old 05-30-2011
This thread is a little old, I hope I dont have to make a new one for this.

On most systems the arrow keys will give you control of the cursor, however when I was first learning my arrow keys just stopped working in vim. I found the solution somewhere and it was just a simple command to run before using vim every day so i added it to my .profile and forgot about it. Now I am miles away from my work computer so have no way to look it up, so if someone knows what I am talking about and can clarify or at least post the command I think that would make a great addition to this thread. I will try to find it and post it here. If no one beats me to it.

As a new user that almost made me want to give up, I couldn't scroll and so for me there was nothing better than cat.
# 16  
Old 09-22-2011
I am a beginner with unix, so may be my question will be very stupid.

I have problem with saving a FORTRAN's code after changing it.
I used the "vim" command to read the code, then use the "SHIFT-I" to insert some new part in the code.
After that I don't know how to save the code.
I tried the command: ":w" but it just write to the code, it can not save the code.
Thanks in advance for helping me.

---------- Post updated at 02:28 AM ---------- Previous update was at 02:02 AM ----------

Could I have another question here?
If I want to copy 19 lines in the fortran code (for example from line 1 to line 19) after using the command "vim" to read the code, what should I do?
Thank so much!
# 17  
Old 09-22-2011
@Phamnu :
What you have to understand is :
when in vi or vim you have 2 main mode :
- insertion mode (when you type your code)
- command mode (when you want to tell vi/vim to do some specific actions, line jump, cursor move ...)
With normal bindings, to switch to command mode, press <ESC>
To switch to insert mode, you can use different command (i : insert where your cursor is, I insert at beginning of the line you are on, o, open a line under which you are, O open line above which you are.


a) <ESC> go to command mode
b) 1G go to first line
c) 19yy yank 19 lines including the line your cursor is on
d) nG go on the nth line under which you want to insert the lines
e) p paste the lines previously yanked.
This User Gave Thanks to ctsgnb For This Post:
phamnu (09-22-2011)
# 18  
Old 11-20-2011
Silly question; are vi and vim one in the same?
# 19  
Old 01-14-2012
Quote:
Originally Posted by illgetit
Silly question; are vi and vim one in the same?

Nope. vi = vi - Wikipedia, the free encyclopedia
vim = http://en.wikipedia.org/wiki/Vim_(text_editor)

vim is of course based on vi but has more features and improvements - like syntax color highlighting. Stands for 'VI iMproved"
# 20  
Old 10-04-2012
I don't have vim editor on my system can anyone suggest where can i find it and how to install it.

I have tried downloading few rpm's packages but it isn't working for me.
# 21  
Old 05-09-2013
Thanks for this post! I've bookmarked this page.
Login to Reply

|
Thread Tools Search this Thread
Search this Thread:
Advanced Search

Similar Threads More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Any tricks on excluding a set of strings from a file? newbie_01 UNIX for Dummies Questions & Answers 3 05-22-2013 03:22 AM
Basic VI tricks cokedude UNIX for Advanced & Expert Users 3 08-05-2011 05:11 PM
tips xerox UNIX for Dummies Questions & Answers 1 02-24-2011 09:01 AM
Very Importan - Vim Settings - Error while opening a File using vim girija Solaris 0 08-13-2010 09:37 AM
Sed Tricks siba.s.nayak UNIX for Dummies Questions & Answers 3 10-20-2009 04:01 AM
Solaris tips and tricks solaris_user Post Here to Contact Site Administrators and Moderators 1 09-24-2009 02:02 PM
need couple of ksh tricks please JamesByars Shell Programming and Scripting 4 02-23-2008 03:07 PM
Set prompt, problems and tricks HybridLogic UNIX for Dummies Questions & Answers 6 09-26-2007 09:05 PM
tar tricks neked UNIX for Advanced & Expert Users 2 08-14-2006 04:14 PM
All times are GMT -4. The time now is 05:02 PM.

Unix & Linux Forums Content Copyright 1993-2018. All Rights Reserved.