From 94d2fc1815a919734353c942f224db1de4b4fcb8 Mon Sep 17 00:00:00 2001 From: Tom Willemsen Date: Mon, 7 Mar 2011 09:04:49 +0100 Subject: Django, org * Added nxhtml, mostly for django support. * Changed some org settings. --- emacs.d/nxhtml/etc/viper-tut/0intro | 59 ++++++ emacs.d/nxhtml/etc/viper-tut/1basics | 187 +++++++++++++++++++ emacs.d/nxhtml/etc/viper-tut/2moving | 269 +++++++++++++++++++++++++++ emacs.d/nxhtml/etc/viper-tut/3cutpaste | 318 ++++++++++++++++++++++++++++++++ emacs.d/nxhtml/etc/viper-tut/4inserting | 180 ++++++++++++++++++ emacs.d/nxhtml/etc/viper-tut/5tricks | 229 +++++++++++++++++++++++ emacs.d/nxhtml/etc/viper-tut/README | 49 +++++ emacs.d/nxhtml/etc/viper-tut/outline | 131 +++++++++++++ 8 files changed, 1422 insertions(+) create mode 100644 emacs.d/nxhtml/etc/viper-tut/0intro create mode 100644 emacs.d/nxhtml/etc/viper-tut/1basics create mode 100644 emacs.d/nxhtml/etc/viper-tut/2moving create mode 100644 emacs.d/nxhtml/etc/viper-tut/3cutpaste create mode 100644 emacs.d/nxhtml/etc/viper-tut/4inserting create mode 100644 emacs.d/nxhtml/etc/viper-tut/5tricks create mode 100644 emacs.d/nxhtml/etc/viper-tut/README create mode 100644 emacs.d/nxhtml/etc/viper-tut/outline (limited to 'emacs.d/nxhtml/etc/viper-tut') diff --git a/emacs.d/nxhtml/etc/viper-tut/0intro b/emacs.d/nxhtml/etc/viper-tut/0intro new file mode 100644 index 0000000..3a37e33 --- /dev/null +++ b/emacs.d/nxhtml/etc/viper-tut/0intro @@ -0,0 +1,59 @@ +Viper tutorial #0: Introduction + +This Viper tutorial is based on the vi tutorial VILEARN. Some things +works differently in Emacs and corresponding parts of the tutorial has +been changed for this. There has also been added some basic +information about Emacs that are useful to get started if you already +are a vi user. + +This tutorial is a hands-on-tutorial for Viper. If you want more +information about Viper, please read the VIPER-MANUAL. + +Note that if you are using Viper you probably still want to know quite +a bit about Emacs to use Emacs efficiently. Therefore you can also +run the Emacs tutorial from here - with special support for +Viper. This is part 6 below. You should run this part also to get to +know which Emacs standard key bindings are shadowed by Viper. + +The tutorial consists of these parts: + + 0 Introduction + (this file) + + 1 Basic Editing + Covers the handful of commands required to both navigate all + five tutorials and do basic editing. + + 2 Moving Efficiently + Covers all of the cursor positioning commands. These are the + commands used later as arguments to editing commands. + + 3 Cutting and Pasting + Introduces the first compound commands, numbering, and copy + buffers. + + 4 Inserting Techniques + Continues the discussion of compound commands, while completing + the list of insertion commands first discussed in tutorial one. + + 5 Tricks and Timesavers + This is less a tutorial than a description of common vi commands + which don't fit correctly into normal logic. + + 6 Emacs Tutorial for Viper Users + Even Viper users use a lot of keys from Emacs. Therefore you can + run the Emacs tutorial here too. It will show you which keys in + the tutorial that are changed because you are using Viper. This + depends of which Viper state you are in, vi state or some insert + state. If you switch Viper state the tutorial will immediately + show which keys are affected. + + +BUGS +Vilearn has the remark that it "Still doesn't cover variables, ex +commands, or tags. At least one more tutorial is necessary for a +complete introduction to vi." - I do not think you have to learn those +parts to use Viper. There are other ways to do these things in Emacs! + +For more information about vilearn see the the README-FILE. + diff --git a/emacs.d/nxhtml/etc/viper-tut/1basics b/emacs.d/nxhtml/etc/viper-tut/1basics new file mode 100644 index 0000000..aea1fc5 --- /dev/null +++ b/emacs.d/nxhtml/etc/viper-tut/1basics @@ -0,0 +1,187 @@ +Viper tutorial #1: The Basics + +This lesson lasts 10-15 minutes and teaches simple editing. Lines +which begin with >>> mark exercises you should try. When you +want to exit this tutorial type 'Z''Z' (type capital Z, twice). + +When you type commands in vi they do not appear on the screen. If the +letters you type unexpectedly appear on the screen, press the ESC key. + + +BASIC CURSOR MOVEMENT +--------------------- +To move through the tutorial use C-d (control d) and C-u (control u). + + C-d Move DOWN one half-screen + (depress the control key and type d) + + C-u Move UP one half-screen + (depress the control key and type u) + +* EMACS-NOTICE: C-u is normally used in Emacs for UNIVERSAL-ARGUMENT. + You can in most cases use DIGIT-ARGUMENT instead. + +>>> Now type C-d (control d) and C-u (control u) to move down and back up. + +When you are done reading a screen, you are expected to type C-d to move +down to the next screen. You must remember to type C-d throughout the +tutorial. + +To move the cursor line by line, or character by character, use the +four keys 'h', 'j', 'k', and 'l'. + + 'h' Move left one character + 'j' Move down one line + 'k' Move up one line + 'l' Move right one character + +You will notice that these keys are in a straight line on the +keyboard. Study the diagram below showing the function of h, j, k, l. + + UP + ....... ....... ....... ....... + : : : : : : : : + LEFT : h : : j : : k : : l : RIGHT + :.....: :.....: :.....: :.....: + + DOWN + +>>> Now type 'j' or 'k' a few times to bring the cursor to this line. + +>>> Try moving off the right end of a line using 'l' . Notice that +>>> vi will not allow you to move off the end of the line using 'l' . +>>> Likewise, you cannot use 'h' and 'l' on a blank line. + +>>> Try moving past the bottom of the screen using 'j' . Notice how +>>> how the screen scrolls downward. + +>>> Now practice using 'k' to move up, and 'h' to move left. + + +DELETION +-------- +To delete characters and lines, use 'x' and 'd''d'. + + 'x' X-OUT one character + 'd''d' DELETE one line + +To undo your changes, use 'u'. + + 'u' UNDO last change only + +>>> Delete this SCRAP line. Move to this line with 'j' or 'k' , now type 'd''d' . +>>> Try undoing the deletion with 'u' . + +>>> Move to this line and x-out the Y's with 'x' : "whY ask whY?" + +>>> Try undoing the deletion with 'u' . Try typing 'u' several times. +>>> Notice that 'u' only undoes the last change. + +* EMACS-NOTICE: In Viper you can use the repeat command '.' (just a dot) + to undo more changes. This goes in both direction, ie undoing and + redoing. Typing just 'u' changes direction. + +Here are more lines on which to practice deleting and undoing (use: 'd''d' 'x' 'u' ) + + Emacs is a nice creation. Emacs is a nice creation. + Emacs is a nice creation. Emacs is a nice creation. + Emacs is a nice creation. Emacs is a nice creation. + + +QUIT COMMANDS +------------- +(DO NOT QUIT the tutorial at this time.) + +To quit a file without saving any changes you have made (for instance, +with the 'd''d' or 'x' commands) use :q! . To quit and save your +changes, use 'Z''Z' . When you are editing your own files, you normally +use 'Z''Z' to quit. + + :q! QUIT without saving changes + (type a colon, then the letter q, then an + exclamation point, and press RETURN) + + 'Z''Z' Exit and save any changes + (type capital Z, twice) + + + +INSERTION +--------- +You enter insert mode with 'i' or 'o' . Anything you type during insert +mode appears on the screen. When you are done inserting, press ESC +to exit insert mode. Type C-[ (control [ ), if you do not have an ESC key. + + 'o' OPEN a line for inserting text + 'i' INSERT starting at the cursor + + ESC ESCAPE from insert mode + +During insert mode, use your erase character (usually backspace or +delete) to delete mistakes. The characters you delete will remain on +the screen until you press ESC. + +>>> Insert your name and phone number below the next blank line. To do this: +>>> Open a line below using 'o' . +>>> Type your first and last name. Press RETURN. +>>> Then type your phone number and press ESC. +>>> Use 'x' to erase part of your phone number. + +>>> Type the date below your phone number. To do this: +>>> Open another line using 'o' . +>>> Type the date and press ESC. + +>>> Type 'u' to undo the insertion. + +>>> Insert a nickname between your first and last names, using 'i'. To do this: +>>> Move the cursor to the spot between your names using 'h', 'j', 'k', 'l'. +>>> Press 'i' . +>>> Type the nickname, use DELETE or BACKSPACE to erase any typos. +>>> Then press ESC. + +On some computers, a line may be longer than the width of the screen. +This means that a very long line may appear to be two lines on the +screen. This happens when you keep typing without pressing RETURN at +the edge of the screen. To avoid any confusion when you're inserting +text, be sure to press RETURN before reaching the right edge of the +screen. + + +SUMMARY +------- +These are the vi commands you should know after tutorial #1: + + C-d Move DOWN one half-screen + (depress the control key and type d) + + C-u Move UP one half-screen + (depress the control key and type u) + + 'h' Move left one character + 'j' Move down one line + 'k' Move up one line + 'l' Move right one character + + 'd''d' DELETE one line + 'x' X-OUT one character + + 'u' UNDO last change + + :q! QUIT without saving changes + (type a colon, then the letter q, then an + exclamation point, and press RETURN) + + 'Z''Z' Exit and save any changes + (type capital Z, twice) + + 'o' OPEN a line for inserting text + 'i' INSERT starting at the cursor + + ESC ESCAPE from insert mode + + +You are now prepared to do simple editing on your own files. Practice +using vi for a few days. Then take the second vi tutorial to learn +more powerful and useful vi commands. + +Copyright (c) 1992 Jill Kliger and Wesley Craig. All Rights Reserved. diff --git a/emacs.d/nxhtml/etc/viper-tut/2moving b/emacs.d/nxhtml/etc/viper-tut/2moving new file mode 100644 index 0000000..8e4148e --- /dev/null +++ b/emacs.d/nxhtml/etc/viper-tut/2moving @@ -0,0 +1,269 @@ +Viper tutorial #2: Moving Through Files Efficiently + +This lesson lasts 15-20 minutes. The material taught here is used in +tutorial #3: Cutting and Pasting. Lines which begin with >>> mark +exercises you should try. When you want to exit this tutorial type 'Z''Z'. + + +WORDS +----- +There are many ways to move from one word to another. Consider these: + + 'w' Move to the beginning of the next WORD + 'e' Move to the END of the next word + 'b' Move BACK to the beginning to the previous word + +For 'w', 'e', and 'b', a word is delimited by any non-alphanumeric +character. The capitalized versions, 'W', 'E', and 'B', also move from word +to word. The difference is that for 'W', 'E', and 'B', a word is delimited +by any blank space. + +>>> Try out 'w', 'b', 'e', on the lines provided below. +>>> Next practice using 'B', 'W', 'b', 'E' on the lines provided below. + + EX-PER-IMENT on these lines;test moving back &forth. + EX-PER-IMENT on these lines;test moving back &forth. + + +ON THE LINE +----------- +You can move immediately to any point on the current line. + + '$' Move to the end of the line + '^' Move to the first non-white character on the line + + '0' Move to the first column on the line (column zero) + #'|' Move to an exact column on the line (column #) e.g. 5| 12| + +>>> Experiment with '$' and '^' on the line provided below. Notice +>>> that '^' moves to the first non-white character, not the beginning. + + This is a PRACTICE LINE. There is white space at the front. END + +'0' (zero) will always take you to the far left edge of the screen. + +#'|' (number vertical-bar) is for moving to an explicit column on a line. +Just type any number 1-80 and press | . For example: 5| 20| 30| +Note that you can't move beyond the last column on a line. + + +FINDING CHARACTERS +------------------ +Often you want to move to a specific letter or character on a line. + + 'f' char FIND the next occurrence of char on the line + 't' char Move 'TIL the next occurrence of char on the line + + 'F' char FIND the previous occurrence of char on the line + 'T' char Move 'TIL the previous occurrence of char on the line + + ';' Repeat the last f, t, F, or T + ',' Reverse the last f, t, F, or T + +'f' and 'F' land on the character. 't' and 'T' land next to the character. +'f' and 't' move forward, while 'F' and 'T' move backward. + +If the specified character is not on the line, vi will beep. + +>>> Move to the beginning of the line below, and try out these commands: +>>> 'f'e 'f'E ';' ';' ',' ',' 't'@ 'T'P 't'e 't'E ',' ';' ',' ';' + + "PRACTICE line?" "Each and Every?" "Find thE char@cter and move to it.END + + +MATCHING +-------- +vi has a handy way to determine if (), {}, and [] pairs match up. + + '%' Move to matching () or {} or [] + +>>> On the practice lines below, move your cursor over a (,),{,},[, or ]. +>>> Then type '%' . + + [TRY THIS. ((Whether) the pairs match up is the question.) [One] + pair is incomplete]. Can you tell {which one? ]} END + + +WINDOW POSITIONS +---------------- +You can move the cursor to the top, middle, or bottom of the vi window. + + 'H' Move to the HIGHEST position in the window + 'M' Move to the MIDDLE position in the window + 'L' Move to the LOWEST position in the window + +>>> Try out these commands: type H then M and L and then M again. + + +MARKING LOCATIONS +----------------- +You can mark positions in the file and return to them. + + 'm' char MARK this location and name it char + ''' char (quote character) return to line named char + '''''' (quote quote) return from last movement + +char can be any lower case letter, a-z. A mark persists until you: + 1) use the same char to mark another location + or 2) delete the marked line + +>>> Move to this line and type ma to mark it a +>>> Move to this line and type mb to mark it b +>>> Move to this line and type mz to mark it z +>>> Type 'a to return to line a +>>> Type 'b to return to line b +>>> Type 'z to return to line z + +Certain commands can move you large distances. These commands cause +your last position to be remembered in the special mark named ' (quote). +To move to this special mark, just type '' (quote quote). + +>>> Try this: 'b to return to line b, and then '' to return here. + + +GO TO A LINE +------------ + + 'G' GO to the last line in the file + #'G' GO to line #. (e.g., 3G , 5G , 124G ) + +Read these directions carefully: +>>> Type '1''G' to go to the top of the file, and then '''''' (quote quote) +>>> to return here. +>>> Now try 'G' to go to the end of the file, and then '''''' to return here. + + +BLOCKS OF TEXT +-------------- +It is often convenient to move through files jumping from one block of +text to the next. To do this use braces and parentheses: + + '{' (left brace) Move to the beginning of a paragraph + '}' (right brace) Move to the end of a paragraph + + '(' (left paren) Move to the beginning of a sentence + ')' (right paren) Move to the beginning of the next sentence + +>>> Experiment with '}' and '{' on the two paragraphs provided below. +>>> Note that paragraphs are separated by a blank line. + + EXPERIMENT on this first paragraph. The quick brown fox jumped + over the seven lazy dogs. The fox must have been very large to + jump over seven dogs! + + EXPERIMENT on this second paragraph. The quick brown dog + jumped over the seven lazy foxes. The dog didn't have to be nearly + as large, since foxes aren't too big. + +>>> Try out ')' and '(' on the two paragraphs provided above. +>>> Notice that sentences are separated by two blank spaces. + +C programmers find it useful to move by sections, since sections may be +delimited by a left brace in the first column. By placing the opening +brace of a C subroutine in the first column, you can move to the top of +the next subroutine, using '[''[' and ']'']' . + + '[''[' Move to the beginning of a section + ']'']' Move to the end of a section + +Note that if vi does not find a left brace at the far left, it will +move to the top or bottom of the file. + +>>> Now try ']'']' then ']'']' and '[''[' on the subroutines provided below: + +main() +{ + helloworld(); +} + +helloworld() +{ + printf( "Hello world\n" ); +} + + +SEARCHING +--------- +This enables you to jump to the next occurrence of a string in a file. +To initially find the string use: + + '/'string Find string looking forward + '?'string Find string looking backward + +To find additional occurrences of the string type: + + 'n' Repeat last / or ? command + 'N' Reverse last / or ? command + +vi may search past the bottom of the file and then start again at the top. +(Or, vi may search past the top and then start again at the bottom.) + +>>> You are going to search for a string, find the next three +>>> occurrences. Then flip directions and find the string until you +>>> return to this location. To do this: +>>> Type '/''t''h''e' then press RETURN. +>>> Type 'n' three times. +>>> Type 'N' until you return to this location. + +* EMACS-NOTICE: Emacs has very powerful SEARCH-COMMANDS which you may + want to use in parallell to those above. One of the first you want + to try is probably C-s (ISEARCH-FORWARD). + + +SUMMARY +------- + + 'w' Move to the beginning of the next WORD + 'e' Move to the END of the next word + 'b' Move BACK to the beginning to the previous word + + '$' Move to the end of the line + '^' Move to the first non-white character on the line + + '0' Move to the first column on the line (column zero) + #'|' Move to an exact column on the line (column #) e.g. 5| 12| + + 'f' char FIND the next occurrence of char on the line + 't' char Move 'TIL the next occurrence of char on the line + + 'F' char FIND the previous occurrence of char on the line + 'T' char Move 'TIL the previous occurrence of char on the line + + ';' Repeat the last f, t, F, or T + ',' Reverse the last f, t, F, or T + + '%' Show matching () or {} or [] + + 'H' Move to the HIGHEST position in the window + 'M' Move to the MIDDLE position in the window + 'L' Move to the LOWEST position in the window + + 'm' char MARK this location and name it char + ''' char (quote character) return to line named char + '''''' (quote quote) return from last movement + + 'G' GO to the last line in the file + #'G' GO to line #. (e.g., 3G , 5G , 175G ) + + '{' (left brace) Move to the beginning of a paragraph + '}' (right brace) Move to the end of a paragraph + + '(' (left paren) Move to the beginning of a sentence + ')' (right paren) Move to the beginning of the next sentence + + '[''[' Move to the beginning of a section + ']'']' Move to the end of a section + + '/'string Find string looking forward + '?'string Find string looking backward + + 'n' Repeat last / or ? command + 'N' Reverse last / or ? command + +You should now be able to move around files very efficiently. These +commands are especially useful if you are using vi over a slow modem. +Practice the material in this lesson for a few days and then take +either the third vi tutorial to learn how to copy, cut, and paste, or +the forth vi tutorial to learn additional insertion techniques. + +Copyright (c) 1992 Jill Kliger and Wesley Craig. All Rights Reserved. diff --git a/emacs.d/nxhtml/etc/viper-tut/3cutpaste b/emacs.d/nxhtml/etc/viper-tut/3cutpaste new file mode 100644 index 0000000..6d531d9 --- /dev/null +++ b/emacs.d/nxhtml/etc/viper-tut/3cutpaste @@ -0,0 +1,318 @@ +Viper tutorial #3: Copying, Cutting, and Pasting + +This lesson lasts 15-20 minutes. This tutorial assumes full knowledge +of tutorial #1, and familiarity with tutorial #2. Lines which begin +with >>> mark exercises you should try. + +When you want to exit this tutorial type 'Z''Z' to exit and save your +changes. Or type :q! to exit without saving changes. +Remember that typing u will UNDO your last change. + + +CUTTING TEXT +------------ +The delete command can be combined with any of the movement commands +taught throughout tutorial #2. The resulting command is of the form: + + 'd'movement DELETE to where the movement command specifies + +Consider the following examples: + + 'd''w' DELETE to the beginning of the next WORD + 'd''$' DELETE to the end of the line + 'd'')' DELETE to the beginning of the next sentence + 'd''t'e DELETE 'TIL the next e + 'd''d' DELETE a line (dd is a special case of the d command) + +>>> Experiment with 'd''w' 'd''$' 'd'')' 'd''t'e 'd''d' on the paragraph provided below: + + PRACTICE here. Now is the time for all good users to learn the + editor. The quick brown fox jumped over the seven lazy fish. Now + is the time for all good users to learn the editor. The quick + brown computer jumped over the seven lazy users. END PRACTICE + +* EMACS-NOTICE: In Viper you can also use 'r' and 'R' for Emacs region and + Viper line extended region. This is very convenient together with + CUA-MODE where the region is visible (it is usually called the + selected text or something similar in other applications). + + +PASTING TEXT +------------ +When text is deleted it is put into a buffer which contains the most +recently deleted text. To paste the contents of this buffer elsewhere +in the file use the p or P command. + + 'P' (upper p) PUT the contents of the buffer before the cursor + 'p' (lower p) PUT the contents of the buffer after the cursor + +>>> Try this sequence of commands on the practice lines below: +>>> 'd''d' to delete one line +>>> 'j' to move down a line +>>> 'p' (lower p) to PUT the deleted text after the cursor +>>> '}' to move to the end of the paragraph +>>> 'P' (upper p) to PUT the deleted text before the cursor + + PRACTICE line. Cut and Paste this line to the bottom of the + paragraph. Here is some filler, feel free to cut and paste the + text in this practice region. Remember that u undoes the last + action. END OF PRACTICE + +>>> Try this sequence of commands at the beginning of a word: +>>> 'd''w' 'w' 'P' + +The fastest way to swap two letters is to type: 'x''p' + +>>> Use xp to correct the misspelled words below: + + PRACTICE. Thier weird quiet recieved an inconvenient shriek. + Thier belief is that to recieve grief from nieghbors outwieghs + all else. Biege skies lead to wierd science. END. + + +NUMBERING +--------- +Consider cutting and pasting 3 words. Based on previous exercises you +would type 'd''w' , move to the new location, and type 'p' , and repeat +this procedure twice more. There is an easier way to do this: + +>>> Using the practice lines below, try the following sequence of commands: +>>> Move to the beginning of the first sentence. +>>> Type 'd''3''w' to DELETE 3 WORDS. +>>> Type 'w' to move ahead one WORD. +>>> Type 'P' (upper p) to PUT the three words before the cursor. + + PRACTICE Numbering vi commands is easy to do. Now is the time for + all good users to learn the editor. The quick brown fox jumped + over the seven lazy dogs. Numbering vi commands is easy to do. + Now is the time for all good users to learn the editor. END PRACTICE + +>>> Type 'd''2''d' to DELETE 2 lines, using the practice paragraph above. +>>> Move to the top of the paragraph. +>>> Type 'p' (lower p) to PUT the two lines after of the cursor. + +Numbering also works for movement commands. + +>>> Now try '4''w' to move ahead 4 WORDs, on the lines provided above. +>>> Then use '3''b' to move BACK 3 words. + +When you type '4''w' THINK "4 words", when you type d4w think "delete 4 +words". In general, we can write + + #movement repeat movement # times + d#movement DELETE to where the #movement command specifies + + +COPYING TEXT +------------ +The YANK command works just like the DELETE command, except 'y' is used +instead of 'd' . + + 'y'movement YANK to where the movement command specifies + +YANK and DELETE are identical except that YANK only copies the specified +text into the buffer. + +>>> Try this sequence of commands on the practice lines below: +>>> 'y''y' to YANK a line (yy is a special case of the y command) +>>> '3''j' to move down 3 lines +>>> 'p' (lower p) to PUT the yanked text after the cursor + + PRACTICE line. Copy and Paste this line to the bottom of the + paragraph. Here is some filler, feel free to copy and paste the + text in this practice region. Remember that u undoes the last + action. END OF PRACTICE + +Please note that copy, cutting, and pasting large blocks of text may +significantly alter the tutorial file. Remember that you can always get +a new copy of the tutorial file and that u UNDOes your last change. + +Here are some examples which show the similarity between y and d . + + 'y''w' YANK to the beginning of the next WORD + 'y''$' YANK to the end of the line + 'y'')' YANK to the beginning of the next sentence + 'y''t'e YANK 'TIL the next e + 'y''y' YANK a line + +Here are some more examples using commands from tutorial #2. + + 'y''L' YANK from here to the lowest point of the window + 'y''/'and YANK from here to the word "and" + 'y''2''}' YANK 2 paragraphs + 'y''''a YANK from here to the marked line "a" (mark line first) + +>>> Experiment with 'y''w' 'y''t'e 'y''4''w' 'y''2''}' 'y''3''y' and 'y''$' on the paragraph +>>> provided below. Copy text AND use 'p' or 'P' to paste it. + + PRACTICE line. Copy and Paste this line to the bottom of the + paragraph. Here is some filler, feel free to copy and paste + the text in this practice region. Remember that u undoes the + last action. END OF PRACTICE + + +NUMBERED BUFFERS +---------------- +In all of the previous pasting exercises you've used the "un-named" +buffer. The un-named buffer contains the text you most recently cut or +copied. When you make a new cut or copy, the old contents of the +un-named buffer are moved to one of the "numbered" buffers. The +buffers are numbered 1-9. Each time you cut or copy text, + + vi saves your current cut or copy in a buffer #1 + vi saves your 2nd to last cut or copy in a buffer #2 + The cut or copy before that is saved in a buffer #3 ... + vi saves your 8th oldest cut or copy in a buffer #8 + vi saves your 9th oldest cut or copy in a buffer #9 + +Note that buffer #1 is the same as the un-named buffer. Here's how to +paste from the numbered buffers: + + "#P (upper p) PUT contents of buffer # before the cursor + "#p (lower p) PUT contents of buffer # after the cursor + +For example: + + "1p PUT buffer 1 after the cursor + "7p PUT buffer 7 after the cursor + +>>> Delete this 1st line with dd +>>> Delete this 2nd line with dd +>>> Delete this 3rd block with d2d +>>> (2nd half of block 3) +>>> Delete this 4th block with dd +>>> Now type "1p "2p "3p "4p + +If you are using vi and have made accidental deletions, just PUT the +contents of each numbered buffer to recover the deleted text. + + +NAMED BUFFERS +------------- +vi maintains the un-named and numbered buffers automatically. You can +maintain your own buffers named a-z. That is, you can cut or copy text +into buffer x and later paste the text from buffer x. + + '"'aDELETE DELETE text into buffer a + "aYANK YANK text into buffer a + "aPUT PUT text from buffer a + +Note, don't actually type 'DELETE', 'YANK', or 'PUT'; type one of the +DELETE commands, YANK commands, or PUT commands. See the examples below: + + "ad} DELETE paragraph into buffer a + "by3y YANK 3 lines into buffer b + "cy200G YANK to line 200 into buffer c + "dp PUT buffer d after the cursor + "zP PUT buffer z before the cursor + +The contents of a named buffer are lost if: + 1) you store new text in a buffer with the same name + or 2) you quit vi (using 'Z''Z' or :q! ) + +>>> Delete this START line into buffer a by typing "add +>>> Paste buffer a by typing "ap + +>>> Delete this INTERMEDIATE line into buffer b by typing "bdd +>>> Paste buffer b by typing "bp + +To put new material into buffer a +>>> Delete this FINAL line into buffer a by typing "add +>>> Paste buffer a by typing "ap + + +SAVING WITHOUT QUITTING +----------------------- +With ZZ you save changes and kill the current buffer. (In vi you also +exit with 'Z''Z'.) With :w you can save and not quit vi. It is a safe +practice to save changes to a file regularly. This reduces re-typing +in the event your computer crashes. + + :w WRITE contents of the file (without quitting) + (type a colon, type w , then press the RETURN key) + +>>> Try :w now. Note the message at the bottom of the screen. + + +PASTING BETWEEN FILES +--------------------- + +* EMACS-NOTICE: In Emacs there are no problems editing several + files. You can however do it in the more complicated vi way below if + you really want to ;-) + +This is an extremely useful procedure in vi. Only one new command is +required for pasting between files, the EDIT command + + :e filename Begin EDITing the file called "filename" + +The EDIT command allows you to edit another file without quitting vi. +This is useful since named buffers are lost when you quit vi. + +Let's say you want to copy 6 lines from the file called "3temp" into +this file which is named "3cutpaste": +(Note that "3temp" has already been created for you) + + 1) WRITE "3cutpaste". vi will not allow :w (press RETURN) + you to edit another file without first + saving any changes you've made. + + 2) EDIT "3temp" without quitting vi. :e 3temp (press RETURN) + + 3) YANK 6 lines from "3temp". "ay6y + + 4) Return to "3cutpaste". :e 3cutpaste (press RETURN) + + 5) PUT from buffer a "ap + +Note that the un-named and numbered buffers are lost when the EDIT +command is used. Only named buffers are preserved with EDIT. + +>>> Follow the 5-step procedure outlined above. Don't be concerned +>>> with remembering all 5 steps, the instructions are repeated in +>>> "3temp". Paste the text from "3temp" near this line of this file, +>>> "3cutpaste". + +You can use this 5-step procedure on any two files, with any cutting or +copying action (here, y6y is the example). + + +SUMMARY +------- + + #movement repeat movement # times + * EMACS-NOTICE: You may also use 'r' or 'R' in Viper. + + 'd'movement DELETE to where "movement" command specifies + 'd'#movement DELETE to where the #movement command specifies + (e.g. 'd''w' 'd''3''w' ) + + 'y'movement YANK to where "movement" command specifies + 'y'#movement YANK to where the #movement command specifies + (e.g. 'y''w' 'y''3''w' ) + + 'P' (upper p) PUT the contents of the buffer before the cursor + 'p' (lower p) PUT the contents of the buffer after the cursor + + '"'#P (upper p) PUT contents of buffer # before the cursor + '"'#p (lower p) PUT contents of buffer # after the cursor + (e.g. '"''2''p' '"''7''P' ) + + '"'aDELETE DELETE text into buffer a + '"'aYANK YANK text into buffer a + '"'aPUT PUT text from named buffer a + (Note, don't actually type 'DELETE', 'YANK', or 'PUT'; + type one of the DELETE commands, YANK commands, or PUT + commands, e.g. '"''a''d''}' '"''b''y''3''y' '"''c''y''2''0''0''G' '"''d''p' '"''z''P' ) + + :w WRITE contents of the file (without quitting) + (type a colon, type w , then press the RETURN key) + + :e filename Begin EDITing the file called "filename" + + +You are now prepared to handle all cutting, copying and pasting tasks +which may arise. If you practice what you've learned you'll find editing +in vi to be fast and convenient. + +Copyright (c) 1992 Jill Kliger and Wesley Craig. All Rights Reserved. diff --git a/emacs.d/nxhtml/etc/viper-tut/4inserting b/emacs.d/nxhtml/etc/viper-tut/4inserting new file mode 100644 index 0000000..ab2c6a5 --- /dev/null +++ b/emacs.d/nxhtml/etc/viper-tut/4inserting @@ -0,0 +1,180 @@ +Viper tutorial #4: Insertion Techniques + +This lesson lasts 5-10 minutes. This tutorial assumes full knowledge +of tutorial #1, and familiarity with tutorial #2. Lines which begin +with >>> mark exercises you should try. When you want to exit this +tutorial type 'Z''Z' . + + +SIMPLE INSERTION +---------------- +You spend most of your time in vi inserting text. As you might expect, +there are several commands to begin insertion. + + 'o' OPEN a line below the cursor + 'O' OPEN a line above the cursor + + 'i' INSERT starting before the cursor + 'I' INSERT at the beginning of the line + + 'a' APPEND starting after the cursor + 'A' APPEND at the end of the line + +Remember to type ESC to leave insert mode. If you don't have an ESC key +type C-[ (control [ ). + + ESC ESCAPE from insert mode + +>>> Move the cursor to this line. Type 'O' , enter your name. Press ESC. +>>> Next type 'o' , enter the date. Press ESC. + +Note that 'O' opens the line above and puts you in insert mode, +while 'o' opens the line below and also puts you in insert mode. + +>>> Type 'a' on any line above, enter your name. Press ESC. Do the +>>> same for 'A'. + +>>> Read the following. Your goal is to take the sentence fragment below: + + BROWN FOX OVER THE SEVEN LAZY + +>>> and convert it to + + THE QUICK BROWN FOX JUMPED OVER THE SEVEN LAZY DOGS. + +>>> To do this type: +>>> 'I' to insert THE QUICK (then press ESC) +>>> move the cursor to after the X in FOX +>>> 'a' to insert JUMPED (then press ESC) +>>> 'A' to insert DOGS. (then press ESC) +>>> Now move to the sentence fragment and make the changes outlined above. + + +JOINING LINES +------------- +Often it is convenient to join two short lines into one line. There +are several ways to do this. The easiest is the J command. Other +methods will be explored in tutorial #5. + + 'J' JOIN two lines + +>>> Go to the first line in the block below. Type J. Type J again. + + Example: NOW IS THE TIME + the walrus said + TO THINK OF MANY THINGS + +In the event that joining lines creates a line which exceeds the width +of the screen, you can break the line by typing i and pressing RETURN. + + +SUBSTITUTING TEXT +----------------- +Substituting combines the delete command and the insert command into a +single step. + + #'s' SUBSTITUTE for # characters + #'S' SUBSTITUTE for # whole lines + + +In order to substitute text you have to know how much text you want to +delete. Consider the following examples: + + '3''s' SUBSTITUTE the next 3 characters for what will be typed + '7''s' SUBSTITUTE the next 7 characters for what will be typed + +>>> Change the SAMPLE DEFINITION below. To do this: +>>> move the cursor to the T in TWO +>>> type '3's +>>> type FOUR then press ESC + + SAMPLE DEFINITION: A string quartet is defined to be + a group of TWO musicians. + + +REPLACING TEXT +-------------- +The 'r' and 'R' commands allow you to directly type over existing text. + + 'r' REPLACE character (NO need to press ESC) + 'R' enter over-type mode + +>>> Correct each of the TYPOs on the sample line below. To do this: +>>> move the cursor to the misspelled character +>>> type 'r' +>>> type the correct character + + SAMPLE: maintanence conveniance complience applience dilagent + +>>> Use the over-type command, 'R' , on the sample line above. +>>> Type 'R' then type the name of a local restaurant. Press ESC. + + +CHANGING TEXT +------------- +The change command combines insertion, deletion, and the movement +commands. (Recall that the movement commands were taught in tutorial +#2.) Change is probably more useful than replace or substitute. The +general form of the change command is: + + 'c'movement CHANGE to where the movement command specifies + +Consider the following examples: + + 'c''w' CHANGE to the beginning of the next WORD + 'c''$' CHANGE to the end of the line + 'c'')' CHANGE to the beginning of the next sentence + 'c''t'e CHANGE 'TIL the next e + 'c''3''w' CHANGE the next 3 WORDS + 'c''c' CHANGE a line (cc is a special case of the c command) + 'c''}' CHANGE to the end of the paragraph + +>>> Follow these steps: +>>> 1. move to the desired location in the practice paragraph below +>>> 2. type 'c''w' (change to the beginning of the next WORD) +>>> 3. type your name +>>> 4. press ESC + + PRACTICE here. Now is the time for all good users to learn the + editor. The quick red fox jumped over the seven lazy fish. Now + is the time for all good users to learn the editor. The quick + brown computer jumped over the seven lazy users. END PRACTICE + +>>> Experiment by using a variety of options for step #2. Try +>>> out 'c''$' 'c'')' 'c''t'e 'c''3''w' 'c''c' 'c''}' on the practice paragraph above. + +Note that the change command follows the same pattern as the delete +and yank commands which were explored in tutorial #3. + + +SUMMARY +------- + + 'o' OPEN a line below the cursor + 'O' OPEN a line above the cursor + + 'i' INSERT starting before the cursor + 'I' INSERT at the beginning of the line + + 'a' APPEND starting after the cursor + 'A' APPEND at the end of the line + + ESC ESCAPE from insert mode + + 'J' JOIN two lines + + #'s' SUBSTITUTE for # characters + #'S' SUBSTITUTE for # whole lines + + 'r' REPLACE character (NO need to press ESC) + 'R' enter over-type mode + + 'c'movement CHANGE to where the movement commands specifies + (e.g. 'c''3''w' 'c''$' 'c''c' ) + + +These commands should improve your ability to insert text efficiently. +The next tutorials deal with advanced commands and tricks which can +further speed up your editing. + +Copyright (c) 1992 Jill Kliger and Wesley Craig. All Rights Reserved. diff --git a/emacs.d/nxhtml/etc/viper-tut/5tricks b/emacs.d/nxhtml/etc/viper-tut/5tricks new file mode 100644 index 0000000..c1e414e --- /dev/null +++ b/emacs.d/nxhtml/etc/viper-tut/5tricks @@ -0,0 +1,229 @@ +Viper tutorial #5: Tricks and Timesavers + +This lesson lasts 10-15 minutes. You should have a strong +understanding of tutorials #1-3 before working through these timesaving +techniques. Lines which begin with >>> mark exercises you should +try. When you want to exit this tutorial type 'Z''Z' . + + +CASE CONVERSION +--------------- +When you want to change an upper-case character to a lower-case +character (or lower-case to upper-case) there is a single command which +does both: + + '~' (tilde) Convert case of current character + +>>> Move the cursor to be OVER the first character in the example +>>> line below. Press '~' until you have changed the case of the +>>> entire line. ( '~' will advance to the right automatically). + + bOB WENT TO pARIS, fRANCE, TO SEE THE #1 CYCLING EVENT. end. + +Note that '~' only affects alphabetic characters. + + +UNDOING +------- +* EMACS-NOTICE: Uppercase U does the same thing as lowercase u in + Viper so this part of the tutorial which was about U has been + removed. + + +REPEAT LAST COMMAND +------------------- +Often you want to make the same change at multiple locations in the +file. To help accomplish this, vi remembers your previous action. + + '.' (dot) repeat last change + +>>> Go through the example below changing "FISH" to "TOAD": +>>> Go to the "F" in the first instance of "FISH" +>>> To change the word: type 'c''w' then type TOAD then press ESC +>>> Move the cursor to "F" in the second occurence of "FISH" +>>> Type '.' (dot) +>>> Move the cursor to "F" in the final occurence of "FISH" +>>> Type '.' (dot) +>>> Now move the cursor to each occurence of "CROW"; Type '.' (dot) + + EXAMPLE: The FISH fed the cat. The CROW fed the cat. Example + text is FISH to make interesting. The man fed the CROW. The + worm fed the FISH. Example text is hard to make CROW. END. + +>>> Go through the example above deleting all occurences of "TOAD": +>>> Move to the beginning of the EXAMPLE paragraph above. +>>> Type '/''T''O''A''D' and press RETURN (recall tutorial #2) +>>> Delete the word by typing 'd''w' +>>> Type 'n' to move to the next occurence of "TOAD" +>>> Type '.' (dot) to repeat the dw command +>>> Use 'n''.' to delete the remaining "TOAD"s + +Note that '.' only repeats changes, not cursor movements. + +* EMACS-NOTICE: In Emacs '.' also repeat undo and redo. + +* EMACS-NOTICE: Emacs KEYBOARD-MACROS are very powerful for repeating + whole sequences of keyboard commands. + + +WINDOW ACTIONS +-------------- +You are already familiar with the C-u (depress the control key and +type u) and C-d commands from tutorial #1. + + C-d Move DOWN one half-screen + C-u Move UP one half-screen + +There are several related commands: + + C-f Move FORWARD one full-screen + C-b Move BACKWARD one full-screen + + C-e Move the window down one line without moving cursor + C-y Move the window up one line without moving cursor + +The C-e and C-y commands may seem obscure; however, notice that on +the keyboard, e and y are close to d and u respectively. This +should help you remember that C-e moves DOWN, and C-y moves UP. + +Recall the 'H' 'M' 'L' (HIGH MIDDLE LOW) window commands from Tutorial 2. +Consider a scenario where you want to yank from the current line to a +line near the top of the window. You could use C-e and C-y to +position the text in the window before you use the yH command. + +The 'z' command also moves the window without moving your cursor: + + 'z' Position the current line to top of window + 'z''.' Position the current line to middle of window + 'z''-' Position the current line to bottom of window + +>>> Move to this line. Type 'z' and press RETURN. Notice that +>>> this text and the cursor have moved to the top of the window. +>>> Try 'z''-' and 'z''.' also. + + +FILE AND DISPLAY CONTROL +------------------------ + +* EMACS-NOTICE: In vi C-g shows the status of the current file, but + C-g in Emacs in most situation stops what Emacs is doing. To get + information about the current file you can use C-c C-g instead when + Viper is in vi state. + +* EMACS-NOTICE: In vi C-l refreshes the screen, but C-l in Emacs calls + the command recenter. + + +SUSPENDING VI +------------- +* EMACS-NOTICE: In vi C-z suspends vi. However in Viper C-z is by + default the VIPER-TOGGLE-KEY. To suspend or iconify Emacs use C-x + C-z. + + +BANG COMMAND +------------ +* EMACS-NOTICE: Emacs has builtin commands to sort etc. + +The exclamation point, '!' (aka BANG), command allows you to feed text +to any Unix command. The output of the Unix command replaces the +original text. Here is a useful Unix command to use from within vi: + + !}fmt Format the paragraph, joining and filling lines to + produce output lines of up to 72 characters + +>>> Move to the example paragraph below. Type !}fmt and press +>>> RETURN. Notice the paragraph will be reformatted such that +>>> the lines are of approximately equal length. + + EXAMPLE: + So we grow together, + Like to a double cherry, seeming parted, + But yet an union in partition; + Two lovely berries moulded on one stem; + So, with two seeming bodies, but one heart; + END. + +Another useful command is: + + !}sort Sort lines of a paragraph alphabetically + +>>> Move to the example text below. Type !}sort and press RETURN. + + OBERON king of the fairies. + PUCK or Robin Goodfellow. + HERMIA daughter to Egeus, in love with Lysander. + HELENA in love with Demetrius. + LYSANDER in love with Hermia. + DEMETRIUS in love with Hermia. + +Remember, any Unix command may be used this way. + + +SHIFTING TEXT +------------- +It is possible to shift large blocks of text right and left with the '>' +and '<' commands. + + '>'movement Shift right to where the movement command specifies + '<'movement Shift left to where the movement command specifies + +These commands work like the 'd' command. For example: + + '>''}' Shift right to the end of the paragraph + '<''}' Shift left to the end of the paragraph + '>''>' Shift the current line right + '<''<' Shift the current line left + +>>> Move the cursor to the first line of the paragraph below. +>>> Type '>''>' and '<''<' to shift the line back and forth. Next +>>> try '>''}' to shift the paragraph to the right, then '<''}' to shift +>>> it left, then type '.' until all four lines start at the left edge. + + THIS IS THE FIRST LINE OF EXAMPLE TEXT + IS + EXAMPLE + TEXT END + + +SUMMARY +------- + + '~' (tilde) Convert case of current character + + 'U' * EMACS-NOTICE: Same as lowercase u undo in Viper. + + '.' (dot) repeat last change + + C-d Move DOWN one half-screen + (depress the control key and type d) + + C-u Move UP one half-screen + (depress the control key and type u) + + C-f Move FORWARD one full-screen + C-b Move BACKWARD one full-screen + + C-e Move the window down one line without moving cursor + C-y Move the window up one line without moving cursor + + 'z' Position the current line to top of window + 'z''.' Position the current line to middle of window + 'z''-' Position the current line to bottom of window + + C-c C-g Show status of current file + C-l Recenter + + '!'}fmt Format the paragraph, joining and filling lines to + produce output lines of up to 72 characters + + '!'}sort Sort lines of a paragraph alphabetically + + '>'movement Shift right to where the movement command specifies + '<'movement Shift left to where the movement command specifies + + +These commands should significantly speed up your editing. Have a nice +day. Tutorial 6 contains even more nifty commands. + +Copyright (c) 1992 Jill Kliger and Wesley Craig. All Rights Reserved. diff --git a/emacs.d/nxhtml/etc/viper-tut/README b/emacs.d/nxhtml/etc/viper-tut/README new file mode 100644 index 0000000..dd39176 --- /dev/null +++ b/emacs.d/nxhtml/etc/viper-tut/README @@ -0,0 +1,49 @@ +Viper Tutorial README +===================== + +To install the Viper tutorial you must do two things: + +1) Put viper-tutorial.el in your Emacs load-path. + +2) Put the tutorial files (0intro, 1basics etc) in subdirectory to + where you put viper-tutorial.el with the name viper-tut. + Optionally you may put those file any where and customize the + option viper-tut-directory. + +The tutorial is started by + + M-x viper-tutorial RET + + + + +Viper tutorial is based on vilearn version 1.0 which was downloaded +from http://vilearn.org. + +Below is the original readme from vilearn. Note that the only part +that applies here is the copyright notice. + +--------------------------------------------------- +This is version 1.0 of vilearn, an interactive vi tutorial. + +Copyright (c) 1992 Jill Kliger and Wesley Craig. All Rights Reserved. + +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, +provided that the above copyright notice appears in all copies and that +the copyright notice, this permission notice, and an explicit record of +any local changes, appear in supporting documentation. This software +is supplied as is without expressed or implied warranties of any kind. + +To install, edit the Makefile and type + + make install + +We have a mailing list, vilearn-admins@terminator.rs.itd.umich.edu. To +be added to the list, send mail to vilearn-admins-request. The list is +intended to discuss the tutorials, coordinate projects relating to +them, and provide help to those who may need it. + +Wesley Craig & Jill Kliger +1317 Packard Street vilearn@terminator.rs.itd.umich.edu +Ann Arbor, MI 48104 diff --git a/emacs.d/nxhtml/etc/viper-tut/outline b/emacs.d/nxhtml/etc/viper-tut/outline new file mode 100644 index 0000000..9eaa3e4 --- /dev/null +++ b/emacs.d/nxhtml/etc/viper-tut/outline @@ -0,0 +1,131 @@ + +* +* tutorial 1 FILENAME: 1basics +* basics +* + +C-d down +C-u up + +h left +j down +k up +l right + +dd delete line +x x-out character + +u undo + +:q! force quit +ZZ good bye + +o open +i insert + +* +* tutorial 2 FILENAME: 2moving +* objects, finds & marks +* + +w W word +b B back +e E end + +{ } paragraph +( ) sentence +[ ] sections + +$ end of line +^ first non-white +| column +0 beginning of line + +f F find +t T to +; repeat fFtT +, reverse fFtT + +G goto + +H high +M middle +L low + +n N next +? / regex + +% match + +' move to marked line +m mark + + +* +* tutorial 3 FILENAME: 3cutpaste & 3temp +* +* cutting, pasting, buffers, and files +* + +d D deletes +y Y yank +p P put +" buffer +:e edit + +* +* tutorial 4 FILENAME: 4inserting +* insertion +* + +a A append +c C change +i I insert +o O open +r R replace +s S substitute + +J join + +* +* tutorial 5 FILENAME: 5tricks +* tricks +* + +~ case + +u U undo + +. do again + +C-b back +C-f forward +C-e down line +C-y up line +z zero + +C-g status +C-l refresh + +C-z suspend + +C-t pop tag proposed +C-] follow tag proposed + +! command + +< > shift + +* +* tutorial 6 PROPOSED +* commands from hell +* + +: colon commands +Q quit +C-r redraw +@ execute buffer as macro +& like :& + +C-t shift (insert) +C-d unshift (insert) -- cgit v1.2.3-54-g00ecf