mirror of
https://github.com/vale981/emacs-ipython-notebook
synced 2025-03-05 09:01:40 -05:00

M-x customize-group RET ein Toggle Ein:Polymode Avoid trying to emulate jump-to-definition, eldoc, and autocompletion functionalities that Elpy will always do better. Fixes #497 #482 #418
17 lines
476 B
Bash
Executable file
17 lines
476 B
Bash
Executable file
#!/bin/bash
|
|
|
|
# by mklement0 https://stackoverflow.com/a/29613573/5132008
|
|
|
|
# Define sample multi-line literal.
|
|
input=`cat`
|
|
replace="$input"
|
|
if [ ! -z "$3" ]; then
|
|
replace=$(awk "/$3/,EOF { print \" \" \$0 }" <<<"$input")
|
|
fi
|
|
|
|
# Escape it for use as a Sed replacement string.
|
|
IFS= read -d '' -r < <(sed -e ':a' -e '$!{N;ba' -e '}' -e 's/[&/\]/\\&/g; s/\n/\\&/g' <<<"$replace")
|
|
replaceEscaped=${REPLY%$'\n'}
|
|
|
|
# If ok, outputs $replace as is.
|
|
sed "/$1/c\\$replaceEscaped" $2
|