Skip to content

Instantly share code, notes, and snippets.

@nawie
Last active October 17, 2019 07:25
Show Gist options
  • Save nawie/e3bdbeea9ebc228ddc2b27c61e412c56 to your computer and use it in GitHub Desktop.
Save nawie/e3bdbeea9ebc228ddc2b27c61e412c56 to your computer and use it in GitHub Desktop.

VIM do operation on selected column in single line

command: '<,'>s/%V(regex)%V/(operation)&/g

example

change query column into uppercase


INSERT INTO users (`Name`, `Account_type`, `Account_level`, `Active`) VALUE ('john', 'administrator', '1', '1')

command:'<,'>s/\%V[a-z].*\%V/\U&/g

INSERT INTO users (`NAME`, `ACCOUNT_TYPE`, `ACCOUNT_LEVEL`, `ACTIVE`) VALUE ('john', 'administrator', '1', '1')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment