Sorting attributes or imports :'<,'>!sort Removing duplicate lines :'<,'>!sort -u jq on the entire JSON file :%!jq .