vimtips on davidchua https://dchua.com/tags/vimtips/ Recent content in vimtips on davidchua Hugo -- gohugo.io en-us Sun, 26 Jan 2014 12:21:39 +0800 Add text to end of multiple line - vim https://dchua.com/posts/2014-01-26-add-text-to-end-of-multiple-line-vim/ Sun, 26 Jan 2014 12:21:39 +0800 https://dchua.com/posts/2014-01-26-add-text-to-end-of-multiple-line-vim/ Suppose you have a whole list of text: Movies Travel Fashion (Men) Fashion (Women) Education Technology Clubbing Nightlife Fine Dining Food E-Commerce Beauty Wellness Gaming Performing Arts Sports Books Music Photography Fitness Gadgets And you want to make the whole thing an array in ruby. How do you do it in vim, quickly? First, we need to give everyone quotation marks. Using surround.vim, do: Surround the entire text using Ctrl-V In vim, type: :norm yss " This will give every single line in the selection a "" like: