Some are more complicated.
First you have to understand that Vim, vi and others like it are "modal" editors, this comes from the fact that they were originally command line and had to have a way to accomodate the lack of a mouse.
So
escape puts you in command mode from there you can issue a command thusly:
Type a colon, then a one of more command sequence of characters.
q for quit
w for write or (save)
e then filename opens a file
so example
escape
:e filename
from command mode there are also commands that you issue with out the colon like 'i' puts you in insert mode and you can edit and add text at will.
then escape
:w enter
saves the file
Start small learn how to edit and save and how to move.
The next thing would be to use distance or amount numbers with a command
yy saves a line
:22,29y
saves lines 22 through 29
p
would print that buffer after the cursor.
dd removes a line but is also like cut and if you issue command p that will print that text after the cursor.
I hope this helps, but it will be worth it. Just take it a step at a time.
--jerry
On Wed, Sep 26, 2012 at 4:47 AM, Deepak adhikari <adhikarideep@gmail.com> wrote:
I am trying to use this editor, searched stackoverflow.com (didn't ask though) went to vim.org but very complex operations are explained and found difficult to grasp.
just trying to know some basic commands like how to start, exit, save/writeout , delete some specific lines. Remove BOM form the utf-8 file(going to the beginning and deleting this bit)
I seem to not find the basic structure of the commands
I could see
"vim [commands] file ..
now in commands I am confused, what if I want to merge two commands together.
Lacking the information on how to load a file in buffer, as it talks a lot about it.
How does it generally operates merging commands, writing out, deleting, combining these commands ,
searching some texts from a file.
yesterday I wanted to use vim, and tried to learn it.
basically what I exactly wanted is>>
remove BOM from utf-8 encoded file, remove 2nd line of the text file which was imported from windows machine.
thought it must be simple to use with such a famous/powerful editor but I am lost in the complexity of its features .... talks about vim, Ex, vi, command line, visual, so many things to see just to get something done.
I would like to know if there are any start up guides, for users who came from nano or some other editors ...
I am not used to editing texts from command line, but now is needed so wanted to learn.
hope some of you will not mind to reply me in more simplified manner .. with some examples ... and in detail ... from starting it to saving it, and exit (of course)
I hope it is not too much to ask.
--
Deepak Adhikari
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
Gerald Klein DBA
Arch Awesome, Ranger & Vim the coding triple threat.
Linux registered user #548580
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
No comments:
Post a Comment