- Good summary on special characters in Emacs minibuffers and in general: http://ergoemacs.org/emacs/emacs_line_ending_char.html
- On replacement by newline: https://stackoverflow.com/a/613029
toggle-truncate-lines
andvisual-line-mode
- Join particular windows:
C-u C-x 0
- Org mode table commands: https://orgmode.org/manual/Built_002din-Table-Editor.html
- in particular M + S + Left to delete a column
- removing text between two patterns
start
andend
(inclusive):sed '/start:/,/end/d'
to leave the lines with delimiters in place, sed'/start:/,/end/{/start/!{/end/!d;};}'
https://stackoverflow.com/a/6287940 - How
sed
works at all: https://www.gnu.org/software/sed/manual/html_node/Execution-Cycle.html#Execution-Cycle - Multi-line technique, an example:
grep -r -e 'deriving.*Generic' DA/ASX/ -B1 | \
sed -e '/--/d' \
-e '$!N;s@\(DA/ASX/[^.]*\.daml\)-\([^\n]*\)\n\1:\(.*\)$@\1 --- \2 \3@g' \
-e 's@\(.*\) --- *newtype \(.*\) *= *\2 \(.*\) deriving (\(.*\))$@\1, \2, \3, \4@g'
- grep for things that derive Generic (and other stuff), with one line before as context
- remove
--
from between matches - apply multiline match
N
to take the next line into the buffer- then match the file name (for context with
-
, then again for match with:
) and the line contents, - and print the file name
\1
and the two lines\2 \3
- then do a match on the now single-line occurrence of the
deriving