私は以下を実行しようとしています
%s/foo/\=substitute(getline('.'),'bar','','g')
この例に
this is a foo cool bar
返して欲しいのは
this is a bar cool bar
しかし、それは戻ってきています
this is a this is a foo cool cool bar
つまり、substitute()関数で一致した正規表現だけでなく行全体が返されます
私は何かが足りないのですか?
split()関数とsedの実装を知っていますが、substitute()に入れたいです