OESF Portables Forum

General Forums => General Discussion => Topic started by: Nato99 on June 05, 2004, 03:01:03 pm

Title: I need basic vi editor commands
Post by: Nato99 on June 05, 2004, 03:01:03 pm
I\'m trying to get kismet to work on my SL5600 using the instructions on www.timekiller.org/howtos/kismet-5600.html which looks fairly straight forward but this is my first time using any kind of Linux so I don\'t know how to save the script once its typed, how to get out of vi, etc. Just the simple stuff!!

Thanks
Title: I need basic vi editor commands
Post by: Greg2 on June 05, 2004, 04:46:01 pm
How to use VI:
http://www.zaurususergroup.com/modules.php...20to%20use%20VI (http://www.zaurususergroup.com/modules.php?op=modload&name=phpWiki&file=index&pagename=How%20to%20use%20VI)

Character Input:
http://www.zaurususergroup.com/modules.php...put&parent_id=0 (http://www.zaurususergroup.com/modules.php?op=modload&name=FAQ&file=index&myfaq=yes&id_cat=4&categories=Character+Input&parent_id=0)

All of this and more can be found on the ZUG with a Search.

Greg
 
Title: I need basic vi editor commands
Post by: Nato99 on June 05, 2004, 10:21:50 pm
Thanks,  that helps. I\'m new to the site and haven\'t cruised around it too much yet. Is there a complete list of vi commands online?
Title: I need basic vi editor commands
Post by: Joshp on June 05, 2004, 10:36:11 pm
If you have a linux/unix box running you could try
man vi
and that sould give you the manual page for vi.

JP
Title: I need basic vi editor commands
Post by: sriley on June 05, 2004, 10:42:36 pm
Basic vi commands, remove the quotation marks:

\"i\" to go from command mode to insert mode
\"esc\" (or cancel) to get from insert mode to command mode
\":q\" to quit
\":q!\" to quit without saving changes
\":wq\" to write changes and quit

In insert mode, everything you type appears at the cursor.
In command mode you can delete the character at the cursor by typing \"x\" without the quotes.

That should give you basic text editor functionality from vi.

More commands can be found at
 http://www.bris.ac.uk/is/selfhelp/document...vi-r2/vi-r2.htm (http://www.bris.ac.uk/is/selfhelp/documentation/vi-r2/vi-r2.htm)
Title: I need basic vi editor commands
Post by: AsLan^ on June 05, 2004, 11:51:43 pm
Personally, I think vi is not very user friendly or intuitive, might I suggest \"nano\" its the standard text editor for Gentoo linux.

the binary is available from http://pathwayjr.com:8001/jpavel/Software/Zaurus/nano (http://pathwayjr.com:8001/jpavel/Software/Zaurus/nano)

its not an .ipk just a bianry, you can download it and copy it to /usr/bin

you will also need libncurses.so.5

to get that... I personally pulled mine off the .ipk feed but this link *should* work http://nelfer.freeshell.org/zaurus/libncurses5_arm.ipk (http://nelfer.freeshell.org/zaurus/libncurses5_arm.ipk)

that will install libncurses.so in /usr/lib, you will have to \"su\" then chdir to /usr/lib and

ln -s libncurses.so libncurses.so.5

now you can invoke nano with the command \"nano\" and preferably \"nano -w\" to avoid wrapping long lines, important in some text files.

when you\'ve finished editing (just like any regular editor) you can fn-x to exit and it will prompt if you want to save or not, very simple, I like it.
Title: I need basic vi editor commands
Post by: sriley on June 06, 2004, 12:17:59 am
The biggest benefit from having basic editing skills in vi is that virtually every *nix box you run across will have a variant of it.  The same typically can\'t be said of pico, nano, nedit, emacs, etc.  Knowing vi can save lots of time and frustration if you find yourself on a different box.  Just my $.02.
Title: I need basic vi editor commands
Post by: AsLan^ on June 06, 2004, 12:52:08 am
I most certainly agree with you, learning vi is definatley important, I just dont like it
Title: I need basic vi editor commands
Post by: Stubear on June 06, 2004, 08:30:08 am
Quote
If you have a linux/unix box running you could try  
man vi  
and that sould give you the manual page for vi.

JP


Sorry Josh but that\'s evil - telling someone who can\'t use vi to read the vi man page!  :wink:

