Author Topic: I need basic vi editor commands  (Read 5492 times)

Nato99

  • Newbie
  • *
  • Posts: 16
    • View Profile
    • http://
I need basic vi editor commands
« 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

Greg2

  • Hero Member
  • *****
  • Posts: 790
    • View Profile
    • http://
I need basic vi editor commands
« Reply #1 on: June 05, 2004, 04:46:01 pm »
How to use VI:
http://www.zaurususergroup.com/modules.php...20to%20use%20VI

Character Input:
http://www.zaurususergroup.com/modules.php...put&parent_id=0

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

Greg
 

Nato99

  • Newbie
  • *
  • Posts: 16
    • View Profile
    • http://
I need basic vi editor commands
« Reply #2 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?

Joshp

  • Sr. Member
  • ****
  • Posts: 265
    • View Profile
    • http://
I need basic vi editor commands
« Reply #3 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

sriley

  • Full Member
  • ***
  • Posts: 155
    • View Profile
    • http://
I need basic vi editor commands
« Reply #4 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

AsLan^

  • Newbie
  • *
  • Posts: 45
    • View Profile
    • http://
I need basic vi editor commands
« Reply #5 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

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

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.
doublethink.

sriley

  • Full Member
  • ***
  • Posts: 155
    • View Profile
    • http://
I need basic vi editor commands
« Reply #6 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.

AsLan^

  • Newbie
  • *
  • Posts: 45
    • View Profile
    • http://
I need basic vi editor commands
« Reply #7 on: June 06, 2004, 12:52:08 am »
I most certainly agree with you, learning vi is definatley important, I just dont like it
doublethink.

Stubear

  • Hero Member
  • *****
  • Posts: 1164
    • View Profile
    • http://
I need basic vi editor commands
« Reply #8 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
SL-C1000, Hand converted to English with Japanese Input
Running X apps via X/Qt
iRiver USB host cable; Diatec P-Cord usb power cable (extendable); Acro's Reel Cable USB (A to A, B, Mini-B,  & Mini-B 8pin); GreenHouse 1Gb PicoDrive+; 2x256Mb Hagiwara SD cards; 128Mb Transcend CF card; 512Mb PQI CF card; AmbiCom WL1100C-CF 11B WLAN card

Anonymous

  • Guest
I need basic vi editor commands
« Reply #9 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

Joshp

  • Sr. Member
  • ****
  • Posts: 265
    • View Profile
    • http://
I need basic vi editor commands
« Reply #10 on: June 06, 2004, 08:43:02 am »
That was me.

jp

terrorphile

  • Newbie
  • *
  • Posts: 44
    • View Profile
I need basic vi editor commands
« Reply #11 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

hope it helps

freizugheit

  • Sr. Member
  • ****
  • Posts: 409
    • View Profile
    • http://
I need basic vi editor commands
« Reply #12 on: June 11, 2004, 11:25:26 pm »
This website, http://www.computerhope.com/unix/uvi.htm,  also provides an overview of vi commands with examples

Nato99

  • Newbie
  • *
  • Posts: 16
    • View Profile
    • http://
I need basic vi editor commands
« Reply #13 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

Anonymous

  • Guest
I need basic vi editor commands
« Reply #14 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 or http://www.systemtoolbox.com/article.php?a...?articles_id=57