In order to overcome my irritation with quoting and comma separating words in a list, I thought I would play with Vim's search and replace to allow myself to type lists like this:
daqs = [this is a test of some cool vim stuff for creating a comma separated list of strings]
and use a regular expression to convert this line to this:
daqs = ["this", "is", "a", "test", "of", "some", "cool", "vim", "stuff", "for", "creating", "a", "comma", "separated", "list", "of", "strings", ]
I visually selected everything inside the brackets, and used the expression:
:'<,'>s/\%V\S\+[^\]]/\"&\", /g
But a trailing whitespace character seems to be following my "&" insertion, giving me this:
daqs = ["this ", "is ", "a ", "test ", "of ", "some ", "cool ", "vim ", "stuff ", "for ", "creating ", "a ", "comma ", "separated ", "list ", "of ", "strings", ]
Note that the final word does not have a space at the end within the quotes. How can I match each word between the brackets without carrying around this ending whitespace?