Delete everything except lines containing string %v/\(keep1\|keep2\)/d %g!/\(keep1\|keep2\)/d Replace last occurrence in line " Replace last space with comma %s/.*\zs /,/gc Run command in all Neovim instances Requires neovim-remote.# Switch all neovim instances to light theme $ for f in $(nvr --serverlist); do nvr --servername $f --remote-send ':set bg=light<cr>'; done