Skip to content

Instantly share code, notes, and snippets.

@n1lux
Last active November 26, 2020 12:06
Show Gist options
  • Save n1lux/5cf4c365b8d35ffb04a676fd99a37984 to your computer and use it in GitHub Desktop.
Save n1lux/5cf4c365b8d35ffb04a676fd99a37984 to your computer and use it in GitHub Desktop.
Put char around content vim
%s/^\(.*\)$/"\1"/
s/regex/replace/ is vim command for search n replace.
% makes it apply throughout the file
^ and $ denotes start and end of the line respectively.
(.*) captures everything in between. ( and ) needs to be escaped in vim regexes.
\1 puts the captured content between two quotes.
puts "," caracter at the end of all lines in document
:%s/$/,/g
convert column in row separated by ","
:%s/\n/,/
@n1lux
Copy link
Author

n1lux commented Mar 12, 2019

:%s/\n/,/

convert column in row separated by ,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment