FRIHOST FORUMS SEARCH FAQ TOS BLOGS COMPETITIONS
You are invited to Log in or Register a free Frihost Account!


the vi editor of unix





pollux1er
i need some help with the editor. I'm a new user and i need some help. When i type "vi", the editor runs. But after it is open what am i supposed to type first? for example if i want to tye a text and then save it? Please help me. thanks
Nyizsa
Check this site out! This is good for a start.

PS. You have a very meaningful signature.
Quote:
...Search and find... are cousins!

The above site has just popped up upon a search... Twisted Evil
moskito
ViM (Vi iMproved) is easier to learn. I use VIM 'cause I can't be produtive w/ VI.
jackill
Try vim tutor. It`s the easiest way to learn vim. And maybe this will help U:

Code:
http://www.viemu.com/a_vi_vim_graphical_cheat_sheet_tutorial.html
kany
Yes vi does seem a bit harder in the start but once you get used to it becomes easy but if you want to switch from vi then i would recommend you to use pico.
Studio Madcrow
"vi" is actually pretty easy to use once you get the hang of the idea of "modes". It certainly beats what came before it (ever try "ed" or TECO?).

Basic vi commands:
i - Insert new text
a - Append text to the end
x - delete current characters
arrow keys - move around
w - save
q - quit
wq - save and exit
ESCAPE - leave edit mode to start punching in commands
sarapicoazul
you can also try Emacs
{name here}
I prefer ED a little more, but if you want a real good CL editor, you must try openwatcom vi, which is sort of a 32-bit version of MS-EDIT crossed with vi in some respects with syntax highlighting.
Studio Madcrow
{name here} wrote:
I prefer ED a little more, but if you want a real good CL editor, you must try openwatcom vi, which is sort of a 32-bit version of MS-EDIT crossed with vi in some respects with syntax highlighting.


O.O 'ed'? You mean the crappy character-mode editor that's like 'vi' without a full screen view or the ability to move around in "real-time"??? Or was there some other program called 'ED' on some other system?
{name here}
Studio Madcrow wrote:
{name here} wrote:
I prefer ED a little more, but if you want a real good CL editor, you must try openwatcom vi, which is sort of a 32-bit version of MS-EDIT crossed with vi in some respects with syntax highlighting.


O.O 'ed'? You mean the crappy character-mode editor that's like 'vi' without a full screen view or the ability to move around in "real-time"??? Or was there some other program called 'ED' on some other system?

Yes, ed, the official UNIX text editor is a favorite of mine for simple editing. If I need to do more complex editing I use vim. There was also and ed for CP/M, but it was nearly the same thing.
Studio Madcrow
{name here} wrote:
Studio Madcrow wrote:
{name here} wrote:
I prefer ED a little more, but if you want a real good CL editor, you must try openwatcom vi, which is sort of a 32-bit version of MS-EDIT crossed with vi in some respects with syntax highlighting.


O.O 'ed'? You mean the crappy character-mode editor that's like 'vi' without a full screen view or the ability to move around in "real-time"??? Or was there some other program called 'ED' on some other system?

Yes, ed, the official UNIX text editor is a favorite of mine for simple editing. If I need to do more complex editing I use vim. There was also and ed for CP/M, but it was nearly the same thing.


Strange taste in text editors you have. I prefer to see what I'm working on as I'm working on it. I guess I'm just too young to appreciate character mode editors...
pollux1er
Please help me.

Fisrt, how to log somebody in the machine i am logged without unlog myself. Secondly how to end a session without quit the windows of prompt commands?
pollux1er
Nyizsa wrote:
Check this site out! This is good for a start.

PS. You have a very meaningful signature.
Quote:
...Search and find... are cousins!

The above site has just popped up upon a search... Twisted Evil


Thanks for that link. It's seems to explain well. Surprised
pollux1er
Du you know how I can replace letters in a text edited with vi?
jackill
Press r on letter highlighted by cursor and press r + <new_letter>. Use google Wink
pollux1er
jackill wrote:
Press r on letter highlighted by cursor and press r + <new_letter>. Use google Wink


In my case i want to replace a letter in all the text.
jackill
Oh, so:

Code:
http://www.felixgers.de/teaching/emacs/vi_search_replace.html


Sorryfor previous post Smile Rolling Eyes
simplyw00x
:%s/LETTER1/LETTER2/g

e.g.
:%s/a/b/g

would change

abababab

to

bbbbbb
redice
you may study a bit before run vi. Vi not like M$ notepad, you may at least know how to exit it before you start it Smile
simplyw00x
Quote:
you may study a bit before run vi. Vi not like M$ notepad, you may at least know how to exit it before you start it Smile


A good start is the 'vimtutor'. And, vim does tell you how to exit it if you try and press ^C.
pollux1er
simplyw00x wrote:
:%s/LETTER1/LETTER2/g

e.g.
:%s/a/b/g

would change

abababab

to

bbbbbb


Do you know other options or argument that i can use for that commands? give me other syntax possible..

Thanks in advance.
jsaxon2
There are some tutorials around. Type man vi and that should help.
pollux1er
I have a long text where "$" is typed instead of "es". I need to replace that. I know the siytax to replace characters. it is

%s/old letter/new letter/g For the whole text.

when i type

%s/$/es/g The result i expect is not the one i see. In fact, it is not well replaced.

What should i type?
simplyw00x
$ means end of line in vim. What you want is to escape the $ with \, like so:
Code:
%s/\$/es/g
pollux1er
simplyw00x wrote:
$ means end of line in vim. What you want is to escape the $ with \, like so:
Code:
%s/\$/es/g

Ok, I will try it right now and tell you the result.
tony
vi is so difficult. what is its advantage over nano exactly?
jamie
first vi filename

after this u should type i(insert) for starting typing

after u type to save file esc+:wq Wink
mikebounds
Why use vi - because it is available in every UNIX O/S - other editors such as emacs, nano and vim are not generally available in main stream UNIX's such as AIX, HP-ux and Solaris unless specifically installed.
Although hard to start with, once you get use to it, it is quick and very powerful and the vi commands can also be used for seaching and editing the command shell history too in shells like ksh and bash.
For beginniners it is important to understand that there is a command mode and an insert mode. So when you start vi you are in command mode and you need to type a command first (such as i) to start typing and if you then need to move the cursor, you need to go back into command mode (press <esc>).
There are various guides on the web, but the basics as mostly already mentioned on earlier in this discussion are:
ESCAPE - leaves insert mode and puts you into command mode where a selection of commands that you can use are shown below:
u - undo
i - Insert text
A - Append text to the end of the line
x - delete current character
dd - delete current line
arrow keys - move around (or use h,j,k and l)
:w - save
:q - quit
:q! - quit without saving


I think this is the minumum you need, but of course there is much more and very powerful global subsitution commands.

When starting, inevitably, vi will sometimes insert, delete or change something you didn't intend to and in this case, press <esc> then u and this in most cases undo what you did if you do it soon enough.

Hope this helps

Mike
Related topics
Great php editor
A "small" list of free apps
PHP Editor
MS frontpage or Dreamweaver or NVU?
i need suggestions
What Web Design Software is everyone using?
C++ help
Web Developer
the vi editor of unix
Moving files between Debian and Windows. Locale issues?
KDE - Su returned with an error(linux root error)
Java utilties for VI
Great free photo editor
Advice on switching OS [Windows --> UNIX? Linux?]
Reply to topic    Frihost Forum Index -> Computers -> Operating Systems

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2011 Frihost, forums powered by phpBB.