i want to run this global command :
/3)\(.*\n\?.*\)\{1,10\};;/
which matches multlines. I want to append a line after the matched block(of lines) across multiple buffers. I don't know where to begin with. Is there an append controller like in sed /a
that appends after the match ? or is there any other way to achieve that?
i am trying to come up with the global command like ..
:g/3)\(.*\n\?.*\)\{1,10\};;/norm
But am stuck as to how to achieve the 'appending' after the block part.
Also, how would it be possible to run across multiple buffers as a macro.
Edit: the line to be appended is :
6) "$TERMINAL" -e "$EDITOR" "$0" ;;
Sample :
3) notify-send "📰 News module" "\- Shows unread news items
- Shows 🔃 if updating with \`newsup\`
- Left click opens newsboat
- Middle click syncs RSS feeds
<b>Note:</b> Only one instance of newsboat (including updates) may be running at a time." ;;
esac
After Operation:
3) notify-send "📰 News module" "\- Shows unread news items
- Shows 🔃 if updating with \`newsup\`
- Left click opens newsboat
- Middle click syncs RSS feeds
<b>Note:</b> Only one instance of newsboat (including updates) may be running at a time." ;;
6) "$TERMINAL" -e "$EDITOR" "$0" ;;
esac
Would be great if it can preserve the indenttation.
Note: There are other are samples that have more(or less) lines between 3)
and ;;
The regex is working (matches all desired patterns).
I tried with substitution like :
:%s/\(3)\(.*\n\?.*\)\{1,10\};;\)/\1\n 6) "$TERMINAL" -e "$EDITOR" "$0" ;;/
But as i feared, the \n
part didn't work in the replace section.
bufdo
,argdo
, etc.