Skip to main content
added 63 characters in body
Source Link
D. Ben Knoble
  • 28.9k
  • 3
  • 35
  • 71

Thank you very much. Here's my function (based on @BLayer’s answer:

He's a self made man who gets what he wants. The small blue forget me not flower was first used by the Grand Lodge.

He's a self made man who gets what he wants. The small blue forget me not flower was first used by the Grand Lodge.

function MyFunction() let myList1 = ["self made man", "forget me not"] for elem1 in myList1 if search("=/elem1", 'W') == 0 let elem2 = substitute(elem1, ' ', '-', 'g') exe '%s/'elem1.'/'elem2 endif endfor endfunction 

He's a self-made-man who gets what he wants. The small blue forget-me-not flower was first used by the Grand Lodge.

He's a self-made-man who gets what he wants. The small blue forget-me-not flower was first used by the Grand Lodge.

Thank you very much. Here's my function :

He's a self made man who gets what he wants. The small blue forget me not flower was first used by the Grand Lodge.

function MyFunction() let myList1 = ["self made man", "forget me not"] for elem1 in myList1 if search("=/elem1", 'W') == 0 let elem2 = substitute(elem1, ' ', '-', 'g') exe '%s/'elem1.'/'elem2 endif endfor endfunction 

He's a self-made-man who gets what he wants. The small blue forget-me-not flower was first used by the Grand Lodge.

Here's my function (based on @BLayer’s answer:

He's a self made man who gets what he wants. The small blue forget me not flower was first used by the Grand Lodge.

function MyFunction() let myList1 = ["self made man", "forget me not"] for elem1 in myList1 if search("=/elem1", 'W') == 0 let elem2 = substitute(elem1, ' ', '-', 'g') exe '%s/'elem1.'/'elem2 endif endfor endfunction 

He's a self-made-man who gets what he wants. The small blue forget-me-not flower was first used by the Grand Lodge.

Source Link

Thank you very much. Here's my function :

He's a self made man who gets what he wants. The small blue forget me not flower was first used by the Grand Lodge.

function MyFunction() let myList1 = ["self made man", "forget me not"] for elem1 in myList1 if search("=/elem1", 'W') == 0 let elem2 = substitute(elem1, ' ', '-', 'g') exe '%s/'elem1.'/'elem2 endif endfor endfunction 

He's a self-made-man who gets what he wants. The small blue forget-me-not flower was first used by the Grand Lodge.