Last active
January 30, 2020 13:53
-
-
Save sun/1a0f5c65df3d01fe5e1d to your computer and use it in GitHub Desktop.
vim
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Replace `define('...', '...');` with `const ... = ...;` | |
:%s/define( *'\(\w*\)',\( *\)'\([^']*\)' *);/const \1 =\2'\3';/ | |
# Replace `isset($_SERVER['SERVER_NAME']) ? $_SERVER['SERVER_NAME'] :` with `$_SERVER['SERVER_NAME'] ??` | |
# Using different delimiters to match an underscore literally. | |
:%s!isset.*SERVER_NAME.*:!$_SERVER['SERVER_NAME'] ??! | |
# Convert line endings to Linux/Unix | |
:set ff=unix |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment