You can swap the caps lock and escape keys in Arch Linux with the following command. setxkbmap -option caps:escape After executing that command, you will then use the escape key to toggle the caps lock and the caps lock key to send an escape.
If you have setup your computer keyboard to swap caps lock and escape, but it is not working in VS Code, then follow these instructions. The fix is a simple preference change. Go to Preferences → Settings → Application → Keyboard → Dispatch and select keyCode. After changing the keyboard dispatch logic to keyCode,