Skip to content

Instantly share code, notes, and snippets.

@sranso
Created August 11, 2014 18:06
Show Gist options
  • Save sranso/068ecc3ec091881fe22c to your computer and use it in GitHub Desktop.
Save sranso/068ecc3ec091881fe22c to your computer and use it in GitHub Desktop.

visual blocks in vim

:'<,'> w outfile.hbs visual block, and then hit w for write and then the place i want it to go, like outfile.hbs :'<,'> ! python -mjson.tool :'<,'>s/change/tothis/g

'<,'> represents the selected text ! says run a shell command

and the python module json.tool can be run like that it takes stdin and prints formatted json as stdout the stdout then replaces the selected text kind of like the sort command too :!sort

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