vi.beginner の 抜粋添付 しておきます にゃんたろう 専用、これらは適当 に 選択 し 誤った 引用を してるでしょう から 原文を 見て 対応する事が 必 要です。あくまで ”にゃんたろう 専用”です。
They are listed in the order of increasing complexity and/or decreasing necessity (to say that a command is less necessary is not to say that it is less useful!). These commands allow you to comfortably edit any text file. There are other commands that will make life easier but will require extra time to learn, obviously. You may want to consider setting this tutorial aside for several weeks and returning to it later after gaining experience with vi and getting comfortable with it. The convenience of some of the more exotic commands may then be apparent and worth the extra investment of time and effort required to master them.
note "{" and "}" are not type ( not press key). "^" mean "Ctrl" control key.(it usually has CTL or CTRLwritten on its upper surface. Your first assignment is to hold the control key down while you press the 'THE KEY' key on your keyboard. "THE KEY" means for example "^F"; key press Cntr while press "F" key. "^M" mean "Return" key. (the control-M key sequence is exactly the same as if you hit the return key) "^[" mean "Esc" escape key.
to get into the editor from Unix: {vi filename} to exit the editor saving all changes {ZZ} or {:wq^M} throwing away all changes {:q!^M} when no changes have been made {:q^M} save a file without exiting the editor {:w^M} write the file into another file {:w filename^M} insert text before the cursor {i ...text... ^[} at the beginning of the line {I ...text... ^[} after the cursor (append) {a ...text... ^[} at the end of the line {A ...text... ^[} after the current line {o ...text... ^[} before the current line {O ...text... ^[} delete the character ... under the cursor {x} to the left of the cursor {X} delete n characters {nx} or {nX} (for n a number) make two lines into one line (Join) {J} find a string in the file ... searching forward {/ ...string... /^M} searching backwards {? ...string... ?^M} repeat the last search command {n} repeat the last search command in the opposite direction {N} find the character c on this line ... searching forward {fc} searching backward {Fc} repeat the last 'find character' command {;} replace a character with character x {rx} substitute a single character with text {s ...text... ^[} substitute n characters with text {ns ...text... ^[} replace characters one-by-one with text {R ...text... ^[} undo all changes to the current line {U} undo the last single change {u} move forward in the file a "screenful" {^F} move back in the file a "screenful" {^B} move forward in the file one line {^M} or {+} move backward in the file one line {-} move to the beginning of the line {0} move to the end of the line {$} move forward one word {w} move forward one word, ignoring punctuation {W} move forward to the end of the next word {e} to the end of the word, ignoring punctuation{E} move backward one word {b} move back one word, ignoring punctuation {B} return to the last line modified {''} scroll a line onto the top of the screen {^Y} scroll a line onto the bottom of the screen {^E} move "up" in the file a half-screen {^U} move "down" in the file a half-screen {^D} move the cursor to the top screen line {H} move the cursor to the bottom screen line {L} move the cursor to the middle line {M} move LEFT one character position {h} or {^H} move RIGHT one character position {l} or { } /* { } mean space */ move UP in the same column {k} or {^P} move DOWN in the same column {j} or {^N} mark the current position, name it x {mx} move to the line marked/named x {'x} move to the character position named x {`x} move to the beginning of the file {1G} move to the end of the file {G} move to line 23 in the file {23G} repaint the screen with the cursor line at the top of the screen {z^M} in the middle of the screen {z.} at the bottom of the screen {z-}
にゃんたろう 拝!
2005年12月10日 (土) 23:52:28 JST 作成
✈