I\'ve been using linux for 10 years now and I still can\'t fully understand that man page :roll:

Better of searching for vi cheat sheet on google - there are about a dozen versions around, if you have a linux box then look for the tutorial file that is installed (probabl in /usr/shar/doc/vi) that\'s how I learnt my way around vi. I\'m a nano/pico fan myself

Stu
Title: I need basic vi editor commands
Post by: Anonymous on June 06, 2004, 08:42:11 am
I leanrd form the vi man page and trying differnt key combos.  Never could figure out the tutorial.

JP
Title: I need basic vi editor commands
Post by: Joshp on June 06, 2004, 08:43:02 am
That was me.

jp
Title: I need basic vi editor commands
Post by: terrorphile on June 11, 2004, 11:12:09 pm
i figured out just a few
when you first go into vi

\"a\"                            changes it to the edit mode so then you can start typing
\"func + bkspce\"          lets you delete in case you mess up
\"function + .\"              puts you back into command mode there you can save the file with \"wq\" or \"q\" to not save it -and exits

if i knew more i\'d post it

i did find this
http://www.eng.hawaii.edu/Tutor/vi.html (http://www.eng.hawaii.edu/Tutor/vi.html)

hope it helps
Title: I need basic vi editor commands
Post by: freizugheit on June 11, 2004, 11:25:26 pm
This website, http://www.computerhope.com/unix/uvi.htm (http://www.computerhope.com/unix/uvi.htm),  also provides an overview of vi commands with examples
Title: I need basic vi editor commands
Post by: Nato99 on June 18, 2004, 02:33:40 am
Thanks for all the help so far and I have another question.

When following the instruction on www.timekiller.com to create this script:

*********************
Next create a script to launch Kismet.

cd /home/QtPalmTop/bin
vi kis_script.sh

Enter the following:
#!/bin/sh
cardctl scheme CardResume
cardctl scheme qpewlan1 &    # SEE NOTE BELOW
kismet_qt
cardctl scheme CardSuspend
***********************

It won\'t write to this directory ( cd /home/QtPalmTop/bin ). I can write it to other directories but not this specific one. I tried to write it somewhere else and then use the mv and cp command but still no luck.

What am I missing?

Thanks
Nato99

SL5600
Title: I need basic vi editor commands
Post by: Anonymous on June 18, 2004, 05:08:12 pm
I wrote this tutorial on vi for Linux.com\'s First Steps section a long time ago.  Check it out here: http://www.cs.bsu.edu/homepages/gjjones/ad.../12/09.html#a49 (http://www.cs.bsu.edu/homepages/gjjones/administrivia/categories/techToolbox/2003/12/09.html#a49) or http://www.systemtoolbox.com/article.php?a...?articles_id=57 (http://www.systemtoolbox.com/article.php?articles_id=57)
Title: I need basic vi editor commands
Post by: Nato99 on June 26, 2004, 05:46:56 am
One more quick question.
I have the script installed and everything ready to go except this:

Next make kismet_qt run as root

chmod 4755 /usr/bin/kismet_qt


When I type in this command it says "operation not allowed"

What should I be doing?

Thanks
Title: I need basic vi editor commands
Post by: Stubear on June 26, 2004, 09:28:29 am
Are you root when you run this command? Only root can set suid on files.

Stu
Title: I need basic vi editor commands
Post by: Nato99 on June 26, 2004, 05:12:43 pm
You could probably see this questions coming  

How do I make my self root




In a related question...............
Is there a good resource that answer these basic question for us newbies. Either in book form or on the net?
Title: I need basic vi editor commands
Post by: gooseman on July 07, 2004, 12:17:49 pm
The best basic *nix text around  IMHO is "Linux for Dummies" quick reference, YMMV,...and they have a nicely laid out basic  "vi" cheatsheet.  

vi rulez - emacs droolz...LOL...for all the newly minted *nix enthusiasts, the vi versus emacs debate is one of the oldest and dearest flame wars ever.  I suspect it might even be the subject of the first flame war
Title: I need basic vi editor commands
Post by: gooseman on July 07, 2004, 12:26:26 pm
ooops...I mean't UNIX for Dummies...

And this is a basic basic text and not much more than you could get from reading MAN pages, as was suggested before, and in many cases less than the man page.  The O'reilly book Unix in a Nutshell is also decent, and a good second step into the *nix world