osX: Vi, RegEx
Via enter insert mode, the characters typed in will be inserted after the current cursor position. If you specify a count, all the text that had been inserted will be repeated that many times.
h move the cursor to the left one character position.
i enter insert mode, the characters typed in will be inserted before the current cursor position. If you specify a count, all the text that had been inserted will be repeated that many times.
j move the cursor down one line.
k move the cursor up one line.
l move the cursor to the right one character position.
r replace one character under the cursor. Specify count to replace a number of characters
u undo the last change to the file. Typing u again will re-do the change.
x delete character under the cursor. Count specifies how many characters to delete. The characters will be deleted after the cursor.
Deleting/ Cutting/ Pasting
" Specify a buffer to be used any of the commands using buffers. Follow the " with a letter or a number, which corresponds to a buffer.
D Delete to the end of the line from the current cursor position.
P Paste the specified buffer before the current cursor position or line. If no buffer is specified (with the " command.) then 'P' uses the general buffer.
X Delete the character before the cursor.
Y Yank the current line into the specified buffer. If no buffer is specified, then the general buffer is used.
d Delete until where. "dd" deletes the current line. A count deletes that many lines. Whatever is deleted is placed into the buffer specified with the " command. If no buffer is specified, then the general buffer is used.
p Paste the specified buffer after the current cursor position or line. If no buffer is specified (with the " command.) then 'p' uses the general buffer.
x Delete character under the cursor. A count tells how many characters to delete. The characters will be deleted after the cursor.
y Yank until , putting the result into a buffer. "yy" yanks the current line. a count yanks that many lines. The buffer can be specified with the " command. If no buffer is specified, then the general buffer is used.
Saving
:w Write out the current file.
:w filename Write the buffer to the filename specified.
grep
<[^>]+> will find any html tag!
start with < and everything unless it is a >, then select also the >
Comments?
Leave a comment regarding “osX: Vi, RegEx”
Recent articles in osXosX: ASR - Apple Software RestoreosX: Bootable OSX cd osX: File locations osX: Hdiutil osX: OS 9 partition on new 2003 hardware |
another number 1 site?