3 ms·
I've used vim for a couple of decades, but never pushed to many advanced features. For your example above I'd do :%s/^/"/ and :%s/$/",/ Unless I use a feature
by isostatic 7y ago
I've used vim for a couple of decades, but never pushed to many advanced features. For your example above I'd do :%s/^/"/ and :%s/$/",/
Unless I use a feature regularly I find it's a higher cognative load. I use bash, sed and perl regexps on a near daily basis. Macros are very rare.
- jermy 7y agoLikewise - with visual mode it's normally pretty quick to select an area and do a basic regex, even for things like re-indentation (auto-completes to something like :'<,'>s/^/\t/) even though I'm sure there's a 'proper' way to do that
- Izkata 7y ago> for indent, < for un-indent
- chongli 7y agoFor that same example, you can accomplish the job in one substitute command: :%s/.*/"&",/ The & special character gets replaced with the whole matched pattern.