Home Accessibility Courses Diary The Mouth Forum Resources Site Map About Us Contact
 
For 2021 - online Python 3 training - see ((here)).

Our plans were to retire in summer 2020 and see the world, but Coronavirus has lead us into a lot of lockdown programming in Python 3 and PHP 7.
We can now offer tailored online training - small groups, real tutors - works really well for groups of 4 to 14 delegates. Anywhere in the world; course language English.

Please ask about private 'maintenance' training for Python 2, Tcl, Perl, PHP, Lua, etc.
Tiny guide to vi basics

Why vi? Because it's available on all Unix and Linux systems and there will be times when you need to navigate and alter files and vi is available and accessible to you when nothing else is.

OPERATING INSTRUCTIONS!

To enter the vi editor, use the vi command followed by the name of the file you want to edit. If the file doesn't exist, it will be created for you before you leave the editor. If it does exist, the current contents will be loaded into the edit buffer for you. When you enter the vi command and press enter, you'll be presented with a screen that shows the first lines of the current file contents.

Stop at this point. The keyboard in front of you has been transformed from a tool you use to enter whole commands, words and sentences into a function keypad. Each time you press a single key, an action will be taken. You're in vi's command mode. Make sure your caps lock key is OFF. Let's try some commands.
 j will move the cursor down 1 line
 k will move the cursor up one line
 h will move the cursor left one character
 l will move the cursor right one character

If you type in a number before you press the letter key, then instead of moving one character, you'll move by the number you entered. Thus 20j will move you down 20 lines. You'll probably find that the direction keys on your keyboard also work in vi, but that doesn't always happen, so learn the letters. Hint: the four letters are in a line on the keyboard, the h that moves left is on the left and the l that moves right is on the right.

You want to delete a character?
 - Move the cursor over it and press "x".
 - To delete six characters, enter "6x".

To insert characters:
 - Move the cursor to the character before the one you want to insert
 - press "i"...this will take you into insert mode
 - type in your extra text; this can even include new line characters.
 - press the "esc" key to return from insert mode to command mode
the "a" key also enters insert mode, but the text is added after the cursor

It's vital that you understand the difference between command mode and insert mode. In insert mode, typing "Graham" will add the word into the edit buffer. In command mode, you'll:
 - Jump the cursor to the last line of the text
 - Replace the first letter on that line with "a"
 - Try to move the cursor one left, which will ring the bell ....

If you forget which mode you're in, press the esc key and you can then be sure that you're in command mode!

That's bare-minimum vi; there are two other commands you'll need to be able to complete any edit, albeit the most basic.

To delete a line, move the cursor onto it and enter "dd".

CAPITAL letter Z twice to save and exit from vi. To save your work and exit from vi, ensure that you're in command mode and enter "ZZ".

COMMAND SUMMARY

The most basic
 a append (add after cursor)
 dd delete current line
 h move cursor left
 i insert (add before cursor)
 j move cursor down
 k move cursor up
 l move cursor right
 x delete a character
 ZZ save (if necessary) and quit
and one more:
 :e![enter] oops, I made a right mess of that. Restart the edit!

Much more you can do - see the manual pages, the thousands of other resources out there on the net


See also Linux introduction

Please note that articles in this section of our web site were current and correct to the best of our ability when published, but by the nature of our business may go out of date quite quickly. The quoting of a price, contract term or any other information in this area of our website is NOT an offer to supply now on those terms - please check back via our main web site

Related Material

Web Application Deployment - Linux -An Introduction For Users
  [73] - ()
  [74] - ()
  [152] - ()
  [249] - ()
  [430] - ()
  [431] - ()
  [593] - ()
  [659] - ()
  [679] - ()
  [703] - ()
  [710] - ()
  [711] - ()
  [749] - ()
  [984] - ()
  [1012] - ()
  [1013] - ()
  [1068] - ()
  [1259] - ()
  [1287] - ()
  [1288] - ()
  [1366] - ()
  [1408] - ()
  [1438] - ()
  [1527] - ()
  [1651] - ()
  [1764] - ()
  [1803] - ()
  [1893] - ()
  [1897] - ()
  [1902] - ()
  [1904] - ()
  [2201] - ()
  [2203] - ()
  [2299] - ()
  [2300] - ()
  [2479] - ()
  [2494] - ()
  [2636] - ()
  [2831] - ()
  [3179] - ()
  [3256] - ()
  [3791] - ()
  [3819] - ()

resource index - Deployment
Solutions centre home page

You'll find shorter technical items at The Horse's Mouth and delegate's questions answered at the Opentalk forum.

At Well House Consultants, we provide training courses on subjects such as Ruby, Lua, Perl, Python, Linux, C, C++, Tcl/Tk, Tomcat, PHP and MySQL. We're asked (and answer) many questions, and answers to those which are of general interest are published in this area of our site.

You can Add a comment or ranking to this page

© WELL HOUSE CONSULTANTS LTD., 2022: Well House Manor • 48 Spa Road • Melksham, Wiltshire • United Kingdom • SN12 7NY
PH: 01144 1225 708225 • FAX: 01144 1225 793803 • EMAIL: info@wellho.net • WEB: http://www.wellho.net • SKYPE: wellho

PAGE: http://www.wellho.net/solutions/general- ... asics.html • PAGE BUILT: Wed Mar 28 07:47:11 2012 • BUILD SYSTEM: wizard