-
-
Save thenbe/234df06b9b915feead215152b78f92e4 to your computer and use it in GitHub Desktop.
Restore original neovim filename substitution behavior when using vscode-neovim extension
This file contains 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
#!/bin/bash | |
# Usage: vnr <your-command> | |
# Example: vnr node % --my-arg | |
# Description: This script removes every occurrence of | |
# "__vscode_neovim__-file://", then runs the command. | |
# The pattern to replace | |
PATTERN="__vscode_neovim__-file:\/\/" | |
# The replacement | |
REPLACEMENT="" | |
# The command to run | |
COMMAND=$@ | |
# Replace the pattern with the replacement in the command | |
NEW_COMMAND=$(echo "$COMMAND" | sed "s/$PATTERN/$REPLACEMENT/g") | |
# Run the command | |
eval $NEW_COMMAND |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment