Home | Links | Weblog


exhalations
Friday, October 01, 2004
  
Emacs I'm still using Emacs for many nitty gritty editing tasks. It can't be beat for removing or adding chunks of text in a document using rectangle kill and rectangle yank (C-x r k, C-x r y). I use it often for writing HTML code, with it's powerful search and replace syntax. Powerful but obscure. After much thrashing, I finally figured out how to insert text before the first character of text in a file or to append it after the last character [RET is a simply hitting Enter, or as it is referred to by some of us dinosaurs, carriage return, or return for short, dating back to when one needed to return the carriage, on which a piece of paper was being typed, to the beginning of the line]. In this case HTML table tags are being inserted or appended:

To insert text before each line, use:
Mx query-replace:
  C-q C-j RET
  C-q C-j ‹tr›‹td› RET

To append text to the end of the line:
Mx query-replace:
  C-q C-j RET
  ‹/td›‹/tr› C-q C-j RET



Comments: Post a Comment