Skip to content

Instantly share code, notes, and snippets.

@hodonsky
Last active April 6, 2016 22:36
Show Gist options
  • Save hodonsky/5086c975ed503d43a65a08d5bc049f4d to your computer and use it in GitHub Desktop.
Save hodonsky/5086c975ed503d43a65a08d5bc049f4d to your computer and use it in GitHub Desktop.
VIM - Any left parenthesis with a character immediately next to it give a space & Any right parenthesis with a character immediately before it that is not a } or ] add a space.

VIM ( Find regex )

Any left parenthesis with a character immediately next to it give a space:
%s/(\([^ )]\)\@=/( /g

Any right parenthesis with a character immediately before it that is not a } or ] add a space.:
%s/\([ }\]]\)\@<!)/ )/g

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